diff --git a/go.mod b/go.mod
index 620bc50aaa..15cd2ab483 100644
--- a/go.mod
+++ b/go.mod
@@ -20,33 +20,33 @@ require (
github.com/in-toto/in-toto-golang v0.11.0
github.com/opencontainers/go-digest v1.0.0
github.com/pkg/errors v0.9.1
- github.com/secure-systems-lab/go-securesystemslib v0.11.0
+ github.com/secure-systems-lab/go-securesystemslib v0.11.1
github.com/sigstore/cosign/v2 v2.6.5
- github.com/sigstore/rekor v1.5.3
+ github.com/sigstore/rekor v1.5.4
github.com/sigstore/sigstore v1.10.9
github.com/sigstore/sigstore/pkg/signature/kms/aws v1.10.9
github.com/sigstore/sigstore/pkg/signature/kms/azure v1.10.9
github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.10.9
github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.10.9
github.com/spiffe/go-spiffe/v2 v2.6.0
- github.com/stretchr/testify v1.11.1
+ github.com/stretchr/testify v1.12.0
github.com/tektoncd/pipeline v1.12.2
github.com/tektoncd/plumbing v0.0.0-20250115133002-f515628dffea
go.opentelemetry.io/otel v1.44.0
go.opentelemetry.io/otel/metric v1.44.0
go.opentelemetry.io/otel/sdk/metric v1.44.0
go.uber.org/zap v1.28.0
- gocloud.dev v0.45.0
+ gocloud.dev v0.46.0
gocloud.dev/docstore/mongodocstore v0.43.0
gocloud.dev/pubsub/kafkapubsub v0.43.0
- golang.org/x/crypto v0.54.0
+ golang.org/x/crypto v0.55.0
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90
google.golang.org/grpc v1.82.1
- google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af
- k8s.io/api v0.36.3
- k8s.io/apimachinery v0.36.3
- k8s.io/client-go v0.36.3
- k8s.io/code-generator v0.36.3
+ google.golang.org/protobuf v1.36.12
+ k8s.io/api v0.36.4
+ k8s.io/apimachinery v0.36.4
+ k8s.io/client-go v0.36.4
+ k8s.io/code-generator v0.36.4
knative.dev/pkg v0.0.0-20260622140654-39ebae2ee2dc
sigs.k8s.io/yaml v1.6.0
)
@@ -58,11 +58,11 @@ require (
cloud.google.com/go v0.123.0 // indirect
cloud.google.com/go/auth v0.20.0 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
- cloud.google.com/go/firestore v1.21.0 // indirect
- cloud.google.com/go/iam v1.11.0 // indirect
+ cloud.google.com/go/firestore v1.22.0 // indirect
+ cloud.google.com/go/iam v1.13.0 // indirect
cloud.google.com/go/kms v1.33.0 // indirect
cloud.google.com/go/longrunning v1.2.0 // indirect
- cloud.google.com/go/monitoring v1.25.0 // indirect
+ cloud.google.com/go/monitoring v1.29.0 // indirect
filippo.io/edwards25519 v1.2.0 // indirect
github.com/4meepo/tagalign v1.4.2 // indirect
github.com/Abirdcfly/dupword v0.1.3 // indirect
@@ -72,7 +72,7 @@ require (
github.com/Antonboom/testifylint v1.5.2 // indirect
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0 // indirect
- github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 // indirect
+ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/containers/azcontainerregistry v0.2.3 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.5.0 // indirect
@@ -86,7 +86,7 @@ require (
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
- github.com/AzureAD/microsoft-authentication-library-for-go v1.7.0 // indirect
+ github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2 // indirect
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect
github.com/Crocmagnon/fatcontext v0.7.1 // indirect
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
@@ -98,6 +98,7 @@ require (
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect
+ github.com/ProtonMail/go-crypto v1.4.1 // indirect
github.com/ThalesIgnite/crypto11 v1.2.5 // indirect
github.com/alecthomas/go-check-sumtype v0.3.1 // indirect
github.com/alexkohler/nakedret/v2 v2.0.5 // indirect
@@ -123,20 +124,20 @@ require (
github.com/aws/aws-sdk-go-v2 v1.43.0 // indirect
github.com/aws/aws-sdk-go-v2/config v1.32.31 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.19.30 // indirect
- github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.20.26 // indirect
- github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.8.26 // indirect
+ github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.20.35 // indirect
+ github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.8.35 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.31 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.31 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.31 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.32 // indirect
- github.com/aws/aws-sdk-go-v2/service/dynamodb v1.53.2 // indirect
- github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.6 // indirect
+ github.com/aws/aws-sdk-go-v2/service/dynamodb v1.56.2 // indirect
+ github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.13 // indirect
github.com/aws/aws-sdk-go-v2/service/ecr v1.55.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.38.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.13 // indirect
- github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.14 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.20 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.31 // indirect
- github.com/aws/aws-sdk-go-v2/service/kms v1.54.0 // indirect
+ github.com/aws/aws-sdk-go-v2/service/kms v1.55.0 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.5.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.33.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.0 // indirect
@@ -145,7 +146,6 @@ require (
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.12.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bkielbasa/cyclop v1.2.3 // indirect
- github.com/blang/semver v3.5.1+incompatible // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/blendle/zapdriver v1.3.1 // indirect
github.com/blizzy78/varnamelen v0.8.0 // indirect
@@ -172,6 +172,7 @@ require (
github.com/clipperhouse/displaywidth v0.11.0 // indirect
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/cloudevents/sdk-go/v2 v2.16.2 // indirect
+ github.com/cloudflare/circl v1.6.3 // indirect
github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be // indirect
github.com/coreos/go-oidc/v3 v3.20.0 // indirect
@@ -204,34 +205,35 @@ require (
github.com/fzipp/gocyclo v0.6.0 // indirect
github.com/gaganhr94/docker-credential-acr v1.0.2 // indirect
github.com/ghostiam/protogetter v0.3.9 // indirect
- github.com/go-chi/chi/v5 v5.2.5 // indirect
+ github.com/go-chi/chi/v5 v5.3.1 // indirect
github.com/go-critic/go-critic v0.12.0 // indirect
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
- github.com/go-openapi/analysis v0.25.2 // indirect
+ github.com/go-openapi/analysis v0.26.0 // indirect
github.com/go-openapi/errors v0.22.8 // indirect
- github.com/go-openapi/jsonpointer v0.23.1 // indirect
- github.com/go-openapi/jsonreference v0.21.6 // indirect
- github.com/go-openapi/loads v0.24.0 // indirect
- github.com/go-openapi/runtime v0.32.4 // indirect
+ github.com/go-openapi/jsonpointer v1.0.0 // indirect
+ github.com/go-openapi/jsonreference v1.0.0 // indirect
+ github.com/go-openapi/loads v0.25.1 // indirect
+ github.com/go-openapi/runtime v0.32.5 // indirect
github.com/go-openapi/runtime/server-middleware v0.30.0 // indirect
- github.com/go-openapi/spec v0.22.6 // indirect
- github.com/go-openapi/strfmt v0.26.4 // indirect
+ github.com/go-openapi/spec v0.22.9 // indirect
+ github.com/go-openapi/strfmt v0.27.0 // indirect
github.com/go-openapi/swag v0.26.1 // indirect
github.com/go-openapi/swag/cmdutils v0.26.1 // indirect
- github.com/go-openapi/swag/conv v0.26.1 // indirect
- github.com/go-openapi/swag/fileutils v0.26.1 // indirect
+ github.com/go-openapi/swag/conv v0.28.0 // indirect
+ github.com/go-openapi/swag/fileutils v0.28.0 // indirect
github.com/go-openapi/swag/jsonname v0.26.1 // indirect
- github.com/go-openapi/swag/jsonutils v0.26.1 // indirect
- github.com/go-openapi/swag/loading v0.26.1 // indirect
- github.com/go-openapi/swag/mangling v0.26.1 // indirect
+ github.com/go-openapi/swag/jsonutils v0.28.0 // indirect
+ github.com/go-openapi/swag/loading v0.28.0 // indirect
+ github.com/go-openapi/swag/mangling v0.28.0 // indirect
github.com/go-openapi/swag/netutils v0.26.1 // indirect
- github.com/go-openapi/swag/stringutils v0.26.1 // indirect
- github.com/go-openapi/swag/typeutils v0.26.1 // indirect
- github.com/go-openapi/swag/yamlutils v0.26.1 // indirect
- github.com/go-openapi/validate v0.26.0 // indirect
+ github.com/go-openapi/swag/pools v0.28.0 // indirect
+ github.com/go-openapi/swag/stringutils v0.28.0 // indirect
+ github.com/go-openapi/swag/typeutils v0.28.0 // indirect
+ github.com/go-openapi/swag/yamlutils v0.28.0 // indirect
+ github.com/go-openapi/validate v0.26.3 // indirect
github.com/go-toolsmith/astcast v1.1.0 // indirect
github.com/go-toolsmith/astcopy v1.1.0 // indirect
github.com/go-toolsmith/astequal v1.2.0 // indirect
@@ -265,7 +267,7 @@ require (
github.com/google/s2a-go v0.1.9 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/google/wire v0.7.0 // indirect
- github.com/googleapis/enterprise-certificate-proxy v0.3.17 // indirect
+ github.com/googleapis/enterprise-certificate-proxy v0.3.18 // indirect
github.com/googleapis/gax-go/v2 v2.23.0 // indirect
github.com/gordonklaus/ineffassign v0.1.0 // indirect
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
@@ -326,7 +328,7 @@ require (
github.com/mattn/go-isatty v0.0.21 // indirect
github.com/mattn/go-runewidth v0.0.22 // indirect
github.com/mgechev/revive v1.7.0 // indirect
- github.com/miekg/pkcs11 v1.1.1 // indirect
+ github.com/miekg/pkcs11 v1.1.2 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/moby/term v0.5.2 // indirect
@@ -356,11 +358,11 @@ require (
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/polyfloyd/go-errorlint v1.7.1 // indirect
- github.com/prometheus/client_golang v1.23.2 // indirect
+ github.com/prometheus/client_golang v1.24.1 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
- github.com/prometheus/common v0.67.5 // indirect
+ github.com/prometheus/common v0.70.1 // indirect
github.com/prometheus/otlptranslator v1.0.0 // indirect
- github.com/prometheus/procfs v0.20.1 // indirect
+ github.com/prometheus/procfs v0.21.1 // indirect
github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 // indirect
github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect
github.com/quasilyte/gogrep v0.5.0 // indirect
@@ -377,7 +379,7 @@ require (
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
github.com/sashamelentyev/usestdlibvars v1.28.0 // indirect
- github.com/sassoftware/relic v7.2.1+incompatible // indirect
+ github.com/sassoftware/relic/v8 v8.2.0 // indirect
github.com/securego/gosec/v2 v2.22.2 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
github.com/shibumi/go-pathspec v1.3.0 // indirect
@@ -399,7 +401,7 @@ require (
github.com/src-d/gcfg v1.4.0 // indirect
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect
github.com/stbenjam/no-sprintf-host-port v0.2.0 // indirect
- github.com/stretchr/objx v0.5.2 // indirect
+ github.com/stretchr/objx v0.5.3 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tdakkota/asciicheck v0.4.1 // indirect
@@ -449,11 +451,11 @@ require (
go.opentelemetry.io/otel/sdk v1.44.0 // indirect
go.opentelemetry.io/otel/trace v1.44.0 // indirect
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
- go.step.sm/crypto v0.77.7 // indirect
+ go.step.sm/crypto v0.87.0 // indirect
go.uber.org/automaxprocs v1.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
- go.yaml.in/yaml/v3 v3.0.4 // indirect
+ go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect
golang.org/x/mod v0.38.0 // indirect
golang.org/x/net v0.57.0 // indirect
@@ -461,13 +463,13 @@ require (
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/term v0.45.0 // indirect
- golang.org/x/text v0.40.0 // indirect
+ golang.org/x/text v0.41.0 // indirect
golang.org/x/time v0.15.0 // indirect
golang.org/x/tools v0.48.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
- google.golang.org/api v0.287.1 // indirect
- google.golang.org/genproto v0.0.0-20260406210006-6f92a3bedf2d // indirect
+ google.golang.org/api v0.290.0 // indirect
+ google.golang.org/genproto v0.0.0-20260622175928-b703f567277d // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260727163830-6c54dddc4772 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260720155508-bb71a54f79dc // indirect
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
diff --git a/go.sum b/go.sum
index c75409410d..8e09ebc46c 100644
--- a/go.sum
+++ b/go.sum
@@ -60,28 +60,28 @@ cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdB
cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
-cloud.google.com/go/firestore v1.21.0 h1:BhopUsx7kh6NFx77ccRsHhrtkbJUmDAxNY3uapWdjcM=
-cloud.google.com/go/firestore v1.21.0/go.mod h1:1xH6HNcnkf/gGyR8udd6pFO4Z7GWJSwLKQMx/u6UrP4=
+cloud.google.com/go/firestore v1.22.0 h1:avooeboIq37vKXobrbPUFhFBxS/c3FqmWoX0xs8dO6E=
+cloud.google.com/go/firestore v1.22.0/go.mod h1:PaM4i7i7ruALSKmlpHXXZaPObcZw0W7ie5UOPr72iTU=
cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY=
cloud.google.com/go/iam v0.4.0/go.mod h1:cbaZxyScUhxl7ZAkNWiALgihfP75wS/fUsVNaa1r3vA=
-cloud.google.com/go/iam v1.11.0 h1:KieQ9Pb+LLPak1O3Rv3GgCxhnmkYf7Xyh0P5HfF1jFM=
-cloud.google.com/go/iam v1.11.0/go.mod h1:KP+nKGugNJW4LcLx1uEZcq1ok5sQHFaQehQNl4QDgV4=
+cloud.google.com/go/iam v1.13.0 h1:ufT3FPT5rFFXu6UtLkNoxaOaV5EuA1dsSkmemCSTo6U=
+cloud.google.com/go/iam v1.13.0/go.mod h1:gHXdDEiPDvqd1q1KwBDGQlgZY/BwY760zU2LhOZS5w0=
cloud.google.com/go/kms v1.33.0 h1:pG0X78m212b2pv9N4fdMoUO69LuZGQ9kSvn8sHBOFAo=
cloud.google.com/go/kms v1.33.0/go.mod h1:CSGvW6GnMQbY+1nOHcIzhMtHSbExXlOmCKjWtYVjcpA=
-cloud.google.com/go/logging v1.14.0 h1:xpPpY8cVT6n9DgIRgrWyE+YEsGlO/994pWnbc7o5Eh4=
-cloud.google.com/go/logging v1.14.0/go.mod h1:jmI+Try/fZeOTOAer3wVYOuPf9WX9PyzhlSDoBAi4HM=
+cloud.google.com/go/logging v1.18.0 h1:KhzZq+1cSkPH9YUaKLLhLtQxIHitVayBmk0sGfoM9+k=
+cloud.google.com/go/logging v1.18.0/go.mod h1:ZGKnpBaURITh+g/uom2VhbiFoFWvejcrHPDhxFtU/gI=
cloud.google.com/go/longrunning v1.2.0 h1:WjYH3YHBGCxGJP9M4dWGHBfXr/cFIjMkNgWcJj7/iMM=
cloud.google.com/go/longrunning v1.2.0/go.mod h1:5KMQALFGOCtFoi2xSOA1u3H7WKlhmckgiyFw7+LGQp0=
-cloud.google.com/go/monitoring v1.25.0 h1:HnsTIOxTN6BCSkt1P/Im23r1m7MHTTpmSYCzPkW7NK4=
-cloud.google.com/go/monitoring v1.25.0/go.mod h1:wlj6rX+JGyusw/8+2duW4cJ6kmDHGmde3zMTJuG3Jpc=
+cloud.google.com/go/monitoring v1.29.0 h1:AHhDsFaSax1/4k+qlIDX/SDGe6hggnfXJ9dkgD9qBPY=
+cloud.google.com/go/monitoring v1.29.0/go.mod h1:72NOVjJXHY/HBfoLT0+qlCZBT059+9VXLeAnL2PeeVM=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
-cloud.google.com/go/pubsub v1.50.2 h1:54Up97HnThdP4H8jjWJSSQ/mnYG2EKon7ZSNETRq0tM=
-cloud.google.com/go/pubsub v1.50.2/go.mod h1:jyCWeZdGFqd4mitSsBERnJcpqaHBsxQoPkNvjj4sp0w=
-cloud.google.com/go/pubsub/v2 v2.6.0 h1:8pjR0id+GTB+krKx5G6AGJoYrHog58w2Q89PCOrfM64=
-cloud.google.com/go/pubsub/v2 v2.6.0/go.mod h1:4anqvV/w8Pcgu2tO0qr2XgsF3GXHowzryfQ5gOnVmWY=
+cloud.google.com/go/pubsub v1.51.0 h1:XOaCejsqX7EEtUdQz+WPag66wWsUUGliyCOfGPKfo90=
+cloud.google.com/go/pubsub v1.51.0/go.mod h1:NERXf11sd82UV3VnflcUj8POIyQUXT/QwrKlxD8di/I=
+cloud.google.com/go/pubsub/v2 v2.6.1 h1:jX6gnC4n8BgYx6MOYICgbbaXZpr1vKeNOE3Bn17P5zg=
+cloud.google.com/go/pubsub/v2 v2.6.1/go.mod h1:1y2lZnKfUFPZz0PU4YmXyk4lA11+xmYA42zbC32RkxQ=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
@@ -90,8 +90,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
cloud.google.com/go/storage v1.62.3 h1:SZq1t23NCI+e96dH77Dg3PEfsNNEjqO8zE5AnD8gVD0=
cloud.google.com/go/storage v1.62.3/go.mod h1:cpYz/kRVZ+UQAF1uHeea10/9ewcRbxGoGNKsS9daSXA=
-cloud.google.com/go/trace v1.12.0 h1:XvWHYfr9q88cX4pZyou6qCcSagnuASyUq2ej1dB6NzQ=
-cloud.google.com/go/trace v1.12.0/go.mod h1:TOYfyeoyCGsSH0ifXD6Aius24uQI9xV3RyvOdljFIyg=
+cloud.google.com/go/trace v1.16.0 h1:GmQovzFc5F0CNfl0VLgL64aoTtu7xsM0YajW2GlG9+E=
+cloud.google.com/go/trace v1.16.0/go.mod h1:r+bdAn16dKLSV1G2D5v3e58IlQlizfxWrUfjx7kM7X0=
code.gitea.io/sdk/gitea v0.21.0 h1:69n6oz6kEVHRo1+APQQyizkhrZrLsTLXey9142pfkD4=
code.gitea.io/sdk/gitea v0.21.0/go.mod h1:tnBjVhuKJCn8ibdyyhvUyxrR1Ca2KHEoTWoukNhXQPA=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
@@ -119,10 +119,10 @@ github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0 h1:aokoqcHvaGjiM3VpjKDfMMnF/8epJ+Q1HLJ7CudztqE=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0/go.mod h1:/WYEx9pcM9Y+Dd/APJaNlSvVSvzl54rrMdZT5+Oi2LM=
-github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4=
-github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0=
-github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY=
-github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.0 h1:CU4+EJeJi3TKYWEcYuSdWsjzw0nVsK/H0MSQOiPcymU=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.0/go.mod h1:q0+UTSRvShwUCrR/s5HtyInYphN7Wvxb7snFM3u+SLA=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.4.0 h1:xFaZZ+IubdftrDHnGGwZ6QvQ3KHTtWl2MCK+GMt2vxs=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.4.0/go.mod h1:mCBhUhlMjLLJKr5aqw2TNS/VqJOie8MzWq3DAMJeKso=
github.com/Azure/azure-sdk-for-go/sdk/containers/azcontainerregistry v0.2.3 h1:ldKsKtEIblsgsr6mPwrd9yRntoX6uLz/K89wsldwx/k=
github.com/Azure/azure-sdk-for-go/sdk/containers/azcontainerregistry v0.2.3/go.mod h1:MAm7bk0oDLmD8yIkvfbxPW04fxzphPyL+7GzwHxOp6Y=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 h1:fhqpLE3UEXi9lPaBRpQ6XuRW0nU7hgg4zlmZZa+a9q4=
@@ -158,8 +158,8 @@ github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUM
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM=
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE=
-github.com/AzureAD/microsoft-authentication-library-for-go v1.7.0 h1:4iB+IesclUXdP0ICgAabvq2FYLXrJWKx1fJQ+GxSo3Y=
-github.com/AzureAD/microsoft-authentication-library-for-go v1.7.0/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk=
+github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2 h1:RHK7bS+HQMslb1sZpAokUt+zTVmue0hKSs2C791hhzU=
+github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
@@ -188,6 +188,8 @@ github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OpenPeeDeeP/depguard/v2 v2.2.1 h1:vckeWVESWp6Qog7UZSARNqfu/cZqvki8zsuj3piCMx4=
github.com/OpenPeeDeeP/depguard/v2 v2.2.1/go.mod h1:q4DKzC4UcVaAvcfd41CZh0PWpGgzrVxUYBlgKNGquUo=
+github.com/ProtonMail/go-crypto v1.4.1 h1:9RfcZHqEQUvP8RzecWEUafnZVtEvrBVL9BiF67IQOfM=
+github.com/ProtonMail/go-crypto v1.4.1/go.mod h1:e1OaTyu5SYVrO9gKOEhTc+5UcXtTUa+P3uLudwcgPqo=
github.com/ThalesIgnite/crypto11 v1.2.5 h1:1IiIIEqYmBvUYFeMnHqRft4bwf/O36jryEUpY+9ef8E=
github.com/ThalesIgnite/crypto11 v1.2.5/go.mod h1:ILDKtnCKiQ7zRoNxcp36Y1ZR8LBPmR2E23+wTQe/MlE=
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
@@ -270,10 +272,10 @@ github.com/aws/aws-sdk-go-v2/config v1.32.31 h1:n4nY9O3QKoHIkL85EX+V8RcMFtOhlpTF
github.com/aws/aws-sdk-go-v2/config v1.32.31/go.mod h1:PN0NYDCCoOpGGsZ2+elDUidmHfQBPyYzN2GCgl8HEBs=
github.com/aws/aws-sdk-go-v2/credentials v1.19.30 h1:TTCvvzFU6gXa4iJecNG/0F/B0oYTiazoRECr2XyLHrY=
github.com/aws/aws-sdk-go-v2/credentials v1.19.30/go.mod h1:jKxAp2AEncnliinzpgOSZDFv6+VjvWhjw/AtbfsWT9U=
-github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.20.26 h1:khdgzmb6QKweEAnjBhg/Ikcn0VguyOyg0gMSVyK8ddI=
-github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.20.26/go.mod h1:P5lKM3+laQ9v0KAOLhxOkClj4UbBwXJ2QcQc2sKSOYo=
-github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.8.26 h1:tHmqvPzeKaCIlD4kdQVP+7v5GdHHtu9olhvweho5zr8=
-github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.8.26/go.mod h1:qEScmjwld3lw08e6CIWbPIgfcCKBdw2htqqBtSOSINQ=
+github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.20.35 h1:CQ2kB9Q4xQ2PDBmn+KCr/pw1DvK7pH6NkR2nl2KV7ng=
+github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.20.35/go.mod h1:ypTMB9nZhpqfMeRVesGj4dEknIg0YS+aXGtLMidw/Ek=
+github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.8.35 h1:qxsbiWRtwChp/rrSHMfYoosVDVWRICoYXoDdczaLFiI=
+github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.8.35/go.mod h1:SomvXQRUKYBML53k4LqIgszKJKz8TdUwi/Zwig7JhfU=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.31 h1:kfVL5wAunCJycL6MOQ6aNh6PlAYEymflcjuKmrWUA0o=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.31/go.mod h1:nWfRNDAppujCQgOUd43lKT4yeLv9z3nJ3bw1G3BgQKo=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.31 h1:Z8F3hfCY33IGpJjFAnv0wvtv1FIKj1GHmRDEYqy64tw=
@@ -282,22 +284,22 @@ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.31 h1:hyOxUyXdh3AyjE93gB
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.31/go.mod h1:OERqI9k0draSLB8O8woxY3q25ZWTELRK4RRoLMuMZFo=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.32 h1:0MrUL35H/Y4kdFfItoR5jCgtDQ4Z/8LudAoIHRfA4hE=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.32/go.mod h1:2tNZkuWz54arj8mHVf+8Y7cKkcD8Wr/fBpENgEXpjLc=
-github.com/aws/aws-sdk-go-v2/service/dynamodb v1.53.2 h1:+/HEQj1fQGr17AQ0fAKpefDHw2hxQ3f0q96hY39J8Ao=
-github.com/aws/aws-sdk-go-v2/service/dynamodb v1.53.2/go.mod h1:bz4cZH7uK5fLxQbj7hL4MFDL+pjReC9en/nM2Wfwxsk=
-github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.6 h1:m8Odxvyy7nirivpiI0VLwqd3lUkVRgeKPQgdJ9YhvcQ=
-github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.6/go.mod h1:r2DJVcbGPv7oJGoPICCQJ+4ci5oSGjdXtdscnJIQBfk=
+github.com/aws/aws-sdk-go-v2/service/dynamodb v1.56.2 h1:xi/ECwajy2mixviBD7bKAlGGSwzEaFKX2wIhrZt9NGw=
+github.com/aws/aws-sdk-go-v2/service/dynamodb v1.56.2/go.mod h1:dLREOeW66eVaaGIOi2ZlLHDgkR3nuJ02rd00j0YSlBE=
+github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.13 h1:xQ9dX2jxVm14uNVe0WomcCSza832ytYWt1ZBu2LrBLM=
+github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.13/go.mod h1:D5up2/CMSP4sF8ESBWla6gJvIMySJi8dYYAaED4oTCc=
github.com/aws/aws-sdk-go-v2/service/ecr v1.55.3 h1:RtGctYMmkTerGClvdY6bHXdtly4FeYw9wz/NPz62LF8=
github.com/aws/aws-sdk-go-v2/service/ecr v1.55.3/go.mod h1:vBfBu24Ka3/5UZtepbTV0gnc9VPLT8ok+0oDDaYAzn4=
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.38.10 h1:1A/sI3LNMi3fhRI5TFLMwwo7ALAALSFVCSGvFlr1Iys=
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.38.10/go.mod h1:Diyyyz0b43X13pdi1mVMqlTwDjOmRbJMvDsqnduUYWM=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.13 h1:mbRIur/BiHK6SKPjoBIXSE/hJ6g6JGRLuxQy1jGjlN4=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.13/go.mod h1:ITg9em2KbJx1s0y4aqRX5OYWG6HBZ5TVR//OdpEZ2CQ=
-github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.14 h1:3exo28cClRTVnxdj/LULxkESZSSv74RUIjZ7tfHXfWQ=
-github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.14/go.mod h1:yLon9pByjyB6JZq5IAmwnjE3ObIhD0QibfRWH7tUhLU=
+github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.20 h1:ru+seMuylHiNZlvgZei83eD8h37hRjm1XIMOEmcV0BU=
+github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.20/go.mod h1:ihZMtPTKoX/ugQRHbui6zNdSgVYN1KY2Dgwb2d3hXlc=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.31 h1:w2SIhW92DZPFrSL4ksVCr8IYff5OZwIcxg8+95tzvAI=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.31/go.mod h1:wAhpCQbkov+IcvjozJbd2xRCoZybUEHNkcFunssNACg=
-github.com/aws/aws-sdk-go-v2/service/kms v1.54.0 h1:XOfYhrscVxDr0fLbgA4lE5UbQh5w9t+eva8bZu4q6wY=
-github.com/aws/aws-sdk-go-v2/service/kms v1.54.0/go.mod h1:0RXNc6Yf3AvSMldGD6Lcch96Ojlw2TtGnHsqfD/L4u8=
+github.com/aws/aws-sdk-go-v2/service/kms v1.55.0 h1:uB8ymkVosyourmGXCZHyWhJ4wuKA4xq3ii2dVMPtBZY=
+github.com/aws/aws-sdk-go-v2/service/kms v1.55.0/go.mod h1:rK4RITSY/qJw3qVJ7p19fceOWuvrisqqOChFkX05n5I=
github.com/aws/aws-sdk-go-v2/service/signin v1.5.0 h1:OHH5iTQvVGmfHjX/5Q+vFuA/Rf2x6/95aJ/75QCQSm4=
github.com/aws/aws-sdk-go-v2/service/signin v1.5.0/go.mod h1:mCF3AK9PpL49oOrhniUXWAfhVBVQ/XbytoE5eccZUIs=
github.com/aws/aws-sdk-go-v2/service/sso v1.33.0 h1:CaJyYhxBE0M/HJX/YvSaSmQlsI91VHB0lKU8LtLxL3A=
@@ -314,8 +316,6 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bkielbasa/cyclop v1.2.3 h1:faIVMIGDIANuGPWH031CZJTi2ymOQBULs9H21HSMa5w=
github.com/bkielbasa/cyclop v1.2.3/go.mod h1:kHTwA9Q0uZqOADdupvcFJQtp/ksSnytRMe8ztxG8Fuo=
-github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
-github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE=
@@ -379,6 +379,8 @@ github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJ
github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
github.com/cloudevents/sdk-go/v2 v2.16.2 h1:ZYDFrYke4FD+jM8TZTJJO6JhKHzOQl2oqpFK1D+NnQM=
github.com/cloudevents/sdk-go/v2 v2.16.2/go.mod h1:laOcGImm4nVJEU+PHnUrKL56CKmRL65RlQF0kRmW/kg=
+github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8=
+github.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
@@ -502,8 +504,8 @@ github.com/ghostiam/protogetter v0.3.9/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJR
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU=
-github.com/go-chi/chi/v5 v5.2.5 h1:Eg4myHZBjyvJmAFjFvWgrqDTXFyOzjj7YIm3L3mu6Ug=
-github.com/go-chi/chi/v5 v5.2.5/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0=
+github.com/go-chi/chi/v5 v5.3.1 h1:3j4HZLGZQ3JpMCrPJF/Jl3mYJfWLKBfNJ6quurUGCf8=
+github.com/go-chi/chi/v5 v5.3.1/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutVsOCto=
github.com/go-critic/go-critic v0.12.0 h1:iLosHZuye812wnkEz1Xu3aBwn5ocCPfc9yqmFG9pa6w=
github.com/go-critic/go-critic v0.12.0/go.mod h1:DpE0P6OVc6JzVYzmM5gq5jMU31zLr4am5mB/VfFK64w=
github.com/go-fed/httpsig v1.1.0 h1:9M+hb0jkEICD8/cAiNqEB66R87tTINszBRTjwjQzWcI=
@@ -521,62 +523,64 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
-github.com/go-openapi/analysis v0.25.2 h1:I0vy4n3alz+DHTiN1PRhCb7QZxkK6g5YmswZKv2TKuw=
-github.com/go-openapi/analysis v0.25.2/go.mod h1:Uhs1t/2XR10EnwONYILGEzw8gcfGIG5Xk5K2AxnhqDo=
+github.com/go-openapi/analysis v0.26.0 h1:1xECln1iMMmQnTjgcknC1vi1hA4KISt6IHpSwnqcuwI=
+github.com/go-openapi/analysis v0.26.0/go.mod h1:40gERFi/2dyXA1FaqRRLxkv1IlC6X+GPDNd1xrYAjZE=
github.com/go-openapi/errors v0.22.8 h1:oP7sW7TWc3wFFjrzzj0nI83H2qMBkNjNfSd+XRejk/I=
github.com/go-openapi/errors v0.22.8/go.mod h1:BuUoHcYrU6E7V9gfj1I5wLQqgtIHnup/alXZ8KdgQ0w=
-github.com/go-openapi/jsonpointer v0.23.1 h1:1HBACs7XIwR2RcmItfdSFlALhGbe6S92p0ry4d1GWg4=
-github.com/go-openapi/jsonpointer v0.23.1/go.mod h1:iWRmZTrGn7XwYhtPt/fvdSFj1OfNBngqRT2UG3BxSqY=
-github.com/go-openapi/jsonreference v0.21.6 h1:NZ5nGfnaM1n4I43Xjm1e5/M2GjOwQwndQz22uhxwD+Y=
-github.com/go-openapi/jsonreference v0.21.6/go.mod h1:xzbgtQ3ZbWxvET3AxdzCJlJt6vkovbf+IfSPJjD0tUY=
-github.com/go-openapi/loads v0.24.0 h1:4LLorXRPTzIN9V6ngMUZbAscsBOUBk3Oa8cClu/bFrQ=
-github.com/go-openapi/loads v0.24.0/go.mod h1:xQMgX+hw5xRAhGrcDXxeMw78IFqUpIzhleu3HqPhyF4=
-github.com/go-openapi/runtime v0.32.4 h1:8ElGj/3goG0itt0nBPP6Cm57ehcYyuHoI3O20nxgvkw=
-github.com/go-openapi/runtime v0.32.4/go.mod h1:Bz6keOZw1NX4T6f+m42OoT1MBPDt6Re13dbccHyGH/4=
+github.com/go-openapi/jsonpointer v1.0.0 h1:kR9tHqY0CtZaOPVFm622dPVNhrvYpwr4uCxgL3h1H8s=
+github.com/go-openapi/jsonpointer v1.0.0/go.mod h1:Z3rw7dWu1p9IgitXCFamSlA5lmDiklEB6vkaxcNZW5Y=
+github.com/go-openapi/jsonreference v1.0.0 h1:jlmTr6torcd1YgDQvSfNmRtKzYDO4FGBkrAdlAVWnpY=
+github.com/go-openapi/jsonreference v1.0.0/go.mod h1:jtwdyGbJk0Xhe5Y+rwtglQP6Sb1WZST4rT32LWB+sv0=
+github.com/go-openapi/loads v0.25.1 h1:toKQdIDLxlqfKLLGUUmUsiTd5/X0Chzvde9EGYQP/Ac=
+github.com/go-openapi/loads v0.25.1/go.mod h1:33Hen4tsKXHL45TyYojvfD5fZUFN4O1y4r/XhsRW2zc=
+github.com/go-openapi/runtime v0.32.5 h1:+aDmMj6xB4P8isUwEOERtgHW3JNI/i93KvTWNa4LRik=
+github.com/go-openapi/runtime v0.32.5/go.mod h1:eNPUCk8LAYV803GHJP3xDSNllJQfv+pBlXpFfWqpPO8=
github.com/go-openapi/runtime/server-middleware v0.30.0 h1:8rPoJ/xv7JL8BsovaqboKETlpWBArVh8n+0L/GyePog=
github.com/go-openapi/runtime/server-middleware v0.30.0/go.mod h1:OYNT/TxNvB/VK5oe4htM2jDTwlEXuejVJmu0DVZfAMs=
-github.com/go-openapi/spec v0.22.6 h1:Tyy1pLaNCM8GBCFLoGYLonjJi6zykqyLCjXLc19ZPic=
-github.com/go-openapi/spec v0.22.6/go.mod h1:HZvTHat+iH0PALQRWhrqIHtU/PEqxqd89fu0MxGlMeM=
-github.com/go-openapi/strfmt v0.26.4 h1:yI6IAEfcWow459BD5UzFY430KUwXZwBHrYusPFkhWlc=
-github.com/go-openapi/strfmt v0.26.4/go.mod h1:hNJi6nb5ETD6i7A1yRo03M9S6ZoTPPoWff1iUexmfUc=
+github.com/go-openapi/spec v0.22.9 h1:/vKIFDcGKp0ktZWGbym/tJEWbk6/XOEmAVU0kqKMH+w=
+github.com/go-openapi/spec v0.22.9/go.mod h1:b/mNUYIOQOyIiUzUzXEE8xzyZqf93KvM9hQGP91yfl0=
+github.com/go-openapi/strfmt v0.27.0 h1:kbcTeaD9TXuXD0hhMXzuYa1sdTo6+dWGvwjW93E80IM=
+github.com/go-openapi/strfmt v0.27.0/go.mod h1:s/qhDqfY72irigXUGJmtgid2Rm+3tnz3k8hZaRmvWYc=
github.com/go-openapi/swag v0.26.1 h1:l5sVEyVpwj+DDYeZyo7wQI/Ebn/mKYIyGB/pFwAfGoQ=
github.com/go-openapi/swag v0.26.1/go.mod h1:yNY38BbIVthxbkDtq1UHBCGasBqjakW3lCR6ANzdBEw=
github.com/go-openapi/swag/cmdutils v0.26.1 h1:f2iE1ijYaJ3nuu5PaEMx3zpEhzhZFgivCJObWEObLIQ=
github.com/go-openapi/swag/cmdutils v0.26.1/go.mod h1:Sm1MVFMkF6guJJ+pQqHnQA3N0j9qALV3NxzDSv6bETM=
-github.com/go-openapi/swag/conv v0.26.1 h1:slr5FVkg9Wc3Y5zcwenD8Sd/PQ94b2I/QJI7N7KTBpg=
-github.com/go-openapi/swag/conv v0.26.1/go.mod h1:mvQXgPptZk9GTrFgGwWvT4q+dN+zQej9JfmGwnipz1A=
-github.com/go-openapi/swag/fileutils v0.26.1 h1:K1XCM2CGhfNsc6YDt6v7Q5+1e59rftYWdcu/isZhvFw=
-github.com/go-openapi/swag/fileutils v0.26.1/go.mod h1:mYUgxQAKX4ShS3qvvySx+/9yrlUnDhjiD1CalaQl8lQ=
+github.com/go-openapi/swag/conv v0.28.0 h1:GtqqbyFe7vR5Y7ehxG9W6/OvrSFdf1OLeTGp40TqxH8=
+github.com/go-openapi/swag/conv v0.28.0/go.mod h1:mbUE+mzctnhxi864m0Q07SpN8OowD9JhxmxuYvZZD/k=
+github.com/go-openapi/swag/fileutils v0.28.0 h1:Z04XWQD7R8Eq+7GnOrjovBxPPmZzsS4gt2H2GPGIViU=
+github.com/go-openapi/swag/fileutils v0.28.0/go.mod h1:VvJFZLTZS0AI854gEQz5tk7dBESdLjiNUMSZ/th2ry8=
github.com/go-openapi/swag/jsonname v0.26.1 h1:VReupaV6WxlAsCn0e4DUfgV6bPmINnPpyJDLqSfNPcE=
github.com/go-openapi/swag/jsonname v0.26.1/go.mod h1:OvdW6BoWoj33pTfi7x9vFrgmT+fk7aw0BRwvCE0YOuc=
-github.com/go-openapi/swag/jsonutils v0.26.1 h1:2hdBfFkHg+7Wrz2VsCbeyR6hzkRDs7AztnMR2u84yOY=
-github.com/go-openapi/swag/jsonutils v0.26.1/go.mod h1:U+RMJH3wa+6BRiphuRtIyI8fW9HPFqFQ4sHk2oRx0UQ=
-github.com/go-openapi/swag/jsonutils/fixtures_test v0.26.1 h1:1CD7NiLLb/TXl3tOnFYU4b+mNfb5rtgHkaA+q7RMYYQ=
-github.com/go-openapi/swag/jsonutils/fixtures_test v0.26.1/go.mod h1:ZWafc8nMdYzTE3uYY6W86f0n46+IF0g4uUyRhJw/kXc=
-github.com/go-openapi/swag/loading v0.26.1 h1:E9K4wqXeROlhjFQ13K9zMz6ojFGXIggGe+ad1odrK9w=
-github.com/go-openapi/swag/loading v0.26.1/go.mod h1:3qvRIlWzWdq1HvmldwmuJ2ohpcAryN6xVt2OTKd0/7E=
-github.com/go-openapi/swag/mangling v0.26.1 h1:gpYI4WuPKFJJVjV5cDLGlDVJhFIxYjQc7yN5eEb4CqM=
-github.com/go-openapi/swag/mangling v0.26.1/go.mod h1:POETDH01hqAdASXfw7ISEd9bCOE6xBHOt8NHmGZRmYM=
+github.com/go-openapi/swag/jsonutils v0.28.0 h1:YIch6FwO7RXzeAnbO8Tu7dWBZeUEH+4nA0HXltVTnv4=
+github.com/go-openapi/swag/jsonutils v0.28.0/go.mod h1:CYM3WlTUcagR2ZoHdz54di/cbBqt82tuxuXgAjxw+mg=
+github.com/go-openapi/swag/jsonutils/fixtures_test v0.28.0 h1:qV+VVUAx5Oro8WjVWpZeql7YReTKhT4smR4zhcOQZr0=
+github.com/go-openapi/swag/jsonutils/fixtures_test v0.28.0/go.mod h1:mofwUWx70wvskwESqRJ//k/9kURmCgyJl5m5Ppoh5kY=
+github.com/go-openapi/swag/loading v0.28.0 h1:td8QZdZC9MIYGGSnSPKShKiK22I2tU5UQvuUhIBPRLU=
+github.com/go-openapi/swag/loading v0.28.0/go.mod h1:rXB0QiQX5mMveXEA7ouM4KiiM9jVJe4K6BVbwhD1M4k=
+github.com/go-openapi/swag/mangling v0.28.0 h1:pH8eyeNO9SLYsTMWJrurnNfKmDa28XrlA+HePVD53VM=
+github.com/go-openapi/swag/mangling v0.28.0/go.mod h1:jtBE2+V+3pILxOR7Vgce+Cwp6A2PgZbvVqfNntbVs0w=
github.com/go-openapi/swag/netutils v0.26.1 h1:BNctoc39WTAUMxyAs355fExOPzMZtPbZ0ZZ1Am2FR5M=
github.com/go-openapi/swag/netutils v0.26.1/go.mod h1:y02vByhZhQPAVwOX+0KipXFZ/hUbk6G/Enhf5rGaOkQ=
-github.com/go-openapi/swag/stringutils v0.26.1 h1:f88uYyTso7TnHrKM/bUBsQ5e2wKf37cpgo6pvbzd9yU=
-github.com/go-openapi/swag/stringutils v0.26.1/go.mod h1:Sc6d3bU8fgk5AyZR8/8jEQ+Is/Ald+TD/IIggPN8UJk=
-github.com/go-openapi/swag/typeutils v0.26.1 h1:yg42FgMzRR6PVQ3M3qHz1s+Y6/P4HoJ3cBarXa3OVnU=
-github.com/go-openapi/swag/typeutils v0.26.1/go.mod h1:VfnV+oUtSP2vCSCn2aJgnr8OevUYemyIzzS1VOzS10o=
-github.com/go-openapi/swag/yamlutils v0.26.1 h1:0TSLK+lXs9vfIhAWzBeI/lOzEnIoot6WTCO1aAeWFTk=
-github.com/go-openapi/swag/yamlutils v0.26.1/go.mod h1:7W5b7PRX9MxwL7TjeG7H8HkyBGRsIDRObhyMWFgBI2M=
-github.com/go-openapi/testify/enable/yaml/v2 v2.5.1 h1:q9NtHwK4qHF7yZziBPvZyv7zWAIk8ok88Gh2mR6Jpc8=
-github.com/go-openapi/testify/enable/yaml/v2 v2.5.1/go.mod h1:JW0MXIotCYps/XsgJnG3a8Q7rE5xAiBwoOD5OfaIQBk=
+github.com/go-openapi/swag/pools v0.28.0 h1:HPMZWSAfce3rdVTFcjFiCIBtDg9h4x2QlRrHipwhxeU=
+github.com/go-openapi/swag/pools v0.28.0/go.mod h1:kVQefhSK5RWuRe7BXsL8htgBPAMpN7HDGpGEknqugeE=
+github.com/go-openapi/swag/stringutils v0.28.0 h1:ixsc9iYgDPubHL/8nSkbnryEHpD2VRlBMLKpQyPXcDU=
+github.com/go-openapi/swag/stringutils v0.28.0/go.mod h1:lzRN95CxXmA03XcDWHLOb6nOMcxCqR5rGY0lOgsfRoM=
+github.com/go-openapi/swag/typeutils v0.28.0 h1:nRBKSBXjDgf01VDPB3fWeD9nQuhCOVeIYAkUx2tbkyY=
+github.com/go-openapi/swag/typeutils v0.28.0/go.mod h1:Srm0xFNRZ1Y+vCxJclo5qzx8aj+1pAKda/YfFPrG0dQ=
+github.com/go-openapi/swag/yamlutils v0.28.0 h1:TV3JXH6DS46KUroDtMLAYHGkdWf5VDq3wVWFirmzROY=
+github.com/go-openapi/swag/yamlutils v0.28.0/go.mod h1:x0q/yndZHEgk9Rx3DyDqzFUmHy55KTvIZldvF2dTJXs=
+github.com/go-openapi/testify/enable/yaml/v2 v2.6.0 h1:gGHwAJ0R/5jU8BEGDbfRNR3hL68dAVi84WuOApp29B0=
+github.com/go-openapi/testify/enable/yaml/v2 v2.6.0/go.mod h1:tY+St1SGq4NFl0QIqdTY4aEdbChAHxhyB77XQi9iJCo=
github.com/go-openapi/testify/v2 v2.6.0 h1:5PKH2HE7YJ/LuRPQGvSxBRlFXNQhSetBLlGAgUEu3ug=
github.com/go-openapi/testify/v2 v2.6.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw=
-github.com/go-openapi/validate v0.26.0 h1:dxWzQ3F+vb1SajqUxHjwb5T4mTpSHmdrtv5Bi7+ZNhw=
-github.com/go-openapi/validate v0.26.0/go.mod h1:b4o00uq7fJeJA+wWhVFCJpKTctzeFwzZImGGmHsl2JA=
+github.com/go-openapi/validate v0.26.3 h1:OkfZgLvLDnGP2hrRGD+42WBiPWWkoHomTJ+IVI+KaDc=
+github.com/go-openapi/validate v0.26.3/go.mod h1:7DOOa4raU6NRe7A8VQSKbm3VcuUIioREYHFt+er9Sk8=
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
github.com/go-rod/rod v0.116.2 h1:A5t2Ky2A+5eD/ZJQr1EfsQSe5rms5Xof/qj296e+ZqA=
github.com/go-rod/rod v0.116.2/go.mod h1:H+CMO9SCNc2TJ2WfrG+pKhITz57uGNYU43qYHh438Mg=
-github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=
-github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
+github.com/go-sql-driver/mysql v1.10.0 h1:Q+1LV8DkHJvSYAdR83XzuhDaTykuDx0l6fkXxoWCWfw=
+github.com/go-sql-driver/mysql v1.10.0/go.mod h1:M+cqaI7+xxXGG9swrdeUIoPG3Y3KCkF0pZej+SK+nWk=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
@@ -763,8 +767,8 @@ github.com/google/wire v0.7.0 h1:JxUKI6+CVBgCO2WToKy/nQk0sS+amI9z9EjVmdaocj4=
github.com/google/wire v0.7.0/go.mod h1:n6YbUQD9cPKTnHXEBN2DXlOp/mVADhVErcMFb0v3J18=
github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
-github.com/googleapis/enterprise-certificate-proxy v0.3.17 h1:73NfMHdiqo9JFU9+7a5ExpVa10/R29pXfZIaW559nrg=
-github.com/googleapis/enterprise-certificate-proxy v0.3.17/go.mod h1:rSEsBUemEBZEexP2y6jPp16LUmUbjmSbcPMQizR0o4k=
+github.com/googleapis/enterprise-certificate-proxy v0.3.18 h1:hvVi34VucdrV1IIsiWuqYM8kutw/92MxNEFxCJZEh0k=
+github.com/googleapis/enterprise-certificate-proxy v0.3.18/go.mod h1:rSEsBUemEBZEexP2y6jPp16LUmUbjmSbcPMQizR0o4k=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
@@ -799,7 +803,8 @@ github.com/gostaticanalysis/testutil v0.5.0/go.mod h1:OLQSbuM6zw2EvCcXTz1lVq5uny
github.com/grafeas/grafeas v0.2.3 h1:B9Bgc3ZQjPhqXKmro95Dfyb+GlE6D1pMuExT+n66ChE=
github.com/grafeas/grafeas v0.2.3/go.mod h1:O+UvNYn4LhdKR59XrxRDWwr2bbheR1KRRNdD8mJpxs4=
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI=
-github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8=
+github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 h1:B+8ClL/kCQkRiU82d9xajRPKYMrB7E0MbtzWVi1K4ns=
+github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3/go.mod h1:NbCUVmiS4foBGBHOYlCT25+YmGpJ32dZPi75pGEUpj4=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs=
@@ -967,8 +972,8 @@ github.com/mattn/go-runewidth v0.0.22/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhg
github.com/mgechev/revive v1.7.0 h1:JyeQ4yO5K8aZhIKf5rec56u0376h8AlKNQEmjfkjKlY=
github.com/mgechev/revive v1.7.0/go.mod h1:qZnwcNhoguE58dfi96IJeSTPeZQejNeoMQLUZGi4SW4=
github.com/miekg/pkcs11 v1.0.3-0.20190429190417-a667d056470f/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
-github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU=
-github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
+github.com/miekg/pkcs11 v1.1.2 h1:/VxmeAX5qU6Q3EwafypogwWbYryHFmF2RpkJmw3m4MQ=
+github.com/miekg/pkcs11 v1.1.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
@@ -1075,17 +1080,17 @@ github.com/polyfloyd/go-errorlint v1.7.1 h1:RyLVXIbosq1gBdk/pChWA8zWYLsq9UEw7a1L
github.com/polyfloyd/go-errorlint v1.7.1/go.mod h1:aXjNb1x2TNhoLsk26iv1yl7a+zTnXPhwEMtEXukiLR8=
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
-github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
-github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
+github.com/prometheus/client_golang v1.24.1 h1:JnJkREXzWxUdCuPFpIWZiPispT9xVV59uiuyR2bPlnU=
+github.com/prometheus/client_golang v1.24.1/go.mod h1:F+oSRECHg4sse5ucfYpYDeIv/hu68Zo0uoHKetWnzcE=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
-github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4=
-github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw=
+github.com/prometheus/common v0.70.1 h1:1HvjP4D5oL3t8RsPlwxA9onvvStjtIHYE5XuuwOi/PY=
+github.com/prometheus/common v0.70.1/go.mod h1:VdFUQDMZK3VLkurFUVhia6uys/0suUp86TJz5qbJRhc=
github.com/prometheus/otlptranslator v1.0.0 h1:s0LJW/iN9dkIH+EnhiD3BlkkP5QVIUVEoIwkU+A6qos=
github.com/prometheus/otlptranslator v1.0.0/go.mod h1:vRYWnXvI6aWGpsdY/mOT/cbeVRBlPWtBNDb7kGR3uKM=
-github.com/prometheus/procfs v0.20.1 h1:XwbrGOIplXW/AU3YhIhLODXMJYyC1isLFfYCsTEycfc=
-github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo=
+github.com/prometheus/procfs v0.21.1 h1:GljZCt+zSTS+NZq88cyQ1LjZ+RCHp3uVuabBWA5+OJI=
+github.com/prometheus/procfs v0.21.1/go.mod h1:aB55Cww9pdSJVHk0hUf0inxWyyjPogFIjmHKYgMKmtY=
github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 h1:+Wl/0aFp0hpuHM3H//KMft64WQ1yX9LdJY64Qm/gFCo=
github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI=
github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE=
@@ -1121,12 +1126,10 @@ github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tM
github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ=
github.com/sashamelentyev/usestdlibvars v1.28.0 h1:jZnudE2zKCtYlGzLVreNp5pmCdOxXUzwsMDBkR21cyQ=
github.com/sashamelentyev/usestdlibvars v1.28.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8=
-github.com/sassoftware/relic v7.2.1+incompatible h1:Pwyh1F3I0r4clFJXkSI8bOyJINGqpgjJU3DYAZeI05A=
-github.com/sassoftware/relic v7.2.1+incompatible/go.mod h1:CWfAxv73/iLZ17rbyhIEq3K9hs5w6FpNMdUT//qR+zk=
-github.com/sassoftware/relic/v7 v7.6.2 h1:rS44Lbv9G9eXsukknS4mSjIAuuX+lMq/FnStgmZlUv4=
-github.com/sassoftware/relic/v7 v7.6.2/go.mod h1:kjmP0IBVkJZ6gXeAu35/KCEfca//+PKM6vTAsyDPY+k=
-github.com/secure-systems-lab/go-securesystemslib v0.11.0 h1:iuCR9kcMFD4QurdKrGvPLoKZLv9YvwPYVr0473BdtFs=
-github.com/secure-systems-lab/go-securesystemslib v0.11.0/go.mod h1:+PMOTjUGwHj2vcZ+TFKlb1tXRbrdWE1LYDT5i9JC80Q=
+github.com/sassoftware/relic/v8 v8.2.0 h1:9/L4S4I6an/JsPNhmcTpqfiOIsLb/iJaePZD1xR+ulE=
+github.com/sassoftware/relic/v8 v8.2.0/go.mod h1:pZy7hLT9WCOKPonV8G/fplvtBLOZd6/kWtKqeHR6nKc=
+github.com/secure-systems-lab/go-securesystemslib v0.11.1 h1:ayahDPjfSIqKegyt5YVGEvQ7SAi72GHXTy+b2YjUd5w=
+github.com/secure-systems-lab/go-securesystemslib v0.11.1/go.mod h1:UyOjhoZLi76ir63u1ptubEevVe6dlNPmNxwgVvKqFFY=
github.com/securego/gosec/v2 v2.22.2 h1:IXbuI7cJninj0nRpZSLCUlotsj8jGusohfONMrHoF6g=
github.com/securego/gosec/v2 v2.22.2/go.mod h1:UEBGA+dSKb+VqM6TdehR7lnQtIIMorYJ4/9CW1KVQBE=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
@@ -1147,8 +1150,8 @@ github.com/sigstore/fulcio v1.8.5 h1:HYTD1/L5wlBp8JxsWxUf8hmfaNBBF/x3r3p5l6tZwbA
github.com/sigstore/fulcio v1.8.5/go.mod h1:tSLYK3JsKvJpDW1BsIsVHZgHj+f8TjXARzqIUWSsSPQ=
github.com/sigstore/protobuf-specs v0.5.1 h1:/5OPaNuolRJmQfeZLayJGFXMpsRJEdgC6ah1/+7Px7U=
github.com/sigstore/protobuf-specs v0.5.1/go.mod h1:DRBzpFuE+LnvQMN10/dU6nBeKwVLGEQ6o2FovN2Rats=
-github.com/sigstore/rekor v1.5.3 h1:0Tyolw3zreRgm7PUW8dccFLXGBThi08278jI8EXNSr4=
-github.com/sigstore/rekor v1.5.3/go.mod h1:h3GK5dDqCcWJJZUJwdpKGSSmEV2GEjPUjJy3WTjBwzA=
+github.com/sigstore/rekor v1.5.4 h1:A9zITTrkRwO+8lfq7L/gBR7rDHHcBQJRI+a0JQo4xDM=
+github.com/sigstore/rekor v1.5.4/go.mod h1:0bcUHhZPlG+RVW1dI/7sdBp0MiVWVzk9h0tgOH/o0Yc=
github.com/sigstore/rekor-tiles/v2 v2.0.1 h1:1Wfz15oSRNGF5Dzb0lWn5W8+lfO50ork4PGIfEKjZeo=
github.com/sigstore/rekor-tiles/v2 v2.0.1/go.mod h1:Pjsbhzj5hc3MKY8FfVTYHBUHQEnP0ozC4huatu4x7OU=
github.com/sigstore/sigstore v1.10.9 h1:7Dcpt+ibnltHQZ8XhaU0dFmhHaf/T491eJfA9WDex4Y=
@@ -1207,8 +1210,9 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
-github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
+github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4=
+github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
@@ -1221,8 +1225,9 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
-github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
+github.com/stretchr/testify v1.12.0 h1:K6Mr6jO9JICuend/5xzTM03ydSV3vdNRYAdPSukj8uI=
+github.com/stretchr/testify v1.12.0/go.mod h1:bOYBZb5qJ00vPzWfIqBUZPaxK8jWiXc6d3ErP4Ca9Gw=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs=
@@ -1253,8 +1258,8 @@ github.com/tink-crypto/tink-go-awskms/v2 v2.1.0 h1:N9UxlsOzu5mttdjhxkDLbzwtEecuX
github.com/tink-crypto/tink-go-awskms/v2 v2.1.0/go.mod h1:PxSp9GlOkKL9rlybW804uspnHuO9nbD98V/fDX4uSis=
github.com/tink-crypto/tink-go-awskms/v3 v3.0.0 h1:XSohRhCkXAVI0iaCnWB/GS05TEmpnKurQmzaY1jzt3Y=
github.com/tink-crypto/tink-go-awskms/v3 v3.0.0/go.mod h1:+7MXsShLzVbSQ6dI0Pe4JuZM52jD1jQ1itAygd/MDsA=
-github.com/tink-crypto/tink-go-gcpkms/v2 v2.2.0 h1:3B9i6XBXNTRspfkTC0asN5W0K6GhOSgcujNiECNRNb0=
-github.com/tink-crypto/tink-go-gcpkms/v2 v2.2.0/go.mod h1:jY5YN2BqD/KSCHM9SqZPIpJNG/u3zwfLXHgws4x2IRw=
+github.com/tink-crypto/tink-go-gcpkms/v2 v2.4.0 h1:xpI5pnEQ0erFCS3JmcEl7Blluo8ZieEPNOURqy9uD70=
+github.com/tink-crypto/tink-go-gcpkms/v2 v2.4.0/go.mod h1:wDDAhjfd1t4TjeJCSsmFK7CARPUs/ITi16ZZ8kmAaFQ=
github.com/tink-crypto/tink-go-hcvault/v2 v2.4.0 h1:j+S+WKBQ5ya26A5EM/uXoVe+a2IaPQN8KgBJZ22cJ+4=
github.com/tink-crypto/tink-go-hcvault/v2 v2.4.0/go.mod h1:OCKJIujnTzDq7f+73NhVs99oA2c1TR6nsOpuasYM6Yo=
github.com/tink-crypto/tink-go/v2 v2.7.0 h1:k7QnUXJ1cRDpvoy/5l1FimZqMAArRff8vjUqzi5N04o=
@@ -1385,8 +1390,8 @@ go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUS
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g=
go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk=
-go.step.sm/crypto v0.77.7 h1:6azC+pD678Vjju8yXnMDHCZJ+HzFaEmL3sCryiezTIA=
-go.step.sm/crypto v0.77.7/go.mod h1:OW/2sEHwTtDKq70PvSQ5B0JGy/CrLyDKOiVy3YvZMTQ=
+go.step.sm/crypto v0.87.0 h1:+u0pDz1OV9M/SswA6KtcQ3GSrYMMelbL//0W/ceJVYI=
+go.step.sm/crypto v0.87.0/go.mod h1:gBr1mpMiKs5804/Yt03uAoOBiw3DFxARZnGUKEUO82M=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
@@ -1400,10 +1405,11 @@ go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo=
go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q=
go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ=
go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
-go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
-gocloud.dev v0.45.0 h1:WknIK8IbRdmynDvara3Q7G6wQhmEiOGwpgJufbM39sY=
-gocloud.dev v0.45.0/go.mod h1:0kXKmkCLG6d31N7NyLZWzt7jDSQura9zD/mWgiB6THI=
+go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
+go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
+gocloud.dev v0.46.0 h1:niIuZwSjMtBx8K+ITB2s5kZullB13PGOS2ZoQPZxQ4Q=
+gocloud.dev v0.46.0/go.mod h1:ACQe+2qO+hEO+pdcvvsM+RB63r8TyGD1W3ESCLFyzvM=
gocloud.dev/docstore/mongodocstore v0.43.0 h1:Ay6NbJcqZOQYS3JULkv3QeaOhmEcVhU5OQEZCBJdCnM=
gocloud.dev/docstore/mongodocstore v0.43.0/go.mod h1:vNd1bxEOoEfhND8rViEXz+lB3zD56PAiiZThuKtSDW8=
gocloud.dev/pubsub/kafkapubsub v0.43.0 h1:Kgwi0na69W3RgxEffEkdrMhox6A3Q0gajoJtjHGVr/s=
@@ -1427,8 +1433,8 @@ golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58
golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
-golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
-golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
+golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M=
+golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -1698,8 +1704,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
-golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
-golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
+golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8=
+golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -1835,8 +1841,8 @@ google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6r
google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg=
google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw=
-google.golang.org/api v0.287.1 h1:LiyJx32VU3cwQfLchn/513qKhc25hq0pEANYJoWNnnI=
-google.golang.org/api v0.287.1/go.mod h1:lM2kYRzYUCBY91P9h6VF1PYmvhxii3O5hji37qRvIcY=
+google.golang.org/api v0.290.0 h1:eMw0Xo+IfbbMlKmW7aHvpyQRv9RCXuWx/vs8AD+0x9A=
+google.golang.org/api v0.290.0/go.mod h1:weJZ3lldHFYI0DBFNKpJelUDNnusTt5YaOEgxvt8ci8=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -1927,8 +1933,8 @@ google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljW
google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
-google.golang.org/genproto v0.0.0-20260406210006-6f92a3bedf2d h1:N1Ec54vZnIPd7MnxRiYLW+oY4fDR4BOS/LrssdD9+ek=
-google.golang.org/genproto v0.0.0-20260406210006-6f92a3bedf2d/go.mod h1:c2hJ1grtnH0xUiEKGDGkjGNTJ1Hy2LrblyKOHF0sqRM=
+google.golang.org/genproto v0.0.0-20260622175928-b703f567277d h1:CP5omUq8AJTiWMrPKM1WRLJ7zZeXd9OPcQD3TbBNAyY=
+google.golang.org/genproto v0.0.0-20260622175928-b703f567277d/go.mod h1:DrwuGJgFSEVNpv3S5Q5VxhRTvdnjauw9GtvwVOEARfA=
google.golang.org/genproto/googleapis/api v0.0.0-20260727163830-6c54dddc4772 h1:4namukbyF7JY83aWHQwi9J5ugNTnDReLJ9ZcpqOpRB4=
google.golang.org/genproto/googleapis/api v0.0.0-20260727163830-6c54dddc4772/go.mod h1:1brfde68Npq6+WA75c1EHWPijZEG1kMus61ygPZfn4A=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260720155508-bb71a54f79dc h1:3TtNq/QbJNrSY1nVdjcikfBw6ujnaNbdrd88wNr1OW4=
@@ -1983,8 +1989,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
-google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI=
-google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
+google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc=
+google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -2031,16 +2037,16 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.6.1 h1:R094WgE8K4JirYjBaOpz/AvTyUu/3wbmAoskKN/pxTI=
honnef.co/go/tools v0.6.1/go.mod h1:3puzxxljPCe8RGJX7BIy1plGbxEOZni5mR2aXe3/uk4=
-k8s.io/api v0.36.3 h1:NxB+05W2UGqXWFXcLO0RB5cnqnUPP5v5sVlaOH0Iz4w=
-k8s.io/api v0.36.3/go.mod h1:JzLQKqRHC5+I8RVj/lS3lCg0mg6nWI9Fo/Sk3ElxHzg=
+k8s.io/api v0.36.4 h1:RxrvqCL6vgH5/+UnTeu1IIFqYmGfy0hnyrod1rn35Oo=
+k8s.io/api v0.36.4/go.mod h1:S2B3orCFBDhrgyWbLeuKcT2QdHIpQesBkCYSlWtwUOw=
k8s.io/apiextensions-apiserver v0.35.6 h1:fyzp3i+PAbB/jSNau9LF0rMuUTUUyybR02BpYhT1YKI=
k8s.io/apiextensions-apiserver v0.35.6/go.mod h1:kkCbFS495cT53wOqNwWnQei759bkvgn6OqE0R8b3DEA=
-k8s.io/apimachinery v0.36.3 h1:PkzMRBRG8joFD8EhCuQAtNPvJlxb82FwplP26HIzvAM=
-k8s.io/apimachinery v0.36.3/go.mod h1:cTSjBWgPe/6CQyBKzY/hDIRWCQQQeK0mfLbml0UYFHE=
-k8s.io/client-go v0.36.3 h1:M4JdVzXxYcZk4fGpfDdYnxSwhLKWCFoQsHW6t+z8Hfg=
-k8s.io/client-go v0.36.3/go.mod h1:gcPwr0c87vjjG6HB6pWEqOeuYVoXSsREjzux2j6GF30=
-k8s.io/code-generator v0.36.3 h1:tsiHI6NepXQncnexlTAf52w5VxZ4HYDU4ZqCNLFb9tA=
-k8s.io/code-generator v0.36.3/go.mod h1:Unn13Mp8X+H803jgZi4f4ExxK11aj0llXcSsl++UTkE=
+k8s.io/apimachinery v0.36.4 h1:PT2UzkupGuAx/+xT5XjiMJ1WGpY3fn9/hdAvjweRet4=
+k8s.io/apimachinery v0.36.4/go.mod h1:p2I2dipt7JHG+quVwQ1d02d28O4GdDi77RByQ13MTpk=
+k8s.io/client-go v0.36.4 h1:MDvfDNvMSt0Br94SK8neviVlwL9qifw9B26hJCpD1K0=
+k8s.io/client-go v0.36.4/go.mod h1:pNK4WKELbwlEDvtbE8l22lEZL5THYF61H5EealokZmA=
+k8s.io/code-generator v0.36.4 h1:KNW2Alv5LVoGiooEYh1GY982CGyg53u1inHu6Zi4bIA=
+k8s.io/code-generator v0.36.4/go.mod h1:JmRrlYwTOn2glEuGOfNnlXTGbz3FfMg7t7Dq/8lHcc4=
k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b h1:gMplByicHV/TJBizHd9aVEsTYoJBnnUAT5MHlTkbjhQ=
k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b/go.mod h1:CgujABENc3KuTrcsdpGmrrASjtQsWCT7R99mEV4U/fM=
k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
@@ -2048,8 +2054,8 @@ k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc=
k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0=
k8s.io/kube-openapi v0.0.0-20260330154417-16be699c7b31 h1:V+sn9a/1fEYDGwnllCmqXBk8x7obZ+hl869Q3Abumkg=
k8s.io/kube-openapi v0.0.0-20260330154417-16be699c7b31/go.mod h1:uGBT7iTA6c6MvqUvSXIaYZo9ukscABYi2btjhvgKGZ0=
-k8s.io/streaming v0.36.3 h1:9rAaqBk0C0Pc7+/fqGekj07NV+/Xrew58p647A0JT8w=
-k8s.io/streaming v0.36.3/go.mod h1:z6fV3D+NVkoeqRMtWwlUZK6U17SY/LqNzOxWL6GyR/s=
+k8s.io/streaming v0.36.4 h1:RS5YlhrdBN2pKGVjgygGntdu6SNdsduyjGWGe3cX0vo=
+k8s.io/streaming v0.36.4/go.mod h1:tJ6S2bZa2HxIBauguBbCWSCYyd93Grfz1+z3tcOvlDE=
k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 h1:kBawHLSnx/mYHmRnNUf9d4CpjREbeZuxoSGOX/J+aYM=
k8s.io/utils v0.0.0-20260319190234-28399d86e0b5/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk=
knative.dev/pkg v0.0.0-20260622140654-39ebae2ee2dc h1:i2GrJuRdTFd4sNWocwefVGwuSOkOPjtadEWRTiGsEOY=
@@ -2071,5 +2077,5 @@ sigs.k8s.io/structured-merge-diff/v6 v6.3.3 h1:u08YRbVUi59ri4YD6cg0UqNM4Dimn0sIl
sigs.k8s.io/structured-merge-diff/v6 v6.3.3/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
-software.sslmate.com/src/go-pkcs12 v0.4.0 h1:H2g08FrTvSFKUj+D309j1DPfk5APnIdAQAB8aEykJ5k=
-software.sslmate.com/src/go-pkcs12 v0.4.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI=
+software.sslmate.com/src/go-pkcs12 v0.5.0 h1:EC6R394xgENTpZ4RltKydeDUjtlM5drOYIG9c6TVj2M=
+software.sslmate.com/src/go-pkcs12 v0.5.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI=
diff --git a/vendor/cloud.google.com/go/firestore/apiv1/.repo-metadata.json b/vendor/cloud.google.com/go/firestore/apiv1/.repo-metadata.json
index d57a0ae7a4..ab5f7ef723 100644
--- a/vendor/cloud.google.com/go/firestore/apiv1/.repo-metadata.json
+++ b/vendor/cloud.google.com/go/firestore/apiv1/.repo-metadata.json
@@ -1,10 +1,10 @@
{
- "api_shortname": "firestore",
- "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/firestore/latest/apiv1",
- "client_library_type": "generated",
- "description": "Cloud Firestore API",
- "distribution_name": "cloud.google.com/go/firestore/apiv1",
- "language": "go",
- "library_type": "GAPIC_AUTO",
- "release_level": "stable"
-}
+ "api_shortname": "firestore",
+ "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/firestore/latest/apiv1",
+ "client_library_type": "generated",
+ "description": "Cloud Firestore API",
+ "distribution_name": "cloud.google.com/go/firestore/apiv1",
+ "language": "go",
+ "library_type": "GAPIC_AUTO",
+ "release_level": "stable"
+}
\ No newline at end of file
diff --git a/vendor/cloud.google.com/go/firestore/apiv1/firestore_client.go b/vendor/cloud.google.com/go/firestore/apiv1/firestore_client.go
index ca765f83de..79fe7ad6cb 100644
--- a/vendor/cloud.google.com/go/firestore/apiv1/firestore_client.go
+++ b/vendor/cloud.google.com/go/firestore/apiv1/firestore_client.go
@@ -32,6 +32,7 @@ import (
firestorepb "cloud.google.com/go/firestore/apiv1/firestorepb"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
gax "github.com/googleapis/gax-go/v2"
+ "github.com/googleapis/gax-go/v2/callctx"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
@@ -150,7 +151,6 @@ func defaultCallOptions() *CallOptions {
BatchGetDocuments: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.ResourceExhausted,
codes.Unavailable,
codes.Internal,
codes.DeadlineExceeded,
@@ -207,7 +207,6 @@ func defaultCallOptions() *CallOptions {
RunQuery: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.ResourceExhausted,
codes.Unavailable,
codes.Internal,
codes.DeadlineExceeded,
@@ -221,7 +220,6 @@ func defaultCallOptions() *CallOptions {
ExecutePipeline: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.ResourceExhausted,
codes.Unavailable,
codes.Internal,
codes.DeadlineExceeded,
@@ -235,7 +233,6 @@ func defaultCallOptions() *CallOptions {
RunAggregationQuery: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.ResourceExhausted,
codes.Unavailable,
codes.Internal,
codes.DeadlineExceeded,
@@ -250,7 +247,6 @@ func defaultCallOptions() *CallOptions {
gax.WithTimeout(300000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
- codes.ResourceExhausted,
codes.Unavailable,
codes.Internal,
codes.DeadlineExceeded,
@@ -389,7 +385,6 @@ func defaultRESTCallOptions() *CallOptions {
Max: 60000 * time.Millisecond,
Multiplier: 1.30,
},
- http.StatusTooManyRequests,
http.StatusServiceUnavailable,
http.StatusInternalServerError,
http.StatusGatewayTimeout)
@@ -443,7 +438,6 @@ func defaultRESTCallOptions() *CallOptions {
Max: 60000 * time.Millisecond,
Multiplier: 1.30,
},
- http.StatusTooManyRequests,
http.StatusServiceUnavailable,
http.StatusInternalServerError,
http.StatusGatewayTimeout)
@@ -457,7 +451,6 @@ func defaultRESTCallOptions() *CallOptions {
Max: 60000 * time.Millisecond,
Multiplier: 1.30,
},
- http.StatusTooManyRequests,
http.StatusServiceUnavailable,
http.StatusInternalServerError,
http.StatusGatewayTimeout)
@@ -471,7 +464,6 @@ func defaultRESTCallOptions() *CallOptions {
Max: 60000 * time.Millisecond,
Multiplier: 1.30,
},
- http.StatusTooManyRequests,
http.StatusServiceUnavailable,
http.StatusInternalServerError,
http.StatusGatewayTimeout)
@@ -485,7 +477,6 @@ func defaultRESTCallOptions() *CallOptions {
Max: 60000 * time.Millisecond,
Multiplier: 1.30,
},
- http.StatusTooManyRequests,
http.StatusServiceUnavailable,
http.StatusInternalServerError,
http.StatusGatewayTimeout)
@@ -790,6 +781,16 @@ type gRPCClient struct {
// truly serverless apps.
func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
clientOpts := defaultGRPCClientOptions()
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{
+ "gcp.client.service": "firestore",
+ "gcp.client.version": getVersionClient(),
+ "gcp.client.repo": "googleapis/google-cloud-go",
+ "gcp.client.artifact": "cloud.google.com/go/firestore/apiv1",
+ "gcp.client.language": "go",
+ "url.domain": "firestore.googleapis.com",
+ }))
+ }
if newClientHook != nil {
hookOpts, err := newClientHook(ctx, clientHookParams{})
if err != nil {
@@ -812,6 +813,40 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error
operationsClient: longrunningpb.NewOperationsClient(connPool),
}
c.setGoogleClientInfo()
+ if gax.IsFeatureEnabled("METRICS") {
+ metrics := gax.NewClientMetrics(
+ gax.WithTelemetryLogger(c.logger),
+ gax.WithTelemetryAttributes(map[string]string{
+ gax.ClientService: "firestore",
+ gax.ClientVersion: getVersionClient(),
+ gax.ClientArtifact: "cloud.google.com/go/firestore/apiv1",
+ gax.RPCSystem: "grpc",
+ gax.URLDomain: "firestore.googleapis.com",
+ }),
+ )
+
+ client.CallOptions.GetDocument = append(client.CallOptions.GetDocument, gax.WithClientMetrics(metrics))
+ client.CallOptions.ListDocuments = append(client.CallOptions.ListDocuments, gax.WithClientMetrics(metrics))
+ client.CallOptions.UpdateDocument = append(client.CallOptions.UpdateDocument, gax.WithClientMetrics(metrics))
+ client.CallOptions.DeleteDocument = append(client.CallOptions.DeleteDocument, gax.WithClientMetrics(metrics))
+ client.CallOptions.BatchGetDocuments = append(client.CallOptions.BatchGetDocuments, gax.WithClientMetrics(metrics))
+ client.CallOptions.BeginTransaction = append(client.CallOptions.BeginTransaction, gax.WithClientMetrics(metrics))
+ client.CallOptions.Commit = append(client.CallOptions.Commit, gax.WithClientMetrics(metrics))
+ client.CallOptions.Rollback = append(client.CallOptions.Rollback, gax.WithClientMetrics(metrics))
+ client.CallOptions.RunQuery = append(client.CallOptions.RunQuery, gax.WithClientMetrics(metrics))
+ client.CallOptions.ExecutePipeline = append(client.CallOptions.ExecutePipeline, gax.WithClientMetrics(metrics))
+ client.CallOptions.RunAggregationQuery = append(client.CallOptions.RunAggregationQuery, gax.WithClientMetrics(metrics))
+ client.CallOptions.PartitionQuery = append(client.CallOptions.PartitionQuery, gax.WithClientMetrics(metrics))
+ client.CallOptions.Write = append(client.CallOptions.Write, gax.WithClientMetrics(metrics))
+ client.CallOptions.Listen = append(client.CallOptions.Listen, gax.WithClientMetrics(metrics))
+ client.CallOptions.ListCollectionIds = append(client.CallOptions.ListCollectionIds, gax.WithClientMetrics(metrics))
+ client.CallOptions.BatchWrite = append(client.CallOptions.BatchWrite, gax.WithClientMetrics(metrics))
+ client.CallOptions.CreateDocument = append(client.CallOptions.CreateDocument, gax.WithClientMetrics(metrics))
+ client.CallOptions.CancelOperation = append(client.CallOptions.CancelOperation, gax.WithClientMetrics(metrics))
+ client.CallOptions.DeleteOperation = append(client.CallOptions.DeleteOperation, gax.WithClientMetrics(metrics))
+ client.CallOptions.GetOperation = append(client.CallOptions.GetOperation, gax.WithClientMetrics(metrics))
+ client.CallOptions.ListOperations = append(client.CallOptions.ListOperations, gax.WithClientMetrics(metrics))
+ }
client.internalClient = c
@@ -872,6 +907,16 @@ type restClient struct {
// truly serverless apps.
func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
clientOpts := append(defaultRESTClientOptions(), opts...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{
+ "gcp.client.service": "firestore",
+ "gcp.client.version": getVersionClient(),
+ "gcp.client.repo": "googleapis/google-cloud-go",
+ "gcp.client.artifact": "cloud.google.com/go/firestore/apiv1",
+ "gcp.client.language": "go",
+ "url.domain": "firestore.googleapis.com",
+ }))
+ }
httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
if err != nil {
return nil, err
@@ -886,6 +931,41 @@ func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, e
}
c.setGoogleClientInfo()
+ if gax.IsFeatureEnabled("METRICS") {
+ metrics := gax.NewClientMetrics(
+ gax.WithTelemetryLogger(c.logger),
+ gax.WithTelemetryAttributes(map[string]string{
+ gax.ClientService: "firestore",
+ gax.ClientVersion: getVersionClient(),
+ gax.ClientArtifact: "cloud.google.com/go/firestore/apiv1",
+ gax.RPCSystem: "http",
+ gax.URLDomain: "firestore.googleapis.com",
+ }),
+ )
+
+ callOpts.GetDocument = append(callOpts.GetDocument, gax.WithClientMetrics(metrics))
+ callOpts.ListDocuments = append(callOpts.ListDocuments, gax.WithClientMetrics(metrics))
+ callOpts.UpdateDocument = append(callOpts.UpdateDocument, gax.WithClientMetrics(metrics))
+ callOpts.DeleteDocument = append(callOpts.DeleteDocument, gax.WithClientMetrics(metrics))
+ callOpts.BatchGetDocuments = append(callOpts.BatchGetDocuments, gax.WithClientMetrics(metrics))
+ callOpts.BeginTransaction = append(callOpts.BeginTransaction, gax.WithClientMetrics(metrics))
+ callOpts.Commit = append(callOpts.Commit, gax.WithClientMetrics(metrics))
+ callOpts.Rollback = append(callOpts.Rollback, gax.WithClientMetrics(metrics))
+ callOpts.RunQuery = append(callOpts.RunQuery, gax.WithClientMetrics(metrics))
+ callOpts.ExecutePipeline = append(callOpts.ExecutePipeline, gax.WithClientMetrics(metrics))
+ callOpts.RunAggregationQuery = append(callOpts.RunAggregationQuery, gax.WithClientMetrics(metrics))
+ callOpts.PartitionQuery = append(callOpts.PartitionQuery, gax.WithClientMetrics(metrics))
+ callOpts.Write = append(callOpts.Write, gax.WithClientMetrics(metrics))
+ callOpts.Listen = append(callOpts.Listen, gax.WithClientMetrics(metrics))
+ callOpts.ListCollectionIds = append(callOpts.ListCollectionIds, gax.WithClientMetrics(metrics))
+ callOpts.BatchWrite = append(callOpts.BatchWrite, gax.WithClientMetrics(metrics))
+ callOpts.CreateDocument = append(callOpts.CreateDocument, gax.WithClientMetrics(metrics))
+ callOpts.CancelOperation = append(callOpts.CancelOperation, gax.WithClientMetrics(metrics))
+ callOpts.DeleteOperation = append(callOpts.DeleteOperation, gax.WithClientMetrics(metrics))
+ callOpts.GetOperation = append(callOpts.GetOperation, gax.WithClientMetrics(metrics))
+ callOpts.ListOperations = append(callOpts.ListOperations, gax.WithClientMetrics(metrics))
+ }
+
return &Client{internalClient: c, CallOptions: callOpts}, nil
}
@@ -931,6 +1011,9 @@ func (c *gRPCClient) GetDocument(ctx context.Context, req *firestorepb.GetDocume
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/GetDocument")
+ }
opts = append((*c.CallOptions).GetDocument[0:len((*c.CallOptions).GetDocument):len((*c.CallOptions).GetDocument)], opts...)
var resp *firestorepb.Document
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -949,6 +1032,9 @@ func (c *gRPCClient) ListDocuments(ctx context.Context, req *firestorepb.ListDoc
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/ListDocuments")
+ }
opts = append((*c.CallOptions).ListDocuments[0:len((*c.CallOptions).ListDocuments):len((*c.CallOptions).ListDocuments)], opts...)
it := &DocumentIterator{}
req = proto.Clone(req).(*firestorepb.ListDocumentsRequest)
@@ -995,6 +1081,9 @@ func (c *gRPCClient) UpdateDocument(ctx context.Context, req *firestorepb.Update
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/UpdateDocument")
+ }
opts = append((*c.CallOptions).UpdateDocument[0:len((*c.CallOptions).UpdateDocument):len((*c.CallOptions).UpdateDocument)], opts...)
var resp *firestorepb.Document
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -1013,6 +1102,9 @@ func (c *gRPCClient) DeleteDocument(ctx context.Context, req *firestorepb.Delete
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/DeleteDocument")
+ }
opts = append((*c.CallOptions).DeleteDocument[0:len((*c.CallOptions).DeleteDocument):len((*c.CallOptions).DeleteDocument)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -1027,6 +1119,9 @@ func (c *gRPCClient) BatchGetDocuments(ctx context.Context, req *firestorepb.Bat
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/BatchGetDocuments")
+ }
opts = append((*c.CallOptions).BatchGetDocuments[0:len((*c.CallOptions).BatchGetDocuments):len((*c.CallOptions).BatchGetDocuments)], opts...)
var resp firestorepb.Firestore_BatchGetDocumentsClient
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -1047,6 +1142,9 @@ func (c *gRPCClient) BeginTransaction(ctx context.Context, req *firestorepb.Begi
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/BeginTransaction")
+ }
opts = append((*c.CallOptions).BeginTransaction[0:len((*c.CallOptions).BeginTransaction):len((*c.CallOptions).BeginTransaction)], opts...)
var resp *firestorepb.BeginTransactionResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -1065,6 +1163,9 @@ func (c *gRPCClient) Commit(ctx context.Context, req *firestorepb.CommitRequest,
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/Commit")
+ }
opts = append((*c.CallOptions).Commit[0:len((*c.CallOptions).Commit):len((*c.CallOptions).Commit)], opts...)
var resp *firestorepb.CommitResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -1083,6 +1184,9 @@ func (c *gRPCClient) Rollback(ctx context.Context, req *firestorepb.RollbackRequ
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/Rollback")
+ }
opts = append((*c.CallOptions).Rollback[0:len((*c.CallOptions).Rollback):len((*c.CallOptions).Rollback)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -1097,6 +1201,9 @@ func (c *gRPCClient) RunQuery(ctx context.Context, req *firestorepb.RunQueryRequ
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/RunQuery")
+ }
opts = append((*c.CallOptions).RunQuery[0:len((*c.CallOptions).RunQuery):len((*c.CallOptions).RunQuery)], opts...)
var resp firestorepb.Firestore_RunQueryClient
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -1134,6 +1241,9 @@ func (c *gRPCClient) ExecutePipeline(ctx context.Context, req *firestorepb.Execu
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/ExecutePipeline")
+ }
opts = append((*c.CallOptions).ExecutePipeline[0:len((*c.CallOptions).ExecutePipeline):len((*c.CallOptions).ExecutePipeline)], opts...)
var resp firestorepb.Firestore_ExecutePipelineClient
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -1154,6 +1264,9 @@ func (c *gRPCClient) RunAggregationQuery(ctx context.Context, req *firestorepb.R
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/RunAggregationQuery")
+ }
opts = append((*c.CallOptions).RunAggregationQuery[0:len((*c.CallOptions).RunAggregationQuery):len((*c.CallOptions).RunAggregationQuery)], opts...)
var resp firestorepb.Firestore_RunAggregationQueryClient
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -1174,6 +1287,9 @@ func (c *gRPCClient) PartitionQuery(ctx context.Context, req *firestorepb.Partit
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/PartitionQuery")
+ }
opts = append((*c.CallOptions).PartitionQuery[0:len((*c.CallOptions).PartitionQuery):len((*c.CallOptions).PartitionQuery)], opts...)
it := &CursorIterator{}
req = proto.Clone(req).(*firestorepb.PartitionQueryRequest)
@@ -1217,6 +1333,9 @@ func (c *gRPCClient) PartitionQuery(ctx context.Context, req *firestorepb.Partit
func (c *gRPCClient) Write(ctx context.Context, opts ...gax.CallOption) (firestorepb.Firestore_WriteClient, error) {
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/Write")
+ }
var resp firestorepb.Firestore_WriteClient
opts = append((*c.CallOptions).Write[0:len((*c.CallOptions).Write):len((*c.CallOptions).Write)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -1234,6 +1353,9 @@ func (c *gRPCClient) Write(ctx context.Context, opts ...gax.CallOption) (firesto
func (c *gRPCClient) Listen(ctx context.Context, opts ...gax.CallOption) (firestorepb.Firestore_ListenClient, error) {
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/Listen")
+ }
var resp firestorepb.Firestore_ListenClient
opts = append((*c.CallOptions).Listen[0:len((*c.CallOptions).Listen):len((*c.CallOptions).Listen)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -1254,6 +1376,9 @@ func (c *gRPCClient) ListCollectionIds(ctx context.Context, req *firestorepb.Lis
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/ListCollectionIds")
+ }
opts = append((*c.CallOptions).ListCollectionIds[0:len((*c.CallOptions).ListCollectionIds):len((*c.CallOptions).ListCollectionIds)], opts...)
it := &StringIterator{}
req = proto.Clone(req).(*firestorepb.ListCollectionIdsRequest)
@@ -1300,6 +1425,9 @@ func (c *gRPCClient) BatchWrite(ctx context.Context, req *firestorepb.BatchWrite
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/BatchWrite")
+ }
opts = append((*c.CallOptions).BatchWrite[0:len((*c.CallOptions).BatchWrite):len((*c.CallOptions).BatchWrite)], opts...)
var resp *firestorepb.BatchWriteResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -1318,6 +1446,9 @@ func (c *gRPCClient) CreateDocument(ctx context.Context, req *firestorepb.Create
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/CreateDocument")
+ }
opts = append((*c.CallOptions).CreateDocument[0:len((*c.CallOptions).CreateDocument):len((*c.CallOptions).CreateDocument)], opts...)
var resp *firestorepb.Document
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -1336,6 +1467,9 @@ func (c *gRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.Can
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/CancelOperation")
+ }
opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -1350,6 +1484,9 @@ func (c *gRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.Del
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/DeleteOperation")
+ }
opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -1364,6 +1501,9 @@ func (c *gRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOpe
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/GetOperation")
+ }
opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -1382,6 +1522,9 @@ func (c *gRPCClient) ListOperations(ctx context.Context, req *longrunningpb.List
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/ListOperations")
+ }
opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...)
it := &OperationIterator{}
req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
@@ -1457,6 +1600,10 @@ func (c *restClient) GetDocument(ctx context.Context, req *firestorepb.GetDocume
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/GetDocument")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=projects/*/databases/*/documents/*/**}")
+ }
opts = append((*c.CallOptions).GetDocument[0:len((*c.CallOptions).GetDocument):len((*c.CallOptions).GetDocument)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &firestorepb.Document{}
@@ -1633,6 +1780,10 @@ func (c *restClient) UpdateDocument(ctx context.Context, req *firestorepb.Update
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/UpdateDocument")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{document.name=projects/*/databases/*/documents/*/**}")
+ }
opts = append((*c.CallOptions).UpdateDocument[0:len((*c.CallOptions).UpdateDocument):len((*c.CallOptions).UpdateDocument)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &firestorepb.Document{}
@@ -1693,6 +1844,10 @@ func (c *restClient) DeleteDocument(ctx context.Context, req *firestorepb.Delete
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/DeleteDocument")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=projects/*/databases/*/documents/*/**}")
+ }
return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
@@ -1737,6 +1892,10 @@ func (c *restClient) BatchGetDocuments(ctx context.Context, req *firestorepb.Bat
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/BatchGetDocuments")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{database=projects/*/databases/*}/documents:batchGet")
+ }
var streamClient *batchGetDocumentsRESTStreamClient
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
@@ -1839,6 +1998,10 @@ func (c *restClient) BeginTransaction(ctx context.Context, req *firestorepb.Begi
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/BeginTransaction")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{database=projects/*/databases/*}/documents:beginTransaction")
+ }
opts = append((*c.CallOptions).BeginTransaction[0:len((*c.CallOptions).BeginTransaction):len((*c.CallOptions).BeginTransaction)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &firestorepb.BeginTransactionResponse{}
@@ -1895,6 +2058,10 @@ func (c *restClient) Commit(ctx context.Context, req *firestorepb.CommitRequest,
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/Commit")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{database=projects/*/databases/*}/documents:commit")
+ }
opts = append((*c.CallOptions).Commit[0:len((*c.CallOptions).Commit):len((*c.CallOptions).Commit)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &firestorepb.CommitResponse{}
@@ -1951,6 +2118,10 @@ func (c *restClient) Rollback(ctx context.Context, req *firestorepb.RollbackRequ
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/Rollback")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{database=projects/*/databases/*}/documents:rollback")
+ }
return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
@@ -1992,6 +2163,10 @@ func (c *restClient) RunQuery(ctx context.Context, req *firestorepb.RunQueryRequ
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/RunQuery")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{parent=projects/*/databases/*/documents}:runQuery")
+ }
var streamClient *runQueryRESTStreamClient
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
@@ -2111,6 +2286,10 @@ func (c *restClient) ExecutePipeline(ctx context.Context, req *firestorepb.Execu
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/ExecutePipeline")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{database=projects/*/databases/*}/documents:executePipeline")
+ }
var streamClient *executePipelineRESTStreamClient
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
@@ -2220,6 +2399,10 @@ func (c *restClient) RunAggregationQuery(ctx context.Context, req *firestorepb.R
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/RunAggregationQuery")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{parent=projects/*/databases/*/documents}:runAggregationQuery")
+ }
var streamClient *runAggregationQueryRESTStreamClient
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
@@ -2505,6 +2688,10 @@ func (c *restClient) BatchWrite(ctx context.Context, req *firestorepb.BatchWrite
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/BatchWrite")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{database=projects/*/databases/*}/documents:batchWrite")
+ }
opts = append((*c.CallOptions).BatchWrite[0:len((*c.CallOptions).BatchWrite):len((*c.CallOptions).BatchWrite)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &firestorepb.BatchWriteResponse{}
@@ -2570,6 +2757,10 @@ func (c *restClient) CreateDocument(ctx context.Context, req *firestorepb.Create
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.firestore.v1.Firestore/CreateDocument")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{parent=projects/*/databases/*/documents/**}/{collection_id}")
+ }
opts = append((*c.CallOptions).CreateDocument[0:len((*c.CallOptions).CreateDocument):len((*c.CallOptions).CreateDocument)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &firestorepb.Document{}
@@ -2626,6 +2817,10 @@ func (c *restClient) CancelOperation(ctx context.Context, req *longrunningpb.Can
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/CancelOperation")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=projects/*/databases/*/operations/*}:cancel")
+ }
return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
@@ -2661,6 +2856,10 @@ func (c *restClient) DeleteOperation(ctx context.Context, req *longrunningpb.Del
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/DeleteOperation")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=projects/*/databases/*/operations/*}")
+ }
return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
@@ -2696,6 +2895,10 @@ func (c *restClient) GetOperation(ctx context.Context, req *longrunningpb.GetOpe
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/GetOperation")
+ ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=projects/*/databases/*/operations/*}")
+ }
opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &longrunningpb.Operation{}
diff --git a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/aggregation_result.pb.go b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/aggregation_result.pb.go
index 1d2b7680af..98417cdeb9 100644
--- a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/aggregation_result.pb.go
+++ b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/aggregation_result.pb.go
@@ -1,4 +1,4 @@
-// Copyright 2025 Google LLC
+// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.35.2
-// protoc v4.25.7
+// protoc-gen-go v1.36.11
+// protoc v6.31.0
// source: google/firestore/v1/aggregation_result.proto
package firestorepb
@@ -23,6 +23,7 @@ package firestorepb
import (
reflect "reflect"
sync "sync"
+ unsafe "unsafe"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
@@ -41,17 +42,16 @@ const (
// query, unlike document queries which can have different fields present for
// each result.
type AggregationResult struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The result of the aggregation functions, ex: `COUNT(*) AS total_docs`.
//
// The key is the
// [alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias]
// assigned to the aggregation function on input and the size of this map
// equals the number of aggregation functions in the query.
- AggregateFields map[string]*Value `protobuf:"bytes,2,rep,name=aggregate_fields,json=aggregateFields,proto3" json:"aggregate_fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ AggregateFields map[string]*Value `protobuf:"bytes,2,rep,name=aggregate_fields,json=aggregateFields,proto3" json:"aggregate_fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *AggregationResult) Reset() {
@@ -93,51 +93,24 @@ func (x *AggregationResult) GetAggregateFields() map[string]*Value {
var File_google_firestore_v1_aggregation_result_proto protoreflect.FileDescriptor
-var file_google_firestore_v1_aggregation_result_proto_rawDesc = []byte{
- 0x0a, 0x2c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f,
- 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x76, 0x31, 0x1a, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
- 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdb, 0x01, 0x0a, 0x11, 0x41, 0x67, 0x67, 0x72,
- 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x66, 0x0a,
- 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64,
- 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67,
- 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e,
- 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45,
- 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46,
- 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x5e, 0x0a, 0x14, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61,
- 0x74, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
- 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
- 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
- 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0xce, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76,
- 0x31, 0x42, 0x16, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
- 0x73, 0x75, 0x6c, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x63, 0x6c, 0x6f,
- 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f,
- 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31,
- 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x3b, 0x66, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0xa2, 0x02, 0x04, 0x47, 0x43, 0x46, 0x53, 0xaa,
- 0x02, 0x19, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x46,
- 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x47, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x46, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xea, 0x02, 0x1c, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
+const file_google_firestore_v1_aggregation_result_proto_rawDesc = "" +
+ "\n" +
+ ",google/firestore/v1/aggregation_result.proto\x12\x13google.firestore.v1\x1a\"google/firestore/v1/document.proto\"\xdb\x01\n" +
+ "\x11AggregationResult\x12f\n" +
+ "\x10aggregate_fields\x18\x02 \x03(\v2;.google.firestore.v1.AggregationResult.AggregateFieldsEntryR\x0faggregateFields\x1a^\n" +
+ "\x14AggregateFieldsEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\tR\x03key\x120\n" +
+ "\x05value\x18\x02 \x01(\v2\x1a.google.firestore.v1.ValueR\x05value:\x028\x01B\xce\x01\n" +
+ "\x17com.google.firestore.v1B\x16AggregationResultProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3"
var (
file_google_firestore_v1_aggregation_result_proto_rawDescOnce sync.Once
- file_google_firestore_v1_aggregation_result_proto_rawDescData = file_google_firestore_v1_aggregation_result_proto_rawDesc
+ file_google_firestore_v1_aggregation_result_proto_rawDescData []byte
)
func file_google_firestore_v1_aggregation_result_proto_rawDescGZIP() []byte {
file_google_firestore_v1_aggregation_result_proto_rawDescOnce.Do(func() {
- file_google_firestore_v1_aggregation_result_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_firestore_v1_aggregation_result_proto_rawDescData)
+ file_google_firestore_v1_aggregation_result_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_firestore_v1_aggregation_result_proto_rawDesc), len(file_google_firestore_v1_aggregation_result_proto_rawDesc)))
})
return file_google_firestore_v1_aggregation_result_proto_rawDescData
}
@@ -168,7 +141,7 @@ func file_google_firestore_v1_aggregation_result_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_google_firestore_v1_aggregation_result_proto_rawDesc,
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_firestore_v1_aggregation_result_proto_rawDesc), len(file_google_firestore_v1_aggregation_result_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
@@ -179,7 +152,6 @@ func file_google_firestore_v1_aggregation_result_proto_init() {
MessageInfos: file_google_firestore_v1_aggregation_result_proto_msgTypes,
}.Build()
File_google_firestore_v1_aggregation_result_proto = out.File
- file_google_firestore_v1_aggregation_result_proto_rawDesc = nil
file_google_firestore_v1_aggregation_result_proto_goTypes = nil
file_google_firestore_v1_aggregation_result_proto_depIdxs = nil
}
diff --git a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/bloom_filter.pb.go b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/bloom_filter.pb.go
index 49aad81bdb..3e1582a1f4 100644
--- a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/bloom_filter.pb.go
+++ b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/bloom_filter.pb.go
@@ -1,4 +1,4 @@
-// Copyright 2025 Google LLC
+// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.35.2
-// protoc v4.25.7
+// protoc-gen-go v1.36.11
+// protoc v6.31.0
// source: google/firestore/v1/bloom_filter.proto
package firestorepb
@@ -23,6 +23,7 @@ package firestorepb
import (
reflect "reflect"
sync "sync"
+ unsafe "unsafe"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
@@ -51,17 +52,16 @@ const (
// The "size" of a `BitSequence` (the number of bits it contains) is calculated
// by this formula: `(bitmap.length * 8) - padding`.
type BitSequence struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The bytes that encode the bit sequence.
// May have a length of zero.
Bitmap []byte `protobuf:"bytes,1,opt,name=bitmap,proto3" json:"bitmap,omitempty"`
// The number of bits of the last byte in `bitmap` to ignore as "padding".
// If the length of `bitmap` is zero, then this value must be `0`.
// Otherwise, this value must be between 0 and 7, inclusive.
- Padding int32 `protobuf:"varint,2,opt,name=padding,proto3" json:"padding,omitempty"`
+ Padding int32 `protobuf:"varint,2,opt,name=padding,proto3" json:"padding,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *BitSequence) Reset() {
@@ -122,14 +122,13 @@ func (x *BitSequence) GetPadding() int32 {
// These resulting values are then taken modulo the number of bits in the bloom
// filter to get the bits of the bloom filter to test for the given entry.
type BloomFilter struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The bloom filter data.
Bits *BitSequence `protobuf:"bytes,1,opt,name=bits,proto3" json:"bits,omitempty"`
// The number of hashes used by the algorithm.
- HashCount int32 `protobuf:"varint,2,opt,name=hash_count,json=hashCount,proto3" json:"hash_count,omitempty"`
+ HashCount int32 `protobuf:"varint,2,opt,name=hash_count,json=hashCount,proto3" json:"hash_count,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *BloomFilter) Reset() {
@@ -178,45 +177,26 @@ func (x *BloomFilter) GetHashCount() int32 {
var File_google_firestore_v1_bloom_filter_proto protoreflect.FileDescriptor
-var file_google_firestore_v1_bloom_filter_proto_rawDesc = []byte{
- 0x0a, 0x26, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x5f, 0x66, 0x69, 0x6c, 0x74,
- 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x3f, 0x0a,
- 0x0b, 0x42, 0x69, 0x74, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06,
- 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x62, 0x69,
- 0x74, 0x6d, 0x61, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x62,
- 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x34, 0x0a,
- 0x04, 0x62, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x42, 0x69, 0x74, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x04, 0x62,
- 0x69, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x63, 0x6f, 0x75, 0x6e,
- 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x68, 0x61, 0x73, 0x68, 0x43, 0x6f, 0x75,
- 0x6e, 0x74, 0x42, 0xc8, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x10,
- 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f,
- 0x50, 0x01, 0x5a, 0x3b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x70, 0x62, 0x3b, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0xa2,
- 0x02, 0x04, 0x47, 0x43, 0x46, 0x53, 0xaa, 0x02, 0x19, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
- 0x56, 0x31, 0xca, 0x02, 0x19, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75,
- 0x64, 0x5c, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xea, 0x02,
- 0x1c, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a,
- 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
+const file_google_firestore_v1_bloom_filter_proto_rawDesc = "" +
+ "\n" +
+ "&google/firestore/v1/bloom_filter.proto\x12\x13google.firestore.v1\"?\n" +
+ "\vBitSequence\x12\x16\n" +
+ "\x06bitmap\x18\x01 \x01(\fR\x06bitmap\x12\x18\n" +
+ "\apadding\x18\x02 \x01(\x05R\apadding\"b\n" +
+ "\vBloomFilter\x124\n" +
+ "\x04bits\x18\x01 \x01(\v2 .google.firestore.v1.BitSequenceR\x04bits\x12\x1d\n" +
+ "\n" +
+ "hash_count\x18\x02 \x01(\x05R\thashCountB\xc8\x01\n" +
+ "\x17com.google.firestore.v1B\x10BloomFilterProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3"
var (
file_google_firestore_v1_bloom_filter_proto_rawDescOnce sync.Once
- file_google_firestore_v1_bloom_filter_proto_rawDescData = file_google_firestore_v1_bloom_filter_proto_rawDesc
+ file_google_firestore_v1_bloom_filter_proto_rawDescData []byte
)
func file_google_firestore_v1_bloom_filter_proto_rawDescGZIP() []byte {
file_google_firestore_v1_bloom_filter_proto_rawDescOnce.Do(func() {
- file_google_firestore_v1_bloom_filter_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_firestore_v1_bloom_filter_proto_rawDescData)
+ file_google_firestore_v1_bloom_filter_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_firestore_v1_bloom_filter_proto_rawDesc), len(file_google_firestore_v1_bloom_filter_proto_rawDesc)))
})
return file_google_firestore_v1_bloom_filter_proto_rawDescData
}
@@ -244,7 +224,7 @@ func file_google_firestore_v1_bloom_filter_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_google_firestore_v1_bloom_filter_proto_rawDesc,
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_firestore_v1_bloom_filter_proto_rawDesc), len(file_google_firestore_v1_bloom_filter_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
@@ -255,7 +235,6 @@ func file_google_firestore_v1_bloom_filter_proto_init() {
MessageInfos: file_google_firestore_v1_bloom_filter_proto_msgTypes,
}.Build()
File_google_firestore_v1_bloom_filter_proto = out.File
- file_google_firestore_v1_bloom_filter_proto_rawDesc = nil
file_google_firestore_v1_bloom_filter_proto_goTypes = nil
file_google_firestore_v1_bloom_filter_proto_depIdxs = nil
}
diff --git a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/common.pb.go b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/common.pb.go
index d749190905..3f41fed30b 100644
--- a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/common.pb.go
+++ b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/common.pb.go
@@ -1,4 +1,4 @@
-// Copyright 2025 Google LLC
+// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.35.2
-// protoc v4.25.7
+// protoc-gen-go v1.36.11
+// protoc v6.31.0
// source: google/firestore/v1/common.proto
package firestorepb
@@ -23,6 +23,7 @@ package firestorepb
import (
reflect "reflect"
sync "sync"
+ unsafe "unsafe"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
@@ -43,14 +44,13 @@ const (
// [Document][google.firestore.v1.Document], and takes in account the dynamic
// nature of [Value][google.firestore.v1.Value].
type DocumentMask struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The list of field paths in the mask. See
// [Document.fields][google.firestore.v1.Document.fields] for a field path
// syntax reference.
- FieldPaths []string `protobuf:"bytes,1,rep,name=field_paths,json=fieldPaths,proto3" json:"field_paths,omitempty"`
+ FieldPaths []string `protobuf:"bytes,1,rep,name=field_paths,json=fieldPaths,proto3" json:"field_paths,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *DocumentMask) Reset() {
@@ -92,17 +92,16 @@ func (x *DocumentMask) GetFieldPaths() []string {
// A precondition on a document, used for conditional operations.
type Precondition struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The type of precondition.
//
- // Types that are assignable to ConditionType:
+ // Types that are valid to be assigned to ConditionType:
//
// *Precondition_Exists
// *Precondition_UpdateTime
ConditionType isPrecondition_ConditionType `protobuf_oneof:"condition_type"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Precondition) Reset() {
@@ -135,23 +134,27 @@ func (*Precondition) Descriptor() ([]byte, []int) {
return file_google_firestore_v1_common_proto_rawDescGZIP(), []int{1}
}
-func (m *Precondition) GetConditionType() isPrecondition_ConditionType {
- if m != nil {
- return m.ConditionType
+func (x *Precondition) GetConditionType() isPrecondition_ConditionType {
+ if x != nil {
+ return x.ConditionType
}
return nil
}
func (x *Precondition) GetExists() bool {
- if x, ok := x.GetConditionType().(*Precondition_Exists); ok {
- return x.Exists
+ if x != nil {
+ if x, ok := x.ConditionType.(*Precondition_Exists); ok {
+ return x.Exists
+ }
}
return false
}
func (x *Precondition) GetUpdateTime() *timestamppb.Timestamp {
- if x, ok := x.GetConditionType().(*Precondition_UpdateTime); ok {
- return x.UpdateTime
+ if x != nil {
+ if x, ok := x.ConditionType.(*Precondition_UpdateTime); ok {
+ return x.UpdateTime
+ }
}
return nil
}
@@ -178,17 +181,16 @@ func (*Precondition_UpdateTime) isPrecondition_ConditionType() {}
// Options for creating a new transaction.
type TransactionOptions struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The mode of the transaction.
//
- // Types that are assignable to Mode:
+ // Types that are valid to be assigned to Mode:
//
// *TransactionOptions_ReadOnly_
// *TransactionOptions_ReadWrite_
- Mode isTransactionOptions_Mode `protobuf_oneof:"mode"`
+ Mode isTransactionOptions_Mode `protobuf_oneof:"mode"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *TransactionOptions) Reset() {
@@ -221,23 +223,27 @@ func (*TransactionOptions) Descriptor() ([]byte, []int) {
return file_google_firestore_v1_common_proto_rawDescGZIP(), []int{2}
}
-func (m *TransactionOptions) GetMode() isTransactionOptions_Mode {
- if m != nil {
- return m.Mode
+func (x *TransactionOptions) GetMode() isTransactionOptions_Mode {
+ if x != nil {
+ return x.Mode
}
return nil
}
func (x *TransactionOptions) GetReadOnly() *TransactionOptions_ReadOnly {
- if x, ok := x.GetMode().(*TransactionOptions_ReadOnly_); ok {
- return x.ReadOnly
+ if x != nil {
+ if x, ok := x.Mode.(*TransactionOptions_ReadOnly_); ok {
+ return x.ReadOnly
+ }
}
return nil
}
func (x *TransactionOptions) GetReadWrite() *TransactionOptions_ReadWrite {
- if x, ok := x.GetMode().(*TransactionOptions_ReadWrite_); ok {
- return x.ReadWrite
+ if x != nil {
+ if x, ok := x.Mode.(*TransactionOptions_ReadWrite_); ok {
+ return x.ReadWrite
+ }
}
return nil
}
@@ -265,12 +271,11 @@ func (*TransactionOptions_ReadWrite_) isTransactionOptions_Mode() {}
// Firestore does not allow 3rd party auth requests to create read-write.
// transactions.
type TransactionOptions_ReadWrite struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// An optional transaction to retry.
RetryTransaction []byte `protobuf:"bytes,1,opt,name=retry_transaction,json=retryTransaction,proto3" json:"retry_transaction,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *TransactionOptions_ReadWrite) Reset() {
@@ -312,17 +317,16 @@ func (x *TransactionOptions_ReadWrite) GetRetryTransaction() []byte {
// Options for a transaction that can only be used to read documents.
type TransactionOptions_ReadOnly struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The consistency mode for this transaction. If not set, defaults to strong
// consistency.
//
- // Types that are assignable to ConsistencySelector:
+ // Types that are valid to be assigned to ConsistencySelector:
//
// *TransactionOptions_ReadOnly_ReadTime
ConsistencySelector isTransactionOptions_ReadOnly_ConsistencySelector `protobuf_oneof:"consistency_selector"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *TransactionOptions_ReadOnly) Reset() {
@@ -355,16 +359,18 @@ func (*TransactionOptions_ReadOnly) Descriptor() ([]byte, []int) {
return file_google_firestore_v1_common_proto_rawDescGZIP(), []int{2, 1}
}
-func (m *TransactionOptions_ReadOnly) GetConsistencySelector() isTransactionOptions_ReadOnly_ConsistencySelector {
- if m != nil {
- return m.ConsistencySelector
+func (x *TransactionOptions_ReadOnly) GetConsistencySelector() isTransactionOptions_ReadOnly_ConsistencySelector {
+ if x != nil {
+ return x.ConsistencySelector
}
return nil
}
func (x *TransactionOptions_ReadOnly) GetReadTime() *timestamppb.Timestamp {
- if x, ok := x.GetConsistencySelector().(*TransactionOptions_ReadOnly_ReadTime); ok {
- return x.ReadTime
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*TransactionOptions_ReadOnly_ReadTime); ok {
+ return x.ReadTime
+ }
}
return nil
}
@@ -386,68 +392,37 @@ func (*TransactionOptions_ReadOnly_ReadTime) isTransactionOptions_ReadOnly_Consi
var File_google_firestore_v1_common_proto protoreflect.FileDescriptor
-var file_google_firestore_v1_common_proto_rawDesc = []byte{
- 0x0a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x12, 0x13, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
- 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2f, 0x0a, 0x0c, 0x44, 0x6f, 0x63, 0x75,
- 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x65, 0x6c,
- 0x64, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x66,
- 0x69, 0x65, 0x6c, 0x64, 0x50, 0x61, 0x74, 0x68, 0x73, 0x22, 0x79, 0x0a, 0x0c, 0x50, 0x72, 0x65,
- 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x06, 0x65, 0x78, 0x69,
- 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x06, 0x65, 0x78, 0x69,
- 0x73, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69,
- 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73,
- 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69,
- 0x6d, 0x65, 0x42, 0x10, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
- 0x74, 0x79, 0x70, 0x65, 0x22, 0xda, 0x02, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4f, 0x0a, 0x09, 0x72,
- 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30,
- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79,
- 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x52, 0x0a, 0x0a,
- 0x72, 0x65, 0x61, 0x64, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72,
- 0x69, 0x74, 0x65, 0x48, 0x00, 0x52, 0x09, 0x72, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65,
- 0x1a, 0x38, 0x0a, 0x09, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x2b, 0x0a,
- 0x11, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x72, 0x65, 0x74, 0x72, 0x79, 0x54,
- 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x5d, 0x0a, 0x08, 0x52, 0x65,
- 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74,
- 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65,
- 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d,
- 0x65, 0x42, 0x16, 0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79,
- 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x42, 0x06, 0x0a, 0x04, 0x6d, 0x6f, 0x64,
- 0x65, 0x42, 0xc3, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43,
- 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x63, 0x6c,
- 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67,
- 0x6f, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76,
- 0x31, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x3b, 0x66, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0xa2, 0x02, 0x04, 0x47, 0x43, 0x46, 0x53,
- 0xaa, 0x02, 0x19, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e,
- 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x47,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x46, 0x69, 0x72, 0x65,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xea, 0x02, 0x1c, 0x47, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
+const file_google_firestore_v1_common_proto_rawDesc = "" +
+ "\n" +
+ " google/firestore/v1/common.proto\x12\x13google.firestore.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"/\n" +
+ "\fDocumentMask\x12\x1f\n" +
+ "\vfield_paths\x18\x01 \x03(\tR\n" +
+ "fieldPaths\"y\n" +
+ "\fPrecondition\x12\x18\n" +
+ "\x06exists\x18\x01 \x01(\bH\x00R\x06exists\x12=\n" +
+ "\vupdate_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampH\x00R\n" +
+ "updateTimeB\x10\n" +
+ "\x0econdition_type\"\xda\x02\n" +
+ "\x12TransactionOptions\x12O\n" +
+ "\tread_only\x18\x02 \x01(\v20.google.firestore.v1.TransactionOptions.ReadOnlyH\x00R\breadOnly\x12R\n" +
+ "\n" +
+ "read_write\x18\x03 \x01(\v21.google.firestore.v1.TransactionOptions.ReadWriteH\x00R\treadWrite\x1a8\n" +
+ "\tReadWrite\x12+\n" +
+ "\x11retry_transaction\x18\x01 \x01(\fR\x10retryTransaction\x1a]\n" +
+ "\bReadOnly\x129\n" +
+ "\tread_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampH\x00R\breadTimeB\x16\n" +
+ "\x14consistency_selectorB\x06\n" +
+ "\x04modeB\xc3\x01\n" +
+ "\x17com.google.firestore.v1B\vCommonProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3"
var (
file_google_firestore_v1_common_proto_rawDescOnce sync.Once
- file_google_firestore_v1_common_proto_rawDescData = file_google_firestore_v1_common_proto_rawDesc
+ file_google_firestore_v1_common_proto_rawDescData []byte
)
func file_google_firestore_v1_common_proto_rawDescGZIP() []byte {
file_google_firestore_v1_common_proto_rawDescOnce.Do(func() {
- file_google_firestore_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_firestore_v1_common_proto_rawDescData)
+ file_google_firestore_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_firestore_v1_common_proto_rawDesc), len(file_google_firestore_v1_common_proto_rawDesc)))
})
return file_google_firestore_v1_common_proto_rawDescData
}
@@ -493,7 +468,7 @@ func file_google_firestore_v1_common_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_google_firestore_v1_common_proto_rawDesc,
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_firestore_v1_common_proto_rawDesc), len(file_google_firestore_v1_common_proto_rawDesc)),
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
@@ -504,7 +479,6 @@ func file_google_firestore_v1_common_proto_init() {
MessageInfos: file_google_firestore_v1_common_proto_msgTypes,
}.Build()
File_google_firestore_v1_common_proto = out.File
- file_google_firestore_v1_common_proto_rawDesc = nil
file_google_firestore_v1_common_proto_goTypes = nil
file_google_firestore_v1_common_proto_depIdxs = nil
}
diff --git a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/document.pb.go b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/document.pb.go
index 77df79bd8f..4c4583ebd9 100644
--- a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/document.pb.go
+++ b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/document.pb.go
@@ -1,4 +1,4 @@
-// Copyright 2025 Google LLC
+// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.35.2
-// protoc v4.25.7
+// protoc-gen-go v1.36.11
+// protoc v6.31.0
// source: google/firestore/v1/document.proto
package firestorepb
@@ -23,6 +23,7 @@ package firestorepb
import (
reflect "reflect"
sync "sync"
+ unsafe "unsafe"
_ "google.golang.org/genproto/googleapis/api/annotations"
latlng "google.golang.org/genproto/googleapis/type/latlng"
@@ -43,10 +44,7 @@ const (
//
// Must not exceed 1 MiB - 4 bytes.
type Document struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The resource name of the document, for example
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
@@ -74,7 +72,7 @@ type Document struct {
// may contain any character. Some characters, including “ ` “, must be
// escaped using a `\`. For example, “ `x&y` “ represents `x&y` and
// “ `bak\`tik` “ represents “ bak`tik “.
- Fields map[string]*Value `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ Fields map[string]*Value `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
// Output only. The time at which the document was created.
//
// This value increases monotonically when a document is deleted then
@@ -86,7 +84,9 @@ type Document struct {
// This value is initially set to the `create_time` then increases
// monotonically with each change to the document. It can also be
// compared to values from other documents and the `read_time` of a query.
- UpdateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
+ UpdateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Document) Reset() {
@@ -149,13 +149,10 @@ func (x *Document) GetUpdateTime() *timestamppb.Timestamp {
// A message that can hold any of the supported value types.
type Value struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Must have a value set.
//
- // Types that are assignable to ValueType:
+ // Types that are valid to be assigned to ValueType:
//
// *Value_NullValue
// *Value_BooleanValue
@@ -169,9 +166,12 @@ type Value struct {
// *Value_ArrayValue
// *Value_MapValue
// *Value_FieldReferenceValue
+ // *Value_VariableReferenceValue
// *Value_FunctionValue
// *Value_PipelineValue
- ValueType isValue_ValueType `protobuf_oneof:"value_type"`
+ ValueType isValue_ValueType `protobuf_oneof:"value_type"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Value) Reset() {
@@ -204,107 +204,144 @@ func (*Value) Descriptor() ([]byte, []int) {
return file_google_firestore_v1_document_proto_rawDescGZIP(), []int{1}
}
-func (m *Value) GetValueType() isValue_ValueType {
- if m != nil {
- return m.ValueType
+func (x *Value) GetValueType() isValue_ValueType {
+ if x != nil {
+ return x.ValueType
}
return nil
}
func (x *Value) GetNullValue() structpb.NullValue {
- if x, ok := x.GetValueType().(*Value_NullValue); ok {
- return x.NullValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_NullValue); ok {
+ return x.NullValue
+ }
}
return structpb.NullValue(0)
}
func (x *Value) GetBooleanValue() bool {
- if x, ok := x.GetValueType().(*Value_BooleanValue); ok {
- return x.BooleanValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_BooleanValue); ok {
+ return x.BooleanValue
+ }
}
return false
}
func (x *Value) GetIntegerValue() int64 {
- if x, ok := x.GetValueType().(*Value_IntegerValue); ok {
- return x.IntegerValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_IntegerValue); ok {
+ return x.IntegerValue
+ }
}
return 0
}
func (x *Value) GetDoubleValue() float64 {
- if x, ok := x.GetValueType().(*Value_DoubleValue); ok {
- return x.DoubleValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_DoubleValue); ok {
+ return x.DoubleValue
+ }
}
return 0
}
func (x *Value) GetTimestampValue() *timestamppb.Timestamp {
- if x, ok := x.GetValueType().(*Value_TimestampValue); ok {
- return x.TimestampValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_TimestampValue); ok {
+ return x.TimestampValue
+ }
}
return nil
}
func (x *Value) GetStringValue() string {
- if x, ok := x.GetValueType().(*Value_StringValue); ok {
- return x.StringValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_StringValue); ok {
+ return x.StringValue
+ }
}
return ""
}
func (x *Value) GetBytesValue() []byte {
- if x, ok := x.GetValueType().(*Value_BytesValue); ok {
- return x.BytesValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_BytesValue); ok {
+ return x.BytesValue
+ }
}
return nil
}
func (x *Value) GetReferenceValue() string {
- if x, ok := x.GetValueType().(*Value_ReferenceValue); ok {
- return x.ReferenceValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_ReferenceValue); ok {
+ return x.ReferenceValue
+ }
}
return ""
}
func (x *Value) GetGeoPointValue() *latlng.LatLng {
- if x, ok := x.GetValueType().(*Value_GeoPointValue); ok {
- return x.GeoPointValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_GeoPointValue); ok {
+ return x.GeoPointValue
+ }
}
return nil
}
func (x *Value) GetArrayValue() *ArrayValue {
- if x, ok := x.GetValueType().(*Value_ArrayValue); ok {
- return x.ArrayValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_ArrayValue); ok {
+ return x.ArrayValue
+ }
}
return nil
}
func (x *Value) GetMapValue() *MapValue {
- if x, ok := x.GetValueType().(*Value_MapValue); ok {
- return x.MapValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_MapValue); ok {
+ return x.MapValue
+ }
}
return nil
}
func (x *Value) GetFieldReferenceValue() string {
- if x, ok := x.GetValueType().(*Value_FieldReferenceValue); ok {
- return x.FieldReferenceValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_FieldReferenceValue); ok {
+ return x.FieldReferenceValue
+ }
+ }
+ return ""
+}
+
+func (x *Value) GetVariableReferenceValue() string {
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_VariableReferenceValue); ok {
+ return x.VariableReferenceValue
+ }
}
return ""
}
func (x *Value) GetFunctionValue() *Function {
- if x, ok := x.GetValueType().(*Value_FunctionValue); ok {
- return x.FunctionValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_FunctionValue); ok {
+ return x.FunctionValue
+ }
}
return nil
}
func (x *Value) GetPipelineValue() *Pipeline {
- if x, ok := x.GetValueType().(*Value_PipelineValue); ok {
- return x.PipelineValue
+ if x != nil {
+ if x, ok := x.ValueType.(*Value_PipelineValue); ok {
+ return x.PipelineValue
+ }
}
return nil
}
@@ -396,6 +433,15 @@ type Value_FieldReferenceValue struct {
FieldReferenceValue string `protobuf:"bytes,19,opt,name=field_reference_value,json=fieldReferenceValue,proto3,oneof"`
}
+type Value_VariableReferenceValue struct {
+ // Pointer to a variable defined elsewhere in a pipeline.
+ //
+ // Unlike `field_reference_value` which references a field within a
+ // document, this refers to a variable, defined in a separate namespace than
+ // the fields of a document.
+ VariableReferenceValue string `protobuf:"bytes,22,opt,name=variable_reference_value,json=variableReferenceValue,proto3,oneof"`
+}
+
type Value_FunctionValue struct {
// A value that represents an unevaluated expression.
//
@@ -438,18 +484,19 @@ func (*Value_MapValue) isValue_ValueType() {}
func (*Value_FieldReferenceValue) isValue_ValueType() {}
+func (*Value_VariableReferenceValue) isValue_ValueType() {}
+
func (*Value_FunctionValue) isValue_ValueType() {}
func (*Value_PipelineValue) isValue_ValueType() {}
// An array value.
type ArrayValue struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Values in the array.
- Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
+ Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ArrayValue) Reset() {
@@ -491,17 +538,16 @@ func (x *ArrayValue) GetValues() []*Value {
// A map value.
type MapValue struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The map's fields.
//
// The map keys represent field names. Field names matching the regular
// expression `__.*__` are reserved. Reserved field names are forbidden except
// in certain documented contexts. The map keys, represented as UTF-8, must
// not exceed 1,500 bytes and cannot be empty.
- Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *MapValue) Reset() {
@@ -551,10 +597,7 @@ func (x *MapValue) GetFields() map[string]*Value {
// args { string_value: "%alice%" }
// ```
type Function struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The name of the function to evaluate.
//
// **Requires:**
@@ -564,7 +607,9 @@ type Function struct {
// Optional. Ordered list of arguments the given function expects.
Args []*Value `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
// Optional. Optional named arguments that certain functions may support.
- Options map[string]*Value `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ Options map[string]*Value `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Function) Reset() {
@@ -620,12 +665,11 @@ func (x *Function) GetOptions() map[string]*Value {
// A Firestore query represented as an ordered list of operations / stages.
type Pipeline struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. Ordered list of stages to evaluate.
- Stages []*Pipeline_Stage `protobuf:"bytes,1,rep,name=stages,proto3" json:"stages,omitempty"`
+ Stages []*Pipeline_Stage `protobuf:"bytes,1,rep,name=stages,proto3" json:"stages,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Pipeline) Reset() {
@@ -687,10 +731,7 @@ func (x *Pipeline) GetStages() []*Pipeline_Stage {
//
// See public documentation for the full list.
type Pipeline_Stage struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The name of the stage to evaluate.
//
// **Requires:**
@@ -700,7 +741,9 @@ type Pipeline_Stage struct {
// Optional. Ordered list of arguments the given stage expects.
Args []*Value `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
// Optional. Optional named arguments that certain functions may support.
- Options map[string]*Value `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ Options map[string]*Value `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Pipeline_Stage) Reset() {
@@ -756,161 +799,75 @@ func (x *Pipeline_Stage) GetOptions() map[string]*Value {
var File_google_firestore_v1_document_proto protoreflect.FileDescriptor
-var file_google_firestore_v1_document_proto_rawDesc = []byte{
- 0x0a, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61,
- 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75,
- 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
- 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6c, 0x61, 0x74, 0x6c, 0x6e, 0x67, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x22, 0xb2, 0x02, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
- 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
- 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02,
- 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d,
- 0x65, 0x6e, 0x74, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52,
- 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74,
- 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54,
- 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
- 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74,
- 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65,
- 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d,
- 0x65, 0x1a, 0x55, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
- 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
- 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76,
- 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x86, 0x06, 0x0a, 0x05, 0x56, 0x61, 0x6c,
- 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65,
- 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c,
- 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12,
- 0x25, 0x0a, 0x0d, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61,
- 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65,
- 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52,
- 0x0c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a,
- 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20,
- 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c,
- 0x75, 0x65, 0x12, 0x45, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f,
- 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
- 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x73,
- 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72,
- 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x48,
- 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21,
- 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x12, 0x20,
- 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75,
- 0x65, 0x12, 0x29, 0x0a, 0x0f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x76,
- 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x72, 0x65,
- 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3d, 0x0a, 0x0f,
- 0x67, 0x65, 0x6f, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
- 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74,
- 0x79, 0x70, 0x65, 0x2e, 0x4c, 0x61, 0x74, 0x4c, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0d, 0x67, 0x65,
- 0x6f, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0b, 0x61,
- 0x72, 0x72, 0x61, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x72, 0x72, 0x61, 0x79, 0x56, 0x61, 0x6c, 0x75,
- 0x65, 0x48, 0x00, 0x52, 0x0a, 0x61, 0x72, 0x72, 0x61, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12,
- 0x3c, 0x0a, 0x09, 0x6d, 0x61, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75,
- 0x65, 0x48, 0x00, 0x52, 0x08, 0x6d, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x34, 0x0a,
- 0x15, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
- 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x13,
- 0x66, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x56, 0x61,
- 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x0e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
- 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0d, 0x66, 0x75,
- 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x0e, 0x70,
- 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x15, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69,
- 0x6e, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x56, 0x61,
- 0x6c, 0x75, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x74, 0x79, 0x70,
- 0x65, 0x22, 0x40, 0x0a, 0x0a, 0x41, 0x72, 0x72, 0x61, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12,
- 0x32, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
- 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c,
- 0x75, 0x65, 0x73, 0x22, 0xa4, 0x01, 0x0a, 0x08, 0x4d, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65,
- 0x12, 0x41, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
- 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e,
- 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x69, 0x65,
- 0x6c, 0x64, 0x73, 0x1a, 0x55, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74,
- 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52,
- 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfb, 0x01, 0x0a, 0x08, 0x46,
- 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
- 0x12, 0x33, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a,
- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52,
- 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x49, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
- 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x75, 0x6e,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74,
- 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
- 0x1a, 0x56, 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
- 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
- 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76,
- 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xcd, 0x02, 0x0a, 0x08, 0x50, 0x69, 0x70,
- 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x67, 0x65, 0x73, 0x18,
- 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66,
- 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x70, 0x65,
- 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x67, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52,
- 0x06, 0x73, 0x74, 0x61, 0x67, 0x65, 0x73, 0x1a, 0xfe, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x67,
- 0x65, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
- 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x61, 0x72,
- 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56,
- 0x61, 0x6c, 0x75, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12,
- 0x4f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
- 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e,
- 0x53, 0x74, 0x61, 0x67, 0x65, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74,
- 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
- 0x1a, 0x56, 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
- 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
- 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76,
- 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d,
- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72,
- 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x3b, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x70, 0x62, 0xa2, 0x02, 0x04, 0x47, 0x43, 0x46, 0x53, 0xaa, 0x02, 0x19, 0x47, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43,
- 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56,
- 0x31, 0xea, 0x02, 0x1c, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75,
- 0x64, 0x3a, 0x3a, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31,
- 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
+const file_google_firestore_v1_document_proto_rawDesc = "" +
+ "\n" +
+ "\"google/firestore/v1/document.proto\x12\x13google.firestore.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x18google/type/latlng.proto\"\xb2\x02\n" +
+ "\bDocument\x12\x12\n" +
+ "\x04name\x18\x01 \x01(\tR\x04name\x12A\n" +
+ "\x06fields\x18\x02 \x03(\v2).google.firestore.v1.Document.FieldsEntryR\x06fields\x12;\n" +
+ "\vcreate_time\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\n" +
+ "createTime\x12;\n" +
+ "\vupdate_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\n" +
+ "updateTime\x1aU\n" +
+ "\vFieldsEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\tR\x03key\x120\n" +
+ "\x05value\x18\x02 \x01(\v2\x1a.google.firestore.v1.ValueR\x05value:\x028\x01\"\xc2\x06\n" +
+ "\x05Value\x12;\n" +
+ "\n" +
+ "null_value\x18\v \x01(\x0e2\x1a.google.protobuf.NullValueH\x00R\tnullValue\x12%\n" +
+ "\rboolean_value\x18\x01 \x01(\bH\x00R\fbooleanValue\x12%\n" +
+ "\rinteger_value\x18\x02 \x01(\x03H\x00R\fintegerValue\x12#\n" +
+ "\fdouble_value\x18\x03 \x01(\x01H\x00R\vdoubleValue\x12E\n" +
+ "\x0ftimestamp_value\x18\n" +
+ " \x01(\v2\x1a.google.protobuf.TimestampH\x00R\x0etimestampValue\x12#\n" +
+ "\fstring_value\x18\x11 \x01(\tH\x00R\vstringValue\x12!\n" +
+ "\vbytes_value\x18\x12 \x01(\fH\x00R\n" +
+ "bytesValue\x12)\n" +
+ "\x0freference_value\x18\x05 \x01(\tH\x00R\x0ereferenceValue\x12=\n" +
+ "\x0fgeo_point_value\x18\b \x01(\v2\x13.google.type.LatLngH\x00R\rgeoPointValue\x12B\n" +
+ "\varray_value\x18\t \x01(\v2\x1f.google.firestore.v1.ArrayValueH\x00R\n" +
+ "arrayValue\x12<\n" +
+ "\tmap_value\x18\x06 \x01(\v2\x1d.google.firestore.v1.MapValueH\x00R\bmapValue\x124\n" +
+ "\x15field_reference_value\x18\x13 \x01(\tH\x00R\x13fieldReferenceValue\x12:\n" +
+ "\x18variable_reference_value\x18\x16 \x01(\tH\x00R\x16variableReferenceValue\x12F\n" +
+ "\x0efunction_value\x18\x14 \x01(\v2\x1d.google.firestore.v1.FunctionH\x00R\rfunctionValue\x12F\n" +
+ "\x0epipeline_value\x18\x15 \x01(\v2\x1d.google.firestore.v1.PipelineH\x00R\rpipelineValueB\f\n" +
+ "\n" +
+ "value_type\"@\n" +
+ "\n" +
+ "ArrayValue\x122\n" +
+ "\x06values\x18\x01 \x03(\v2\x1a.google.firestore.v1.ValueR\x06values\"\xa4\x01\n" +
+ "\bMapValue\x12A\n" +
+ "\x06fields\x18\x01 \x03(\v2).google.firestore.v1.MapValue.FieldsEntryR\x06fields\x1aU\n" +
+ "\vFieldsEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\tR\x03key\x120\n" +
+ "\x05value\x18\x02 \x01(\v2\x1a.google.firestore.v1.ValueR\x05value:\x028\x01\"\xfb\x01\n" +
+ "\bFunction\x12\x17\n" +
+ "\x04name\x18\x01 \x01(\tB\x03\xe0A\x02R\x04name\x123\n" +
+ "\x04args\x18\x02 \x03(\v2\x1a.google.firestore.v1.ValueB\x03\xe0A\x01R\x04args\x12I\n" +
+ "\aoptions\x18\x03 \x03(\v2*.google.firestore.v1.Function.OptionsEntryB\x03\xe0A\x01R\aoptions\x1aV\n" +
+ "\fOptionsEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\tR\x03key\x120\n" +
+ "\x05value\x18\x02 \x01(\v2\x1a.google.firestore.v1.ValueR\x05value:\x028\x01\"\xcd\x02\n" +
+ "\bPipeline\x12@\n" +
+ "\x06stages\x18\x01 \x03(\v2#.google.firestore.v1.Pipeline.StageB\x03\xe0A\x02R\x06stages\x1a\xfe\x01\n" +
+ "\x05Stage\x12\x17\n" +
+ "\x04name\x18\x01 \x01(\tB\x03\xe0A\x02R\x04name\x123\n" +
+ "\x04args\x18\x02 \x03(\v2\x1a.google.firestore.v1.ValueB\x03\xe0A\x01R\x04args\x12O\n" +
+ "\aoptions\x18\x03 \x03(\v20.google.firestore.v1.Pipeline.Stage.OptionsEntryB\x03\xe0A\x01R\aoptions\x1aV\n" +
+ "\fOptionsEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\tR\x03key\x120\n" +
+ "\x05value\x18\x02 \x01(\v2\x1a.google.firestore.v1.ValueR\x05value:\x028\x01B\xc5\x01\n" +
+ "\x17com.google.firestore.v1B\rDocumentProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3"
var (
file_google_firestore_v1_document_proto_rawDescOnce sync.Once
- file_google_firestore_v1_document_proto_rawDescData = file_google_firestore_v1_document_proto_rawDesc
+ file_google_firestore_v1_document_proto_rawDescData []byte
)
func file_google_firestore_v1_document_proto_rawDescGZIP() []byte {
file_google_firestore_v1_document_proto_rawDescOnce.Do(func() {
- file_google_firestore_v1_document_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_firestore_v1_document_proto_rawDescData)
+ file_google_firestore_v1_document_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_firestore_v1_document_proto_rawDesc), len(file_google_firestore_v1_document_proto_rawDesc)))
})
return file_google_firestore_v1_document_proto_rawDescData
}
@@ -979,6 +936,7 @@ func file_google_firestore_v1_document_proto_init() {
(*Value_ArrayValue)(nil),
(*Value_MapValue)(nil),
(*Value_FieldReferenceValue)(nil),
+ (*Value_VariableReferenceValue)(nil),
(*Value_FunctionValue)(nil),
(*Value_PipelineValue)(nil),
}
@@ -986,7 +944,7 @@ func file_google_firestore_v1_document_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_google_firestore_v1_document_proto_rawDesc,
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_firestore_v1_document_proto_rawDesc), len(file_google_firestore_v1_document_proto_rawDesc)),
NumEnums: 0,
NumMessages: 11,
NumExtensions: 0,
@@ -997,7 +955,6 @@ func file_google_firestore_v1_document_proto_init() {
MessageInfos: file_google_firestore_v1_document_proto_msgTypes,
}.Build()
File_google_firestore_v1_document_proto = out.File
- file_google_firestore_v1_document_proto_rawDesc = nil
file_google_firestore_v1_document_proto_goTypes = nil
file_google_firestore_v1_document_proto_depIdxs = nil
}
diff --git a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/explain_stats.pb.go b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/explain_stats.pb.go
index 87ebda8e97..d43f06c020 100644
--- a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/explain_stats.pb.go
+++ b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/explain_stats.pb.go
@@ -1,4 +1,4 @@
-// Copyright 2025 Google LLC
+// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.35.2
-// protoc v4.25.7
+// protoc-gen-go v1.36.11
+// protoc v6.31.0
// source: google/firestore/v1/explain_stats.proto
package firestorepb
@@ -23,6 +23,7 @@ package firestorepb
import (
reflect "reflect"
sync "sync"
+ unsafe "unsafe"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
@@ -41,15 +42,14 @@ const (
// Depending on the explain options in the original request, this can contain
// the optimized plan and / or execution stats.
type ExplainStats struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The format depends on the `output_format` options in the request.
//
// Currently there are two supported options: `TEXT` and `JSON`.
// Both supply a `google.protobuf.StringValue`.
- Data *anypb.Any `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
+ Data *anypb.Any `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ExplainStats) Reset() {
@@ -91,39 +91,21 @@ func (x *ExplainStats) GetData() *anypb.Any {
var File_google_firestore_v1_explain_stats_proto protoreflect.FileDescriptor
-var file_google_firestore_v1_explain_stats_proto_rawDesc = []byte{
- 0x0a, 0x27, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x73, 0x74,
- 0x61, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x19,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
- 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x38, 0x0a, 0x0c, 0x45, 0x78, 0x70,
- 0x6c, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x28, 0x0a, 0x04, 0x64, 0x61, 0x74,
- 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x64,
- 0x61, 0x74, 0x61, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42,
- 0x11, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x50, 0x72, 0x6f,
- 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x70, 0x62, 0x3b, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70,
- 0x62, 0xaa, 0x02, 0x19, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64,
- 0x2e, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19,
- 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x46, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xea, 0x02, 0x1c, 0x47, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x46, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
+const file_google_firestore_v1_explain_stats_proto_rawDesc = "" +
+ "\n" +
+ "'google/firestore/v1/explain_stats.proto\x12\x13google.firestore.v1\x1a\x19google/protobuf/any.proto\"8\n" +
+ "\fExplainStats\x12(\n" +
+ "\x04data\x18\x01 \x01(\v2\x14.google.protobuf.AnyR\x04dataB\xc2\x01\n" +
+ "\x17com.google.firestore.v1B\x11ExplainStatsProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3"
var (
file_google_firestore_v1_explain_stats_proto_rawDescOnce sync.Once
- file_google_firestore_v1_explain_stats_proto_rawDescData = file_google_firestore_v1_explain_stats_proto_rawDesc
+ file_google_firestore_v1_explain_stats_proto_rawDescData []byte
)
func file_google_firestore_v1_explain_stats_proto_rawDescGZIP() []byte {
file_google_firestore_v1_explain_stats_proto_rawDescOnce.Do(func() {
- file_google_firestore_v1_explain_stats_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_firestore_v1_explain_stats_proto_rawDescData)
+ file_google_firestore_v1_explain_stats_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_firestore_v1_explain_stats_proto_rawDesc), len(file_google_firestore_v1_explain_stats_proto_rawDesc)))
})
return file_google_firestore_v1_explain_stats_proto_rawDescData
}
@@ -151,7 +133,7 @@ func file_google_firestore_v1_explain_stats_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_google_firestore_v1_explain_stats_proto_rawDesc,
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_firestore_v1_explain_stats_proto_rawDesc), len(file_google_firestore_v1_explain_stats_proto_rawDesc)),
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
@@ -162,7 +144,6 @@ func file_google_firestore_v1_explain_stats_proto_init() {
MessageInfos: file_google_firestore_v1_explain_stats_proto_msgTypes,
}.Build()
File_google_firestore_v1_explain_stats_proto = out.File
- file_google_firestore_v1_explain_stats_proto_rawDesc = nil
file_google_firestore_v1_explain_stats_proto_goTypes = nil
file_google_firestore_v1_explain_stats_proto_depIdxs = nil
}
diff --git a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/firestore.pb.go b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/firestore.pb.go
index 3311134494..c649e57673 100644
--- a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/firestore.pb.go
+++ b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/firestore.pb.go
@@ -1,4 +1,4 @@
-// Copyright 2025 Google LLC
+// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.35.2
-// protoc v4.25.7
+// protoc-gen-go v1.36.11
+// protoc v6.31.0
// source: google/firestore/v1/firestore.proto
package firestorepb
@@ -23,6 +23,7 @@ package firestorepb
import (
reflect "reflect"
sync "sync"
+ unsafe "unsafe"
_ "google.golang.org/genproto/googleapis/api/annotations"
status "google.golang.org/genproto/googleapis/rpc/status"
@@ -115,10 +116,7 @@ func (TargetChange_TargetChangeType) EnumDescriptor() ([]byte, []int) {
// The request for
// [Firestore.GetDocument][google.firestore.v1.Firestore.GetDocument].
type GetDocumentRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The resource name of the Document to get. In the format:
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
@@ -130,11 +128,13 @@ type GetDocumentRequest struct {
// The consistency mode for this transaction.
// If not set, defaults to strong consistency.
//
- // Types that are assignable to ConsistencySelector:
+ // Types that are valid to be assigned to ConsistencySelector:
//
// *GetDocumentRequest_Transaction
// *GetDocumentRequest_ReadTime
ConsistencySelector isGetDocumentRequest_ConsistencySelector `protobuf_oneof:"consistency_selector"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *GetDocumentRequest) Reset() {
@@ -181,23 +181,27 @@ func (x *GetDocumentRequest) GetMask() *DocumentMask {
return nil
}
-func (m *GetDocumentRequest) GetConsistencySelector() isGetDocumentRequest_ConsistencySelector {
- if m != nil {
- return m.ConsistencySelector
+func (x *GetDocumentRequest) GetConsistencySelector() isGetDocumentRequest_ConsistencySelector {
+ if x != nil {
+ return x.ConsistencySelector
}
return nil
}
func (x *GetDocumentRequest) GetTransaction() []byte {
- if x, ok := x.GetConsistencySelector().(*GetDocumentRequest_Transaction); ok {
- return x.Transaction
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*GetDocumentRequest_Transaction); ok {
+ return x.Transaction
+ }
}
return nil
}
func (x *GetDocumentRequest) GetReadTime() *timestamppb.Timestamp {
- if x, ok := x.GetConsistencySelector().(*GetDocumentRequest_ReadTime); ok {
- return x.ReadTime
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*GetDocumentRequest_ReadTime); ok {
+ return x.ReadTime
+ }
}
return nil
}
@@ -227,10 +231,7 @@ func (*GetDocumentRequest_ReadTime) isGetDocumentRequest_ConsistencySelector() {
// The request for
// [Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments].
type ListDocumentsRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The parent resource name. In the format:
// `projects/{project_id}/databases/{database_id}/documents` or
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
@@ -272,7 +273,7 @@ type ListDocumentsRequest struct {
// The consistency mode for this transaction.
// If not set, defaults to strong consistency.
//
- // Types that are assignable to ConsistencySelector:
+ // Types that are valid to be assigned to ConsistencySelector:
//
// *ListDocumentsRequest_Transaction
// *ListDocumentsRequest_ReadTime
@@ -286,7 +287,9 @@ type ListDocumentsRequest struct {
// [`update_time`][google.firestore.v1.Document.update_time] set.
//
// Requests with `show_missing` may not specify `where` or `order_by`.
- ShowMissing bool `protobuf:"varint,12,opt,name=show_missing,json=showMissing,proto3" json:"show_missing,omitempty"`
+ ShowMissing bool `protobuf:"varint,12,opt,name=show_missing,json=showMissing,proto3" json:"show_missing,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ListDocumentsRequest) Reset() {
@@ -361,23 +364,27 @@ func (x *ListDocumentsRequest) GetMask() *DocumentMask {
return nil
}
-func (m *ListDocumentsRequest) GetConsistencySelector() isListDocumentsRequest_ConsistencySelector {
- if m != nil {
- return m.ConsistencySelector
+func (x *ListDocumentsRequest) GetConsistencySelector() isListDocumentsRequest_ConsistencySelector {
+ if x != nil {
+ return x.ConsistencySelector
}
return nil
}
func (x *ListDocumentsRequest) GetTransaction() []byte {
- if x, ok := x.GetConsistencySelector().(*ListDocumentsRequest_Transaction); ok {
- return x.Transaction
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*ListDocumentsRequest_Transaction); ok {
+ return x.Transaction
+ }
}
return nil
}
func (x *ListDocumentsRequest) GetReadTime() *timestamppb.Timestamp {
- if x, ok := x.GetConsistencySelector().(*ListDocumentsRequest_ReadTime); ok {
- return x.ReadTime
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*ListDocumentsRequest_ReadTime); ok {
+ return x.ReadTime
+ }
}
return nil
}
@@ -414,16 +421,15 @@ func (*ListDocumentsRequest_ReadTime) isListDocumentsRequest_ConsistencySelector
// The response for
// [Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments].
type ListDocumentsResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The Documents found.
Documents []*Document `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents,omitempty"`
// A token to retrieve the next page of documents.
//
// If this field is omitted, there are no subsequent pages.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ListDocumentsResponse) Reset() {
@@ -473,10 +479,7 @@ func (x *ListDocumentsResponse) GetNextPageToken() string {
// The request for
// [Firestore.CreateDocument][google.firestore.v1.Firestore.CreateDocument].
type CreateDocumentRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The parent resource. For example:
// `projects/{project_id}/databases/{database_id}/documents` or
// `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
@@ -494,7 +497,9 @@ type CreateDocumentRequest struct {
//
// If the document has a field that is not present in this mask, that field
// will not be returned in the response.
- Mask *DocumentMask `protobuf:"bytes,5,opt,name=mask,proto3" json:"mask,omitempty"`
+ Mask *DocumentMask `protobuf:"bytes,5,opt,name=mask,proto3" json:"mask,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *CreateDocumentRequest) Reset() {
@@ -565,10 +570,7 @@ func (x *CreateDocumentRequest) GetMask() *DocumentMask {
// The request for
// [Firestore.UpdateDocument][google.firestore.v1.Firestore.UpdateDocument].
type UpdateDocumentRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The updated document.
// Creates the document if it does not already exist.
Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"`
@@ -588,6 +590,8 @@ type UpdateDocumentRequest struct {
// An optional precondition on the document.
// The request will fail if this is set and not met by the target document.
CurrentDocument *Precondition `protobuf:"bytes,4,opt,name=current_document,json=currentDocument,proto3" json:"current_document,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *UpdateDocumentRequest) Reset() {
@@ -651,16 +655,15 @@ func (x *UpdateDocumentRequest) GetCurrentDocument() *Precondition {
// The request for
// [Firestore.DeleteDocument][google.firestore.v1.Firestore.DeleteDocument].
type DeleteDocumentRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The resource name of the Document to delete. In the format:
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// An optional precondition on the document.
// The request will fail if this is set and not met by the target document.
CurrentDocument *Precondition `protobuf:"bytes,2,opt,name=current_document,json=currentDocument,proto3" json:"current_document,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *DeleteDocumentRequest) Reset() {
@@ -710,10 +713,7 @@ func (x *DeleteDocumentRequest) GetCurrentDocument() *Precondition {
// The request for
// [Firestore.BatchGetDocuments][google.firestore.v1.Firestore.BatchGetDocuments].
type BatchGetDocumentsRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The database name. In the format:
// `projects/{project_id}/databases/{database_id}`.
Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
@@ -730,12 +730,14 @@ type BatchGetDocumentsRequest struct {
// The consistency mode for this transaction.
// If not set, defaults to strong consistency.
//
- // Types that are assignable to ConsistencySelector:
+ // Types that are valid to be assigned to ConsistencySelector:
//
// *BatchGetDocumentsRequest_Transaction
// *BatchGetDocumentsRequest_NewTransaction
// *BatchGetDocumentsRequest_ReadTime
ConsistencySelector isBatchGetDocumentsRequest_ConsistencySelector `protobuf_oneof:"consistency_selector"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *BatchGetDocumentsRequest) Reset() {
@@ -789,30 +791,36 @@ func (x *BatchGetDocumentsRequest) GetMask() *DocumentMask {
return nil
}
-func (m *BatchGetDocumentsRequest) GetConsistencySelector() isBatchGetDocumentsRequest_ConsistencySelector {
- if m != nil {
- return m.ConsistencySelector
+func (x *BatchGetDocumentsRequest) GetConsistencySelector() isBatchGetDocumentsRequest_ConsistencySelector {
+ if x != nil {
+ return x.ConsistencySelector
}
return nil
}
func (x *BatchGetDocumentsRequest) GetTransaction() []byte {
- if x, ok := x.GetConsistencySelector().(*BatchGetDocumentsRequest_Transaction); ok {
- return x.Transaction
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*BatchGetDocumentsRequest_Transaction); ok {
+ return x.Transaction
+ }
}
return nil
}
func (x *BatchGetDocumentsRequest) GetNewTransaction() *TransactionOptions {
- if x, ok := x.GetConsistencySelector().(*BatchGetDocumentsRequest_NewTransaction); ok {
- return x.NewTransaction
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*BatchGetDocumentsRequest_NewTransaction); ok {
+ return x.NewTransaction
+ }
}
return nil
}
func (x *BatchGetDocumentsRequest) GetReadTime() *timestamppb.Timestamp {
- if x, ok := x.GetConsistencySelector().(*BatchGetDocumentsRequest_ReadTime); ok {
- return x.ReadTime
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*BatchGetDocumentsRequest_ReadTime); ok {
+ return x.ReadTime
+ }
}
return nil
}
@@ -852,14 +860,11 @@ func (*BatchGetDocumentsRequest_ReadTime) isBatchGetDocumentsRequest_Consistency
// The streamed response for
// [Firestore.BatchGetDocuments][google.firestore.v1.Firestore.BatchGetDocuments].
type BatchGetDocumentsResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// A single result.
// This can be empty if the server is just returning a transaction.
//
- // Types that are assignable to Result:
+ // Types that are valid to be assigned to Result:
//
// *BatchGetDocumentsResponse_Found
// *BatchGetDocumentsResponse_Missing
@@ -873,7 +878,9 @@ type BatchGetDocumentsResponse struct {
// This may be monotically increasing, in this case the previous documents in
// the result stream are guaranteed not to have changed between their
// read_time and this one.
- ReadTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=read_time,json=readTime,proto3" json:"read_time,omitempty"`
+ ReadTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=read_time,json=readTime,proto3" json:"read_time,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *BatchGetDocumentsResponse) Reset() {
@@ -906,23 +913,27 @@ func (*BatchGetDocumentsResponse) Descriptor() ([]byte, []int) {
return file_google_firestore_v1_firestore_proto_rawDescGZIP(), []int{7}
}
-func (m *BatchGetDocumentsResponse) GetResult() isBatchGetDocumentsResponse_Result {
- if m != nil {
- return m.Result
+func (x *BatchGetDocumentsResponse) GetResult() isBatchGetDocumentsResponse_Result {
+ if x != nil {
+ return x.Result
}
return nil
}
func (x *BatchGetDocumentsResponse) GetFound() *Document {
- if x, ok := x.GetResult().(*BatchGetDocumentsResponse_Found); ok {
- return x.Found
+ if x != nil {
+ if x, ok := x.Result.(*BatchGetDocumentsResponse_Found); ok {
+ return x.Found
+ }
}
return nil
}
func (x *BatchGetDocumentsResponse) GetMissing() string {
- if x, ok := x.GetResult().(*BatchGetDocumentsResponse_Missing); ok {
- return x.Missing
+ if x != nil {
+ if x, ok := x.Result.(*BatchGetDocumentsResponse_Missing); ok {
+ return x.Missing
+ }
}
return ""
}
@@ -963,16 +974,15 @@ func (*BatchGetDocumentsResponse_Missing) isBatchGetDocumentsResponse_Result() {
// The request for
// [Firestore.BeginTransaction][google.firestore.v1.Firestore.BeginTransaction].
type BeginTransactionRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The database name. In the format:
// `projects/{project_id}/databases/{database_id}`.
Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
// The options for the transaction.
// Defaults to a read-write transaction.
- Options *TransactionOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
+ Options *TransactionOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *BeginTransactionRequest) Reset() {
@@ -1022,12 +1032,11 @@ func (x *BeginTransactionRequest) GetOptions() *TransactionOptions {
// The response for
// [Firestore.BeginTransaction][google.firestore.v1.Firestore.BeginTransaction].
type BeginTransactionResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The transaction that was started.
- Transaction []byte `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"`
+ Transaction []byte `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *BeginTransactionResponse) Reset() {
@@ -1069,10 +1078,7 @@ func (x *BeginTransactionResponse) GetTransaction() []byte {
// The request for [Firestore.Commit][google.firestore.v1.Firestore.Commit].
type CommitRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The database name. In the format:
// `projects/{project_id}/databases/{database_id}`.
Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
@@ -1081,7 +1087,9 @@ type CommitRequest struct {
// Always executed atomically and in order.
Writes []*Write `protobuf:"bytes,2,rep,name=writes,proto3" json:"writes,omitempty"`
// If set, applies all writes in this transaction, and commits it.
- Transaction []byte `protobuf:"bytes,3,opt,name=transaction,proto3" json:"transaction,omitempty"`
+ Transaction []byte `protobuf:"bytes,3,opt,name=transaction,proto3" json:"transaction,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *CommitRequest) Reset() {
@@ -1137,10 +1145,7 @@ func (x *CommitRequest) GetTransaction() []byte {
// The response for [Firestore.Commit][google.firestore.v1.Firestore.Commit].
type CommitResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The result of applying the writes.
//
// This i-th write result corresponds to the i-th write in the
@@ -1148,7 +1153,9 @@ type CommitResponse struct {
WriteResults []*WriteResult `protobuf:"bytes,1,rep,name=write_results,json=writeResults,proto3" json:"write_results,omitempty"`
// The time at which the commit occurred. Any read with an equal or greater
// `read_time` is guaranteed to see the effects of the commit.
- CommitTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=commit_time,json=commitTime,proto3" json:"commit_time,omitempty"`
+ CommitTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=commit_time,json=commitTime,proto3" json:"commit_time,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *CommitResponse) Reset() {
@@ -1197,15 +1204,14 @@ func (x *CommitResponse) GetCommitTime() *timestamppb.Timestamp {
// The request for [Firestore.Rollback][google.firestore.v1.Firestore.Rollback].
type RollbackRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The database name. In the format:
// `projects/{project_id}/databases/{database_id}`.
Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
// Required. The transaction to roll back.
- Transaction []byte `protobuf:"bytes,2,opt,name=transaction,proto3" json:"transaction,omitempty"`
+ Transaction []byte `protobuf:"bytes,2,opt,name=transaction,proto3" json:"transaction,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *RollbackRequest) Reset() {
@@ -1254,10 +1260,7 @@ func (x *RollbackRequest) GetTransaction() []byte {
// The request for [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery].
type RunQueryRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The parent resource name. In the format:
// `projects/{project_id}/databases/{database_id}/documents` or
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
@@ -1267,14 +1270,14 @@ type RunQueryRequest struct {
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// The query to run.
//
- // Types that are assignable to QueryType:
+ // Types that are valid to be assigned to QueryType:
//
// *RunQueryRequest_StructuredQuery
QueryType isRunQueryRequest_QueryType `protobuf_oneof:"query_type"`
// The consistency mode for this transaction.
// If not set, defaults to strong consistency.
//
- // Types that are assignable to ConsistencySelector:
+ // Types that are valid to be assigned to ConsistencySelector:
//
// *RunQueryRequest_Transaction
// *RunQueryRequest_NewTransaction
@@ -1283,6 +1286,8 @@ type RunQueryRequest struct {
// Optional. Explain options for the query. If set, additional query
// statistics will be returned. If not, only query results will be returned.
ExplainOptions *ExplainOptions `protobuf:"bytes,10,opt,name=explain_options,json=explainOptions,proto3" json:"explain_options,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *RunQueryRequest) Reset() {
@@ -1322,44 +1327,52 @@ func (x *RunQueryRequest) GetParent() string {
return ""
}
-func (m *RunQueryRequest) GetQueryType() isRunQueryRequest_QueryType {
- if m != nil {
- return m.QueryType
+func (x *RunQueryRequest) GetQueryType() isRunQueryRequest_QueryType {
+ if x != nil {
+ return x.QueryType
}
return nil
}
func (x *RunQueryRequest) GetStructuredQuery() *StructuredQuery {
- if x, ok := x.GetQueryType().(*RunQueryRequest_StructuredQuery); ok {
- return x.StructuredQuery
+ if x != nil {
+ if x, ok := x.QueryType.(*RunQueryRequest_StructuredQuery); ok {
+ return x.StructuredQuery
+ }
}
return nil
}
-func (m *RunQueryRequest) GetConsistencySelector() isRunQueryRequest_ConsistencySelector {
- if m != nil {
- return m.ConsistencySelector
+func (x *RunQueryRequest) GetConsistencySelector() isRunQueryRequest_ConsistencySelector {
+ if x != nil {
+ return x.ConsistencySelector
}
return nil
}
func (x *RunQueryRequest) GetTransaction() []byte {
- if x, ok := x.GetConsistencySelector().(*RunQueryRequest_Transaction); ok {
- return x.Transaction
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*RunQueryRequest_Transaction); ok {
+ return x.Transaction
+ }
}
return nil
}
func (x *RunQueryRequest) GetNewTransaction() *TransactionOptions {
- if x, ok := x.GetConsistencySelector().(*RunQueryRequest_NewTransaction); ok {
- return x.NewTransaction
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*RunQueryRequest_NewTransaction); ok {
+ return x.NewTransaction
+ }
}
return nil
}
func (x *RunQueryRequest) GetReadTime() *timestamppb.Timestamp {
- if x, ok := x.GetConsistencySelector().(*RunQueryRequest_ReadTime); ok {
- return x.ReadTime
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*RunQueryRequest_ReadTime); ok {
+ return x.ReadTime
+ }
}
return nil
}
@@ -1419,10 +1432,7 @@ func (*RunQueryRequest_ReadTime) isRunQueryRequest_ConsistencySelector() {}
// The response for
// [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery].
type RunQueryResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The transaction that was started as part of this request.
// Can only be set in the first response, and only if
// [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction]
@@ -1446,7 +1456,7 @@ type RunQueryResponse struct {
// query response stream has finished. This can be set with or without a
// `document` present, but when set, no more results are returned.
//
- // Types that are assignable to ContinuationSelector:
+ // Types that are valid to be assigned to ContinuationSelector:
//
// *RunQueryResponse_Done
ContinuationSelector isRunQueryResponse_ContinuationSelector `protobuf_oneof:"continuation_selector"`
@@ -1454,6 +1464,8 @@ type RunQueryResponse struct {
// [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options]
// is provided, and it is sent only once with the last response in the stream.
ExplainMetrics *ExplainMetrics `protobuf:"bytes,11,opt,name=explain_metrics,json=explainMetrics,proto3" json:"explain_metrics,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *RunQueryResponse) Reset() {
@@ -1514,16 +1526,18 @@ func (x *RunQueryResponse) GetSkippedResults() int32 {
return 0
}
-func (m *RunQueryResponse) GetContinuationSelector() isRunQueryResponse_ContinuationSelector {
- if m != nil {
- return m.ContinuationSelector
+func (x *RunQueryResponse) GetContinuationSelector() isRunQueryResponse_ContinuationSelector {
+ if x != nil {
+ return x.ContinuationSelector
}
return nil
}
func (x *RunQueryResponse) GetDone() bool {
- if x, ok := x.GetContinuationSelector().(*RunQueryResponse_Done); ok {
- return x.Done
+ if x != nil {
+ if x, ok := x.ContinuationSelector.(*RunQueryResponse_Done); ok {
+ return x.Done
+ }
}
return false
}
@@ -1550,25 +1564,24 @@ func (*RunQueryResponse_Done) isRunQueryResponse_ContinuationSelector() {}
// The request for
// [Firestore.ExecutePipeline][google.firestore.v1.Firestore.ExecutePipeline].
type ExecutePipelineRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. Database identifier, in the form
// `projects/{project}/databases/{database}`.
Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
- // Types that are assignable to PipelineType:
+ // Types that are valid to be assigned to PipelineType:
//
// *ExecutePipelineRequest_StructuredPipeline
PipelineType isExecutePipelineRequest_PipelineType `protobuf_oneof:"pipeline_type"`
// Optional consistency arguments, defaults to strong consistency.
//
- // Types that are assignable to ConsistencySelector:
+ // Types that are valid to be assigned to ConsistencySelector:
//
// *ExecutePipelineRequest_Transaction
// *ExecutePipelineRequest_NewTransaction
// *ExecutePipelineRequest_ReadTime
ConsistencySelector isExecutePipelineRequest_ConsistencySelector `protobuf_oneof:"consistency_selector"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ExecutePipelineRequest) Reset() {
@@ -1608,44 +1621,52 @@ func (x *ExecutePipelineRequest) GetDatabase() string {
return ""
}
-func (m *ExecutePipelineRequest) GetPipelineType() isExecutePipelineRequest_PipelineType {
- if m != nil {
- return m.PipelineType
+func (x *ExecutePipelineRequest) GetPipelineType() isExecutePipelineRequest_PipelineType {
+ if x != nil {
+ return x.PipelineType
}
return nil
}
func (x *ExecutePipelineRequest) GetStructuredPipeline() *StructuredPipeline {
- if x, ok := x.GetPipelineType().(*ExecutePipelineRequest_StructuredPipeline); ok {
- return x.StructuredPipeline
+ if x != nil {
+ if x, ok := x.PipelineType.(*ExecutePipelineRequest_StructuredPipeline); ok {
+ return x.StructuredPipeline
+ }
}
return nil
}
-func (m *ExecutePipelineRequest) GetConsistencySelector() isExecutePipelineRequest_ConsistencySelector {
- if m != nil {
- return m.ConsistencySelector
+func (x *ExecutePipelineRequest) GetConsistencySelector() isExecutePipelineRequest_ConsistencySelector {
+ if x != nil {
+ return x.ConsistencySelector
}
return nil
}
func (x *ExecutePipelineRequest) GetTransaction() []byte {
- if x, ok := x.GetConsistencySelector().(*ExecutePipelineRequest_Transaction); ok {
- return x.Transaction
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*ExecutePipelineRequest_Transaction); ok {
+ return x.Transaction
+ }
}
return nil
}
func (x *ExecutePipelineRequest) GetNewTransaction() *TransactionOptions {
- if x, ok := x.GetConsistencySelector().(*ExecutePipelineRequest_NewTransaction); ok {
- return x.NewTransaction
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*ExecutePipelineRequest_NewTransaction); ok {
+ return x.NewTransaction
+ }
}
return nil
}
func (x *ExecutePipelineRequest) GetReadTime() *timestamppb.Timestamp {
- if x, ok := x.GetConsistencySelector().(*ExecutePipelineRequest_ReadTime); ok {
- return x.ReadTime
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*ExecutePipelineRequest_ReadTime); ok {
+ return x.ReadTime
+ }
}
return nil
}
@@ -1697,10 +1718,7 @@ func (*ExecutePipelineRequest_ReadTime) isExecutePipelineRequest_ConsistencySele
// The response for [Firestore.Execute][].
type ExecutePipelineResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Newly created transaction identifier.
//
// This field is only specified as part of the first response from the server,
@@ -1738,7 +1756,9 @@ type ExecutePipelineResponse struct {
// to run in 'analyze' or 'explain' mode in the pipeline options. If the query
// does not return any results, a response with `explain_stats` and no
// `results` will still be sent.
- ExplainStats *ExplainStats `protobuf:"bytes,4,opt,name=explain_stats,json=explainStats,proto3" json:"explain_stats,omitempty"`
+ ExplainStats *ExplainStats `protobuf:"bytes,4,opt,name=explain_stats,json=explainStats,proto3" json:"explain_stats,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ExecutePipelineResponse) Reset() {
@@ -1802,10 +1822,7 @@ func (x *ExecutePipelineResponse) GetExplainStats() *ExplainStats {
// The request for
// [Firestore.RunAggregationQuery][google.firestore.v1.Firestore.RunAggregationQuery].
type RunAggregationQueryRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The parent resource name. In the format:
// `projects/{project_id}/databases/{database_id}/documents` or
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
@@ -1815,13 +1832,13 @@ type RunAggregationQueryRequest struct {
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// The query to run.
//
- // Types that are assignable to QueryType:
+ // Types that are valid to be assigned to QueryType:
//
// *RunAggregationQueryRequest_StructuredAggregationQuery
QueryType isRunAggregationQueryRequest_QueryType `protobuf_oneof:"query_type"`
// The consistency mode for the query, defaults to strong consistency.
//
- // Types that are assignable to ConsistencySelector:
+ // Types that are valid to be assigned to ConsistencySelector:
//
// *RunAggregationQueryRequest_Transaction
// *RunAggregationQueryRequest_NewTransaction
@@ -1830,6 +1847,8 @@ type RunAggregationQueryRequest struct {
// Optional. Explain options for the query. If set, additional query
// statistics will be returned. If not, only query results will be returned.
ExplainOptions *ExplainOptions `protobuf:"bytes,8,opt,name=explain_options,json=explainOptions,proto3" json:"explain_options,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *RunAggregationQueryRequest) Reset() {
@@ -1869,44 +1888,52 @@ func (x *RunAggregationQueryRequest) GetParent() string {
return ""
}
-func (m *RunAggregationQueryRequest) GetQueryType() isRunAggregationQueryRequest_QueryType {
- if m != nil {
- return m.QueryType
+func (x *RunAggregationQueryRequest) GetQueryType() isRunAggregationQueryRequest_QueryType {
+ if x != nil {
+ return x.QueryType
}
return nil
}
func (x *RunAggregationQueryRequest) GetStructuredAggregationQuery() *StructuredAggregationQuery {
- if x, ok := x.GetQueryType().(*RunAggregationQueryRequest_StructuredAggregationQuery); ok {
- return x.StructuredAggregationQuery
+ if x != nil {
+ if x, ok := x.QueryType.(*RunAggregationQueryRequest_StructuredAggregationQuery); ok {
+ return x.StructuredAggregationQuery
+ }
}
return nil
}
-func (m *RunAggregationQueryRequest) GetConsistencySelector() isRunAggregationQueryRequest_ConsistencySelector {
- if m != nil {
- return m.ConsistencySelector
+func (x *RunAggregationQueryRequest) GetConsistencySelector() isRunAggregationQueryRequest_ConsistencySelector {
+ if x != nil {
+ return x.ConsistencySelector
}
return nil
}
func (x *RunAggregationQueryRequest) GetTransaction() []byte {
- if x, ok := x.GetConsistencySelector().(*RunAggregationQueryRequest_Transaction); ok {
- return x.Transaction
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*RunAggregationQueryRequest_Transaction); ok {
+ return x.Transaction
+ }
}
return nil
}
func (x *RunAggregationQueryRequest) GetNewTransaction() *TransactionOptions {
- if x, ok := x.GetConsistencySelector().(*RunAggregationQueryRequest_NewTransaction); ok {
- return x.NewTransaction
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*RunAggregationQueryRequest_NewTransaction); ok {
+ return x.NewTransaction
+ }
}
return nil
}
func (x *RunAggregationQueryRequest) GetReadTime() *timestamppb.Timestamp {
- if x, ok := x.GetConsistencySelector().(*RunAggregationQueryRequest_ReadTime); ok {
- return x.ReadTime
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*RunAggregationQueryRequest_ReadTime); ok {
+ return x.ReadTime
+ }
}
return nil
}
@@ -1968,10 +1995,7 @@ func (*RunAggregationQueryRequest_ReadTime) isRunAggregationQueryRequest_Consist
// The response for
// [Firestore.RunAggregationQuery][google.firestore.v1.Firestore.RunAggregationQuery].
type RunAggregationQueryResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// A single aggregation result.
//
// Not present when reporting partial progress.
@@ -1994,6 +2018,8 @@ type RunAggregationQueryResponse struct {
// [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options]
// is provided, and it is sent only once with the last response in the stream.
ExplainMetrics *ExplainMetrics `protobuf:"bytes,10,opt,name=explain_metrics,json=explainMetrics,proto3" json:"explain_metrics,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *RunAggregationQueryResponse) Reset() {
@@ -2057,10 +2083,7 @@ func (x *RunAggregationQueryResponse) GetExplainMetrics() *ExplainMetrics {
// The request for
// [Firestore.PartitionQuery][google.firestore.v1.Firestore.PartitionQuery].
type PartitionQueryRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The parent resource name. In the format:
// `projects/{project_id}/databases/{database_id}/documents`.
// Document resource names are not supported; only database resource names
@@ -2068,7 +2091,7 @@ type PartitionQueryRequest struct {
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// The query to partition.
//
- // Types that are assignable to QueryType:
+ // Types that are valid to be assigned to QueryType:
//
// *PartitionQueryRequest_StructuredQuery
QueryType isPartitionQueryRequest_QueryType `protobuf_oneof:"query_type"`
@@ -2106,10 +2129,12 @@ type PartitionQueryRequest struct {
// The consistency mode for this request.
// If not set, defaults to strong consistency.
//
- // Types that are assignable to ConsistencySelector:
+ // Types that are valid to be assigned to ConsistencySelector:
//
// *PartitionQueryRequest_ReadTime
ConsistencySelector isPartitionQueryRequest_ConsistencySelector `protobuf_oneof:"consistency_selector"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *PartitionQueryRequest) Reset() {
@@ -2149,16 +2174,18 @@ func (x *PartitionQueryRequest) GetParent() string {
return ""
}
-func (m *PartitionQueryRequest) GetQueryType() isPartitionQueryRequest_QueryType {
- if m != nil {
- return m.QueryType
+func (x *PartitionQueryRequest) GetQueryType() isPartitionQueryRequest_QueryType {
+ if x != nil {
+ return x.QueryType
}
return nil
}
func (x *PartitionQueryRequest) GetStructuredQuery() *StructuredQuery {
- if x, ok := x.GetQueryType().(*PartitionQueryRequest_StructuredQuery); ok {
- return x.StructuredQuery
+ if x != nil {
+ if x, ok := x.QueryType.(*PartitionQueryRequest_StructuredQuery); ok {
+ return x.StructuredQuery
+ }
}
return nil
}
@@ -2184,16 +2211,18 @@ func (x *PartitionQueryRequest) GetPageSize() int32 {
return 0
}
-func (m *PartitionQueryRequest) GetConsistencySelector() isPartitionQueryRequest_ConsistencySelector {
- if m != nil {
- return m.ConsistencySelector
+func (x *PartitionQueryRequest) GetConsistencySelector() isPartitionQueryRequest_ConsistencySelector {
+ if x != nil {
+ return x.ConsistencySelector
}
return nil
}
func (x *PartitionQueryRequest) GetReadTime() *timestamppb.Timestamp {
- if x, ok := x.GetConsistencySelector().(*PartitionQueryRequest_ReadTime); ok {
- return x.ReadTime
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*PartitionQueryRequest_ReadTime); ok {
+ return x.ReadTime
+ }
}
return nil
}
@@ -2230,10 +2259,7 @@ func (*PartitionQueryRequest_ReadTime) isPartitionQueryRequest_ConsistencySelect
// The response for
// [Firestore.PartitionQuery][google.firestore.v1.Firestore.PartitionQuery].
type PartitionQueryResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Partition results.
// Each partition is a split point that can be used by RunQuery as a starting
// or end point for the query results. The RunQuery requests must be made with
@@ -2256,6 +2282,8 @@ type PartitionQueryResponse struct {
// to the number specified by `partition_count` in the PartitionQuery request.
// If blank, there are no more results.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *PartitionQueryResponse) Reset() {
@@ -2313,10 +2341,7 @@ func (x *PartitionQueryResponse) GetNextPageToken() string {
// given token, then a response containing only an up-to-date token, to use in
// the next request.
type WriteRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The database name. In the format:
// `projects/{project_id}/databases/{database_id}`.
// This is only required in the first message.
@@ -2348,7 +2373,9 @@ type WriteRequest struct {
// Leave this field unset when creating a new stream.
StreamToken []byte `protobuf:"bytes,4,opt,name=stream_token,json=streamToken,proto3" json:"stream_token,omitempty"`
// Labels associated with this write request.
- Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *WriteRequest) Reset() {
@@ -2418,10 +2445,7 @@ func (x *WriteRequest) GetLabels() map[string]string {
// The response for [Firestore.Write][google.firestore.v1.Firestore.Write].
type WriteResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The ID of the stream.
// Only set on the first message, when a new stream was created.
StreamId string `protobuf:"bytes,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"`
@@ -2437,7 +2461,9 @@ type WriteResponse struct {
WriteResults []*WriteResult `protobuf:"bytes,3,rep,name=write_results,json=writeResults,proto3" json:"write_results,omitempty"`
// The time at which the commit occurred. Any read with an equal or greater
// `read_time` is guaranteed to see the effects of the write.
- CommitTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=commit_time,json=commitTime,proto3" json:"commit_time,omitempty"`
+ CommitTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=commit_time,json=commitTime,proto3" json:"commit_time,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *WriteResponse) Reset() {
@@ -2500,22 +2526,21 @@ func (x *WriteResponse) GetCommitTime() *timestamppb.Timestamp {
// A request for [Firestore.Listen][google.firestore.v1.Firestore.Listen]
type ListenRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The database name. In the format:
// `projects/{project_id}/databases/{database_id}`.
Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
// The supported target changes.
//
- // Types that are assignable to TargetChange:
+ // Types that are valid to be assigned to TargetChange:
//
// *ListenRequest_AddTarget
// *ListenRequest_RemoveTarget
TargetChange isListenRequest_TargetChange `protobuf_oneof:"target_change"`
// Labels associated with this target change.
- Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ListenRequest) Reset() {
@@ -2555,23 +2580,27 @@ func (x *ListenRequest) GetDatabase() string {
return ""
}
-func (m *ListenRequest) GetTargetChange() isListenRequest_TargetChange {
- if m != nil {
- return m.TargetChange
+func (x *ListenRequest) GetTargetChange() isListenRequest_TargetChange {
+ if x != nil {
+ return x.TargetChange
}
return nil
}
func (x *ListenRequest) GetAddTarget() *Target {
- if x, ok := x.GetTargetChange().(*ListenRequest_AddTarget); ok {
- return x.AddTarget
+ if x != nil {
+ if x, ok := x.TargetChange.(*ListenRequest_AddTarget); ok {
+ return x.AddTarget
+ }
}
return nil
}
func (x *ListenRequest) GetRemoveTarget() int32 {
- if x, ok := x.GetTargetChange().(*ListenRequest_RemoveTarget); ok {
- return x.RemoveTarget
+ if x != nil {
+ if x, ok := x.TargetChange.(*ListenRequest_RemoveTarget); ok {
+ return x.RemoveTarget
+ }
}
return 0
}
@@ -2603,20 +2632,19 @@ func (*ListenRequest_RemoveTarget) isListenRequest_TargetChange() {}
// The response for [Firestore.Listen][google.firestore.v1.Firestore.Listen].
type ListenResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The supported responses.
//
- // Types that are assignable to ResponseType:
+ // Types that are valid to be assigned to ResponseType:
//
// *ListenResponse_TargetChange
// *ListenResponse_DocumentChange
// *ListenResponse_DocumentDelete
// *ListenResponse_DocumentRemove
// *ListenResponse_Filter
- ResponseType isListenResponse_ResponseType `protobuf_oneof:"response_type"`
+ ResponseType isListenResponse_ResponseType `protobuf_oneof:"response_type"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ListenResponse) Reset() {
@@ -2649,44 +2677,54 @@ func (*ListenResponse) Descriptor() ([]byte, []int) {
return file_google_firestore_v1_firestore_proto_rawDescGZIP(), []int{24}
}
-func (m *ListenResponse) GetResponseType() isListenResponse_ResponseType {
- if m != nil {
- return m.ResponseType
+func (x *ListenResponse) GetResponseType() isListenResponse_ResponseType {
+ if x != nil {
+ return x.ResponseType
}
return nil
}
func (x *ListenResponse) GetTargetChange() *TargetChange {
- if x, ok := x.GetResponseType().(*ListenResponse_TargetChange); ok {
- return x.TargetChange
+ if x != nil {
+ if x, ok := x.ResponseType.(*ListenResponse_TargetChange); ok {
+ return x.TargetChange
+ }
}
return nil
}
func (x *ListenResponse) GetDocumentChange() *DocumentChange {
- if x, ok := x.GetResponseType().(*ListenResponse_DocumentChange); ok {
- return x.DocumentChange
+ if x != nil {
+ if x, ok := x.ResponseType.(*ListenResponse_DocumentChange); ok {
+ return x.DocumentChange
+ }
}
return nil
}
func (x *ListenResponse) GetDocumentDelete() *DocumentDelete {
- if x, ok := x.GetResponseType().(*ListenResponse_DocumentDelete); ok {
- return x.DocumentDelete
+ if x != nil {
+ if x, ok := x.ResponseType.(*ListenResponse_DocumentDelete); ok {
+ return x.DocumentDelete
+ }
}
return nil
}
func (x *ListenResponse) GetDocumentRemove() *DocumentRemove {
- if x, ok := x.GetResponseType().(*ListenResponse_DocumentRemove); ok {
- return x.DocumentRemove
+ if x != nil {
+ if x, ok := x.ResponseType.(*ListenResponse_DocumentRemove); ok {
+ return x.DocumentRemove
+ }
}
return nil
}
func (x *ListenResponse) GetFilter() *ExistenceFilter {
- if x, ok := x.GetResponseType().(*ListenResponse_Filter); ok {
- return x.Filter
+ if x != nil {
+ if x, ok := x.ResponseType.(*ListenResponse_Filter); ok {
+ return x.Filter
+ }
}
return nil
}
@@ -2737,13 +2775,10 @@ func (*ListenResponse_Filter) isListenResponse_ResponseType() {}
// A specification of a set of documents to listen to.
type Target struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The type of target to listen to.
//
- // Types that are assignable to TargetType:
+ // Types that are valid to be assigned to TargetType:
//
// *Target_Query
// *Target_Documents
@@ -2754,7 +2789,7 @@ type Target struct {
// `resume_token` or `read_time` will be returned. Otherwise, all matching
// Documents are returned before any subsequent changes.
//
- // Types that are assignable to ResumeType:
+ // Types that are valid to be assigned to ResumeType:
//
// *Target_ResumeToken
// *Target_ReadTime
@@ -2786,6 +2821,8 @@ type Target struct {
// being present and greater than zero signals that the client wants
// `ExistenceFilter.unchanged_names` to be included in the response.
ExpectedCount *wrapperspb.Int32Value `protobuf:"bytes,12,opt,name=expected_count,json=expectedCount,proto3" json:"expected_count,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Target) Reset() {
@@ -2818,44 +2855,52 @@ func (*Target) Descriptor() ([]byte, []int) {
return file_google_firestore_v1_firestore_proto_rawDescGZIP(), []int{25}
}
-func (m *Target) GetTargetType() isTarget_TargetType {
- if m != nil {
- return m.TargetType
+func (x *Target) GetTargetType() isTarget_TargetType {
+ if x != nil {
+ return x.TargetType
}
return nil
}
func (x *Target) GetQuery() *Target_QueryTarget {
- if x, ok := x.GetTargetType().(*Target_Query); ok {
- return x.Query
+ if x != nil {
+ if x, ok := x.TargetType.(*Target_Query); ok {
+ return x.Query
+ }
}
return nil
}
func (x *Target) GetDocuments() *Target_DocumentsTarget {
- if x, ok := x.GetTargetType().(*Target_Documents); ok {
- return x.Documents
+ if x != nil {
+ if x, ok := x.TargetType.(*Target_Documents); ok {
+ return x.Documents
+ }
}
return nil
}
-func (m *Target) GetResumeType() isTarget_ResumeType {
- if m != nil {
- return m.ResumeType
+func (x *Target) GetResumeType() isTarget_ResumeType {
+ if x != nil {
+ return x.ResumeType
}
return nil
}
func (x *Target) GetResumeToken() []byte {
- if x, ok := x.GetResumeType().(*Target_ResumeToken); ok {
- return x.ResumeToken
+ if x != nil {
+ if x, ok := x.ResumeType.(*Target_ResumeToken); ok {
+ return x.ResumeToken
+ }
}
return nil
}
func (x *Target) GetReadTime() *timestamppb.Timestamp {
- if x, ok := x.GetResumeType().(*Target_ReadTime); ok {
- return x.ReadTime
+ if x != nil {
+ if x, ok := x.ResumeType.(*Target_ReadTime); ok {
+ return x.ReadTime
+ }
}
return nil
}
@@ -2924,10 +2969,7 @@ func (*Target_ReadTime) isTarget_ResumeType() {}
// Targets being watched have changed.
type TargetChange struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The type of change that occurred.
TargetChangeType TargetChange_TargetChangeType `protobuf:"varint,1,opt,name=target_change_type,json=targetChangeType,proto3,enum=google.firestore.v1.TargetChange_TargetChangeType" json:"target_change_type,omitempty"`
// The target IDs of targets that have changed.
@@ -2953,7 +2995,9 @@ type TargetChange struct {
//
// For a given stream, `read_time` is guaranteed to be monotonically
// increasing.
- ReadTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=read_time,json=readTime,proto3" json:"read_time,omitempty"`
+ ReadTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=read_time,json=readTime,proto3" json:"read_time,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *TargetChange) Reset() {
@@ -3024,10 +3068,7 @@ func (x *TargetChange) GetReadTime() *timestamppb.Timestamp {
// The request for
// [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds].
type ListCollectionIdsRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The parent document. In the format:
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
// For example:
@@ -3041,10 +3082,12 @@ type ListCollectionIdsRequest struct {
// The consistency mode for this request.
// If not set, defaults to strong consistency.
//
- // Types that are assignable to ConsistencySelector:
+ // Types that are valid to be assigned to ConsistencySelector:
//
// *ListCollectionIdsRequest_ReadTime
ConsistencySelector isListCollectionIdsRequest_ConsistencySelector `protobuf_oneof:"consistency_selector"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ListCollectionIdsRequest) Reset() {
@@ -3098,16 +3141,18 @@ func (x *ListCollectionIdsRequest) GetPageToken() string {
return ""
}
-func (m *ListCollectionIdsRequest) GetConsistencySelector() isListCollectionIdsRequest_ConsistencySelector {
- if m != nil {
- return m.ConsistencySelector
+func (x *ListCollectionIdsRequest) GetConsistencySelector() isListCollectionIdsRequest_ConsistencySelector {
+ if x != nil {
+ return x.ConsistencySelector
}
return nil
}
func (x *ListCollectionIdsRequest) GetReadTime() *timestamppb.Timestamp {
- if x, ok := x.GetConsistencySelector().(*ListCollectionIdsRequest_ReadTime); ok {
- return x.ReadTime
+ if x != nil {
+ if x, ok := x.ConsistencySelector.(*ListCollectionIdsRequest_ReadTime); ok {
+ return x.ReadTime
+ }
}
return nil
}
@@ -3130,14 +3175,13 @@ func (*ListCollectionIdsRequest_ReadTime) isListCollectionIdsRequest_Consistency
// The response from
// [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds].
type ListCollectionIdsResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The collection ids.
CollectionIds []string `protobuf:"bytes,1,rep,name=collection_ids,json=collectionIds,proto3" json:"collection_ids,omitempty"`
// A page token that may be used to continue the list.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ListCollectionIdsResponse) Reset() {
@@ -3187,10 +3231,7 @@ func (x *ListCollectionIdsResponse) GetNextPageToken() string {
// The request for
// [Firestore.BatchWrite][google.firestore.v1.Firestore.BatchWrite].
type BatchWriteRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. The database name. In the format:
// `projects/{project_id}/databases/{database_id}`.
Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
@@ -3201,7 +3242,9 @@ type BatchWriteRequest struct {
// document more than once per request.
Writes []*Write `protobuf:"bytes,2,rep,name=writes,proto3" json:"writes,omitempty"`
// Labels associated with this batch write.
- Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *BatchWriteRequest) Reset() {
@@ -3258,10 +3301,7 @@ func (x *BatchWriteRequest) GetLabels() map[string]string {
// The response from
// [Firestore.BatchWrite][google.firestore.v1.Firestore.BatchWrite].
type BatchWriteResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The result of applying the writes.
//
// This i-th write result corresponds to the i-th write in the
@@ -3271,7 +3311,9 @@ type BatchWriteResponse struct {
//
// This i-th write status corresponds to the i-th write in the
// request.
- Status []*status.Status `protobuf:"bytes,2,rep,name=status,proto3" json:"status,omitempty"`
+ Status []*status.Status `protobuf:"bytes,2,rep,name=status,proto3" json:"status,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *BatchWriteResponse) Reset() {
@@ -3320,15 +3362,14 @@ func (x *BatchWriteResponse) GetStatus() []*status.Status {
// A target specified by a set of documents names.
type Target_DocumentsTarget struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The names of the documents to retrieve. In the format:
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
// The request will fail if any of the document is not a child resource of
// the given `database`. Duplicate names will be elided.
- Documents []string `protobuf:"bytes,2,rep,name=documents,proto3" json:"documents,omitempty"`
+ Documents []string `protobuf:"bytes,2,rep,name=documents,proto3" json:"documents,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Target_DocumentsTarget) Reset() {
@@ -3370,10 +3411,7 @@ func (x *Target_DocumentsTarget) GetDocuments() []string {
// A target specified by a query.
type Target_QueryTarget struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The parent resource name. In the format:
// `projects/{project_id}/databases/{database_id}/documents` or
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
@@ -3383,10 +3421,12 @@ type Target_QueryTarget struct {
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// The query to run.
//
- // Types that are assignable to QueryType:
+ // Types that are valid to be assigned to QueryType:
//
// *Target_QueryTarget_StructuredQuery
- QueryType isTarget_QueryTarget_QueryType `protobuf_oneof:"query_type"`
+ QueryType isTarget_QueryTarget_QueryType `protobuf_oneof:"query_type"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Target_QueryTarget) Reset() {
@@ -3426,16 +3466,18 @@ func (x *Target_QueryTarget) GetParent() string {
return ""
}
-func (m *Target_QueryTarget) GetQueryType() isTarget_QueryTarget_QueryType {
- if m != nil {
- return m.QueryType
+func (x *Target_QueryTarget) GetQueryType() isTarget_QueryTarget_QueryType {
+ if x != nil {
+ return x.QueryType
}
return nil
}
func (x *Target_QueryTarget) GetStructuredQuery() *StructuredQuery {
- if x, ok := x.GetQueryType().(*Target_QueryTarget_StructuredQuery); ok {
- return x.StructuredQuery
+ if x != nil {
+ if x, ok := x.QueryType.(*Target_QueryTarget_StructuredQuery); ok {
+ return x.StructuredQuery
+ }
}
return nil
}
@@ -3453,792 +3495,255 @@ func (*Target_QueryTarget_StructuredQuery) isTarget_QueryTarget_QueryType() {}
var File_google_firestore_v1_firestore_proto protoreflect.FileDescriptor
-var file_google_firestore_v1_firestore_proto_rawDesc = []byte{
- 0x0a, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
- 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69,
- 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x1a, 0x18, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72,
- 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76,
- 0x31, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65,
- 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f,
- 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76,
- 0x31, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x1a, 0x27, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x73, 0x74,
- 0x61, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70,
- 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f,
- 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c,
- 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
- 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x72, 0x69,
- 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72,
- 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
- 0xdb, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
- 0x35, 0x0a, 0x04, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x73, 0x6b,
- 0x52, 0x04, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x22, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0b, 0x74,
- 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65,
- 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
- 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x61,
- 0x64, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x16, 0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74,
- 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x99, 0x03,
- 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x61, 0x72,
- 0x65, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f,
- 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52,
- 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x20, 0x0a,
- 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
- 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12,
- 0x22, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20,
- 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f,
- 0x6b, 0x65, 0x6e, 0x12, 0x1e, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18,
- 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65,
- 0x72, 0x42, 0x79, 0x12, 0x3a, 0x0a, 0x04, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
- 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x6d, 0x61, 0x73, 0x6b, 0x12,
- 0x22, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08,
- 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
- 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65,
- 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
- 0x6d, 0x70, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x21,
- 0x0a, 0x0c, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x18, 0x0c,
- 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e,
- 0x67, 0x42, 0x16, 0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79,
- 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x7c, 0x0a, 0x15, 0x4c, 0x69, 0x73,
- 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18,
- 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66,
- 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75,
- 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12,
- 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b,
- 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61,
- 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xf6, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61,
- 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
- 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x28,
- 0x0a, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x6c,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75,
- 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64,
- 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x3e, 0x0a, 0x08, 0x64, 0x6f, 0x63,
- 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52,
- 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x6d, 0x61, 0x73,
- 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f,
- 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x04, 0x6d, 0x61, 0x73, 0x6b,
- 0x22, 0xa0, 0x02, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d,
- 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x08, 0x64, 0x6f,
- 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02,
- 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x75, 0x70,
- 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61,
- 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x35,
- 0x0a, 0x04, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x52,
- 0x04, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x4c, 0x0a, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74,
- 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69,
- 0x6f, 0x6e, 0x52, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d,
- 0x65, 0x6e, 0x74, 0x22, 0x7e, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x63,
- 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04,
- 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52,
- 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4c, 0x0a, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74,
- 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69,
- 0x6f, 0x6e, 0x52, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d,
- 0x65, 0x6e, 0x74, 0x22, 0xdb, 0x02, 0x0a, 0x18, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74,
- 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x12, 0x1f, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
- 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02,
- 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12,
- 0x35, 0x0a, 0x04, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x73, 0x6b,
- 0x52, 0x04, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x22, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0b, 0x74,
- 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x0f, 0x6e, 0x65,
- 0x77, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x0e,
- 0x6e, 0x65, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39,
- 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52,
- 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x16, 0x0a, 0x14, 0x63, 0x6f, 0x6e,
- 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f,
- 0x72, 0x22, 0xd3, 0x01, 0x0a, 0x19, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x44, 0x6f,
- 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
- 0x35, 0x0a, 0x05, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d,
- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52,
- 0x05, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x07, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e,
- 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x69, 0x73, 0x73, 0x69,
- 0x6e, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
- 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d,
- 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74,
- 0x61, 0x6d, 0x70, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x08, 0x0a,
- 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x7d, 0x0a, 0x17, 0x42, 0x65, 0x67, 0x69, 0x6e,
- 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
- 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73,
- 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f,
- 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3c, 0x0a, 0x18, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x54,
- 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
- 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x86, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
- 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x64,
- 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x77, 0x72, 0x69, 0x74, 0x65,
- 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72,
- 0x69, 0x74, 0x65, 0x52, 0x06, 0x77, 0x72, 0x69, 0x74, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x74,
- 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c,
- 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x94, 0x01,
- 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
- 0x12, 0x45, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
- 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72,
- 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65,
- 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69,
- 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54,
- 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
- 0x54, 0x69, 0x6d, 0x65, 0x22, 0x59, 0x0a, 0x0f, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08,
- 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e,
- 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0,
- 0x41, 0x02, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22,
- 0xad, 0x03, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
- 0x12, 0x51, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x5f, 0x71,
- 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79,
- 0x48, 0x00, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75,
- 0x65, 0x72, 0x79, 0x12, 0x22, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e,
- 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x0f, 0x6e, 0x65, 0x77, 0x5f, 0x74,
- 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x01, 0x52, 0x0e, 0x6e, 0x65, 0x77,
- 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x09, 0x72,
- 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x08, 0x72, 0x65,
- 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69,
- 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x70, 0x74,
- 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x6c, 0x61,
- 0x69, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0c, 0x0a, 0x0a, 0x71, 0x75, 0x65,
- 0x72, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x16, 0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x73, 0x69,
- 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22,
- 0xce, 0x02, 0x0a, 0x10, 0x52, 0x75, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70,
- 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
- 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73,
- 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
- 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44,
- 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
- 0x74, 0x12, 0x37, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
- 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x6b,
- 0x69, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x04, 0x20,
- 0x01, 0x28, 0x05, 0x52, 0x0e, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x52, 0x65, 0x73, 0x75,
- 0x6c, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
- 0x08, 0x48, 0x00, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x12, 0x4c, 0x0a, 0x0f, 0x65, 0x78, 0x70,
- 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x0b, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e,
- 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e,
- 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x42, 0x17, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x74, 0x69,
- 0x6e, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72,
- 0x22, 0xf1, 0x02, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x50, 0x69, 0x70, 0x65,
- 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x08, 0x64,
- 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0,
- 0x41, 0x02, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x13,
- 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x5f, 0x70, 0x69, 0x70, 0x65, 0x6c,
- 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69,
- 0x6e, 0x65, 0x48, 0x00, 0x52, 0x12, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64,
- 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x22, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e,
- 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52,
- 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x0f,
- 0x6e, 0x65, 0x77, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18,
- 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66,
- 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e,
- 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x01,
- 0x52, 0x0e, 0x6e, 0x65, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48,
- 0x01, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0f, 0x0a, 0x0d, 0x70,
- 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x16, 0x0a, 0x14,
- 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x73, 0x65, 0x6c, 0x65,
- 0x63, 0x74, 0x6f, 0x72, 0x22, 0xff, 0x01, 0x0a, 0x17, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65,
- 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
- 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20,
- 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65,
- 0x6e, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x0e, 0x65,
- 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52,
- 0x0d, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x46,
- 0x0a, 0x0d, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18,
- 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66,
- 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6c,
- 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69,
- 0x6e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x22, 0xda, 0x03, 0x0a, 0x1a, 0x52, 0x75, 0x6e, 0x41, 0x67,
- 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65,
- 0x6e, 0x74, 0x12, 0x73, 0x0a, 0x1c, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64,
- 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x71, 0x75, 0x65,
- 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53,
- 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x1a, 0x73, 0x74, 0x72,
- 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x22, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73,
- 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x0b,
- 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x0f, 0x6e,
- 0x65, 0x77, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73,
- 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x01, 0x52,
- 0x0e, 0x6e, 0x65, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12,
- 0x39, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01,
- 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x65, 0x78,
- 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69,
- 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x65,
- 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0c, 0x0a,
- 0x0a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x16, 0x0a, 0x14, 0x63,
- 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63,
- 0x74, 0x6f, 0x72, 0x22, 0x86, 0x02, 0x0a, 0x1b, 0x52, 0x75, 0x6e, 0x41, 0x67, 0x67, 0x72, 0x65,
- 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f,
- 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73,
- 0x75, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69,
- 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73,
- 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4c,
- 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63,
- 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78,
- 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x0e, 0x65, 0x78,
- 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0xcd, 0x02, 0x0a,
- 0x15, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x61, 0x72,
- 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65,
- 0x64, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75,
- 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65,
- 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74,
- 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
- 0x0e, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12,
- 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1b,
- 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
- 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x39, 0x0a, 0x09, 0x72,
- 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x08, 0x72, 0x65,
- 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f,
- 0x74, 0x79, 0x70, 0x65, 0x42, 0x16, 0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65,
- 0x6e, 0x63, 0x79, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x7d, 0x0a, 0x16,
- 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65,
- 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74,
- 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69,
- 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65,
- 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65,
- 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xa5, 0x02, 0x0a, 0x0c,
- 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x08,
- 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03,
- 0xe0, 0x41, 0x02, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1b, 0x0a,
- 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x08, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x06, 0x77, 0x72,
- 0x69, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x06, 0x77, 0x72, 0x69, 0x74, 0x65, 0x73, 0x12, 0x21,
- 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04,
- 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x54, 0x6f, 0x6b, 0x65,
- 0x6e, 0x12, 0x45, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
- 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65,
- 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
- 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
- 0x02, 0x38, 0x01, 0x22, 0xd3, 0x01, 0x0a, 0x0d, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73,
- 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f,
- 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d,
- 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x74, 0x6f, 0x6b,
- 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d,
- 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x45, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x72,
- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0c,
- 0x77, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x3b, 0x0a, 0x0b,
- 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63,
- 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xa9, 0x02, 0x0a, 0x0d, 0x4c, 0x69,
- 0x73, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x08, 0x64,
- 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0,
- 0x41, 0x02, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0a,
- 0x61, 0x64, 0x64, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x00, 0x52,
- 0x09, 0x61, 0x64, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0d, 0x72, 0x65,
- 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x05, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65,
- 0x74, 0x12, 0x46, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72,
- 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62,
- 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
- 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
- 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x63,
- 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x9b, 0x03, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e,
- 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0d, 0x74, 0x61, 0x72, 0x67,
- 0x65, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e,
- 0x67, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e,
- 0x67, 0x65, 0x12, 0x4e, 0x0a, 0x0f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63,
- 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
- 0x48, 0x00, 0x52, 0x0e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e,
- 0x67, 0x65, 0x12, 0x4e, 0x0a, 0x0f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x64,
- 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
- 0x48, 0x00, 0x52, 0x0e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x65,
- 0x74, 0x65, 0x12, 0x4e, 0x0a, 0x0f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72,
- 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65,
- 0x48, 0x00, 0x52, 0x0e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6d, 0x6f,
- 0x76, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x65, 0x6e,
- 0x63, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74,
- 0x65, 0x72, 0x42, 0x0f, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74,
- 0x79, 0x70, 0x65, 0x22, 0xc3, 0x04, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x3f,
- 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79,
- 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x00, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12,
- 0x4b, 0x0a, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e,
- 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48,
- 0x00, 0x52, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x23, 0x0a, 0x0c,
- 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01,
- 0x28, 0x0c, 0x48, 0x01, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x54, 0x6f, 0x6b, 0x65,
- 0x6e, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
- 0x48, 0x01, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09,
- 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52,
- 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x6e, 0x63,
- 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x42, 0x0a,
- 0x0e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
- 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c,
- 0x75, 0x65, 0x52, 0x0d, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e,
- 0x74, 0x1a, 0x2f, 0x0a, 0x0f, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x54, 0x61,
- 0x72, 0x67, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
- 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
- 0x74, 0x73, 0x1a, 0x86, 0x01, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x72, 0x67,
- 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x10, 0x73, 0x74,
- 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63,
- 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x74,
- 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x0c, 0x0a,
- 0x0a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x74,
- 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x72, 0x65,
- 0x73, 0x75, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0xe5, 0x02, 0x0a, 0x0c, 0x54, 0x61,
- 0x72, 0x67, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x60, 0x0a, 0x12, 0x74, 0x61,
- 0x72, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x72,
- 0x67, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74,
- 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x10, 0x74, 0x61, 0x72, 0x67,
- 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a,
- 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05,
- 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x73, 0x12, 0x28, 0x0a, 0x05, 0x63,
- 0x61, 0x75, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x05,
- 0x63, 0x61, 0x75, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x5f,
- 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x72, 0x65, 0x73,
- 0x75, 0x6d, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x37, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64,
- 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
- 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d,
- 0x65, 0x22, 0x4e, 0x0a, 0x10, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67,
- 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x5f, 0x43, 0x48, 0x41, 0x4e,
- 0x47, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x44, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a,
- 0x06, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x55, 0x52,
- 0x52, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x45, 0x53, 0x45, 0x54, 0x10,
- 0x04, 0x22, 0xc6, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b,
- 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03,
- 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70,
- 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
- 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65,
- 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61,
- 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f,
- 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d,
- 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69,
- 0x6d, 0x65, 0x42, 0x16, 0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63,
- 0x79, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x6a, 0x0a, 0x19, 0x4c, 0x69,
- 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x52,
- 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52,
- 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x26,
- 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65,
- 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67,
- 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xef, 0x01, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x63, 0x68,
- 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x08,
- 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03,
- 0xe0, 0x41, 0x02, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x32, 0x0a,
- 0x06, 0x77, 0x72, 0x69, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x06, 0x77, 0x72, 0x69, 0x74, 0x65,
- 0x73, 0x12, 0x4a, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x57, 0x72, 0x69,
- 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73,
- 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a,
- 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
- 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
- 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76,
- 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x87, 0x01, 0x0a, 0x12, 0x42, 0x61, 0x74,
- 0x63, 0x68, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
- 0x45, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73,
- 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69,
- 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x52,
- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
- 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74,
- 0x75, 0x73, 0x32, 0xfb, 0x1b, 0x0a, 0x09, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x12, 0x8f, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
- 0x12, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65,
- 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32,
- 0x12, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73,
- 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x2a,
- 0x2a, 0x7d, 0x12, 0xf5, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d,
- 0x65, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44,
- 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65,
- 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8c, 0x01, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x85, 0x01, 0x5a, 0x3f, 0x12, 0x3d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61,
- 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f,
- 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75,
- 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x7d, 0x2f, 0x7b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x42, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72,
- 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64,
- 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d,
- 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x2a, 0x2a, 0x7d, 0x2f, 0x7b, 0x63, 0x6f, 0x6c, 0x6c,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xbf, 0x01, 0x0a, 0x0e, 0x55,
- 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65,
- 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x62, 0xda, 0x41, 0x14, 0x64, 0x6f, 0x63,
- 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73,
- 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x45, 0x3a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
- 0x74, 0x32, 0x39, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
- 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
- 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63,
- 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x2a, 0x2a, 0x7d, 0x12, 0x95, 0x01, 0x0a,
- 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12,
- 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75,
- 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
- 0x70, 0x74, 0x79, 0x22, 0x3f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93,
- 0x02, 0x32, 0x2a, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72,
- 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
- 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a,
- 0x2f, 0x2a, 0x2a, 0x7d, 0x12, 0xb9, 0x01, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65,
- 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2d, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
- 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
- 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02,
- 0x3d, 0x3a, 0x01, 0x2a, 0x22, 0x38, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64,
- 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75,
- 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x30, 0x01,
- 0x12, 0xc7, 0x01, 0x0a, 0x10, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66,
- 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x67, 0x69,
- 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x54,
- 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x22, 0x56, 0xda, 0x41, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x82,
- 0xd3, 0xe4, 0x93, 0x02, 0x45, 0x3a, 0x01, 0x2a, 0x22, 0x40, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x64,
- 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73,
- 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f,
- 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x54,
- 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xa6, 0x01, 0x0a, 0x06, 0x43,
- 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66,
- 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d,
- 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53,
- 0xda, 0x41, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2c, 0x77, 0x72, 0x69, 0x74,
- 0x65, 0x73, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x3a, 0x01, 0x2a, 0x22, 0x36, 0x2f, 0x76, 0x31,
- 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65,
- 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f,
- 0x2a, 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x63, 0x6f, 0x6d,
- 0x6d, 0x69, 0x74, 0x12, 0xa4, 0x01, 0x0a, 0x08, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b,
- 0x12, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x5a,
- 0xda, 0x41, 0x14, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2c, 0x74, 0x72, 0x61, 0x6e,
- 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x3a, 0x01, 0x2a,
- 0x22, 0x38, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x3d,
- 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
- 0x73, 0x3a, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0xdf, 0x01, 0x0a, 0x08, 0x52,
- 0x75, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75,
- 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70,
- 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x83, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x7d, 0x3a, 0x01, 0x2a,
- 0x5a, 0x40, 0x3a, 0x01, 0x2a, 0x22, 0x3b, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65,
- 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
- 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x2a, 0x2a, 0x7d, 0x3a, 0x72, 0x75, 0x6e, 0x51, 0x75, 0x65,
- 0x72, 0x79, 0x22, 0x36, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d,
- 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
- 0x7d, 0x3a, 0x72, 0x75, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x30, 0x01, 0x12, 0x9e, 0x02, 0x0a,
- 0x0f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65,
- 0x12, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x50, 0x69,
- 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x50, 0x69, 0x70, 0x65, 0x6c,
- 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xad, 0x01, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x44, 0x3a, 0x01, 0x2a, 0x22, 0x3f, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x64, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f,
- 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x64,
- 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65,
- 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x5d, 0x12, 0x26,
- 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1a, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64,
- 0x3d, 0x2a, 0x7d, 0x2f, 0x2a, 0x2a, 0x12, 0x33, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
- 0x73, 0x65, 0x12, 0x27, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64,
- 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
- 0x73, 0x65, 0x5f, 0x69, 0x64, 0x3d, 0x2a, 0x7d, 0x2f, 0x2a, 0x2a, 0x30, 0x01, 0x12, 0x97, 0x02,
- 0x0a, 0x13, 0x52, 0x75, 0x6e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66,
- 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x41,
- 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e,
- 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79,
- 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02,
- 0x93, 0x01, 0x3a, 0x01, 0x2a, 0x5a, 0x4b, 0x3a, 0x01, 0x2a, 0x22, 0x46, 0x2f, 0x76, 0x31, 0x2f,
- 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73,
- 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64,
- 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x2a, 0x2a, 0x7d, 0x3a, 0x72,
- 0x75, 0x6e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65,
- 0x72, 0x79, 0x22, 0x41, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d,
- 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
- 0x7d, 0x3a, 0x72, 0x75, 0x6e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x51, 0x75, 0x65, 0x72, 0x79, 0x30, 0x01, 0x12, 0xfc, 0x01, 0x0a, 0x0e, 0x50, 0x61, 0x72, 0x74,
- 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72,
- 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f,
- 0x6e, 0x73, 0x65, 0x22, 0x90, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x89, 0x01, 0x3a, 0x01, 0x2a,
- 0x5a, 0x46, 0x3a, 0x01, 0x2a, 0x22, 0x41, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65,
- 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
- 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x2a, 0x2a, 0x7d, 0x3a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74,
- 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x22, 0x3c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70,
- 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
- 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63,
- 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x7d, 0x3a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f,
- 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x94, 0x01, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65,
- 0x12, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52,
- 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x3a,
- 0x01, 0x2a, 0x22, 0x35, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
- 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74,
- 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
- 0x6e, 0x74, 0x73, 0x3a, 0x77, 0x72, 0x69, 0x74, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x98, 0x01,
- 0x0a, 0x06, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c,
- 0x69, 0x73, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
- 0x65, 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x3a, 0x01, 0x2a, 0x22, 0x36, 0x2f, 0x76,
- 0x31, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73,
- 0x2f, 0x2a, 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x6c, 0x69,
- 0x73, 0x74, 0x65, 0x6e, 0x28, 0x01, 0x30, 0x01, 0x12, 0x94, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73,
- 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x2d,
- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74,
- 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9f, 0x01,
- 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x8f, 0x01,
- 0x3a, 0x01, 0x2a, 0x5a, 0x49, 0x3a, 0x01, 0x2a, 0x22, 0x44, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70,
- 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
- 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63,
- 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x2a, 0x2a, 0x7d, 0x3a, 0x6c, 0x69, 0x73,
- 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x22, 0x3f,
- 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73,
- 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x7d, 0x3a, 0x6c, 0x69,
- 0x73, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12,
- 0xa4, 0x01, 0x0a, 0x0a, 0x42, 0x61, 0x74, 0x63, 0x68, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x26,
- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74,
- 0x63, 0x68, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
- 0x45, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3f, 0x3a, 0x01, 0x2a, 0x22, 0x3a, 0x2f, 0x76, 0x31, 0x2f,
- 0x7b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
- 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a,
- 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x62, 0x61, 0x74, 0x63,
- 0x68, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0xaf, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74,
- 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66,
- 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75,
- 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x52, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4c, 0x3a, 0x08, 0x64, 0x6f,
- 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x40, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72,
- 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x64,
- 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d,
- 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2a, 0x7d, 0x2f, 0x7b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x1a, 0x76, 0xca, 0x41, 0x18, 0x66, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69,
- 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x58, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f,
- 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63,
- 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x6c,
- 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77,
- 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f,
- 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x42, 0xbf, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x46, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b,
- 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
- 0x2f, 0x67, 0x6f, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70,
- 0x69, 0x76, 0x31, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x3b,
- 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0xaa, 0x02, 0x19, 0x47, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x46, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x5c, 0x56, 0x31, 0xea, 0x02, 0x1c, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c,
- 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3a, 0x3a,
- 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
+const file_google_firestore_v1_firestore_proto_rawDesc = "" +
+ "\n" +
+ "#google/firestore/v1/firestore.proto\x12\x13google.firestore.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x18google/api/routing.proto\x1a,google/firestore/v1/aggregation_result.proto\x1a google/firestore/v1/common.proto\x1a\"google/firestore/v1/document.proto\x1a'google/firestore/v1/explain_stats.proto\x1a\"google/firestore/v1/pipeline.proto\x1a\x1fgoogle/firestore/v1/query.proto\x1a'google/firestore/v1/query_profile.proto\x1a\x1fgoogle/firestore/v1/write.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x17google/rpc/status.proto\"\xdb\x01\n" +
+ "\x12GetDocumentRequest\x12\x17\n" +
+ "\x04name\x18\x01 \x01(\tB\x03\xe0A\x02R\x04name\x125\n" +
+ "\x04mask\x18\x02 \x01(\v2!.google.firestore.v1.DocumentMaskR\x04mask\x12\"\n" +
+ "\vtransaction\x18\x03 \x01(\fH\x00R\vtransaction\x129\n" +
+ "\tread_time\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampH\x00R\breadTimeB\x16\n" +
+ "\x14consistency_selector\"\x99\x03\n" +
+ "\x14ListDocumentsRequest\x12\x1b\n" +
+ "\x06parent\x18\x01 \x01(\tB\x03\xe0A\x02R\x06parent\x12(\n" +
+ "\rcollection_id\x18\x02 \x01(\tB\x03\xe0A\x01R\fcollectionId\x12 \n" +
+ "\tpage_size\x18\x03 \x01(\x05B\x03\xe0A\x01R\bpageSize\x12\"\n" +
+ "\n" +
+ "page_token\x18\x04 \x01(\tB\x03\xe0A\x01R\tpageToken\x12\x1e\n" +
+ "\border_by\x18\x06 \x01(\tB\x03\xe0A\x01R\aorderBy\x12:\n" +
+ "\x04mask\x18\a \x01(\v2!.google.firestore.v1.DocumentMaskB\x03\xe0A\x01R\x04mask\x12\"\n" +
+ "\vtransaction\x18\b \x01(\fH\x00R\vtransaction\x129\n" +
+ "\tread_time\x18\n" +
+ " \x01(\v2\x1a.google.protobuf.TimestampH\x00R\breadTime\x12!\n" +
+ "\fshow_missing\x18\f \x01(\bR\vshowMissingB\x16\n" +
+ "\x14consistency_selector\"|\n" +
+ "\x15ListDocumentsResponse\x12;\n" +
+ "\tdocuments\x18\x01 \x03(\v2\x1d.google.firestore.v1.DocumentR\tdocuments\x12&\n" +
+ "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\xf6\x01\n" +
+ "\x15CreateDocumentRequest\x12\x1b\n" +
+ "\x06parent\x18\x01 \x01(\tB\x03\xe0A\x02R\x06parent\x12(\n" +
+ "\rcollection_id\x18\x02 \x01(\tB\x03\xe0A\x02R\fcollectionId\x12\x1f\n" +
+ "\vdocument_id\x18\x03 \x01(\tR\n" +
+ "documentId\x12>\n" +
+ "\bdocument\x18\x04 \x01(\v2\x1d.google.firestore.v1.DocumentB\x03\xe0A\x02R\bdocument\x125\n" +
+ "\x04mask\x18\x05 \x01(\v2!.google.firestore.v1.DocumentMaskR\x04mask\"\xa0\x02\n" +
+ "\x15UpdateDocumentRequest\x12>\n" +
+ "\bdocument\x18\x01 \x01(\v2\x1d.google.firestore.v1.DocumentB\x03\xe0A\x02R\bdocument\x12B\n" +
+ "\vupdate_mask\x18\x02 \x01(\v2!.google.firestore.v1.DocumentMaskR\n" +
+ "updateMask\x125\n" +
+ "\x04mask\x18\x03 \x01(\v2!.google.firestore.v1.DocumentMaskR\x04mask\x12L\n" +
+ "\x10current_document\x18\x04 \x01(\v2!.google.firestore.v1.PreconditionR\x0fcurrentDocument\"~\n" +
+ "\x15DeleteDocumentRequest\x12\x17\n" +
+ "\x04name\x18\x01 \x01(\tB\x03\xe0A\x02R\x04name\x12L\n" +
+ "\x10current_document\x18\x02 \x01(\v2!.google.firestore.v1.PreconditionR\x0fcurrentDocument\"\xdb\x02\n" +
+ "\x18BatchGetDocumentsRequest\x12\x1f\n" +
+ "\bdatabase\x18\x01 \x01(\tB\x03\xe0A\x02R\bdatabase\x12\x1c\n" +
+ "\tdocuments\x18\x02 \x03(\tR\tdocuments\x125\n" +
+ "\x04mask\x18\x03 \x01(\v2!.google.firestore.v1.DocumentMaskR\x04mask\x12\"\n" +
+ "\vtransaction\x18\x04 \x01(\fH\x00R\vtransaction\x12R\n" +
+ "\x0fnew_transaction\x18\x05 \x01(\v2'.google.firestore.v1.TransactionOptionsH\x00R\x0enewTransaction\x129\n" +
+ "\tread_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampH\x00R\breadTimeB\x16\n" +
+ "\x14consistency_selector\"\xd3\x01\n" +
+ "\x19BatchGetDocumentsResponse\x125\n" +
+ "\x05found\x18\x01 \x01(\v2\x1d.google.firestore.v1.DocumentH\x00R\x05found\x12\x1a\n" +
+ "\amissing\x18\x02 \x01(\tH\x00R\amissing\x12 \n" +
+ "\vtransaction\x18\x03 \x01(\fR\vtransaction\x127\n" +
+ "\tread_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\breadTimeB\b\n" +
+ "\x06result\"}\n" +
+ "\x17BeginTransactionRequest\x12\x1f\n" +
+ "\bdatabase\x18\x01 \x01(\tB\x03\xe0A\x02R\bdatabase\x12A\n" +
+ "\aoptions\x18\x02 \x01(\v2'.google.firestore.v1.TransactionOptionsR\aoptions\"<\n" +
+ "\x18BeginTransactionResponse\x12 \n" +
+ "\vtransaction\x18\x01 \x01(\fR\vtransaction\"\x86\x01\n" +
+ "\rCommitRequest\x12\x1f\n" +
+ "\bdatabase\x18\x01 \x01(\tB\x03\xe0A\x02R\bdatabase\x122\n" +
+ "\x06writes\x18\x02 \x03(\v2\x1a.google.firestore.v1.WriteR\x06writes\x12 \n" +
+ "\vtransaction\x18\x03 \x01(\fR\vtransaction\"\x94\x01\n" +
+ "\x0eCommitResponse\x12E\n" +
+ "\rwrite_results\x18\x01 \x03(\v2 .google.firestore.v1.WriteResultR\fwriteResults\x12;\n" +
+ "\vcommit_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\n" +
+ "commitTime\"Y\n" +
+ "\x0fRollbackRequest\x12\x1f\n" +
+ "\bdatabase\x18\x01 \x01(\tB\x03\xe0A\x02R\bdatabase\x12%\n" +
+ "\vtransaction\x18\x02 \x01(\fB\x03\xe0A\x02R\vtransaction\"\xad\x03\n" +
+ "\x0fRunQueryRequest\x12\x1b\n" +
+ "\x06parent\x18\x01 \x01(\tB\x03\xe0A\x02R\x06parent\x12Q\n" +
+ "\x10structured_query\x18\x02 \x01(\v2$.google.firestore.v1.StructuredQueryH\x00R\x0fstructuredQuery\x12\"\n" +
+ "\vtransaction\x18\x05 \x01(\fH\x01R\vtransaction\x12R\n" +
+ "\x0fnew_transaction\x18\x06 \x01(\v2'.google.firestore.v1.TransactionOptionsH\x01R\x0enewTransaction\x129\n" +
+ "\tread_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampH\x01R\breadTime\x12Q\n" +
+ "\x0fexplain_options\x18\n" +
+ " \x01(\v2#.google.firestore.v1.ExplainOptionsB\x03\xe0A\x01R\x0eexplainOptionsB\f\n" +
+ "\n" +
+ "query_typeB\x16\n" +
+ "\x14consistency_selector\"\xce\x02\n" +
+ "\x10RunQueryResponse\x12 \n" +
+ "\vtransaction\x18\x02 \x01(\fR\vtransaction\x129\n" +
+ "\bdocument\x18\x01 \x01(\v2\x1d.google.firestore.v1.DocumentR\bdocument\x127\n" +
+ "\tread_time\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\breadTime\x12'\n" +
+ "\x0fskipped_results\x18\x04 \x01(\x05R\x0eskippedResults\x12\x14\n" +
+ "\x04done\x18\x06 \x01(\bH\x00R\x04done\x12L\n" +
+ "\x0fexplain_metrics\x18\v \x01(\v2#.google.firestore.v1.ExplainMetricsR\x0eexplainMetricsB\x17\n" +
+ "\x15continuation_selector\"\xf1\x02\n" +
+ "\x16ExecutePipelineRequest\x12\x1f\n" +
+ "\bdatabase\x18\x01 \x01(\tB\x03\xe0A\x02R\bdatabase\x12Z\n" +
+ "\x13structured_pipeline\x18\x02 \x01(\v2'.google.firestore.v1.StructuredPipelineH\x00R\x12structuredPipeline\x12\"\n" +
+ "\vtransaction\x18\x05 \x01(\fH\x01R\vtransaction\x12R\n" +
+ "\x0fnew_transaction\x18\x06 \x01(\v2'.google.firestore.v1.TransactionOptionsH\x01R\x0enewTransaction\x129\n" +
+ "\tread_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampH\x01R\breadTimeB\x0f\n" +
+ "\rpipeline_typeB\x16\n" +
+ "\x14consistency_selector\"\xff\x01\n" +
+ "\x17ExecutePipelineResponse\x12 \n" +
+ "\vtransaction\x18\x01 \x01(\fR\vtransaction\x127\n" +
+ "\aresults\x18\x02 \x03(\v2\x1d.google.firestore.v1.DocumentR\aresults\x12A\n" +
+ "\x0eexecution_time\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\rexecutionTime\x12F\n" +
+ "\rexplain_stats\x18\x04 \x01(\v2!.google.firestore.v1.ExplainStatsR\fexplainStats\"\xda\x03\n" +
+ "\x1aRunAggregationQueryRequest\x12\x1b\n" +
+ "\x06parent\x18\x01 \x01(\tB\x03\xe0A\x02R\x06parent\x12s\n" +
+ "\x1cstructured_aggregation_query\x18\x02 \x01(\v2/.google.firestore.v1.StructuredAggregationQueryH\x00R\x1astructuredAggregationQuery\x12\"\n" +
+ "\vtransaction\x18\x04 \x01(\fH\x01R\vtransaction\x12R\n" +
+ "\x0fnew_transaction\x18\x05 \x01(\v2'.google.firestore.v1.TransactionOptionsH\x01R\x0enewTransaction\x129\n" +
+ "\tread_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampH\x01R\breadTime\x12Q\n" +
+ "\x0fexplain_options\x18\b \x01(\v2#.google.firestore.v1.ExplainOptionsB\x03\xe0A\x01R\x0eexplainOptionsB\f\n" +
+ "\n" +
+ "query_typeB\x16\n" +
+ "\x14consistency_selector\"\x86\x02\n" +
+ "\x1bRunAggregationQueryResponse\x12>\n" +
+ "\x06result\x18\x01 \x01(\v2&.google.firestore.v1.AggregationResultR\x06result\x12 \n" +
+ "\vtransaction\x18\x02 \x01(\fR\vtransaction\x127\n" +
+ "\tread_time\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\breadTime\x12L\n" +
+ "\x0fexplain_metrics\x18\n" +
+ " \x01(\v2#.google.firestore.v1.ExplainMetricsR\x0eexplainMetrics\"\xcd\x02\n" +
+ "\x15PartitionQueryRequest\x12\x1b\n" +
+ "\x06parent\x18\x01 \x01(\tB\x03\xe0A\x02R\x06parent\x12Q\n" +
+ "\x10structured_query\x18\x02 \x01(\v2$.google.firestore.v1.StructuredQueryH\x00R\x0fstructuredQuery\x12'\n" +
+ "\x0fpartition_count\x18\x03 \x01(\x03R\x0epartitionCount\x12\x1d\n" +
+ "\n" +
+ "page_token\x18\x04 \x01(\tR\tpageToken\x12\x1b\n" +
+ "\tpage_size\x18\x05 \x01(\x05R\bpageSize\x129\n" +
+ "\tread_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampH\x01R\breadTimeB\f\n" +
+ "\n" +
+ "query_typeB\x16\n" +
+ "\x14consistency_selector\"}\n" +
+ "\x16PartitionQueryResponse\x12;\n" +
+ "\n" +
+ "partitions\x18\x01 \x03(\v2\x1b.google.firestore.v1.CursorR\n" +
+ "partitions\x12&\n" +
+ "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\xa5\x02\n" +
+ "\fWriteRequest\x12\x1f\n" +
+ "\bdatabase\x18\x01 \x01(\tB\x03\xe0A\x02R\bdatabase\x12\x1b\n" +
+ "\tstream_id\x18\x02 \x01(\tR\bstreamId\x122\n" +
+ "\x06writes\x18\x03 \x03(\v2\x1a.google.firestore.v1.WriteR\x06writes\x12!\n" +
+ "\fstream_token\x18\x04 \x01(\fR\vstreamToken\x12E\n" +
+ "\x06labels\x18\x05 \x03(\v2-.google.firestore.v1.WriteRequest.LabelsEntryR\x06labels\x1a9\n" +
+ "\vLabelsEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
+ "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xd3\x01\n" +
+ "\rWriteResponse\x12\x1b\n" +
+ "\tstream_id\x18\x01 \x01(\tR\bstreamId\x12!\n" +
+ "\fstream_token\x18\x02 \x01(\fR\vstreamToken\x12E\n" +
+ "\rwrite_results\x18\x03 \x03(\v2 .google.firestore.v1.WriteResultR\fwriteResults\x12;\n" +
+ "\vcommit_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\n" +
+ "commitTime\"\xa9\x02\n" +
+ "\rListenRequest\x12\x1f\n" +
+ "\bdatabase\x18\x01 \x01(\tB\x03\xe0A\x02R\bdatabase\x12<\n" +
+ "\n" +
+ "add_target\x18\x02 \x01(\v2\x1b.google.firestore.v1.TargetH\x00R\taddTarget\x12%\n" +
+ "\rremove_target\x18\x03 \x01(\x05H\x00R\fremoveTarget\x12F\n" +
+ "\x06labels\x18\x04 \x03(\v2..google.firestore.v1.ListenRequest.LabelsEntryR\x06labels\x1a9\n" +
+ "\vLabelsEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
+ "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\x0f\n" +
+ "\rtarget_change\"\x9b\x03\n" +
+ "\x0eListenResponse\x12H\n" +
+ "\rtarget_change\x18\x02 \x01(\v2!.google.firestore.v1.TargetChangeH\x00R\ftargetChange\x12N\n" +
+ "\x0fdocument_change\x18\x03 \x01(\v2#.google.firestore.v1.DocumentChangeH\x00R\x0edocumentChange\x12N\n" +
+ "\x0fdocument_delete\x18\x04 \x01(\v2#.google.firestore.v1.DocumentDeleteH\x00R\x0edocumentDelete\x12N\n" +
+ "\x0fdocument_remove\x18\x06 \x01(\v2#.google.firestore.v1.DocumentRemoveH\x00R\x0edocumentRemove\x12>\n" +
+ "\x06filter\x18\x05 \x01(\v2$.google.firestore.v1.ExistenceFilterH\x00R\x06filterB\x0f\n" +
+ "\rresponse_type\"\xc3\x04\n" +
+ "\x06Target\x12?\n" +
+ "\x05query\x18\x02 \x01(\v2'.google.firestore.v1.Target.QueryTargetH\x00R\x05query\x12K\n" +
+ "\tdocuments\x18\x03 \x01(\v2+.google.firestore.v1.Target.DocumentsTargetH\x00R\tdocuments\x12#\n" +
+ "\fresume_token\x18\x04 \x01(\fH\x01R\vresumeToken\x129\n" +
+ "\tread_time\x18\v \x01(\v2\x1a.google.protobuf.TimestampH\x01R\breadTime\x12\x1b\n" +
+ "\ttarget_id\x18\x05 \x01(\x05R\btargetId\x12\x12\n" +
+ "\x04once\x18\x06 \x01(\bR\x04once\x12B\n" +
+ "\x0eexpected_count\x18\f \x01(\v2\x1b.google.protobuf.Int32ValueR\rexpectedCount\x1a/\n" +
+ "\x0fDocumentsTarget\x12\x1c\n" +
+ "\tdocuments\x18\x02 \x03(\tR\tdocuments\x1a\x86\x01\n" +
+ "\vQueryTarget\x12\x16\n" +
+ "\x06parent\x18\x01 \x01(\tR\x06parent\x12Q\n" +
+ "\x10structured_query\x18\x02 \x01(\v2$.google.firestore.v1.StructuredQueryH\x00R\x0fstructuredQueryB\f\n" +
+ "\n" +
+ "query_typeB\r\n" +
+ "\vtarget_typeB\r\n" +
+ "\vresume_type\"\xe5\x02\n" +
+ "\fTargetChange\x12`\n" +
+ "\x12target_change_type\x18\x01 \x01(\x0e22.google.firestore.v1.TargetChange.TargetChangeTypeR\x10targetChangeType\x12\x1d\n" +
+ "\n" +
+ "target_ids\x18\x02 \x03(\x05R\ttargetIds\x12(\n" +
+ "\x05cause\x18\x03 \x01(\v2\x12.google.rpc.StatusR\x05cause\x12!\n" +
+ "\fresume_token\x18\x04 \x01(\fR\vresumeToken\x127\n" +
+ "\tread_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\breadTime\"N\n" +
+ "\x10TargetChangeType\x12\r\n" +
+ "\tNO_CHANGE\x10\x00\x12\a\n" +
+ "\x03ADD\x10\x01\x12\n" +
+ "\n" +
+ "\x06REMOVE\x10\x02\x12\v\n" +
+ "\aCURRENT\x10\x03\x12\t\n" +
+ "\x05RESET\x10\x04\"\xc6\x01\n" +
+ "\x18ListCollectionIdsRequest\x12\x1b\n" +
+ "\x06parent\x18\x01 \x01(\tB\x03\xe0A\x02R\x06parent\x12\x1b\n" +
+ "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" +
+ "\n" +
+ "page_token\x18\x03 \x01(\tR\tpageToken\x129\n" +
+ "\tread_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampH\x00R\breadTimeB\x16\n" +
+ "\x14consistency_selector\"j\n" +
+ "\x19ListCollectionIdsResponse\x12%\n" +
+ "\x0ecollection_ids\x18\x01 \x03(\tR\rcollectionIds\x12&\n" +
+ "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\xef\x01\n" +
+ "\x11BatchWriteRequest\x12\x1f\n" +
+ "\bdatabase\x18\x01 \x01(\tB\x03\xe0A\x02R\bdatabase\x122\n" +
+ "\x06writes\x18\x02 \x03(\v2\x1a.google.firestore.v1.WriteR\x06writes\x12J\n" +
+ "\x06labels\x18\x03 \x03(\v22.google.firestore.v1.BatchWriteRequest.LabelsEntryR\x06labels\x1a9\n" +
+ "\vLabelsEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
+ "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x87\x01\n" +
+ "\x12BatchWriteResponse\x12E\n" +
+ "\rwrite_results\x18\x01 \x03(\v2 .google.firestore.v1.WriteResultR\fwriteResults\x12*\n" +
+ "\x06status\x18\x02 \x03(\v2\x12.google.rpc.StatusR\x06status2\xfb\x1b\n" +
+ "\tFirestore\x12\x8f\x01\n" +
+ "\vGetDocument\x12'.google.firestore.v1.GetDocumentRequest\x1a\x1d.google.firestore.v1.Document\"8\x82\xd3\xe4\x93\x022\x120/v1/{name=projects/*/databases/*/documents/*/**}\x12\xf5\x01\n" +
+ "\rListDocuments\x12).google.firestore.v1.ListDocumentsRequest\x1a*.google.firestore.v1.ListDocumentsResponse\"\x8c\x01\x82\xd3\xe4\x93\x02\x85\x01Z?\x12=/v1/{parent=projects/*/databases/*/documents}/{collection_id}\x12B/v1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}\x12\xbf\x01\n" +
+ "\x0eUpdateDocument\x12*.google.firestore.v1.UpdateDocumentRequest\x1a\x1d.google.firestore.v1.Document\"b\xdaA\x14document,update_mask\x82\xd3\xe4\x93\x02E:\bdocument29/v1/{document.name=projects/*/databases/*/documents/*/**}\x12\x95\x01\n" +
+ "\x0eDeleteDocument\x12*.google.firestore.v1.DeleteDocumentRequest\x1a\x16.google.protobuf.Empty\"?\xdaA\x04name\x82\xd3\xe4\x93\x022*0/v1/{name=projects/*/databases/*/documents/*/**}\x12\xb9\x01\n" +
+ "\x11BatchGetDocuments\x12-.google.firestore.v1.BatchGetDocumentsRequest\x1a..google.firestore.v1.BatchGetDocumentsResponse\"C\x82\xd3\xe4\x93\x02=:\x01*\"8/v1/{database=projects/*/databases/*}/documents:batchGet0\x01\x12\xc7\x01\n" +
+ "\x10BeginTransaction\x12,.google.firestore.v1.BeginTransactionRequest\x1a-.google.firestore.v1.BeginTransactionResponse\"V\xdaA\bdatabase\x82\xd3\xe4\x93\x02E:\x01*\"@/v1/{database=projects/*/databases/*}/documents:beginTransaction\x12\xa6\x01\n" +
+ "\x06Commit\x12\".google.firestore.v1.CommitRequest\x1a#.google.firestore.v1.CommitResponse\"S\xdaA\x0fdatabase,writes\x82\xd3\xe4\x93\x02;:\x01*\"6/v1/{database=projects/*/databases/*}/documents:commit\x12\xa4\x01\n" +
+ "\bRollback\x12$.google.firestore.v1.RollbackRequest\x1a\x16.google.protobuf.Empty\"Z\xdaA\x14database,transaction\x82\xd3\xe4\x93\x02=:\x01*\"8/v1/{database=projects/*/databases/*}/documents:rollback\x12\xdf\x01\n" +
+ "\bRunQuery\x12$.google.firestore.v1.RunQueryRequest\x1a%.google.firestore.v1.RunQueryResponse\"\x83\x01\x82\xd3\xe4\x93\x02}:\x01*Z@:\x01*\";/v1/{parent=projects/*/databases/*/documents/*/**}:runQuery\"6/v1/{parent=projects/*/databases/*/documents}:runQuery0\x01\x12\x9e\x02\n" +
+ "\x0fExecutePipeline\x12+.google.firestore.v1.ExecutePipelineRequest\x1a,.google.firestore.v1.ExecutePipelineResponse\"\xad\x01\x82\xd3\xe4\x93\x02D:\x01*\"?/v1/{database=projects/*/databases/*}/documents:executePipeline\x8a\xd3\xe4\x93\x02]\x12&\n" +
+ "\bdatabase\x12\x1aprojects/{project_id=*}/**\x123\n" +
+ "\bdatabase\x12'projects/*/databases/{database_id=*}/**0\x01\x12\x97\x02\n" +
+ "\x13RunAggregationQuery\x12/.google.firestore.v1.RunAggregationQueryRequest\x1a0.google.firestore.v1.RunAggregationQueryResponse\"\x9a\x01\x82\xd3\xe4\x93\x02\x93\x01:\x01*ZK:\x01*\"F/v1/{parent=projects/*/databases/*/documents/*/**}:runAggregationQuery\"A/v1/{parent=projects/*/databases/*/documents}:runAggregationQuery0\x01\x12\xfc\x01\n" +
+ "\x0ePartitionQuery\x12*.google.firestore.v1.PartitionQueryRequest\x1a+.google.firestore.v1.PartitionQueryResponse\"\x90\x01\x82\xd3\xe4\x93\x02\x89\x01:\x01*ZF:\x01*\"A/v1/{parent=projects/*/databases/*/documents/*/**}:partitionQuery\"\n" +
+ "\bpipeline\x18\x01 \x01(\v2\x1d.google.firestore.v1.PipelineB\x03\xe0A\x02R\bpipeline\x12S\n" +
+ "\aoptions\x18\x02 \x03(\v24.google.firestore.v1.StructuredPipeline.OptionsEntryB\x03\xe0A\x01R\aoptions\x1aV\n" +
+ "\fOptionsEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\tR\x03key\x120\n" +
+ "\x05value\x18\x02 \x01(\v2\x1a.google.firestore.v1.ValueR\x05value:\x028\x01B\xc5\x01\n" +
+ "\x17com.google.firestore.v1B\rPipelineProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3"
var (
file_google_firestore_v1_pipeline_proto_rawDescOnce sync.Once
- file_google_firestore_v1_pipeline_proto_rawDescData = file_google_firestore_v1_pipeline_proto_rawDesc
+ file_google_firestore_v1_pipeline_proto_rawDescData []byte
)
func file_google_firestore_v1_pipeline_proto_rawDescGZIP() []byte {
file_google_firestore_v1_pipeline_proto_rawDescOnce.Do(func() {
- file_google_firestore_v1_pipeline_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_firestore_v1_pipeline_proto_rawDescData)
+ file_google_firestore_v1_pipeline_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_firestore_v1_pipeline_proto_rawDesc), len(file_google_firestore_v1_pipeline_proto_rawDesc)))
})
return file_google_firestore_v1_pipeline_proto_rawDescData
}
@@ -179,7 +149,7 @@ func file_google_firestore_v1_pipeline_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_google_firestore_v1_pipeline_proto_rawDesc,
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_firestore_v1_pipeline_proto_rawDesc), len(file_google_firestore_v1_pipeline_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
@@ -190,7 +160,6 @@ func file_google_firestore_v1_pipeline_proto_init() {
MessageInfos: file_google_firestore_v1_pipeline_proto_msgTypes,
}.Build()
File_google_firestore_v1_pipeline_proto = out.File
- file_google_firestore_v1_pipeline_proto_rawDesc = nil
file_google_firestore_v1_pipeline_proto_goTypes = nil
file_google_firestore_v1_pipeline_proto_depIdxs = nil
}
diff --git a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/query.pb.go b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/query.pb.go
index f1fcc8f5ff..889f94fae4 100644
--- a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/query.pb.go
+++ b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/query.pb.go
@@ -1,4 +1,4 @@
-// Copyright 2025 Google LLC
+// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.35.2
-// protoc v4.25.7
+// protoc-gen-go v1.36.11
+// protoc v6.31.0
// source: google/firestore/v1/query.proto
package firestorepb
@@ -23,6 +23,7 @@ package firestorepb
import (
reflect "reflect"
sync "sync"
+ unsafe "unsafe"
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -421,10 +422,7 @@ func (StructuredQuery_FindNearest_DistanceMeasure) EnumDescriptor() ([]byte, []i
// 6. limit
// 7. find_nearest
type StructuredQuery struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Optional sub-set of the fields to return.
//
// This acts as a [DocumentMask][google.firestore.v1.DocumentMask] over the
@@ -520,7 +518,9 @@ type StructuredQuery struct {
// Applies after all other filters and ordering.
//
// Finds the closest vector embeddings to the given query vector.
- FindNearest *StructuredQuery_FindNearest `protobuf:"bytes,9,opt,name=find_nearest,json=findNearest,proto3" json:"find_nearest,omitempty"`
+ FindNearest *StructuredQuery_FindNearest `protobuf:"bytes,9,opt,name=find_nearest,json=findNearest,proto3" json:"find_nearest,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredQuery) Reset() {
@@ -619,13 +619,10 @@ func (x *StructuredQuery) GetFindNearest() *StructuredQuery_FindNearest {
// Firestore query for running an aggregation over a
// [StructuredQuery][google.firestore.v1.StructuredQuery].
type StructuredAggregationQuery struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The base query to aggregate over.
//
- // Types that are assignable to QueryType:
+ // Types that are valid to be assigned to QueryType:
//
// *StructuredAggregationQuery_StructuredQuery
QueryType isStructuredAggregationQuery_QueryType `protobuf_oneof:"query_type"`
@@ -635,7 +632,9 @@ type StructuredAggregationQuery struct {
// Requires:
//
// * A minimum of one and maximum of five aggregations per query.
- Aggregations []*StructuredAggregationQuery_Aggregation `protobuf:"bytes,3,rep,name=aggregations,proto3" json:"aggregations,omitempty"`
+ Aggregations []*StructuredAggregationQuery_Aggregation `protobuf:"bytes,3,rep,name=aggregations,proto3" json:"aggregations,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredAggregationQuery) Reset() {
@@ -668,16 +667,18 @@ func (*StructuredAggregationQuery) Descriptor() ([]byte, []int) {
return file_google_firestore_v1_query_proto_rawDescGZIP(), []int{1}
}
-func (m *StructuredAggregationQuery) GetQueryType() isStructuredAggregationQuery_QueryType {
- if m != nil {
- return m.QueryType
+func (x *StructuredAggregationQuery) GetQueryType() isStructuredAggregationQuery_QueryType {
+ if x != nil {
+ return x.QueryType
}
return nil
}
func (x *StructuredAggregationQuery) GetStructuredQuery() *StructuredQuery {
- if x, ok := x.GetQueryType().(*StructuredAggregationQuery_StructuredQuery); ok {
- return x.StructuredQuery
+ if x != nil {
+ if x, ok := x.QueryType.(*StructuredAggregationQuery_StructuredQuery); ok {
+ return x.StructuredQuery
+ }
}
return nil
}
@@ -702,10 +703,7 @@ func (*StructuredAggregationQuery_StructuredQuery) isStructuredAggregationQuery_
// A position in a query result set.
type Cursor struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The values that represent a position, in the order they appear in
// the order by clause of a query.
//
@@ -713,7 +711,9 @@ type Cursor struct {
Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
// If the position is just before or just after the given values, relative
// to the sort order defined by the query.
- Before bool `protobuf:"varint,2,opt,name=before,proto3" json:"before,omitempty"`
+ Before bool `protobuf:"varint,2,opt,name=before,proto3" json:"before,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Cursor) Reset() {
@@ -762,10 +762,7 @@ func (x *Cursor) GetBefore() bool {
// A selection of a collection, such as `messages as m1`.
type StructuredQuery_CollectionSelector struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The collection ID.
// When set, selects only collections with this ID.
CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"`
@@ -773,6 +770,8 @@ type StructuredQuery_CollectionSelector struct {
// the `parent` specified in the containing `RunQueryRequest`.
// When true, selects all descendant collections.
AllDescendants bool `protobuf:"varint,3,opt,name=all_descendants,json=allDescendants,proto3" json:"all_descendants,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredQuery_CollectionSelector) Reset() {
@@ -821,18 +820,17 @@ func (x *StructuredQuery_CollectionSelector) GetAllDescendants() bool {
// A filter.
type StructuredQuery_Filter struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The type of filter.
//
- // Types that are assignable to FilterType:
+ // Types that are valid to be assigned to FilterType:
//
// *StructuredQuery_Filter_CompositeFilter
// *StructuredQuery_Filter_FieldFilter
// *StructuredQuery_Filter_UnaryFilter
- FilterType isStructuredQuery_Filter_FilterType `protobuf_oneof:"filter_type"`
+ FilterType isStructuredQuery_Filter_FilterType `protobuf_oneof:"filter_type"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredQuery_Filter) Reset() {
@@ -865,30 +863,36 @@ func (*StructuredQuery_Filter) Descriptor() ([]byte, []int) {
return file_google_firestore_v1_query_proto_rawDescGZIP(), []int{0, 1}
}
-func (m *StructuredQuery_Filter) GetFilterType() isStructuredQuery_Filter_FilterType {
- if m != nil {
- return m.FilterType
+func (x *StructuredQuery_Filter) GetFilterType() isStructuredQuery_Filter_FilterType {
+ if x != nil {
+ return x.FilterType
}
return nil
}
func (x *StructuredQuery_Filter) GetCompositeFilter() *StructuredQuery_CompositeFilter {
- if x, ok := x.GetFilterType().(*StructuredQuery_Filter_CompositeFilter); ok {
- return x.CompositeFilter
+ if x != nil {
+ if x, ok := x.FilterType.(*StructuredQuery_Filter_CompositeFilter); ok {
+ return x.CompositeFilter
+ }
}
return nil
}
func (x *StructuredQuery_Filter) GetFieldFilter() *StructuredQuery_FieldFilter {
- if x, ok := x.GetFilterType().(*StructuredQuery_Filter_FieldFilter); ok {
- return x.FieldFilter
+ if x != nil {
+ if x, ok := x.FilterType.(*StructuredQuery_Filter_FieldFilter); ok {
+ return x.FieldFilter
+ }
}
return nil
}
func (x *StructuredQuery_Filter) GetUnaryFilter() *StructuredQuery_UnaryFilter {
- if x, ok := x.GetFilterType().(*StructuredQuery_Filter_UnaryFilter); ok {
- return x.UnaryFilter
+ if x != nil {
+ if x, ok := x.FilterType.(*StructuredQuery_Filter_UnaryFilter); ok {
+ return x.UnaryFilter
+ }
}
return nil
}
@@ -920,10 +924,7 @@ func (*StructuredQuery_Filter_UnaryFilter) isStructuredQuery_Filter_FilterType()
// A filter that merges multiple other filters using the given operator.
type StructuredQuery_CompositeFilter struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The operator for combining multiple filters.
Op StructuredQuery_CompositeFilter_Operator `protobuf:"varint,1,opt,name=op,proto3,enum=google.firestore.v1.StructuredQuery_CompositeFilter_Operator" json:"op,omitempty"`
// The list of filters to combine.
@@ -931,7 +932,9 @@ type StructuredQuery_CompositeFilter struct {
// Requires:
//
// * At least one filter is present.
- Filters []*StructuredQuery_Filter `protobuf:"bytes,2,rep,name=filters,proto3" json:"filters,omitempty"`
+ Filters []*StructuredQuery_Filter `protobuf:"bytes,2,rep,name=filters,proto3" json:"filters,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredQuery_CompositeFilter) Reset() {
@@ -980,16 +983,15 @@ func (x *StructuredQuery_CompositeFilter) GetFilters() []*StructuredQuery_Filter
// A filter on a specific field.
type StructuredQuery_FieldFilter struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The field to filter by.
Field *StructuredQuery_FieldReference `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
// The operator to filter by.
Op StructuredQuery_FieldFilter_Operator `protobuf:"varint,2,opt,name=op,proto3,enum=google.firestore.v1.StructuredQuery_FieldFilter_Operator" json:"op,omitempty"`
// The value to compare to.
- Value *Value `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
+ Value *Value `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredQuery_FieldFilter) Reset() {
@@ -1045,18 +1047,17 @@ func (x *StructuredQuery_FieldFilter) GetValue() *Value {
// A filter with a single operand.
type StructuredQuery_UnaryFilter struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The unary operator to apply.
Op StructuredQuery_UnaryFilter_Operator `protobuf:"varint,1,opt,name=op,proto3,enum=google.firestore.v1.StructuredQuery_UnaryFilter_Operator" json:"op,omitempty"`
// The argument to the filter.
//
- // Types that are assignable to OperandType:
+ // Types that are valid to be assigned to OperandType:
//
// *StructuredQuery_UnaryFilter_Field
- OperandType isStructuredQuery_UnaryFilter_OperandType `protobuf_oneof:"operand_type"`
+ OperandType isStructuredQuery_UnaryFilter_OperandType `protobuf_oneof:"operand_type"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredQuery_UnaryFilter) Reset() {
@@ -1096,16 +1097,18 @@ func (x *StructuredQuery_UnaryFilter) GetOp() StructuredQuery_UnaryFilter_Operat
return StructuredQuery_UnaryFilter_OPERATOR_UNSPECIFIED
}
-func (m *StructuredQuery_UnaryFilter) GetOperandType() isStructuredQuery_UnaryFilter_OperandType {
- if m != nil {
- return m.OperandType
+func (x *StructuredQuery_UnaryFilter) GetOperandType() isStructuredQuery_UnaryFilter_OperandType {
+ if x != nil {
+ return x.OperandType
}
return nil
}
func (x *StructuredQuery_UnaryFilter) GetField() *StructuredQuery_FieldReference {
- if x, ok := x.GetOperandType().(*StructuredQuery_UnaryFilter_Field); ok {
- return x.Field
+ if x != nil {
+ if x, ok := x.OperandType.(*StructuredQuery_UnaryFilter_Field); ok {
+ return x.Field
+ }
}
return nil
}
@@ -1123,14 +1126,13 @@ func (*StructuredQuery_UnaryFilter_Field) isStructuredQuery_UnaryFilter_OperandT
// An order on a field.
type StructuredQuery_Order struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The field to order by.
Field *StructuredQuery_FieldReference `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
// The direction to order by. Defaults to `ASCENDING`.
- Direction StructuredQuery_Direction `protobuf:"varint,2,opt,name=direction,proto3,enum=google.firestore.v1.StructuredQuery_Direction" json:"direction,omitempty"`
+ Direction StructuredQuery_Direction `protobuf:"varint,2,opt,name=direction,proto3,enum=google.firestore.v1.StructuredQuery_Direction" json:"direction,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredQuery_Order) Reset() {
@@ -1179,10 +1181,7 @@ func (x *StructuredQuery_Order) GetDirection() StructuredQuery_Direction {
// A reference to a field in a document, ex: `stats.operations`.
type StructuredQuery_FieldReference struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// A reference to a field in a document.
//
// Requires:
@@ -1190,7 +1189,9 @@ type StructuredQuery_FieldReference struct {
// * MUST be a dot-delimited (`.`) string of segments, where each segment
// conforms to [document field name][google.firestore.v1.Document.fields]
// limitations.
- FieldPath string `protobuf:"bytes,2,opt,name=field_path,json=fieldPath,proto3" json:"field_path,omitempty"`
+ FieldPath string `protobuf:"bytes,2,opt,name=field_path,json=fieldPath,proto3" json:"field_path,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredQuery_FieldReference) Reset() {
@@ -1232,15 +1233,14 @@ func (x *StructuredQuery_FieldReference) GetFieldPath() string {
// The projection of document's fields to return.
type StructuredQuery_Projection struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The fields to return.
//
// If empty, all fields are returned. To only return the name
// of the document, use `['__name__']`.
- Fields []*StructuredQuery_FieldReference `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"`
+ Fields []*StructuredQuery_FieldReference `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredQuery_Projection) Reset() {
@@ -1285,10 +1285,7 @@ func (x *StructuredQuery_Projection) GetFields() []*StructuredQuery_FieldReferen
// distance, the returned document order is not guaranteed to be stable
// between queries.
type StructuredQuery_FindNearest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Required. An indexed vector field to search upon. Only documents which
// contain vectors whose dimensionality match the query_vector can be
// returned.
@@ -1314,6 +1311,8 @@ type StructuredQuery_FindNearest struct {
// * For EUCLIDEAN, COSINE: `WHERE distance <= distance_threshold`
// * For DOT_PRODUCT: `WHERE distance >= distance_threshold`
DistanceThreshold *wrapperspb.DoubleValue `protobuf:"bytes,6,opt,name=distance_threshold,json=distanceThreshold,proto3" json:"distance_threshold,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredQuery_FindNearest) Reset() {
@@ -1390,13 +1389,10 @@ func (x *StructuredQuery_FindNearest) GetDistanceThreshold() *wrapperspb.DoubleV
// Defines an aggregation that produces a single result.
type StructuredAggregationQuery_Aggregation struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The type of aggregation to perform, required.
//
- // Types that are assignable to Operator:
+ // Types that are valid to be assigned to Operator:
//
// *StructuredAggregationQuery_Aggregation_Count_
// *StructuredAggregationQuery_Aggregation_Sum_
@@ -1445,7 +1441,9 @@ type StructuredAggregationQuery_Aggregation struct {
// * Must be unique across all aggregation aliases.
// * Conform to [document field name][google.firestore.v1.Document.fields]
// limitations.
- Alias string `protobuf:"bytes,7,opt,name=alias,proto3" json:"alias,omitempty"`
+ Alias string `protobuf:"bytes,7,opt,name=alias,proto3" json:"alias,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredAggregationQuery_Aggregation) Reset() {
@@ -1478,30 +1476,36 @@ func (*StructuredAggregationQuery_Aggregation) Descriptor() ([]byte, []int) {
return file_google_firestore_v1_query_proto_rawDescGZIP(), []int{1, 0}
}
-func (m *StructuredAggregationQuery_Aggregation) GetOperator() isStructuredAggregationQuery_Aggregation_Operator {
- if m != nil {
- return m.Operator
+func (x *StructuredAggregationQuery_Aggregation) GetOperator() isStructuredAggregationQuery_Aggregation_Operator {
+ if x != nil {
+ return x.Operator
}
return nil
}
func (x *StructuredAggregationQuery_Aggregation) GetCount() *StructuredAggregationQuery_Aggregation_Count {
- if x, ok := x.GetOperator().(*StructuredAggregationQuery_Aggregation_Count_); ok {
- return x.Count
+ if x != nil {
+ if x, ok := x.Operator.(*StructuredAggregationQuery_Aggregation_Count_); ok {
+ return x.Count
+ }
}
return nil
}
func (x *StructuredAggregationQuery_Aggregation) GetSum() *StructuredAggregationQuery_Aggregation_Sum {
- if x, ok := x.GetOperator().(*StructuredAggregationQuery_Aggregation_Sum_); ok {
- return x.Sum
+ if x != nil {
+ if x, ok := x.Operator.(*StructuredAggregationQuery_Aggregation_Sum_); ok {
+ return x.Sum
+ }
}
return nil
}
func (x *StructuredAggregationQuery_Aggregation) GetAvg() *StructuredAggregationQuery_Aggregation_Avg {
- if x, ok := x.GetOperator().(*StructuredAggregationQuery_Aggregation_Avg_); ok {
- return x.Avg
+ if x != nil {
+ if x, ok := x.Operator.(*StructuredAggregationQuery_Aggregation_Avg_); ok {
+ return x.Avg
+ }
}
return nil
}
@@ -1546,10 +1550,7 @@ func (*StructuredAggregationQuery_Aggregation_Avg_) isStructuredAggregationQuery
// The `COUNT(*)` aggregation function operates on the entire document
// so it does not require a field reference.
type StructuredAggregationQuery_Aggregation_Count struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Optional. Optional constraint on the maximum number of documents to
// count.
//
@@ -1567,7 +1568,9 @@ type StructuredAggregationQuery_Aggregation_Count struct {
// Requires:
//
// * Must be greater than zero when present.
- UpTo *wrapperspb.Int64Value `protobuf:"bytes,1,opt,name=up_to,json=upTo,proto3" json:"up_to,omitempty"`
+ UpTo *wrapperspb.Int64Value `protobuf:"bytes,1,opt,name=up_to,json=upTo,proto3" json:"up_to,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredAggregationQuery_Aggregation_Count) Reset() {
@@ -1629,12 +1632,11 @@ func (x *StructuredAggregationQuery_Aggregation_Count) GetUpTo() *wrapperspb.Int
// time. In those cases, values should be stored as integers over
// floating-point numbers.
type StructuredAggregationQuery_Aggregation_Sum struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The field to aggregate on.
- Field *StructuredQuery_FieldReference `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
+ Field *StructuredQuery_FieldReference `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredAggregationQuery_Aggregation_Sum) Reset() {
@@ -1686,12 +1688,11 @@ func (x *StructuredAggregationQuery_Aggregation_Sum) GetField() *StructuredQuery
//
// * Always returns the result as a double.
type StructuredAggregationQuery_Aggregation_Avg struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The field to aggregate on.
- Field *StructuredQuery_FieldReference `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
+ Field *StructuredQuery_FieldReference `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *StructuredAggregationQuery_Aggregation_Avg) Reset() {
@@ -1733,273 +1734,123 @@ func (x *StructuredAggregationQuery_Aggregation_Avg) GetField() *StructuredQuery
var File_google_firestore_v1_query_proto protoreflect.FileDescriptor
-var file_google_firestore_v1_query_proto_rawDesc = []byte{
- 0x0a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x12, 0x13, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61,
- 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f,
- 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
- 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x6f, 0x63,
- 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61,
- 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x16, 0x0a, 0x0f,
- 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12,
- 0x47, 0x0a, 0x06, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64,
- 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x52, 0x06, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x4b, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d,
- 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72,
- 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6c,
- 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52,
- 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x41, 0x0a, 0x05, 0x77, 0x68, 0x65, 0x72, 0x65, 0x18, 0x03,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63,
- 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65,
- 0x72, 0x52, 0x05, 0x77, 0x68, 0x65, 0x72, 0x65, 0x12, 0x45, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65,
- 0x72, 0x5f, 0x62, 0x79, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79,
- 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12,
- 0x36, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x52, 0x07,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x41, 0x74, 0x12, 0x32, 0x0a, 0x06, 0x65, 0x6e, 0x64, 0x5f, 0x61,
- 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75,
- 0x72, 0x73, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f,
- 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66,
- 0x73, 0x65, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52,
- 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x58, 0x0a, 0x0c, 0x66, 0x69, 0x6e, 0x64, 0x5f, 0x6e,
- 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65,
- 0x72, 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x42, 0x03,
- 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x64, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74,
- 0x1a, 0x62, 0x0a, 0x12, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65,
- 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63,
- 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x61,
- 0x6c, 0x6c, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x65, 0x6e, 0x64, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x03,
- 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x44, 0x65, 0x73, 0x63, 0x65, 0x6e, 0x64,
- 0x61, 0x6e, 0x74, 0x73, 0x1a, 0xa8, 0x02, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12,
- 0x61, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x5f, 0x66, 0x69, 0x6c,
- 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e,
- 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48,
- 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x74,
- 0x65, 0x72, 0x12, 0x55, 0x0a, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x74,
- 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53,
- 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46,
- 0x69, 0x65, 0x6c, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0b, 0x66, 0x69,
- 0x65, 0x6c, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x55, 0x0a, 0x0c, 0x75, 0x6e, 0x61,
- 0x72, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x30, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64,
- 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65,
- 0x72, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x6e, 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72,
- 0x42, 0x0d, 0x0a, 0x0b, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x1a,
- 0xde, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x46, 0x69, 0x6c,
- 0x74, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
- 0x3d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64,
- 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x46,
- 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x02,
- 0x6f, 0x70, 0x12, 0x45, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20,
- 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74,
- 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72,
- 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x35, 0x0a, 0x08, 0x4f, 0x70, 0x65,
- 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f,
- 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
- 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x52, 0x10, 0x02,
- 0x1a, 0xaa, 0x03, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72,
- 0x12, 0x49, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64,
- 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x65, 0x66, 0x65, 0x72,
- 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x49, 0x0a, 0x02, 0x6f,
- 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74,
- 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69,
- 0x65, 0x6c, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74,
- 0x6f, 0x72, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
- 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66,
- 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x75,
- 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xd2, 0x01, 0x0a, 0x08, 0x4f, 0x70, 0x65,
- 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f,
- 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
- 0x0d, 0x0a, 0x09, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x01, 0x12, 0x16,
- 0x0a, 0x12, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x5f, 0x4f, 0x52, 0x5f, 0x45,
- 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45,
- 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x47, 0x52, 0x45, 0x41,
- 0x54, 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x5f, 0x4f, 0x52, 0x5f, 0x45, 0x51, 0x55, 0x41,
- 0x4c, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x05, 0x12, 0x0d,
- 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x06, 0x12, 0x12, 0x0a,
- 0x0e, 0x41, 0x52, 0x52, 0x41, 0x59, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x53, 0x10,
- 0x07, 0x12, 0x06, 0x0a, 0x02, 0x49, 0x4e, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x52, 0x52,
- 0x41, 0x59, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x53, 0x5f, 0x41, 0x4e, 0x59, 0x10,
- 0x09, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4e, 0x10, 0x0a, 0x1a, 0x95, 0x02,
- 0x0a, 0x0b, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x49, 0x0a,
- 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e,
- 0x55, 0x6e, 0x61, 0x72, 0x79, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x4f, 0x70, 0x65, 0x72,
- 0x61, 0x74, 0x6f, 0x72, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x4b, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c,
- 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74,
- 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69,
- 0x65, 0x6c, 0x64, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x05,
- 0x66, 0x69, 0x65, 0x6c, 0x64, 0x22, 0x5e, 0x0a, 0x08, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f,
- 0x72, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x55, 0x4e,
- 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x49,
- 0x53, 0x5f, 0x4e, 0x41, 0x4e, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x53, 0x5f, 0x4e, 0x55,
- 0x4c, 0x4c, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x53, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x4e,
- 0x41, 0x4e, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x53, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x4e,
- 0x55, 0x4c, 0x4c, 0x10, 0x05, 0x42, 0x0e, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x6e, 0x64,
- 0x5f, 0x74, 0x79, 0x70, 0x65, 0x1a, 0xa0, 0x01, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12,
- 0x49, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33,
- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51,
- 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65,
- 0x6e, 0x63, 0x65, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x4c, 0x0a, 0x09, 0x64, 0x69,
- 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75,
- 0x65, 0x72, 0x79, 0x2e, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x64,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2f, 0x0a, 0x0e, 0x46, 0x69, 0x65, 0x6c,
- 0x64, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69,
- 0x65, 0x6c, 0x64, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
- 0x66, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x61, 0x74, 0x68, 0x1a, 0x59, 0x0a, 0x0a, 0x50, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4b, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64,
- 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74,
- 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69,
- 0x65, 0x6c, 0x64, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x66, 0x69,
- 0x65, 0x6c, 0x64, 0x73, 0x1a, 0xc4, 0x04, 0x0a, 0x0b, 0x46, 0x69, 0x6e, 0x64, 0x4e, 0x65, 0x61,
- 0x72, 0x65, 0x73, 0x74, 0x12, 0x5b, 0x0a, 0x0c, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x66,
- 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79,
- 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42,
- 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x46, 0x69, 0x65, 0x6c,
- 0x64, 0x12, 0x42, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x76, 0x65, 0x63, 0x74, 0x6f,
- 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61,
- 0x6c, 0x75, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x56,
- 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x70, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63,
- 0x65, 0x5f, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32,
- 0x40, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64,
- 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73,
- 0x74, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72,
- 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0f, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,
- 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74,
- 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61,
- 0x6c, 0x75, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12,
- 0x37, 0x0a, 0x15, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x75,
- 0x6c, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03,
- 0xe0, 0x41, 0x01, 0x52, 0x13, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73,
- 0x75, 0x6c, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x50, 0x0a, 0x12, 0x64, 0x69, 0x73, 0x74,
- 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x06,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c,
- 0x75, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x11, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63,
- 0x65, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x22, 0x5f, 0x0a, 0x0f, 0x44, 0x69,
- 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x12, 0x20, 0x0a,
- 0x1c, 0x44, 0x49, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x4d, 0x45, 0x41, 0x53, 0x55, 0x52,
- 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
- 0x0d, 0x0a, 0x09, 0x45, 0x55, 0x43, 0x4c, 0x49, 0x44, 0x45, 0x41, 0x4e, 0x10, 0x01, 0x12, 0x0a,
- 0x0a, 0x06, 0x43, 0x4f, 0x53, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x44, 0x4f,
- 0x54, 0x5f, 0x50, 0x52, 0x4f, 0x44, 0x55, 0x43, 0x54, 0x10, 0x03, 0x22, 0x45, 0x0a, 0x09, 0x44,
- 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, 0x44, 0x49, 0x52, 0x45,
- 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
- 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47,
- 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47,
- 0x10, 0x02, 0x22, 0x83, 0x06, 0x0a, 0x1a, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65,
- 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72,
- 0x79, 0x12, 0x51, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x5f,
- 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72,
- 0x79, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x51,
- 0x75, 0x65, 0x72, 0x79, 0x12, 0x64, 0x0a, 0x0c, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65,
- 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x41, 0x67, 0x67, 0x72,
- 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x61, 0x67,
- 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x9d, 0x04, 0x0a, 0x0b, 0x41,
- 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x59, 0x0a, 0x05, 0x63, 0x6f,
- 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65,
- 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x05,
- 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x53, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75,
- 0x72, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75,
- 0x65, 0x72, 0x79, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
- 0x53, 0x75, 0x6d, 0x48, 0x00, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x12, 0x53, 0x0a, 0x03, 0x61, 0x76,
- 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74,
- 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x76, 0x67, 0x48, 0x00, 0x52, 0x03, 0x61, 0x76, 0x67, 0x12,
- 0x19, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03,
- 0xe0, 0x41, 0x01, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x1a, 0x3e, 0x0a, 0x05, 0x43, 0x6f,
- 0x75, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x05, 0x75, 0x70, 0x5f, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42,
- 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x75, 0x70, 0x54, 0x6f, 0x1a, 0x50, 0x0a, 0x03, 0x53, 0x75,
- 0x6d, 0x12, 0x49, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65,
- 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x65, 0x66, 0x65,
- 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x1a, 0x50, 0x0a, 0x03,
- 0x41, 0x76, 0x67, 0x12, 0x49, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75,
- 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x65,
- 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x0a,
- 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x0c, 0x0a, 0x0a, 0x71, 0x75,
- 0x65, 0x72, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x54, 0x0a, 0x06, 0x43, 0x75, 0x72, 0x73,
- 0x6f, 0x72, 0x12, 0x32, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03,
- 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06,
- 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x42, 0xc2,
- 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72,
- 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x66, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x66, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x3b, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x70, 0x62, 0xa2, 0x02, 0x04, 0x47, 0x43, 0x46, 0x53, 0xaa, 0x02, 0x19, 0x47,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x46, 0x69, 0x72, 0x65,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x47, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x5c, 0x56, 0x31, 0xea, 0x02, 0x1c, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43,
- 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3a,
- 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
+const file_google_firestore_v1_query_proto_rawDesc = "" +
+ "\n" +
+ "\x1fgoogle/firestore/v1/query.proto\x12\x13google.firestore.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\"google/firestore/v1/document.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xb4\x16\n" +
+ "\x0fStructuredQuery\x12G\n" +
+ "\x06select\x18\x01 \x01(\v2/.google.firestore.v1.StructuredQuery.ProjectionR\x06select\x12K\n" +
+ "\x04from\x18\x02 \x03(\v27.google.firestore.v1.StructuredQuery.CollectionSelectorR\x04from\x12A\n" +
+ "\x05where\x18\x03 \x01(\v2+.google.firestore.v1.StructuredQuery.FilterR\x05where\x12E\n" +
+ "\border_by\x18\x04 \x03(\v2*.google.firestore.v1.StructuredQuery.OrderR\aorderBy\x126\n" +
+ "\bstart_at\x18\a \x01(\v2\x1b.google.firestore.v1.CursorR\astartAt\x122\n" +
+ "\x06end_at\x18\b \x01(\v2\x1b.google.firestore.v1.CursorR\x05endAt\x12\x16\n" +
+ "\x06offset\x18\x06 \x01(\x05R\x06offset\x121\n" +
+ "\x05limit\x18\x05 \x01(\v2\x1b.google.protobuf.Int32ValueR\x05limit\x12X\n" +
+ "\ffind_nearest\x18\t \x01(\v20.google.firestore.v1.StructuredQuery.FindNearestB\x03\xe0A\x01R\vfindNearest\x1ab\n" +
+ "\x12CollectionSelector\x12#\n" +
+ "\rcollection_id\x18\x02 \x01(\tR\fcollectionId\x12'\n" +
+ "\x0fall_descendants\x18\x03 \x01(\bR\x0eallDescendants\x1a\xa8\x02\n" +
+ "\x06Filter\x12a\n" +
+ "\x10composite_filter\x18\x01 \x01(\v24.google.firestore.v1.StructuredQuery.CompositeFilterH\x00R\x0fcompositeFilter\x12U\n" +
+ "\ffield_filter\x18\x02 \x01(\v20.google.firestore.v1.StructuredQuery.FieldFilterH\x00R\vfieldFilter\x12U\n" +
+ "\funary_filter\x18\x03 \x01(\v20.google.firestore.v1.StructuredQuery.UnaryFilterH\x00R\vunaryFilterB\r\n" +
+ "\vfilter_type\x1a\xde\x01\n" +
+ "\x0fCompositeFilter\x12M\n" +
+ "\x02op\x18\x01 \x01(\x0e2=.google.firestore.v1.StructuredQuery.CompositeFilter.OperatorR\x02op\x12E\n" +
+ "\afilters\x18\x02 \x03(\v2+.google.firestore.v1.StructuredQuery.FilterR\afilters\"5\n" +
+ "\bOperator\x12\x18\n" +
+ "\x14OPERATOR_UNSPECIFIED\x10\x00\x12\a\n" +
+ "\x03AND\x10\x01\x12\x06\n" +
+ "\x02OR\x10\x02\x1a\xaa\x03\n" +
+ "\vFieldFilter\x12I\n" +
+ "\x05field\x18\x01 \x01(\v23.google.firestore.v1.StructuredQuery.FieldReferenceR\x05field\x12I\n" +
+ "\x02op\x18\x02 \x01(\x0e29.google.firestore.v1.StructuredQuery.FieldFilter.OperatorR\x02op\x120\n" +
+ "\x05value\x18\x03 \x01(\v2\x1a.google.firestore.v1.ValueR\x05value\"\xd2\x01\n" +
+ "\bOperator\x12\x18\n" +
+ "\x14OPERATOR_UNSPECIFIED\x10\x00\x12\r\n" +
+ "\tLESS_THAN\x10\x01\x12\x16\n" +
+ "\x12LESS_THAN_OR_EQUAL\x10\x02\x12\x10\n" +
+ "\fGREATER_THAN\x10\x03\x12\x19\n" +
+ "\x15GREATER_THAN_OR_EQUAL\x10\x04\x12\t\n" +
+ "\x05EQUAL\x10\x05\x12\r\n" +
+ "\tNOT_EQUAL\x10\x06\x12\x12\n" +
+ "\x0eARRAY_CONTAINS\x10\a\x12\x06\n" +
+ "\x02IN\x10\b\x12\x16\n" +
+ "\x12ARRAY_CONTAINS_ANY\x10\t\x12\n" +
+ "\n" +
+ "\x06NOT_IN\x10\n" +
+ "\x1a\x95\x02\n" +
+ "\vUnaryFilter\x12I\n" +
+ "\x02op\x18\x01 \x01(\x0e29.google.firestore.v1.StructuredQuery.UnaryFilter.OperatorR\x02op\x12K\n" +
+ "\x05field\x18\x02 \x01(\v23.google.firestore.v1.StructuredQuery.FieldReferenceH\x00R\x05field\"^\n" +
+ "\bOperator\x12\x18\n" +
+ "\x14OPERATOR_UNSPECIFIED\x10\x00\x12\n" +
+ "\n" +
+ "\x06IS_NAN\x10\x02\x12\v\n" +
+ "\aIS_NULL\x10\x03\x12\x0e\n" +
+ "\n" +
+ "IS_NOT_NAN\x10\x04\x12\x0f\n" +
+ "\vIS_NOT_NULL\x10\x05B\x0e\n" +
+ "\foperand_type\x1a\xa0\x01\n" +
+ "\x05Order\x12I\n" +
+ "\x05field\x18\x01 \x01(\v23.google.firestore.v1.StructuredQuery.FieldReferenceR\x05field\x12L\n" +
+ "\tdirection\x18\x02 \x01(\x0e2..google.firestore.v1.StructuredQuery.DirectionR\tdirection\x1a/\n" +
+ "\x0eFieldReference\x12\x1d\n" +
+ "\n" +
+ "field_path\x18\x02 \x01(\tR\tfieldPath\x1aY\n" +
+ "\n" +
+ "Projection\x12K\n" +
+ "\x06fields\x18\x02 \x03(\v23.google.firestore.v1.StructuredQuery.FieldReferenceR\x06fields\x1a\xc4\x04\n" +
+ "\vFindNearest\x12[\n" +
+ "\fvector_field\x18\x01 \x01(\v23.google.firestore.v1.StructuredQuery.FieldReferenceB\x03\xe0A\x02R\vvectorField\x12B\n" +
+ "\fquery_vector\x18\x02 \x01(\v2\x1a.google.firestore.v1.ValueB\x03\xe0A\x02R\vqueryVector\x12p\n" +
+ "\x10distance_measure\x18\x03 \x01(\x0e2@.google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasureB\x03\xe0A\x02R\x0fdistanceMeasure\x126\n" +
+ "\x05limit\x18\x04 \x01(\v2\x1b.google.protobuf.Int32ValueB\x03\xe0A\x02R\x05limit\x127\n" +
+ "\x15distance_result_field\x18\x05 \x01(\tB\x03\xe0A\x01R\x13distanceResultField\x12P\n" +
+ "\x12distance_threshold\x18\x06 \x01(\v2\x1c.google.protobuf.DoubleValueB\x03\xe0A\x01R\x11distanceThreshold\"_\n" +
+ "\x0fDistanceMeasure\x12 \n" +
+ "\x1cDISTANCE_MEASURE_UNSPECIFIED\x10\x00\x12\r\n" +
+ "\tEUCLIDEAN\x10\x01\x12\n" +
+ "\n" +
+ "\x06COSINE\x10\x02\x12\x0f\n" +
+ "\vDOT_PRODUCT\x10\x03\"E\n" +
+ "\tDirection\x12\x19\n" +
+ "\x15DIRECTION_UNSPECIFIED\x10\x00\x12\r\n" +
+ "\tASCENDING\x10\x01\x12\x0e\n" +
+ "\n" +
+ "DESCENDING\x10\x02\"\x83\x06\n" +
+ "\x1aStructuredAggregationQuery\x12Q\n" +
+ "\x10structured_query\x18\x01 \x01(\v2$.google.firestore.v1.StructuredQueryH\x00R\x0fstructuredQuery\x12d\n" +
+ "\faggregations\x18\x03 \x03(\v2;.google.firestore.v1.StructuredAggregationQuery.AggregationB\x03\xe0A\x01R\faggregations\x1a\x9d\x04\n" +
+ "\vAggregation\x12Y\n" +
+ "\x05count\x18\x01 \x01(\v2A.google.firestore.v1.StructuredAggregationQuery.Aggregation.CountH\x00R\x05count\x12S\n" +
+ "\x03sum\x18\x02 \x01(\v2?.google.firestore.v1.StructuredAggregationQuery.Aggregation.SumH\x00R\x03sum\x12S\n" +
+ "\x03avg\x18\x03 \x01(\v2?.google.firestore.v1.StructuredAggregationQuery.Aggregation.AvgH\x00R\x03avg\x12\x19\n" +
+ "\x05alias\x18\a \x01(\tB\x03\xe0A\x01R\x05alias\x1a>\n" +
+ "\x05Count\x125\n" +
+ "\x05up_to\x18\x01 \x01(\v2\x1b.google.protobuf.Int64ValueB\x03\xe0A\x01R\x04upTo\x1aP\n" +
+ "\x03Sum\x12I\n" +
+ "\x05field\x18\x01 \x01(\v23.google.firestore.v1.StructuredQuery.FieldReferenceR\x05field\x1aP\n" +
+ "\x03Avg\x12I\n" +
+ "\x05field\x18\x01 \x01(\v23.google.firestore.v1.StructuredQuery.FieldReferenceR\x05fieldB\n" +
+ "\n" +
+ "\boperatorB\f\n" +
+ "\n" +
+ "query_type\"T\n" +
+ "\x06Cursor\x122\n" +
+ "\x06values\x18\x01 \x03(\v2\x1a.google.firestore.v1.ValueR\x06values\x12\x16\n" +
+ "\x06before\x18\x02 \x01(\bR\x06beforeB\xc2\x01\n" +
+ "\x17com.google.firestore.v1B\n" +
+ "QueryProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3"
var (
file_google_firestore_v1_query_proto_rawDescOnce sync.Once
- file_google_firestore_v1_query_proto_rawDescData = file_google_firestore_v1_query_proto_rawDesc
+ file_google_firestore_v1_query_proto_rawDescData []byte
)
func file_google_firestore_v1_query_proto_rawDescGZIP() []byte {
file_google_firestore_v1_query_proto_rawDescOnce.Do(func() {
- file_google_firestore_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_firestore_v1_query_proto_rawDescData)
+ file_google_firestore_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_firestore_v1_query_proto_rawDesc), len(file_google_firestore_v1_query_proto_rawDesc)))
})
return file_google_firestore_v1_query_proto_rawDescData
}
@@ -2102,7 +1953,7 @@ func file_google_firestore_v1_query_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_google_firestore_v1_query_proto_rawDesc,
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_firestore_v1_query_proto_rawDesc), len(file_google_firestore_v1_query_proto_rawDesc)),
NumEnums: 5,
NumMessages: 16,
NumExtensions: 0,
@@ -2114,7 +1965,6 @@ func file_google_firestore_v1_query_proto_init() {
MessageInfos: file_google_firestore_v1_query_proto_msgTypes,
}.Build()
File_google_firestore_v1_query_proto = out.File
- file_google_firestore_v1_query_proto_rawDesc = nil
file_google_firestore_v1_query_proto_goTypes = nil
file_google_firestore_v1_query_proto_depIdxs = nil
}
diff --git a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/query_profile.pb.go b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/query_profile.pb.go
index fc4c745364..245e1b4141 100644
--- a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/query_profile.pb.go
+++ b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/query_profile.pb.go
@@ -1,4 +1,4 @@
-// Copyright 2025 Google LLC
+// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.35.2
-// protoc v4.25.7
+// protoc-gen-go v1.36.11
+// protoc v6.31.0
// source: google/firestore/v1/query_profile.proto
package firestorepb
@@ -23,6 +23,7 @@ package firestorepb
import (
reflect "reflect"
sync "sync"
+ unsafe "unsafe"
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -40,10 +41,7 @@ const (
// Explain options for the query.
type ExplainOptions struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Optional. Whether to execute this query.
//
// When false (the default), the query will be planned, returning only
@@ -51,7 +49,9 @@ type ExplainOptions struct {
//
// When true, the query will be planned and executed, returning the full
// query results along with both planning and execution stage metrics.
- Analyze bool `protobuf:"varint,1,opt,name=analyze,proto3" json:"analyze,omitempty"`
+ Analyze bool `protobuf:"varint,1,opt,name=analyze,proto3" json:"analyze,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ExplainOptions) Reset() {
@@ -93,16 +93,15 @@ func (x *ExplainOptions) GetAnalyze() bool {
// Explain metrics for the query.
type ExplainMetrics struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Planning phase information for the query.
PlanSummary *PlanSummary `protobuf:"bytes,1,opt,name=plan_summary,json=planSummary,proto3" json:"plan_summary,omitempty"`
// Aggregated stats from the execution of the query. Only present when
// [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set
// to true.
ExecutionStats *ExecutionStats `protobuf:"bytes,2,opt,name=execution_stats,json=executionStats,proto3" json:"execution_stats,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ExplainMetrics) Reset() {
@@ -151,17 +150,16 @@ func (x *ExplainMetrics) GetExecutionStats() *ExecutionStats {
// Planning phase information for the query.
type PlanSummary struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The indexes selected for the query. For example:
//
// [
// {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
// {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
// ]
- IndexesUsed []*structpb.Struct `protobuf:"bytes,1,rep,name=indexes_used,json=indexesUsed,proto3" json:"indexes_used,omitempty"`
+ IndexesUsed []*structpb.Struct `protobuf:"bytes,1,rep,name=indexes_used,json=indexesUsed,proto3" json:"indexes_used,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *PlanSummary) Reset() {
@@ -203,10 +201,7 @@ func (x *PlanSummary) GetIndexesUsed() []*structpb.Struct {
// Execution statistics for the query.
type ExecutionStats struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// Total number of results returned, including documents, projections,
// aggregation results, keys.
ResultsReturned int64 `protobuf:"varint,1,opt,name=results_returned,json=resultsReturned,proto3" json:"results_returned,omitempty"`
@@ -227,7 +222,9 @@ type ExecutionStats struct {
// "min_query_cost": "0"
// }
// }
- DebugStats *structpb.Struct `protobuf:"bytes,5,opt,name=debug_stats,json=debugStats,proto3" json:"debug_stats,omitempty"`
+ DebugStats *structpb.Struct `protobuf:"bytes,5,opt,name=debug_stats,json=debugStats,proto3" json:"debug_stats,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ExecutionStats) Reset() {
@@ -290,73 +287,32 @@ func (x *ExecutionStats) GetDebugStats() *structpb.Struct {
var File_google_firestore_v1_query_profile_proto protoreflect.FileDescriptor
-var file_google_firestore_v1_query_profile_proto_rawDesc = []byte{
- 0x0a, 0x27, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x66,
- 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64,
- 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
- 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
- 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2f, 0x0a,
- 0x0e, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
- 0x1d, 0x0a, 0x07, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
- 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x22, 0xa3,
- 0x01, 0x0a, 0x0e, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63,
- 0x73, 0x12, 0x43, 0x0a, 0x0c, 0x70, 0x6c, 0x61, 0x6e, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72,
- 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c,
- 0x61, 0x6e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x0b, 0x70, 0x6c, 0x61, 0x6e, 0x53,
- 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x4c, 0x0a, 0x0f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74,
- 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53,
- 0x74, 0x61, 0x74, 0x73, 0x52, 0x0e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53,
- 0x74, 0x61, 0x74, 0x73, 0x22, 0x49, 0x0a, 0x0b, 0x50, 0x6c, 0x61, 0x6e, 0x53, 0x75, 0x6d, 0x6d,
- 0x61, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x0c, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x5f, 0x75,
- 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75,
- 0x63, 0x74, 0x52, 0x0b, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x55, 0x73, 0x65, 0x64, 0x22,
- 0xe8, 0x01, 0x0a, 0x0e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61,
- 0x74, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x5f, 0x72, 0x65,
- 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65,
- 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x12, 0x48, 0x0a,
- 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x44,
- 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x61, 0x64, 0x5f,
- 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
- 0x52, 0x0e, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
- 0x12, 0x38, 0x0a, 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18,
- 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0a,
- 0x64, 0x65, 0x62, 0x75, 0x67, 0x53, 0x74, 0x61, 0x74, 0x73, 0x42, 0xc9, 0x01, 0x0a, 0x17, 0x63,
- 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f,
- 0x66, 0x69, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x63, 0x6c, 0x6f,
- 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f,
- 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31,
- 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x3b, 0x66, 0x69, 0x72,
- 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0xa2, 0x02, 0x04, 0x47, 0x43, 0x46, 0x53, 0xaa,
- 0x02, 0x19, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x46,
- 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x47, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x46, 0x69, 0x72, 0x65, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xea, 0x02, 0x1c, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
+const file_google_firestore_v1_query_profile_proto_rawDesc = "" +
+ "\n" +
+ "'google/firestore/v1/query_profile.proto\x12\x13google.firestore.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\"/\n" +
+ "\x0eExplainOptions\x12\x1d\n" +
+ "\aanalyze\x18\x01 \x01(\bB\x03\xe0A\x01R\aanalyze\"\xa3\x01\n" +
+ "\x0eExplainMetrics\x12C\n" +
+ "\fplan_summary\x18\x01 \x01(\v2 .google.firestore.v1.PlanSummaryR\vplanSummary\x12L\n" +
+ "\x0fexecution_stats\x18\x02 \x01(\v2#.google.firestore.v1.ExecutionStatsR\x0eexecutionStats\"I\n" +
+ "\vPlanSummary\x12:\n" +
+ "\findexes_used\x18\x01 \x03(\v2\x17.google.protobuf.StructR\vindexesUsed\"\xe8\x01\n" +
+ "\x0eExecutionStats\x12)\n" +
+ "\x10results_returned\x18\x01 \x01(\x03R\x0fresultsReturned\x12H\n" +
+ "\x12execution_duration\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\x11executionDuration\x12'\n" +
+ "\x0fread_operations\x18\x04 \x01(\x03R\x0ereadOperations\x128\n" +
+ "\vdebug_stats\x18\x05 \x01(\v2\x17.google.protobuf.StructR\n" +
+ "debugStatsB\xc9\x01\n" +
+ "\x17com.google.firestore.v1B\x11QueryProfileProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3"
var (
file_google_firestore_v1_query_profile_proto_rawDescOnce sync.Once
- file_google_firestore_v1_query_profile_proto_rawDescData = file_google_firestore_v1_query_profile_proto_rawDesc
+ file_google_firestore_v1_query_profile_proto_rawDescData []byte
)
func file_google_firestore_v1_query_profile_proto_rawDescGZIP() []byte {
file_google_firestore_v1_query_profile_proto_rawDescOnce.Do(func() {
- file_google_firestore_v1_query_profile_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_firestore_v1_query_profile_proto_rawDescData)
+ file_google_firestore_v1_query_profile_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_firestore_v1_query_profile_proto_rawDesc), len(file_google_firestore_v1_query_profile_proto_rawDesc)))
})
return file_google_firestore_v1_query_profile_proto_rawDescData
}
@@ -392,7 +348,7 @@ func file_google_firestore_v1_query_profile_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_google_firestore_v1_query_profile_proto_rawDesc,
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_firestore_v1_query_profile_proto_rawDesc), len(file_google_firestore_v1_query_profile_proto_rawDesc)),
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
@@ -403,7 +359,6 @@ func file_google_firestore_v1_query_profile_proto_init() {
MessageInfos: file_google_firestore_v1_query_profile_proto_msgTypes,
}.Build()
File_google_firestore_v1_query_profile_proto = out.File
- file_google_firestore_v1_query_profile_proto_rawDesc = nil
file_google_firestore_v1_query_profile_proto_goTypes = nil
file_google_firestore_v1_query_profile_proto_depIdxs = nil
}
diff --git a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/write.pb.go b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/write.pb.go
index a89fc6f91f..774a2fc98d 100644
--- a/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/write.pb.go
+++ b/vendor/cloud.google.com/go/firestore/apiv1/firestorepb/write.pb.go
@@ -1,4 +1,4 @@
-// Copyright 2025 Google LLC
+// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.35.2
-// protoc v4.25.7
+// protoc-gen-go v1.36.11
+// protoc v6.31.0
// source: google/firestore/v1/write.proto
package firestorepb
@@ -23,6 +23,7 @@ package firestorepb
import (
reflect "reflect"
sync "sync"
+ unsafe "unsafe"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
@@ -89,13 +90,10 @@ func (DocumentTransform_FieldTransform_ServerValue) EnumDescriptor() ([]byte, []
// A write on a document.
type Write struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The operation to execute.
//
- // Types that are assignable to Operation:
+ // Types that are valid to be assigned to Operation:
//
// *Write_Update
// *Write_Delete
@@ -122,6 +120,8 @@ type Write struct {
//
// The write will fail if this is set and not met by the target document.
CurrentDocument *Precondition `protobuf:"bytes,4,opt,name=current_document,json=currentDocument,proto3" json:"current_document,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Write) Reset() {
@@ -154,30 +154,36 @@ func (*Write) Descriptor() ([]byte, []int) {
return file_google_firestore_v1_write_proto_rawDescGZIP(), []int{0}
}
-func (m *Write) GetOperation() isWrite_Operation {
- if m != nil {
- return m.Operation
+func (x *Write) GetOperation() isWrite_Operation {
+ if x != nil {
+ return x.Operation
}
return nil
}
func (x *Write) GetUpdate() *Document {
- if x, ok := x.GetOperation().(*Write_Update); ok {
- return x.Update
+ if x != nil {
+ if x, ok := x.Operation.(*Write_Update); ok {
+ return x.Update
+ }
}
return nil
}
func (x *Write) GetDelete() string {
- if x, ok := x.GetOperation().(*Write_Delete); ok {
- return x.Delete
+ if x != nil {
+ if x, ok := x.Operation.(*Write_Delete); ok {
+ return x.Delete
+ }
}
return ""
}
func (x *Write) GetTransform() *DocumentTransform {
- if x, ok := x.GetOperation().(*Write_Transform); ok {
- return x.Transform
+ if x != nil {
+ if x, ok := x.Operation.(*Write_Transform); ok {
+ return x.Transform
+ }
}
return nil
}
@@ -231,16 +237,15 @@ func (*Write_Transform) isWrite_Operation() {}
// A transformation of a document.
type DocumentTransform struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The name of the document to transform.
Document string `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"`
// The list of transformations to apply to the fields of the document, in
// order.
// This must not be empty.
FieldTransforms []*DocumentTransform_FieldTransform `protobuf:"bytes,2,rep,name=field_transforms,json=fieldTransforms,proto3" json:"field_transforms,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *DocumentTransform) Reset() {
@@ -289,10 +294,7 @@ func (x *DocumentTransform) GetFieldTransforms() []*DocumentTransform_FieldTrans
// The result of applying a write.
type WriteResult struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The last update time of the document after applying the write. Not set
// after a `delete`.
//
@@ -303,6 +305,8 @@ type WriteResult struct {
// [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform],
// in the same order.
TransformResults []*Value `protobuf:"bytes,2,rep,name=transform_results,json=transformResults,proto3" json:"transform_results,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *WriteResult) Reset() {
@@ -358,10 +362,7 @@ func (x *WriteResult) GetTransformResults() []*Value {
// Multiple [DocumentChange][google.firestore.v1.DocumentChange] messages may be
// returned for the same logical change, if multiple targets are affected.
type DocumentChange struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The new state of the [Document][google.firestore.v1.Document].
//
// If `mask` is set, contains only fields that were updated or added.
@@ -370,6 +371,8 @@ type DocumentChange struct {
TargetIds []int32 `protobuf:"varint,5,rep,packed,name=target_ids,json=targetIds,proto3" json:"target_ids,omitempty"`
// A set of target IDs for targets that no longer match this document.
RemovedTargetIds []int32 `protobuf:"varint,6,rep,packed,name=removed_target_ids,json=removedTargetIds,proto3" json:"removed_target_ids,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *DocumentChange) Reset() {
@@ -432,10 +435,7 @@ func (x *DocumentChange) GetRemovedTargetIds() []int32 {
// Multiple [DocumentDelete][google.firestore.v1.DocumentDelete] messages may be
// returned for the same logical delete, if multiple targets are affected.
type DocumentDelete struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The resource name of the [Document][google.firestore.v1.Document] that was
// deleted.
Document string `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"`
@@ -444,7 +444,9 @@ type DocumentDelete struct {
// The read timestamp at which the delete was observed.
//
// Greater or equal to the `commit_time` of the delete.
- ReadTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=read_time,json=readTime,proto3" json:"read_time,omitempty"`
+ ReadTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=read_time,json=readTime,proto3" json:"read_time,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *DocumentDelete) Reset() {
@@ -509,10 +511,7 @@ func (x *DocumentDelete) GetReadTime() *timestamppb.Timestamp {
// returned for the same logical write or delete, if multiple targets are
// affected.
type DocumentRemove struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The resource name of the [Document][google.firestore.v1.Document] that has
// gone out of view.
Document string `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"`
@@ -521,7 +520,9 @@ type DocumentRemove struct {
// The read timestamp at which the remove was observed.
//
// Greater or equal to the `commit_time` of the change/delete/remove.
- ReadTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=read_time,json=readTime,proto3" json:"read_time,omitempty"`
+ ReadTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=read_time,json=readTime,proto3" json:"read_time,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *DocumentRemove) Reset() {
@@ -577,10 +578,7 @@ func (x *DocumentRemove) GetReadTime() *timestamppb.Timestamp {
// A digest of all the documents that match a given target.
type ExistenceFilter struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The target ID to which this filter applies.
TargetId int32 `protobuf:"varint,1,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"`
// The total count of documents that match
@@ -606,6 +604,8 @@ type ExistenceFilter struct {
// this field existed; that is, re-add the target without a resume token to
// figure out which documents in the client's cache are out of sync.
UnchangedNames *BloomFilter `protobuf:"bytes,3,opt,name=unchanged_names,json=unchangedNames,proto3" json:"unchanged_names,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ExistenceFilter) Reset() {
@@ -661,17 +661,14 @@ func (x *ExistenceFilter) GetUnchangedNames() *BloomFilter {
// A transformation of a field of the document.
type DocumentTransform_FieldTransform struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
+ state protoimpl.MessageState `protogen:"open.v1"`
// The path of the field. See
// [Document.fields][google.firestore.v1.Document.fields] for the field path
// syntax reference.
FieldPath string `protobuf:"bytes,1,opt,name=field_path,json=fieldPath,proto3" json:"field_path,omitempty"`
// The transformation to apply on the field.
//
- // Types that are assignable to TransformType:
+ // Types that are valid to be assigned to TransformType:
//
// *DocumentTransform_FieldTransform_SetToServerValue
// *DocumentTransform_FieldTransform_Increment
@@ -680,6 +677,8 @@ type DocumentTransform_FieldTransform struct {
// *DocumentTransform_FieldTransform_AppendMissingElements
// *DocumentTransform_FieldTransform_RemoveAllFromArray
TransformType isDocumentTransform_FieldTransform_TransformType `protobuf_oneof:"transform_type"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *DocumentTransform_FieldTransform) Reset() {
@@ -719,51 +718,63 @@ func (x *DocumentTransform_FieldTransform) GetFieldPath() string {
return ""
}
-func (m *DocumentTransform_FieldTransform) GetTransformType() isDocumentTransform_FieldTransform_TransformType {
- if m != nil {
- return m.TransformType
+func (x *DocumentTransform_FieldTransform) GetTransformType() isDocumentTransform_FieldTransform_TransformType {
+ if x != nil {
+ return x.TransformType
}
return nil
}
func (x *DocumentTransform_FieldTransform) GetSetToServerValue() DocumentTransform_FieldTransform_ServerValue {
- if x, ok := x.GetTransformType().(*DocumentTransform_FieldTransform_SetToServerValue); ok {
- return x.SetToServerValue
+ if x != nil {
+ if x, ok := x.TransformType.(*DocumentTransform_FieldTransform_SetToServerValue); ok {
+ return x.SetToServerValue
+ }
}
return DocumentTransform_FieldTransform_SERVER_VALUE_UNSPECIFIED
}
func (x *DocumentTransform_FieldTransform) GetIncrement() *Value {
- if x, ok := x.GetTransformType().(*DocumentTransform_FieldTransform_Increment); ok {
- return x.Increment
+ if x != nil {
+ if x, ok := x.TransformType.(*DocumentTransform_FieldTransform_Increment); ok {
+ return x.Increment
+ }
}
return nil
}
func (x *DocumentTransform_FieldTransform) GetMaximum() *Value {
- if x, ok := x.GetTransformType().(*DocumentTransform_FieldTransform_Maximum); ok {
- return x.Maximum
+ if x != nil {
+ if x, ok := x.TransformType.(*DocumentTransform_FieldTransform_Maximum); ok {
+ return x.Maximum
+ }
}
return nil
}
func (x *DocumentTransform_FieldTransform) GetMinimum() *Value {
- if x, ok := x.GetTransformType().(*DocumentTransform_FieldTransform_Minimum); ok {
- return x.Minimum
+ if x != nil {
+ if x, ok := x.TransformType.(*DocumentTransform_FieldTransform_Minimum); ok {
+ return x.Minimum
+ }
}
return nil
}
func (x *DocumentTransform_FieldTransform) GetAppendMissingElements() *ArrayValue {
- if x, ok := x.GetTransformType().(*DocumentTransform_FieldTransform_AppendMissingElements); ok {
- return x.AppendMissingElements
+ if x != nil {
+ if x, ok := x.TransformType.(*DocumentTransform_FieldTransform_AppendMissingElements); ok {
+ return x.AppendMissingElements
+ }
}
return nil
}
func (x *DocumentTransform_FieldTransform) GetRemoveAllFromArray() *ArrayValue {
- if x, ok := x.GetTransformType().(*DocumentTransform_FieldTransform_RemoveAllFromArray); ok {
- return x.RemoveAllFromArray
+ if x != nil {
+ if x, ok := x.TransformType.(*DocumentTransform_FieldTransform_RemoveAllFromArray); ok {
+ return x.RemoveAllFromArray
+ }
}
return nil
}
@@ -871,163 +882,66 @@ func (*DocumentTransform_FieldTransform_RemoveAllFromArray) isDocumentTransform_
var File_google_firestore_v1_write_proto protoreflect.FileDescriptor
-var file_google_firestore_v1_write_proto_rawDesc = []byte{
- 0x0a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x12, 0x13, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x26, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66,
- 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6c, 0x6f, 0x6f,
- 0x6d, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x1a, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x03, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12,
- 0x37, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00,
- 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65,
- 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65,
- 0x74, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x18,
- 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66,
- 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75,
- 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x48, 0x00, 0x52,
- 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x42, 0x0a, 0x0b, 0x75, 0x70,
- 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61,
- 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x62,
- 0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f,
- 0x72, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72,
- 0x6d, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
- 0x52, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72,
- 0x6d, 0x73, 0x12, 0x4c, 0x0a, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x6f,
- 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52,
- 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
- 0x42, 0x0b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xe5, 0x05,
- 0x0a, 0x11, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
- 0x6f, 0x72, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12,
- 0x60, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f,
- 0x72, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72,
- 0x6d, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
- 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
- 0x73, 0x1a, 0xd1, 0x04, 0x0a, 0x0e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73,
- 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x70, 0x61,
- 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x50,
- 0x61, 0x74, 0x68, 0x12, 0x72, 0x0a, 0x13, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x65,
- 0x72, 0x76, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e,
- 0x32, 0x41, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x54,
- 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x72,
- 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x61,
- 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x10, 0x73, 0x65, 0x74, 0x54, 0x6f, 0x53, 0x65, 0x72, 0x76,
- 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3a, 0x0a, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65,
- 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d,
- 0x65, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x04,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65,
- 0x48, 0x00, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x36, 0x0a, 0x07, 0x6d,
- 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69,
- 0x6d, 0x75, 0x6d, 0x12, 0x59, 0x0a, 0x17, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x5f, 0x6d, 0x69,
- 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x72, 0x72, 0x61, 0x79,
- 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x15, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4d,
- 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x54,
- 0x0a, 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x66, 0x72, 0x6f,
- 0x6d, 0x5f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x72, 0x72, 0x61, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00,
- 0x52, 0x12, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x6c, 0x6c, 0x46, 0x72, 0x6f, 0x6d, 0x41,
- 0x72, 0x72, 0x61, 0x79, 0x22, 0x3d, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x61,
- 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x5f, 0x56, 0x41,
- 0x4c, 0x55, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
- 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x54, 0x49, 0x4d,
- 0x45, 0x10, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
- 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0b, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52,
- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f,
- 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d,
- 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69,
- 0x6d, 0x65, 0x12, 0x47, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x5f,
- 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73,
- 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x98, 0x01, 0x0a, 0x0e,
- 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x39,
- 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52,
- 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72,
- 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x74,
- 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x72, 0x65, 0x6d, 0x6f,
- 0x76, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x06,
- 0x20, 0x03, 0x28, 0x05, 0x52, 0x10, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x54, 0x61, 0x72,
- 0x67, 0x65, 0x74, 0x49, 0x64, 0x73, 0x22, 0x93, 0x01, 0x0a, 0x0e, 0x44, 0x6f, 0x63, 0x75, 0x6d,
- 0x65, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x6f, 0x63,
- 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x6f, 0x63,
- 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64,
- 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28,
- 0x05, 0x52, 0x10, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74,
- 0x49, 0x64, 0x73, 0x12, 0x37, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65,
- 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
- 0x6d, 0x70, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x93, 0x01, 0x0a,
- 0x0e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12,
- 0x1a, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x72,
- 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64,
- 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x10, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64,
- 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x73, 0x12, 0x37, 0x0a, 0x09, 0x72, 0x65, 0x61,
- 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54,
- 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69,
- 0x6d, 0x65, 0x22, 0x8f, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65,
- 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
- 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65,
- 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x49, 0x0a, 0x0f, 0x75, 0x6e, 0x63,
- 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x46, 0x69,
- 0x6c, 0x74, 0x65, 0x72, 0x52, 0x0e, 0x75, 0x6e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x4e,
- 0x61, 0x6d, 0x65, 0x73, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31,
- 0x42, 0x0a, 0x57, 0x72, 0x69, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b,
- 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
- 0x2f, 0x67, 0x6f, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70,
- 0x69, 0x76, 0x31, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0x3b,
- 0x66, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x70, 0x62, 0xa2, 0x02, 0x04, 0x47, 0x43,
- 0x46, 0x53, 0xaa, 0x02, 0x19, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75,
- 0x64, 0x2e, 0x46, 0x69, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02,
- 0x19, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x46, 0x69,
- 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xea, 0x02, 0x1c, 0x47, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x46, 0x69, 0x72, 0x65,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x33,
-}
+const file_google_firestore_v1_write_proto_rawDesc = "" +
+ "\n" +
+ "\x1fgoogle/firestore/v1/write.proto\x12\x13google.firestore.v1\x1a&google/firestore/v1/bloom_filter.proto\x1a google/firestore/v1/common.proto\x1a\"google/firestore/v1/document.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa5\x03\n" +
+ "\x05Write\x127\n" +
+ "\x06update\x18\x01 \x01(\v2\x1d.google.firestore.v1.DocumentH\x00R\x06update\x12\x18\n" +
+ "\x06delete\x18\x02 \x01(\tH\x00R\x06delete\x12F\n" +
+ "\ttransform\x18\x06 \x01(\v2&.google.firestore.v1.DocumentTransformH\x00R\ttransform\x12B\n" +
+ "\vupdate_mask\x18\x03 \x01(\v2!.google.firestore.v1.DocumentMaskR\n" +
+ "updateMask\x12b\n" +
+ "\x11update_transforms\x18\a \x03(\v25.google.firestore.v1.DocumentTransform.FieldTransformR\x10updateTransforms\x12L\n" +
+ "\x10current_document\x18\x04 \x01(\v2!.google.firestore.v1.PreconditionR\x0fcurrentDocumentB\v\n" +
+ "\toperation\"\xe5\x05\n" +
+ "\x11DocumentTransform\x12\x1a\n" +
+ "\bdocument\x18\x01 \x01(\tR\bdocument\x12`\n" +
+ "\x10field_transforms\x18\x02 \x03(\v25.google.firestore.v1.DocumentTransform.FieldTransformR\x0ffieldTransforms\x1a\xd1\x04\n" +
+ "\x0eFieldTransform\x12\x1d\n" +
+ "\n" +
+ "field_path\x18\x01 \x01(\tR\tfieldPath\x12r\n" +
+ "\x13set_to_server_value\x18\x02 \x01(\x0e2A.google.firestore.v1.DocumentTransform.FieldTransform.ServerValueH\x00R\x10setToServerValue\x12:\n" +
+ "\tincrement\x18\x03 \x01(\v2\x1a.google.firestore.v1.ValueH\x00R\tincrement\x126\n" +
+ "\amaximum\x18\x04 \x01(\v2\x1a.google.firestore.v1.ValueH\x00R\amaximum\x126\n" +
+ "\aminimum\x18\x05 \x01(\v2\x1a.google.firestore.v1.ValueH\x00R\aminimum\x12Y\n" +
+ "\x17append_missing_elements\x18\x06 \x01(\v2\x1f.google.firestore.v1.ArrayValueH\x00R\x15appendMissingElements\x12T\n" +
+ "\x15remove_all_from_array\x18\a \x01(\v2\x1f.google.firestore.v1.ArrayValueH\x00R\x12removeAllFromArray\"=\n" +
+ "\vServerValue\x12\x1c\n" +
+ "\x18SERVER_VALUE_UNSPECIFIED\x10\x00\x12\x10\n" +
+ "\fREQUEST_TIME\x10\x01B\x10\n" +
+ "\x0etransform_type\"\x93\x01\n" +
+ "\vWriteResult\x12;\n" +
+ "\vupdate_time\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\n" +
+ "updateTime\x12G\n" +
+ "\x11transform_results\x18\x02 \x03(\v2\x1a.google.firestore.v1.ValueR\x10transformResults\"\x98\x01\n" +
+ "\x0eDocumentChange\x129\n" +
+ "\bdocument\x18\x01 \x01(\v2\x1d.google.firestore.v1.DocumentR\bdocument\x12\x1d\n" +
+ "\n" +
+ "target_ids\x18\x05 \x03(\x05R\ttargetIds\x12,\n" +
+ "\x12removed_target_ids\x18\x06 \x03(\x05R\x10removedTargetIds\"\x93\x01\n" +
+ "\x0eDocumentDelete\x12\x1a\n" +
+ "\bdocument\x18\x01 \x01(\tR\bdocument\x12,\n" +
+ "\x12removed_target_ids\x18\x06 \x03(\x05R\x10removedTargetIds\x127\n" +
+ "\tread_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\breadTime\"\x93\x01\n" +
+ "\x0eDocumentRemove\x12\x1a\n" +
+ "\bdocument\x18\x01 \x01(\tR\bdocument\x12,\n" +
+ "\x12removed_target_ids\x18\x02 \x03(\x05R\x10removedTargetIds\x127\n" +
+ "\tread_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\breadTime\"\x8f\x01\n" +
+ "\x0fExistenceFilter\x12\x1b\n" +
+ "\ttarget_id\x18\x01 \x01(\x05R\btargetId\x12\x14\n" +
+ "\x05count\x18\x02 \x01(\x05R\x05count\x12I\n" +
+ "\x0funchanged_names\x18\x03 \x01(\v2 .google.firestore.v1.BloomFilterR\x0eunchangedNamesB\xc2\x01\n" +
+ "\x17com.google.firestore.v1B\n" +
+ "WriteProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3"
var (
file_google_firestore_v1_write_proto_rawDescOnce sync.Once
- file_google_firestore_v1_write_proto_rawDescData = file_google_firestore_v1_write_proto_rawDesc
+ file_google_firestore_v1_write_proto_rawDescData []byte
)
func file_google_firestore_v1_write_proto_rawDescGZIP() []byte {
file_google_firestore_v1_write_proto_rawDescOnce.Do(func() {
- file_google_firestore_v1_write_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_firestore_v1_write_proto_rawDescData)
+ file_google_firestore_v1_write_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_firestore_v1_write_proto_rawDesc), len(file_google_firestore_v1_write_proto_rawDesc)))
})
return file_google_firestore_v1_write_proto_rawDescData
}
@@ -1103,7 +1017,7 @@ func file_google_firestore_v1_write_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_google_firestore_v1_write_proto_rawDesc,
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_firestore_v1_write_proto_rawDesc), len(file_google_firestore_v1_write_proto_rawDesc)),
NumEnums: 1,
NumMessages: 8,
NumExtensions: 0,
@@ -1115,7 +1029,6 @@ func file_google_firestore_v1_write_proto_init() {
MessageInfos: file_google_firestore_v1_write_proto_msgTypes,
}.Build()
File_google_firestore_v1_write_proto = out.File
- file_google_firestore_v1_write_proto_rawDesc = nil
file_google_firestore_v1_write_proto_goTypes = nil
file_google_firestore_v1_write_proto_depIdxs = nil
}
diff --git a/vendor/cloud.google.com/go/firestore/apiv1/version.go b/vendor/cloud.google.com/go/firestore/apiv1/version.go
index 2105ffa87e..8d9d96aa32 100644
--- a/vendor/cloud.google.com/go/firestore/apiv1/version.go
+++ b/vendor/cloud.google.com/go/firestore/apiv1/version.go
@@ -1,10 +1,10 @@
-// Copyright 2023 Google LLC
+// Copyright 2026 Google LLC
//
// 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
+// https://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,
diff --git a/vendor/cloud.google.com/go/firestore/internal/version.go b/vendor/cloud.google.com/go/firestore/internal/version.go
index fd500844ac..dcd9f62af8 100644
--- a/vendor/cloud.google.com/go/firestore/internal/version.go
+++ b/vendor/cloud.google.com/go/firestore/internal/version.go
@@ -4,7 +4,7 @@
// 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
+// https://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,
@@ -17,4 +17,4 @@
package internal
// Version is the current tagged release of the library.
-const Version = "1.21.0"
+const Version = "1.22.0"
diff --git a/vendor/cloud.google.com/go/iam/CHANGES.md b/vendor/cloud.google.com/go/iam/CHANGES.md
index 6a43a66783..d7853f2340 100644
--- a/vendor/cloud.google.com/go/iam/CHANGES.md
+++ b/vendor/cloud.google.com/go/iam/CHANGES.md
@@ -1,6 +1,20 @@
# Changes
+## [1.13.0](https://github.com/googleapis/google-cloud-go/compare/iam/v1.12.0...iam/v1.13.0) (2026-08-07)
+
+
+### Features
+
+* Update API sources and regenerate ([#20326](https://github.com/googleapis/google-cloud-go/issues/20326)) ([a25826f](https://github.com/googleapis/google-cloud-go/commit/a25826f05527527005b7868284df86df4d46ce05))
+
+## [1.12.0](https://github.com/googleapis/google-cloud-go/compare/iam/v1.11.0...iam/v1.12.0) (2026-07-13)
+
+
+### Features
+
+* **o11y:** Regenerate clients for LRO tracing ([#20107](https://github.com/googleapis/google-cloud-go/issues/20107)) ([779074e](https://github.com/googleapis/google-cloud-go/commit/779074edd267a26520bae459307660953129eb07))
+
## [1.11.0](https://github.com/googleapis/google-cloud-go/releases/tag/iam%2Fv1.11.0) (2026-05-07)
## [1.10.0](https://github.com/googleapis/google-cloud-go/releases/tag/iam%2Fv1.10.0) (2026-04-30)
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go
index a268202504..d960ceed22 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go
@@ -26,6 +26,7 @@ import (
monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
gax "github.com/googleapis/gax-go/v2"
+ "github.com/googleapis/gax-go/v2/callctx"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
@@ -237,6 +238,16 @@ type alertPolicyGRPCClient struct {
// Cloud console (at https://console.cloud.google.com/).
func NewAlertPolicyClient(ctx context.Context, opts ...option.ClientOption) (*AlertPolicyClient, error) {
clientOpts := defaultAlertPolicyGRPCClientOptions()
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{
+ "gcp.client.service": "monitoring",
+ "gcp.client.version": getVersionClient(),
+ "gcp.client.repo": "googleapis/google-cloud-go",
+ "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2",
+ "gcp.client.language": "go",
+ "url.domain": "monitoring.googleapis.com",
+ }))
+ }
if newAlertPolicyClientHook != nil {
hookOpts, err := newAlertPolicyClientHook(ctx, clientHookParams{})
if err != nil {
@@ -258,6 +269,24 @@ func NewAlertPolicyClient(ctx context.Context, opts ...option.ClientOption) (*Al
logger: internaloption.GetLogger(opts),
}
c.setGoogleClientInfo()
+ if gax.IsFeatureEnabled("METRICS") {
+ metrics := gax.NewClientMetrics(
+ gax.WithTelemetryLogger(c.logger),
+ gax.WithTelemetryAttributes(map[string]string{
+ gax.ClientService: "monitoring",
+ gax.ClientVersion: getVersionClient(),
+ gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2",
+ gax.RPCSystem: "grpc",
+ gax.URLDomain: "monitoring.googleapis.com",
+ }),
+ )
+
+ client.CallOptions.ListAlertPolicies = append(client.CallOptions.ListAlertPolicies, gax.WithClientMetrics(metrics))
+ client.CallOptions.GetAlertPolicy = append(client.CallOptions.GetAlertPolicy, gax.WithClientMetrics(metrics))
+ client.CallOptions.CreateAlertPolicy = append(client.CallOptions.CreateAlertPolicy, gax.WithClientMetrics(metrics))
+ client.CallOptions.DeleteAlertPolicy = append(client.CallOptions.DeleteAlertPolicy, gax.WithClientMetrics(metrics))
+ client.CallOptions.UpdateAlertPolicy = append(client.CallOptions.UpdateAlertPolicy, gax.WithClientMetrics(metrics))
+ }
client.internalClient = c
@@ -294,9 +323,15 @@ func (c *alertPolicyGRPCClient) ListAlertPolicies(ctx context.Context, req *moni
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/ListAlertPolicies")
+ }
opts = append((*c.CallOptions).ListAlertPolicies[0:len((*c.CallOptions).ListAlertPolicies):len((*c.CallOptions).ListAlertPolicies)], opts...)
it := &AlertPolicyIterator{}
- req = proto.Clone(req).(*monitoringpb.ListAlertPoliciesRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.AlertPolicy, string, error) {
resp := &monitoringpb.ListAlertPoliciesResponse{}
if pageToken != "" {
@@ -340,6 +375,12 @@ func (c *alertPolicyGRPCClient) GetAlertPolicy(ctx context.Context, req *monitor
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/GetAlertPolicy")
+ }
opts = append((*c.CallOptions).GetAlertPolicy[0:len((*c.CallOptions).GetAlertPolicy):len((*c.CallOptions).GetAlertPolicy)], opts...)
var resp *monitoringpb.AlertPolicy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -358,6 +399,12 @@ func (c *alertPolicyGRPCClient) CreateAlertPolicy(ctx context.Context, req *moni
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/CreateAlertPolicy")
+ }
opts = append((*c.CallOptions).CreateAlertPolicy[0:len((*c.CallOptions).CreateAlertPolicy):len((*c.CallOptions).CreateAlertPolicy)], opts...)
var resp *monitoringpb.AlertPolicy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -376,6 +423,12 @@ func (c *alertPolicyGRPCClient) DeleteAlertPolicy(ctx context.Context, req *moni
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy")
+ }
opts = append((*c.CallOptions).DeleteAlertPolicy[0:len((*c.CallOptions).DeleteAlertPolicy):len((*c.CallOptions).DeleteAlertPolicy)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -390,6 +443,9 @@ func (c *alertPolicyGRPCClient) UpdateAlertPolicy(ctx context.Context, req *moni
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy")
+ }
opts = append((*c.CallOptions).UpdateAlertPolicy[0:len((*c.CallOptions).UpdateAlertPolicy):len((*c.CallOptions).UpdateAlertPolicy)], opts...)
var resp *monitoringpb.AlertPolicy
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go
index 17d5f9ac30..fd134943e7 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go
@@ -26,6 +26,7 @@ import (
monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
gax "github.com/googleapis/gax-go/v2"
+ "github.com/googleapis/gax-go/v2/callctx"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
@@ -258,6 +259,16 @@ type groupGRPCClient struct {
// from the infrastructure.
func NewGroupClient(ctx context.Context, opts ...option.ClientOption) (*GroupClient, error) {
clientOpts := defaultGroupGRPCClientOptions()
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{
+ "gcp.client.service": "monitoring",
+ "gcp.client.version": getVersionClient(),
+ "gcp.client.repo": "googleapis/google-cloud-go",
+ "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2",
+ "gcp.client.language": "go",
+ "url.domain": "monitoring.googleapis.com",
+ }))
+ }
if newGroupClientHook != nil {
hookOpts, err := newGroupClientHook(ctx, clientHookParams{})
if err != nil {
@@ -279,6 +290,25 @@ func NewGroupClient(ctx context.Context, opts ...option.ClientOption) (*GroupCli
logger: internaloption.GetLogger(opts),
}
c.setGoogleClientInfo()
+ if gax.IsFeatureEnabled("METRICS") {
+ metrics := gax.NewClientMetrics(
+ gax.WithTelemetryLogger(c.logger),
+ gax.WithTelemetryAttributes(map[string]string{
+ gax.ClientService: "monitoring",
+ gax.ClientVersion: getVersionClient(),
+ gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2",
+ gax.RPCSystem: "grpc",
+ gax.URLDomain: "monitoring.googleapis.com",
+ }),
+ )
+
+ client.CallOptions.ListGroups = append(client.CallOptions.ListGroups, gax.WithClientMetrics(metrics))
+ client.CallOptions.GetGroup = append(client.CallOptions.GetGroup, gax.WithClientMetrics(metrics))
+ client.CallOptions.CreateGroup = append(client.CallOptions.CreateGroup, gax.WithClientMetrics(metrics))
+ client.CallOptions.UpdateGroup = append(client.CallOptions.UpdateGroup, gax.WithClientMetrics(metrics))
+ client.CallOptions.DeleteGroup = append(client.CallOptions.DeleteGroup, gax.WithClientMetrics(metrics))
+ client.CallOptions.ListGroupMembers = append(client.CallOptions.ListGroupMembers, gax.WithClientMetrics(metrics))
+ }
client.internalClient = c
@@ -315,9 +345,15 @@ func (c *groupGRPCClient) ListGroups(ctx context.Context, req *monitoringpb.List
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/ListGroups")
+ }
opts = append((*c.CallOptions).ListGroups[0:len((*c.CallOptions).ListGroups):len((*c.CallOptions).ListGroups)], opts...)
it := &GroupIterator{}
- req = proto.Clone(req).(*monitoringpb.ListGroupsRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.Group, string, error) {
resp := &monitoringpb.ListGroupsResponse{}
if pageToken != "" {
@@ -361,6 +397,12 @@ func (c *groupGRPCClient) GetGroup(ctx context.Context, req *monitoringpb.GetGro
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/GetGroup")
+ }
opts = append((*c.CallOptions).GetGroup[0:len((*c.CallOptions).GetGroup):len((*c.CallOptions).GetGroup)], opts...)
var resp *monitoringpb.Group
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -379,6 +421,12 @@ func (c *groupGRPCClient) CreateGroup(ctx context.Context, req *monitoringpb.Cre
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/CreateGroup")
+ }
opts = append((*c.CallOptions).CreateGroup[0:len((*c.CallOptions).CreateGroup):len((*c.CallOptions).CreateGroup)], opts...)
var resp *monitoringpb.Group
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -397,6 +445,9 @@ func (c *groupGRPCClient) UpdateGroup(ctx context.Context, req *monitoringpb.Upd
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/UpdateGroup")
+ }
opts = append((*c.CallOptions).UpdateGroup[0:len((*c.CallOptions).UpdateGroup):len((*c.CallOptions).UpdateGroup)], opts...)
var resp *monitoringpb.Group
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -415,6 +466,12 @@ func (c *groupGRPCClient) DeleteGroup(ctx context.Context, req *monitoringpb.Del
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/DeleteGroup")
+ }
opts = append((*c.CallOptions).DeleteGroup[0:len((*c.CallOptions).DeleteGroup):len((*c.CallOptions).DeleteGroup)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -429,9 +486,15 @@ func (c *groupGRPCClient) ListGroupMembers(ctx context.Context, req *monitoringp
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.GroupService/ListGroupMembers")
+ }
opts = append((*c.CallOptions).ListGroupMembers[0:len((*c.CallOptions).ListGroupMembers):len((*c.CallOptions).ListGroupMembers)], opts...)
it := &MonitoredResourceIterator{}
- req = proto.Clone(req).(*monitoringpb.ListGroupMembersRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoredrespb.MonitoredResource, string, error) {
resp := &monitoringpb.ListGroupMembersResponse{}
if pageToken != "" {
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go
index 2584698345..58aceafaaa 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go
@@ -26,6 +26,7 @@ import (
monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
gax "github.com/googleapis/gax-go/v2"
+ "github.com/googleapis/gax-go/v2/callctx"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
@@ -296,6 +297,16 @@ type metricGRPCClient struct {
// time series data.
func NewMetricClient(ctx context.Context, opts ...option.ClientOption) (*MetricClient, error) {
clientOpts := defaultMetricGRPCClientOptions()
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{
+ "gcp.client.service": "monitoring",
+ "gcp.client.version": getVersionClient(),
+ "gcp.client.repo": "googleapis/google-cloud-go",
+ "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2",
+ "gcp.client.language": "go",
+ "url.domain": "monitoring.googleapis.com",
+ }))
+ }
if newMetricClientHook != nil {
hookOpts, err := newMetricClientHook(ctx, clientHookParams{})
if err != nil {
@@ -317,6 +328,28 @@ func NewMetricClient(ctx context.Context, opts ...option.ClientOption) (*MetricC
logger: internaloption.GetLogger(opts),
}
c.setGoogleClientInfo()
+ if gax.IsFeatureEnabled("METRICS") {
+ metrics := gax.NewClientMetrics(
+ gax.WithTelemetryLogger(c.logger),
+ gax.WithTelemetryAttributes(map[string]string{
+ gax.ClientService: "monitoring",
+ gax.ClientVersion: getVersionClient(),
+ gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2",
+ gax.RPCSystem: "grpc",
+ gax.URLDomain: "monitoring.googleapis.com",
+ }),
+ )
+
+ client.CallOptions.ListMonitoredResourceDescriptors = append(client.CallOptions.ListMonitoredResourceDescriptors, gax.WithClientMetrics(metrics))
+ client.CallOptions.GetMonitoredResourceDescriptor = append(client.CallOptions.GetMonitoredResourceDescriptor, gax.WithClientMetrics(metrics))
+ client.CallOptions.ListMetricDescriptors = append(client.CallOptions.ListMetricDescriptors, gax.WithClientMetrics(metrics))
+ client.CallOptions.GetMetricDescriptor = append(client.CallOptions.GetMetricDescriptor, gax.WithClientMetrics(metrics))
+ client.CallOptions.CreateMetricDescriptor = append(client.CallOptions.CreateMetricDescriptor, gax.WithClientMetrics(metrics))
+ client.CallOptions.DeleteMetricDescriptor = append(client.CallOptions.DeleteMetricDescriptor, gax.WithClientMetrics(metrics))
+ client.CallOptions.ListTimeSeries = append(client.CallOptions.ListTimeSeries, gax.WithClientMetrics(metrics))
+ client.CallOptions.CreateTimeSeries = append(client.CallOptions.CreateTimeSeries, gax.WithClientMetrics(metrics))
+ client.CallOptions.CreateServiceTimeSeries = append(client.CallOptions.CreateServiceTimeSeries, gax.WithClientMetrics(metrics))
+ }
client.internalClient = c
@@ -353,9 +386,15 @@ func (c *metricGRPCClient) ListMonitoredResourceDescriptors(ctx context.Context,
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors")
+ }
opts = append((*c.CallOptions).ListMonitoredResourceDescriptors[0:len((*c.CallOptions).ListMonitoredResourceDescriptors):len((*c.CallOptions).ListMonitoredResourceDescriptors)], opts...)
it := &MonitoredResourceDescriptorIterator{}
- req = proto.Clone(req).(*monitoringpb.ListMonitoredResourceDescriptorsRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoredrespb.MonitoredResourceDescriptor, string, error) {
resp := &monitoringpb.ListMonitoredResourceDescriptorsResponse{}
if pageToken != "" {
@@ -399,6 +438,12 @@ func (c *metricGRPCClient) GetMonitoredResourceDescriptor(ctx context.Context, r
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor")
+ }
opts = append((*c.CallOptions).GetMonitoredResourceDescriptor[0:len((*c.CallOptions).GetMonitoredResourceDescriptor):len((*c.CallOptions).GetMonitoredResourceDescriptor)], opts...)
var resp *monitoredrespb.MonitoredResourceDescriptor
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -417,9 +462,15 @@ func (c *metricGRPCClient) ListMetricDescriptors(ctx context.Context, req *monit
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/ListMetricDescriptors")
+ }
opts = append((*c.CallOptions).ListMetricDescriptors[0:len((*c.CallOptions).ListMetricDescriptors):len((*c.CallOptions).ListMetricDescriptors)], opts...)
it := &MetricDescriptorIterator{}
- req = proto.Clone(req).(*monitoringpb.ListMetricDescriptorsRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*metricpb.MetricDescriptor, string, error) {
resp := &monitoringpb.ListMetricDescriptorsResponse{}
if pageToken != "" {
@@ -463,6 +514,12 @@ func (c *metricGRPCClient) GetMetricDescriptor(ctx context.Context, req *monitor
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/GetMetricDescriptor")
+ }
opts = append((*c.CallOptions).GetMetricDescriptor[0:len((*c.CallOptions).GetMetricDescriptor):len((*c.CallOptions).GetMetricDescriptor)], opts...)
var resp *metricpb.MetricDescriptor
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -481,6 +538,12 @@ func (c *metricGRPCClient) CreateMetricDescriptor(ctx context.Context, req *moni
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/CreateMetricDescriptor")
+ }
opts = append((*c.CallOptions).CreateMetricDescriptor[0:len((*c.CallOptions).CreateMetricDescriptor):len((*c.CallOptions).CreateMetricDescriptor)], opts...)
var resp *metricpb.MetricDescriptor
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -499,6 +562,12 @@ func (c *metricGRPCClient) DeleteMetricDescriptor(ctx context.Context, req *moni
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/DeleteMetricDescriptor")
+ }
opts = append((*c.CallOptions).DeleteMetricDescriptor[0:len((*c.CallOptions).DeleteMetricDescriptor):len((*c.CallOptions).DeleteMetricDescriptor)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -513,9 +582,15 @@ func (c *metricGRPCClient) ListTimeSeries(ctx context.Context, req *monitoringpb
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/ListTimeSeries")
+ }
opts = append((*c.CallOptions).ListTimeSeries[0:len((*c.CallOptions).ListTimeSeries):len((*c.CallOptions).ListTimeSeries)], opts...)
it := &TimeSeriesIterator{}
- req = proto.Clone(req).(*monitoringpb.ListTimeSeriesRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.TimeSeries, string, error) {
resp := &monitoringpb.ListTimeSeriesResponse{}
if pageToken != "" {
@@ -559,6 +634,12 @@ func (c *metricGRPCClient) CreateTimeSeries(ctx context.Context, req *monitoring
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/CreateTimeSeries")
+ }
opts = append((*c.CallOptions).CreateTimeSeries[0:len((*c.CallOptions).CreateTimeSeries):len((*c.CallOptions).CreateTimeSeries)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -573,6 +654,12 @@ func (c *metricGRPCClient) CreateServiceTimeSeries(ctx context.Context, req *mon
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.MetricService/CreateServiceTimeSeries")
+ }
opts = append((*c.CallOptions).CreateServiceTimeSeries[0:len((*c.CallOptions).CreateServiceTimeSeries):len((*c.CallOptions).CreateServiceTimeSeries)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go
index 9344c13575..0e0b0f58f8 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/alert.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go
index 0bf780fe85..9db077f43d 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/alert_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go
index 861849e02a..a9e32797c9 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
-// - protoc v4.25.7
+// - protoc v6.33.2
// source: google/monitoring/v3/alert_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go
index 1b0121c11a..f09a3d9589 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/common.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go
index de6375fc00..ad8d2361ae 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/dropped_labels.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go
index 3b08e8af98..03c6fc298d 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/group.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go
index a45505ad3e..cb2af61ba5 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/group_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go
index cc3402f1f5..0d94d9a72a 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
-// - protoc v4.25.7
+// - protoc v6.33.2
// source: google/monitoring/v3/group_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go
index 2ad077940e..de021e107d 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/metric.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go
index e6de1cd533..fc6e03699a 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/metric_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go
index 9656352344..a2627fbd7a 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
-// - protoc v4.25.7
+// - protoc v6.33.2
// source: google/monitoring/v3/metric_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go
index aa705ab762..12d685d910 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/mutation_record.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go
index 4cff05f350..e98909d56f 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/notification.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go
index c0d18163c9..9311171187 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/notification_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go
index db17ffddd9..8adf4a88f6 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
-// - protoc v4.25.7
+// - protoc v6.33.2
// source: google/monitoring/v3/notification_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go
index a652facf27..e175b33bf2 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/query_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go
index 9f52098810..7fef265221 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
-// - protoc v4.25.7
+// - protoc v6.33.2
// source: google/monitoring/v3/query_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go
index 87573d82ce..b0448b0dbc 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go
index 6e0990dbfb..446fa68e1a 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/service_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go
index 0bc80f64f7..96bfe0ab67 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
-// - protoc v4.25.7
+// - protoc v6.33.2
// source: google/monitoring/v3/service_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go
index 3091de7629..423d366af0 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/snooze.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go
index daa14488db..4cc87a4840 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/snooze_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go
index aebe4703f6..fe198fddd1 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
-// - protoc v4.25.7
+// - protoc v6.33.2
// source: google/monitoring/v3/snooze_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go
index 7e4728d14f..62e484ce6f 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/span_context.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go
index 754d034221..b2b96799bc 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/uptime.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go
index f3c3b68f56..3196f0d285 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
-// protoc v4.25.7
+// protoc v6.33.2
// source: google/monitoring/v3/uptime_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go
index d19e0846f3..40727e4e8a 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go
@@ -15,7 +15,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
-// - protoc v4.25.7
+// - protoc v6.33.2
// source: google/monitoring/v3/uptime_service.proto
package monitoringpb
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go
index 4901db1045..80462496d1 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go
@@ -26,6 +26,7 @@ import (
monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
gax "github.com/googleapis/gax-go/v2"
+ "github.com/googleapis/gax-go/v2/callctx"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
@@ -342,6 +343,16 @@ type notificationChannelGRPCClient struct {
// controls how messages related to incidents are sent.
func NewNotificationChannelClient(ctx context.Context, opts ...option.ClientOption) (*NotificationChannelClient, error) {
clientOpts := defaultNotificationChannelGRPCClientOptions()
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{
+ "gcp.client.service": "monitoring",
+ "gcp.client.version": getVersionClient(),
+ "gcp.client.repo": "googleapis/google-cloud-go",
+ "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2",
+ "gcp.client.language": "go",
+ "url.domain": "monitoring.googleapis.com",
+ }))
+ }
if newNotificationChannelClientHook != nil {
hookOpts, err := newNotificationChannelClientHook(ctx, clientHookParams{})
if err != nil {
@@ -363,6 +374,29 @@ func NewNotificationChannelClient(ctx context.Context, opts ...option.ClientOpti
logger: internaloption.GetLogger(opts),
}
c.setGoogleClientInfo()
+ if gax.IsFeatureEnabled("METRICS") {
+ metrics := gax.NewClientMetrics(
+ gax.WithTelemetryLogger(c.logger),
+ gax.WithTelemetryAttributes(map[string]string{
+ gax.ClientService: "monitoring",
+ gax.ClientVersion: getVersionClient(),
+ gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2",
+ gax.RPCSystem: "grpc",
+ gax.URLDomain: "monitoring.googleapis.com",
+ }),
+ )
+
+ client.CallOptions.ListNotificationChannelDescriptors = append(client.CallOptions.ListNotificationChannelDescriptors, gax.WithClientMetrics(metrics))
+ client.CallOptions.GetNotificationChannelDescriptor = append(client.CallOptions.GetNotificationChannelDescriptor, gax.WithClientMetrics(metrics))
+ client.CallOptions.ListNotificationChannels = append(client.CallOptions.ListNotificationChannels, gax.WithClientMetrics(metrics))
+ client.CallOptions.GetNotificationChannel = append(client.CallOptions.GetNotificationChannel, gax.WithClientMetrics(metrics))
+ client.CallOptions.CreateNotificationChannel = append(client.CallOptions.CreateNotificationChannel, gax.WithClientMetrics(metrics))
+ client.CallOptions.UpdateNotificationChannel = append(client.CallOptions.UpdateNotificationChannel, gax.WithClientMetrics(metrics))
+ client.CallOptions.DeleteNotificationChannel = append(client.CallOptions.DeleteNotificationChannel, gax.WithClientMetrics(metrics))
+ client.CallOptions.SendNotificationChannelVerificationCode = append(client.CallOptions.SendNotificationChannelVerificationCode, gax.WithClientMetrics(metrics))
+ client.CallOptions.GetNotificationChannelVerificationCode = append(client.CallOptions.GetNotificationChannelVerificationCode, gax.WithClientMetrics(metrics))
+ client.CallOptions.VerifyNotificationChannel = append(client.CallOptions.VerifyNotificationChannel, gax.WithClientMetrics(metrics))
+ }
client.internalClient = c
@@ -399,9 +433,15 @@ func (c *notificationChannelGRPCClient) ListNotificationChannelDescriptors(ctx c
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors")
+ }
opts = append((*c.CallOptions).ListNotificationChannelDescriptors[0:len((*c.CallOptions).ListNotificationChannelDescriptors):len((*c.CallOptions).ListNotificationChannelDescriptors)], opts...)
it := &NotificationChannelDescriptorIterator{}
- req = proto.Clone(req).(*monitoringpb.ListNotificationChannelDescriptorsRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.NotificationChannelDescriptor, string, error) {
resp := &monitoringpb.ListNotificationChannelDescriptorsResponse{}
if pageToken != "" {
@@ -445,6 +485,12 @@ func (c *notificationChannelGRPCClient) GetNotificationChannelDescriptor(ctx con
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor")
+ }
opts = append((*c.CallOptions).GetNotificationChannelDescriptor[0:len((*c.CallOptions).GetNotificationChannelDescriptor):len((*c.CallOptions).GetNotificationChannelDescriptor)], opts...)
var resp *monitoringpb.NotificationChannelDescriptor
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -463,9 +509,15 @@ func (c *notificationChannelGRPCClient) ListNotificationChannels(ctx context.Con
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/ListNotificationChannels")
+ }
opts = append((*c.CallOptions).ListNotificationChannels[0:len((*c.CallOptions).ListNotificationChannels):len((*c.CallOptions).ListNotificationChannels)], opts...)
it := &NotificationChannelIterator{}
- req = proto.Clone(req).(*monitoringpb.ListNotificationChannelsRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.NotificationChannel, string, error) {
resp := &monitoringpb.ListNotificationChannelsResponse{}
if pageToken != "" {
@@ -509,6 +561,12 @@ func (c *notificationChannelGRPCClient) GetNotificationChannel(ctx context.Conte
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/GetNotificationChannel")
+ }
opts = append((*c.CallOptions).GetNotificationChannel[0:len((*c.CallOptions).GetNotificationChannel):len((*c.CallOptions).GetNotificationChannel)], opts...)
var resp *monitoringpb.NotificationChannel
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -527,6 +585,12 @@ func (c *notificationChannelGRPCClient) CreateNotificationChannel(ctx context.Co
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/CreateNotificationChannel")
+ }
opts = append((*c.CallOptions).CreateNotificationChannel[0:len((*c.CallOptions).CreateNotificationChannel):len((*c.CallOptions).CreateNotificationChannel)], opts...)
var resp *monitoringpb.NotificationChannel
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -545,6 +609,9 @@ func (c *notificationChannelGRPCClient) UpdateNotificationChannel(ctx context.Co
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel")
+ }
opts = append((*c.CallOptions).UpdateNotificationChannel[0:len((*c.CallOptions).UpdateNotificationChannel):len((*c.CallOptions).UpdateNotificationChannel)], opts...)
var resp *monitoringpb.NotificationChannel
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -563,6 +630,12 @@ func (c *notificationChannelGRPCClient) DeleteNotificationChannel(ctx context.Co
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel")
+ }
opts = append((*c.CallOptions).DeleteNotificationChannel[0:len((*c.CallOptions).DeleteNotificationChannel):len((*c.CallOptions).DeleteNotificationChannel)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -577,6 +650,12 @@ func (c *notificationChannelGRPCClient) SendNotificationChannelVerificationCode(
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode")
+ }
opts = append((*c.CallOptions).SendNotificationChannelVerificationCode[0:len((*c.CallOptions).SendNotificationChannelVerificationCode):len((*c.CallOptions).SendNotificationChannelVerificationCode)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -591,6 +670,12 @@ func (c *notificationChannelGRPCClient) GetNotificationChannelVerificationCode(c
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode")
+ }
opts = append((*c.CallOptions).GetNotificationChannelVerificationCode[0:len((*c.CallOptions).GetNotificationChannelVerificationCode):len((*c.CallOptions).GetNotificationChannelVerificationCode)], opts...)
var resp *monitoringpb.GetNotificationChannelVerificationCodeResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -609,6 +694,12 @@ func (c *notificationChannelGRPCClient) VerifyNotificationChannel(ctx context.Co
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel")
+ }
opts = append((*c.CallOptions).VerifyNotificationChannel[0:len((*c.CallOptions).VerifyNotificationChannel):len((*c.CallOptions).VerifyNotificationChannel)], opts...)
var resp *monitoringpb.NotificationChannel
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go
index 9160d21618..236a85b232 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go
@@ -25,6 +25,7 @@ import (
monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
gax "github.com/googleapis/gax-go/v2"
+ "github.com/googleapis/gax-go/v2/callctx"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
@@ -144,6 +145,16 @@ type queryGRPCClient struct {
// the time-varying values of a metric.
func NewQueryClient(ctx context.Context, opts ...option.ClientOption) (*QueryClient, error) {
clientOpts := defaultQueryGRPCClientOptions()
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{
+ "gcp.client.service": "monitoring",
+ "gcp.client.version": getVersionClient(),
+ "gcp.client.repo": "googleapis/google-cloud-go",
+ "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2",
+ "gcp.client.language": "go",
+ "url.domain": "monitoring.googleapis.com",
+ }))
+ }
if newQueryClientHook != nil {
hookOpts, err := newQueryClientHook(ctx, clientHookParams{})
if err != nil {
@@ -165,6 +176,20 @@ func NewQueryClient(ctx context.Context, opts ...option.ClientOption) (*QueryCli
logger: internaloption.GetLogger(opts),
}
c.setGoogleClientInfo()
+ if gax.IsFeatureEnabled("METRICS") {
+ metrics := gax.NewClientMetrics(
+ gax.WithTelemetryLogger(c.logger),
+ gax.WithTelemetryAttributes(map[string]string{
+ gax.ClientService: "monitoring",
+ gax.ClientVersion: getVersionClient(),
+ gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2",
+ gax.RPCSystem: "grpc",
+ gax.URLDomain: "monitoring.googleapis.com",
+ }),
+ )
+
+ client.CallOptions.QueryTimeSeries = append(client.CallOptions.QueryTimeSeries, gax.WithClientMetrics(metrics))
+ }
client.internalClient = c
@@ -201,9 +226,12 @@ func (c *queryGRPCClient) QueryTimeSeries(ctx context.Context, req *monitoringpb
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.QueryService/QueryTimeSeries")
+ }
opts = append((*c.CallOptions).QueryTimeSeries[0:len((*c.CallOptions).QueryTimeSeries):len((*c.CallOptions).QueryTimeSeries)], opts...)
it := &TimeSeriesDataIterator{}
- req = proto.Clone(req).(*monitoringpb.QueryTimeSeriesRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.TimeSeriesData, string, error) {
resp := &monitoringpb.QueryTimeSeriesResponse{}
if pageToken != "" {
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go
index 39f5cf31d8..6498d81992 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go
@@ -26,6 +26,7 @@ import (
monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
gax "github.com/googleapis/gax-go/v2"
+ "github.com/googleapis/gax-go/v2/callctx"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
@@ -289,6 +290,16 @@ type serviceMonitoringGRPCClient struct {
// taxonomy of categorized Health Metrics.
func NewServiceMonitoringClient(ctx context.Context, opts ...option.ClientOption) (*ServiceMonitoringClient, error) {
clientOpts := defaultServiceMonitoringGRPCClientOptions()
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{
+ "gcp.client.service": "monitoring",
+ "gcp.client.version": getVersionClient(),
+ "gcp.client.repo": "googleapis/google-cloud-go",
+ "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2",
+ "gcp.client.language": "go",
+ "url.domain": "monitoring.googleapis.com",
+ }))
+ }
if newServiceMonitoringClientHook != nil {
hookOpts, err := newServiceMonitoringClientHook(ctx, clientHookParams{})
if err != nil {
@@ -310,6 +321,29 @@ func NewServiceMonitoringClient(ctx context.Context, opts ...option.ClientOption
logger: internaloption.GetLogger(opts),
}
c.setGoogleClientInfo()
+ if gax.IsFeatureEnabled("METRICS") {
+ metrics := gax.NewClientMetrics(
+ gax.WithTelemetryLogger(c.logger),
+ gax.WithTelemetryAttributes(map[string]string{
+ gax.ClientService: "monitoring",
+ gax.ClientVersion: getVersionClient(),
+ gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2",
+ gax.RPCSystem: "grpc",
+ gax.URLDomain: "monitoring.googleapis.com",
+ }),
+ )
+
+ client.CallOptions.CreateService = append(client.CallOptions.CreateService, gax.WithClientMetrics(metrics))
+ client.CallOptions.GetService = append(client.CallOptions.GetService, gax.WithClientMetrics(metrics))
+ client.CallOptions.ListServices = append(client.CallOptions.ListServices, gax.WithClientMetrics(metrics))
+ client.CallOptions.UpdateService = append(client.CallOptions.UpdateService, gax.WithClientMetrics(metrics))
+ client.CallOptions.DeleteService = append(client.CallOptions.DeleteService, gax.WithClientMetrics(metrics))
+ client.CallOptions.CreateServiceLevelObjective = append(client.CallOptions.CreateServiceLevelObjective, gax.WithClientMetrics(metrics))
+ client.CallOptions.GetServiceLevelObjective = append(client.CallOptions.GetServiceLevelObjective, gax.WithClientMetrics(metrics))
+ client.CallOptions.ListServiceLevelObjectives = append(client.CallOptions.ListServiceLevelObjectives, gax.WithClientMetrics(metrics))
+ client.CallOptions.UpdateServiceLevelObjective = append(client.CallOptions.UpdateServiceLevelObjective, gax.WithClientMetrics(metrics))
+ client.CallOptions.DeleteServiceLevelObjective = append(client.CallOptions.DeleteServiceLevelObjective, gax.WithClientMetrics(metrics))
+ }
client.internalClient = c
@@ -346,6 +380,12 @@ func (c *serviceMonitoringGRPCClient) CreateService(ctx context.Context, req *mo
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/CreateService")
+ }
opts = append((*c.CallOptions).CreateService[0:len((*c.CallOptions).CreateService):len((*c.CallOptions).CreateService)], opts...)
var resp *monitoringpb.Service
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -364,6 +404,12 @@ func (c *serviceMonitoringGRPCClient) GetService(ctx context.Context, req *monit
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/GetService")
+ }
opts = append((*c.CallOptions).GetService[0:len((*c.CallOptions).GetService):len((*c.CallOptions).GetService)], opts...)
var resp *monitoringpb.Service
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -382,9 +428,15 @@ func (c *serviceMonitoringGRPCClient) ListServices(ctx context.Context, req *mon
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/ListServices")
+ }
opts = append((*c.CallOptions).ListServices[0:len((*c.CallOptions).ListServices):len((*c.CallOptions).ListServices)], opts...)
it := &ServiceIterator{}
- req = proto.Clone(req).(*monitoringpb.ListServicesRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.Service, string, error) {
resp := &monitoringpb.ListServicesResponse{}
if pageToken != "" {
@@ -428,6 +480,9 @@ func (c *serviceMonitoringGRPCClient) UpdateService(ctx context.Context, req *mo
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/UpdateService")
+ }
opts = append((*c.CallOptions).UpdateService[0:len((*c.CallOptions).UpdateService):len((*c.CallOptions).UpdateService)], opts...)
var resp *monitoringpb.Service
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -446,6 +501,12 @@ func (c *serviceMonitoringGRPCClient) DeleteService(ctx context.Context, req *mo
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/DeleteService")
+ }
opts = append((*c.CallOptions).DeleteService[0:len((*c.CallOptions).DeleteService):len((*c.CallOptions).DeleteService)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -460,6 +521,12 @@ func (c *serviceMonitoringGRPCClient) CreateServiceLevelObjective(ctx context.Co
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective")
+ }
opts = append((*c.CallOptions).CreateServiceLevelObjective[0:len((*c.CallOptions).CreateServiceLevelObjective):len((*c.CallOptions).CreateServiceLevelObjective)], opts...)
var resp *monitoringpb.ServiceLevelObjective
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -478,6 +545,12 @@ func (c *serviceMonitoringGRPCClient) GetServiceLevelObjective(ctx context.Conte
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective")
+ }
opts = append((*c.CallOptions).GetServiceLevelObjective[0:len((*c.CallOptions).GetServiceLevelObjective):len((*c.CallOptions).GetServiceLevelObjective)], opts...)
var resp *monitoringpb.ServiceLevelObjective
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -496,9 +569,15 @@ func (c *serviceMonitoringGRPCClient) ListServiceLevelObjectives(ctx context.Con
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives")
+ }
opts = append((*c.CallOptions).ListServiceLevelObjectives[0:len((*c.CallOptions).ListServiceLevelObjectives):len((*c.CallOptions).ListServiceLevelObjectives)], opts...)
it := &ServiceLevelObjectiveIterator{}
- req = proto.Clone(req).(*monitoringpb.ListServiceLevelObjectivesRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.ServiceLevelObjective, string, error) {
resp := &monitoringpb.ListServiceLevelObjectivesResponse{}
if pageToken != "" {
@@ -542,6 +621,9 @@ func (c *serviceMonitoringGRPCClient) UpdateServiceLevelObjective(ctx context.Co
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective")
+ }
opts = append((*c.CallOptions).UpdateServiceLevelObjective[0:len((*c.CallOptions).UpdateServiceLevelObjective):len((*c.CallOptions).UpdateServiceLevelObjective)], opts...)
var resp *monitoringpb.ServiceLevelObjective
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -560,6 +642,12 @@ func (c *serviceMonitoringGRPCClient) DeleteServiceLevelObjective(ctx context.Co
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective")
+ }
opts = append((*c.CallOptions).DeleteServiceLevelObjective[0:len((*c.CallOptions).DeleteServiceLevelObjective):len((*c.CallOptions).DeleteServiceLevelObjective)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go
index a664900f49..1e325ecd34 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go
@@ -26,6 +26,7 @@ import (
monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
gax "github.com/googleapis/gax-go/v2"
+ "github.com/googleapis/gax-go/v2/callctx"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
@@ -195,6 +196,16 @@ type snoozeGRPCClient struct {
// or more alert policies should not fire alerts for the specified duration.
func NewSnoozeClient(ctx context.Context, opts ...option.ClientOption) (*SnoozeClient, error) {
clientOpts := defaultSnoozeGRPCClientOptions()
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{
+ "gcp.client.service": "monitoring",
+ "gcp.client.version": getVersionClient(),
+ "gcp.client.repo": "googleapis/google-cloud-go",
+ "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2",
+ "gcp.client.language": "go",
+ "url.domain": "monitoring.googleapis.com",
+ }))
+ }
if newSnoozeClientHook != nil {
hookOpts, err := newSnoozeClientHook(ctx, clientHookParams{})
if err != nil {
@@ -216,6 +227,23 @@ func NewSnoozeClient(ctx context.Context, opts ...option.ClientOption) (*SnoozeC
logger: internaloption.GetLogger(opts),
}
c.setGoogleClientInfo()
+ if gax.IsFeatureEnabled("METRICS") {
+ metrics := gax.NewClientMetrics(
+ gax.WithTelemetryLogger(c.logger),
+ gax.WithTelemetryAttributes(map[string]string{
+ gax.ClientService: "monitoring",
+ gax.ClientVersion: getVersionClient(),
+ gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2",
+ gax.RPCSystem: "grpc",
+ gax.URLDomain: "monitoring.googleapis.com",
+ }),
+ )
+
+ client.CallOptions.CreateSnooze = append(client.CallOptions.CreateSnooze, gax.WithClientMetrics(metrics))
+ client.CallOptions.ListSnoozes = append(client.CallOptions.ListSnoozes, gax.WithClientMetrics(metrics))
+ client.CallOptions.GetSnooze = append(client.CallOptions.GetSnooze, gax.WithClientMetrics(metrics))
+ client.CallOptions.UpdateSnooze = append(client.CallOptions.UpdateSnooze, gax.WithClientMetrics(metrics))
+ }
client.internalClient = c
@@ -252,6 +280,12 @@ func (c *snoozeGRPCClient) CreateSnooze(ctx context.Context, req *monitoringpb.C
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.SnoozeService/CreateSnooze")
+ }
opts = append((*c.CallOptions).CreateSnooze[0:len((*c.CallOptions).CreateSnooze):len((*c.CallOptions).CreateSnooze)], opts...)
var resp *monitoringpb.Snooze
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -270,9 +304,15 @@ func (c *snoozeGRPCClient) ListSnoozes(ctx context.Context, req *monitoringpb.Li
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.SnoozeService/ListSnoozes")
+ }
opts = append((*c.CallOptions).ListSnoozes[0:len((*c.CallOptions).ListSnoozes):len((*c.CallOptions).ListSnoozes)], opts...)
it := &SnoozeIterator{}
- req = proto.Clone(req).(*monitoringpb.ListSnoozesRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.Snooze, string, error) {
resp := &monitoringpb.ListSnoozesResponse{}
if pageToken != "" {
@@ -316,6 +356,12 @@ func (c *snoozeGRPCClient) GetSnooze(ctx context.Context, req *monitoringpb.GetS
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.SnoozeService/GetSnooze")
+ }
opts = append((*c.CallOptions).GetSnooze[0:len((*c.CallOptions).GetSnooze):len((*c.CallOptions).GetSnooze)], opts...)
var resp *monitoringpb.Snooze
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -334,6 +380,9 @@ func (c *snoozeGRPCClient) UpdateSnooze(ctx context.Context, req *monitoringpb.U
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.SnoozeService/UpdateSnooze")
+ }
opts = append((*c.CallOptions).UpdateSnooze[0:len((*c.CallOptions).UpdateSnooze):len((*c.CallOptions).UpdateSnooze)], opts...)
var resp *monitoringpb.Snooze
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go
index 427d508269..d120f4b4eb 100644
--- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go
+++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go
@@ -26,6 +26,7 @@ import (
monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
gax "github.com/googleapis/gax-go/v2"
+ "github.com/googleapis/gax-go/v2/callctx"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
@@ -245,6 +246,16 @@ type uptimeCheckGRPCClient struct {
// Monitoring, and then clicking on “Uptime”.
func NewUptimeCheckClient(ctx context.Context, opts ...option.ClientOption) (*UptimeCheckClient, error) {
clientOpts := defaultUptimeCheckGRPCClientOptions()
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{
+ "gcp.client.service": "monitoring",
+ "gcp.client.version": getVersionClient(),
+ "gcp.client.repo": "googleapis/google-cloud-go",
+ "gcp.client.artifact": "cloud.google.com/go/monitoring/apiv3/v2",
+ "gcp.client.language": "go",
+ "url.domain": "monitoring.googleapis.com",
+ }))
+ }
if newUptimeCheckClientHook != nil {
hookOpts, err := newUptimeCheckClientHook(ctx, clientHookParams{})
if err != nil {
@@ -266,6 +277,25 @@ func NewUptimeCheckClient(ctx context.Context, opts ...option.ClientOption) (*Up
logger: internaloption.GetLogger(opts),
}
c.setGoogleClientInfo()
+ if gax.IsFeatureEnabled("METRICS") {
+ metrics := gax.NewClientMetrics(
+ gax.WithTelemetryLogger(c.logger),
+ gax.WithTelemetryAttributes(map[string]string{
+ gax.ClientService: "monitoring",
+ gax.ClientVersion: getVersionClient(),
+ gax.ClientArtifact: "cloud.google.com/go/monitoring/apiv3/v2",
+ gax.RPCSystem: "grpc",
+ gax.URLDomain: "monitoring.googleapis.com",
+ }),
+ )
+
+ client.CallOptions.ListUptimeCheckConfigs = append(client.CallOptions.ListUptimeCheckConfigs, gax.WithClientMetrics(metrics))
+ client.CallOptions.GetUptimeCheckConfig = append(client.CallOptions.GetUptimeCheckConfig, gax.WithClientMetrics(metrics))
+ client.CallOptions.CreateUptimeCheckConfig = append(client.CallOptions.CreateUptimeCheckConfig, gax.WithClientMetrics(metrics))
+ client.CallOptions.UpdateUptimeCheckConfig = append(client.CallOptions.UpdateUptimeCheckConfig, gax.WithClientMetrics(metrics))
+ client.CallOptions.DeleteUptimeCheckConfig = append(client.CallOptions.DeleteUptimeCheckConfig, gax.WithClientMetrics(metrics))
+ client.CallOptions.ListUptimeCheckIps = append(client.CallOptions.ListUptimeCheckIps, gax.WithClientMetrics(metrics))
+ }
client.internalClient = c
@@ -302,9 +332,15 @@ func (c *uptimeCheckGRPCClient) ListUptimeCheckConfigs(ctx context.Context, req
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs")
+ }
opts = append((*c.CallOptions).ListUptimeCheckConfigs[0:len((*c.CallOptions).ListUptimeCheckConfigs):len((*c.CallOptions).ListUptimeCheckConfigs)], opts...)
it := &UptimeCheckConfigIterator{}
- req = proto.Clone(req).(*monitoringpb.ListUptimeCheckConfigsRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.UptimeCheckConfig, string, error) {
resp := &monitoringpb.ListUptimeCheckConfigsResponse{}
if pageToken != "" {
@@ -348,6 +384,12 @@ func (c *uptimeCheckGRPCClient) GetUptimeCheckConfig(ctx context.Context, req *m
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig")
+ }
opts = append((*c.CallOptions).GetUptimeCheckConfig[0:len((*c.CallOptions).GetUptimeCheckConfig):len((*c.CallOptions).GetUptimeCheckConfig)], opts...)
var resp *monitoringpb.UptimeCheckConfig
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -366,6 +408,12 @@ func (c *uptimeCheckGRPCClient) CreateUptimeCheckConfig(ctx context.Context, req
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetParent()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig")
+ }
opts = append((*c.CallOptions).CreateUptimeCheckConfig[0:len((*c.CallOptions).CreateUptimeCheckConfig):len((*c.CallOptions).CreateUptimeCheckConfig)], opts...)
var resp *monitoringpb.UptimeCheckConfig
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -384,6 +432,9 @@ func (c *uptimeCheckGRPCClient) UpdateUptimeCheckConfig(ctx context.Context, req
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig")
+ }
opts = append((*c.CallOptions).UpdateUptimeCheckConfig[0:len((*c.CallOptions).UpdateUptimeCheckConfig):len((*c.CallOptions).UpdateUptimeCheckConfig)], opts...)
var resp *monitoringpb.UptimeCheckConfig
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -402,6 +453,12 @@ func (c *uptimeCheckGRPCClient) DeleteUptimeCheckConfig(ctx context.Context, req
hds = append(c.xGoogHeaders, hds...)
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "resource_name", fmt.Sprintf("//monitoring.googleapis.com/%v", req.GetName()))
+ }
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig")
+ }
opts = append((*c.CallOptions).DeleteUptimeCheckConfig[0:len((*c.CallOptions).DeleteUptimeCheckConfig):len((*c.CallOptions).DeleteUptimeCheckConfig)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -413,9 +470,12 @@ func (c *uptimeCheckGRPCClient) DeleteUptimeCheckConfig(ctx context.Context, req
func (c *uptimeCheckGRPCClient) ListUptimeCheckIps(ctx context.Context, req *monitoringpb.ListUptimeCheckIpsRequest, opts ...gax.CallOption) *UptimeCheckIpIterator {
ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...)
+ if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") {
+ ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps")
+ }
opts = append((*c.CallOptions).ListUptimeCheckIps[0:len((*c.CallOptions).ListUptimeCheckIps):len((*c.CallOptions).ListUptimeCheckIps)], opts...)
it := &UptimeCheckIpIterator{}
- req = proto.Clone(req).(*monitoringpb.ListUptimeCheckIpsRequest)
+ req = proto.CloneOf(req)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoringpb.UptimeCheckIp, string, error) {
resp := &monitoringpb.ListUptimeCheckIpsResponse{}
if pageToken != "" {
diff --git a/vendor/cloud.google.com/go/monitoring/internal/version.go b/vendor/cloud.google.com/go/monitoring/internal/version.go
index e414f80c43..6403eb8543 100644
--- a/vendor/cloud.google.com/go/monitoring/internal/version.go
+++ b/vendor/cloud.google.com/go/monitoring/internal/version.go
@@ -17,4 +17,4 @@
package internal
// Version is the current tagged release of the library.
-const Version = "1.25.0"
+const Version = "1.29.0"
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md
index 4a6349e167..ba360a30e3 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md
@@ -1,11 +1,61 @@
# Release History
+## 1.14.0 (2026-06-15)
+
+### Breaking Changes
+
+> These changes affect only code written against a beta version such as v1.14.0-beta.3
+- Removed `WorkloadIdentityCredentialOptions.EnableAzureProxy`.
+ It will return in v1.15.0-beta.1
+
+### Bugs Fixed
+
+- `AzureDeveloperCLICredential` improved reporting of error messages returned from `azd`
+
+### Other Changes
+
+- Returned `azidentity` errors include links to the troubleshooting guide when appropriate
+- This module now requires a minimum Go version of 1.25
+- Upgraded dependencies
+
+## 1.14.0-beta.3 (2026-02-10)
+
+### Breaking Changes
+
+> These changes affect only code written against a beta version such as v1.14.0-beta.2
+- Renamed `WorkloadIdentityCredentialOptions.EnableAzureTokenProxy` to `EnableAzureProxy`
+
+### Other Changes
+
+- Removed extraneous JSON from `AzureDeveloperCLICredential` errors
+
+## 1.14.0-beta.2 (2025-11-10)
+
+### Breaking Changes
+
+> These changes affect only code written against a beta version such as v1.13.0-beta.1
+- `WorkloadIdentityCredential` identity binding mode is disabled by default. To enable it, set
+ `WorkloadIdentityCredentialOptions.EnableAzureTokenProxy` to `true`
+- Removed identity binding mode support from `DefaultAzureCredential`. To use this feature, use
+ `WorkloadIdentityCredential` directly instead and set
+ `WorkloadIdentityCredentialOptions.EnableAzureTokenProxy` to `true`
+
+### Bugs Fixed
+
+- `AzureCLICredential` quoted arguments incorrectly on Windows
+
## 1.13.1 (2025-11-10)
### Bugs Fixed
- `AzureCLICredential` quoted arguments incorrectly on Windows
+## 1.14.0-beta.1 (2025-10-07)
+
+### Features Added
+
+- Restored the `WorkloadIdentityCredential` identity binding mode support removed in v1.13.0
+
## 1.13.0 (2025-10-07)
### Features Added
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md
index 517006a424..c69664a84a 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md
@@ -83,7 +83,7 @@ azlog.SetEvents(azidentity.EventAuthentication)
| Error |Description| Mitigation |
|---|---|---|
-|"DefaultAzureCredential failed to acquire a token"|No credential in the `DefaultAzureCredential` chain provided a token|
- [Enable logging](#enable-and-configure-logging) to get further diagnostic information.
- Consult the troubleshooting guide for underlying credential types for more information.
- [EnvironmentCredential](#troubleshoot-environmentcredential-authentication-issues)
- [ManagedIdentityCredential](#troubleshoot-managedidentitycredential-authentication-issues)
- [AzureCLICredential](#troubleshoot-azureclicredential-authentication-issues)
|
+|"DefaultAzureCredential failed to acquire a token"|No credential in the `DefaultAzureCredential` chain provided a token|- [Enable logging](#enable-and-configure-logging) to get further diagnostic information.
- Consult the troubleshooting guide for underlying credential types for more information.
- [EnvironmentCredential](#troubleshoot-environmentcredential-authentication-issues)
- [ManagedIdentityCredential](#troubleshoot-managedidentitycredential-authentication-issues)
- [AzureCLICredential](#troubleshoot-azureclicredential-authentication-issues)
|
|Error from the client with a status code of 401 or 403|Authentication succeeded but the authorizing Azure service responded with a 401 (Unauthorized), or 403 (Forbidden) status code|- [Enable logging](#enable-and-configure-logging) to determine which credential in the chain returned the authenticating token.
- If an unexpected credential is returning a token, check application configuration such as environment variables.
- Ensure the correct role is assigned to the authenticated identity. For example, a service specific role rather than the subscription Owner role.
|
|"managed identity timed out"|`DefaultAzureCredential` sets a short timeout on its first managed identity authentication attempt to prevent very long timeouts during local development when no managed identity is available. That timeout causes this error in production when an application requests a token before the hosting environment is ready to provide one.|Use [ManagedIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ManagedIdentityCredential) directly, at least in production. It doesn't set a timeout on its authentication attempts.|
|invalid AZURE_TOKEN_CREDENTIALS value "..."|AZURE_TOKEN_CREDENTIALS has an unexpected value|Specify a valid value as described in [DefaultAzureCredential documentation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential)
@@ -130,7 +130,7 @@ azlog.SetEvents(azidentity.EventAuthentication)
|The requested identity hasn’t been assigned to this resource.|The IMDS endpoint responded with a status code of 400, indicating the requested identity isn’t assigned to the VM.|If using a user assigned identity, ensure the specified ID is correct.If using a system assigned identity, make sure it has been enabled as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm#enable-system-assigned-managed-identity-on-an-existing-vm).|
|The request failed due to a gateway error.|The request to the IMDS endpoint failed due to a gateway error, 502 or 504 status code.|IMDS doesn't support requests via proxy or gateway. Disable proxies or gateways running on the VM for requests to the IMDS endpoint `http://169.254.169.254`|
|No response received from the managed identity endpoint.|No response was received for the request to IMDS or the request timed out.|- Ensure the VM is configured for managed identity as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm).
- Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
|
-|Multiple attempts failed to obtain a token from the managed identity endpoint.|The credential has exhausted its retries for a token request.|- Refer to the error message for more details on specific failures.
- Ensure the VM is configured for managed identity as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm).
- Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
|
+|Multiple attempts failed to obtain a token from the managed identity endpoint.|The credential has exhausted its retries for a token request.|- Refer to the error message for more details on specific failures.
- Ensure the VM is configured for managed identity as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm).
- Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
|
#### Verify IMDS is available on the VM
@@ -193,17 +193,26 @@ az account get-access-token --output json --resource https://management.core.win
#### Verify the Azure Developer CLI can obtain tokens
-You can manually verify that the Azure Developer CLI is properly authenticated and can obtain tokens. First, use the `config` command to verify the account that is currently logged in to the Azure Developer CLI.
+You can manually verify that the Azure Developer CLI is properly authenticated and can obtain tokens. Execute the command corresponding to your CLI version to verify the account currently logged in.
-```sh
-azd config list
-```
+- In Azure Developer CLI versions >= 1.23.0:
+
+ ```sh
+ azd auth status
+ ```
+
+- In Azure Developer CLI versions < 1.23.0:
+
+ ```sh
+ azd config list
+ ```
Once you've verified the Azure Developer CLI is using correct account, you can validate that it's able to obtain tokens for this account.
```sh
azd auth token --output json --scope https://management.core.windows.net/.default
```
+
>Note that output of this command will contain a valid access token, and SHOULD NOT BE SHARED to avoid compromising account security.
@@ -239,7 +248,7 @@ Get-AzAccessToken -ResourceUrl "https://management.core.windows.net"
| Error Message |Description| Mitigation |
|---|---|---|
-|no client ID/tenant ID/token file specified|Incomplete configuration|In most cases these values are provided via environment variables set by Azure Workload Identity.- If your application runs on Azure Kubernetes Service (AKS) or a cluster that has deployed the Azure Workload Identity admission webhook, check pod labels and service account configuration. See the [AKS documentation](https://learn.microsoft.com/azure/aks/workload-identity-deploy-cluster#disable-workload-identity) and [Azure Workload Identity troubleshooting guide](https://azure.github.io/azure-workload-identity/docs/troubleshooting.html) for more details.
- If your application isn't running on AKS or your cluster hasn't deployed the Workload Identity admission webhook, set these values in `WorkloadIdentityCredentialOptions`
+|no client ID/tenant ID/token file specified|Incomplete configuration|In most cases these values are provided via environment variables set by Azure Workload Identity.
- If your application runs on Azure Kubernetes Service (AKS) or a cluster that has deployed the Azure Workload Identity admission webhook, check pod labels and service account configuration. See the [AKS documentation](https://learn.microsoft.com/azure/aks/workload-identity-deploy-cluster#disable-workload-identity) and [Azure Workload Identity troubleshooting guide](https://azure.github.io/azure-workload-identity/docs/troubleshooting.html) for more details.
- If your application isn't running on AKS or your cluster hasn't deployed the Workload Identity admission webhook, set these values in `WorkloadIdentityCredentialOptions`
## Troubleshoot AzurePipelinesCredential authentication issues
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/authentication_record.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/authentication_record.go
index 840a71469c..2b89963e62 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/authentication_record.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/authentication_record.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go
index bd196ddd32..e8699c46a8 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
@@ -154,7 +151,7 @@ func validTenantID(tenantID string) bool {
return false
}
for _, r := range tenantID {
- if !(alphanumeric(r) || r == '.' || r == '-') {
+ if !alphanumeric(r) && r != '.' && r != '-' {
return false
}
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go
index 6944152c96..d34a255b36 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
@@ -57,7 +54,7 @@ func NewAzureCLICredential(options *AzureCLICredentialOptions) (*AzureCLICredent
cp = *options
}
for _, r := range cp.Subscription {
- if !(alphanumeric(r) || r == '-' || r == '_' || r == ' ' || r == '.') {
+ if !alphanumeric(r) && r != '-' && r != '_' && r != ' ' && r != '.' {
return nil, fmt.Errorf(
"%s: Subscription %q contains invalid characters. If this is the name of a subscription, use its ID instead",
credNameAzureCLI,
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_developer_cli_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_developer_cli_credential.go
index f97bf95df9..76e2d966c9 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_developer_cli_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_developer_cli_credential.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
@@ -115,8 +112,6 @@ func (c *AzureDeveloperCLICredential) GetToken(ctx context.Context, opts policy.
mfaRequired+". Run this command then retry the operation: "+commandNoClaims,
nil,
)
- case strings.Contains(msg, "azd auth login"):
- err = newCredentialUnavailableError(credNameAzureDeveloperCLI, `please run "azd auth login" from a command prompt to authenticate before using this credential`)
}
err = unavailableIfInDAC(err, c.opts.inDefaultChain)
return at, err
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go
index a4b8ab6f4d..3e7f0082e9 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go
@@ -89,7 +89,7 @@ func NewAzurePipelinesCredential(tenantID, clientID, serviceConnectionID, system
options = &AzurePipelinesCredentialOptions{}
}
// these headers are useful to the DevOps team when debugging OIDC error responses
- options.ClientOptions.Logging.AllowedHeaders = append(options.ClientOptions.Logging.AllowedHeaders, xMsEdgeRef, xVssE2eId)
+ options.Logging.AllowedHeaders = append(options.Logging.AllowedHeaders, xMsEdgeRef, xVssE2eId)
caco := ClientAssertionCredentialOptions{
AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
Cache: options.Cache,
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go
index 82342a0254..150305a70a 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml
index 51dd979390..7e05ddcecb 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml
@@ -29,13 +29,13 @@ extends:
SubscriptionConfigurations:
- $(sub-config-identity-test-resources)
EnableRaceDetector: true
- Location: westus2
- RunLiveTests: true
+ Location: westus3
ServiceDirectory: azidentity
UsePipelineProxy: false
${{ if endsWith(variables['Build.DefinitionName'], 'weekly') }}:
PersistOidcToken: true
+ RunLiveTests: true
MatrixConfigs:
- Name: managed_identity_matrix
GenerateVMJobs: true
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go
index 2307da86f4..6be7576be2 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go
index 9e6bca1c92..45476f9426 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go
index f0890fe1ec..cd64d8e283 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go
index 58c4b585c1..6af3b41473 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
@@ -111,7 +108,7 @@ func (c *confidentialClient) GetToken(ctx context.Context, tro policy.TokenReque
authFailedErr *AuthenticationFailedError
unavailableErr credentialUnavailable
)
- if !(errors.As(err, &unavailableErr) || errors.As(err, &authFailedErr)) {
+ if !errors.As(err, &unavailableErr) && !errors.As(err, &authFailedErr) {
err = newAuthenticationFailedErrorFromMSAL(c.name, err)
}
} else {
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go
index aaaabc5c2f..3751ba9c08 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go
index cb7dbe2e4b..e797baf855 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
@@ -9,6 +6,7 @@ package azidentity
import (
"bytes"
"context"
+ "encoding/json"
"errors"
"os"
"os/exec"
@@ -45,12 +43,15 @@ var shellExec = func(ctx context.Context, credName, command string) ([]byte, err
return stdout, nil
}
if err != nil {
- msg := stderr.String()
+ msg := strings.Trim(stderr.String(), "\r\n")
var exErr *exec.ExitError
if errors.As(err, &exErr) && exErr.ExitCode() == 127 || strings.Contains(msg, "' is not recognized") {
return nil, newCredentialUnavailableError(credName, "executable not found on path")
}
- if credName == credNameAzurePowerShell {
+ switch credName {
+ case credNameAzureDeveloperCLI:
+ msg = extractAzdError(msg)
+ case credNameAzurePowerShell:
if strings.Contains(msg, "Connect-AzAccount") {
msg = `Please run "Connect-AzAccount" to set up an account`
}
@@ -80,9 +81,47 @@ func unavailableIfInDAC(err error, inDefaultChain bool) error {
// validScope is for credentials authenticating via external tools. The authority validates scopes for all other credentials.
func validScope(scope string) bool {
for _, r := range scope {
- if !(alphanumeric(r) || r == '.' || r == '-' || r == '_' || r == '/' || r == ':') {
+ if !alphanumeric(r) && r != '.' && r != '-' && r != '_' && r != '/' && r != ':' {
return false
}
}
return true
}
+
+// extractAzdError extracts a human-readable error message from azd's stderr JSON output.
+// azd writes JSON error messages to stderr. The format depends on the azd version:
+// - v1.23.7+: {"error":"...","message":"...","suggestion":"..."} (may be preceded by an empty consoleMessage line)
+// - pre-v1.23.7: {"type":"consoleMessage","data":{"message":"..."}}
+//
+// Prefer the structured "error" format, fall back to legacy consoleMessage.
+func extractAzdError(msg string) string {
+ lines := strings.Split(msg, "\n")
+ fallback := ""
+ for _, line := range lines {
+ line = strings.TrimSpace(line)
+
+ var errObj struct {
+ Error string `json:"error"`
+ }
+ if json.Unmarshal([]byte(line), &errObj) == nil && errObj.Error != "" {
+ return errObj.Error
+ }
+
+ if fallback == "" {
+ var obj struct {
+ Data struct {
+ Message string `json:"message"`
+ } `json:"data"`
+ }
+ if json.Unmarshal([]byte(line), &obj) == nil {
+ if m := strings.TrimSpace(obj.Data.Message); m != "" {
+ fallback = m
+ }
+ }
+ }
+ }
+ if fallback != "" {
+ return fallback
+ }
+ return msg
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go
index 53ae9767f4..88e9215e66 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go
index f04d40ea4e..3c59b5e73f 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go
index 33cb63be09..9aa9b5b174 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
@@ -12,6 +9,7 @@ import (
"errors"
"fmt"
"net/http"
+ "strings"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
@@ -19,6 +17,19 @@ import (
msal "github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"
)
+// tsgAnchors maps credential type names to sections of the troubleshooting
+// guide at https://aka.ms/azsdk/go/identity/troubleshoot
+var tsgAnchors = map[string]string{
+ credNameAzureCLI: "azure-cli",
+ credNameAzureDeveloperCLI: "azd",
+ credNameAzurePipelines: "apc",
+ credNameAzurePowerShell: "azure-pwsh",
+ credNameCert: "client-cert",
+ credNameManagedIdentity: "managed-id",
+ credNameSecret: "client-secret",
+ credNameWorkloadIdentity: "workload",
+}
+
// getResponseFromError retrieves the response carried by
// an AuthenticationFailedError or MSAL CallErr, if any
func getResponseFromError(err error) *http.Response {
@@ -61,8 +72,19 @@ func newAuthenticationFailedErrorFromMSAL(credType string, err error) error {
// Error implements the error interface. Note that the message contents are not contractual and can change over time.
func (e *AuthenticationFailedError) Error() string {
+ link := ""
+ if anchor, ok := tsgAnchors[e.credType]; ok {
+ link = "To troubleshoot, visit https://aka.ms/azsdk/go/identity/troubleshoot#" + anchor
+ }
if e.RawResponse == nil || e.omitResponse {
- return e.credType + ": " + e.message
+ if link != "" {
+ prefix := " "
+ if !strings.HasSuffix(e.message, ".") {
+ prefix = ". "
+ }
+ link = prefix + link
+ }
+ return e.credType + ": " + e.message + link
}
msg := &bytes.Buffer{}
fmt.Fprintf(msg, "%s authentication failed. %s\n", e.credType, e.message)
@@ -88,29 +110,10 @@ func (e *AuthenticationFailedError) Error() string {
default:
fmt.Fprint(msg, "Response contained no body")
}
- fmt.Fprintln(msg, "\n--------------------------------------------------------------------------------")
- var anchor string
- switch e.credType {
- case credNameAzureCLI:
- anchor = "azure-cli"
- case credNameAzureDeveloperCLI:
- anchor = "azd"
- case credNameAzurePipelines:
- anchor = "apc"
- case credNameCert:
- anchor = "client-cert"
- case credNameAzurePowerShell:
- anchor = "azure-pwsh"
- case credNameSecret:
- anchor = "client-secret"
- case credNameManagedIdentity:
- anchor = "managed-id"
- case credNameWorkloadIdentity:
- anchor = "workload"
- }
- if anchor != "" {
- fmt.Fprintf(msg, "To troubleshoot, visit https://aka.ms/azsdk/go/identity/troubleshoot#%s", anchor)
+ if link != "" {
+ link = "\n" + link
}
+ fmt.Fprint(msg, "\n--------------------------------------------------------------------------------"+link)
return msg.String()
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work
deleted file mode 100644
index 6dd5b3d64d..0000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work
+++ /dev/null
@@ -1,6 +0,0 @@
-go 1.23.0
-
-use (
- .
- ./cache
-)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go
index ec89de9b5b..2d3eb8c087 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/customtokenproxy/transport.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/customtokenproxy/transport.go
new file mode 100644
index 0000000000..6c0fc62442
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/customtokenproxy/transport.go
@@ -0,0 +1,233 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package customtokenproxy
+
+import (
+ "bytes"
+ "crypto/tls"
+ "crypto/x509"
+ "errors"
+ "fmt"
+ "net/http"
+ "net/url"
+ "os"
+ "time"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+)
+
+const (
+ AzureKubernetesCAData = "AZURE_KUBERNETES_CA_DATA"
+ AzureKubernetesCAFile = "AZURE_KUBERNETES_CA_FILE"
+ AzureKubernetesSNIName = "AZURE_KUBERNETES_SNI_NAME"
+
+ AzureKubernetesTokenProxy = "AZURE_KUBERNETES_TOKEN_PROXY"
+)
+
+func parseAndValidate(endpoint string) (*url.URL, error) {
+ tokenProxy, err := url.Parse(endpoint)
+ if err != nil {
+ return nil, fmt.Errorf("failed to parse custom token proxy URL %q: %s", endpoint, err)
+ }
+ if tokenProxy.Scheme != "https" {
+ return nil, fmt.Errorf("custom token endpoint must use https scheme, got %q", tokenProxy.Scheme)
+ }
+ if tokenProxy.User != nil {
+ return nil, fmt.Errorf("custom token endpoint URL %q must not contain user info", tokenProxy)
+ }
+ if tokenProxy.RawQuery != "" {
+ return nil, fmt.Errorf("custom token endpoint URL %q must not contain a query", tokenProxy)
+ }
+ if tokenProxy.EscapedFragment() != "" {
+ return nil, fmt.Errorf("custom token endpoint URL %q must not contain a fragment", tokenProxy)
+ }
+ if tokenProxy.EscapedPath() == "" {
+ // if the path is empty, set it to "/" to avoid stripping the path from req.URL
+ tokenProxy.Path = "/"
+ }
+ return tokenProxy, nil
+}
+
+var (
+ errCustomEndpointEnvSetWithoutTokenProxy = errors.New(
+ "AZURE_KUBERNETES_TOKEN_PROXY is not set but other custom endpoint-related environment variables are present",
+ )
+ errCustomEndpointMultipleCASourcesSet = errors.New(
+ "only one of AZURE_KUBERNETES_CA_FILE and AZURE_KUBERNETES_CA_DATA can be specified",
+ )
+)
+
+func createTransport(sniName string, caPool *x509.CertPool) *http.Transport {
+ var transport *http.Transport
+ if tr, ok := http.DefaultTransport.(*http.Transport); ok {
+ transport = tr.Clone()
+ } else {
+ // this should not happen, but if the user mutates the net/http.DefaultTransport
+ // to something else, we fall back to a sane default
+ transport = &http.Transport{
+ ForceAttemptHTTP2: true,
+ MaxIdleConns: 100,
+ IdleConnTimeout: 90 * time.Second,
+ TLSHandshakeTimeout: 10 * time.Second,
+ }
+ }
+
+ if transport.TLSClientConfig == nil {
+ transport.TLSClientConfig = &tls.Config{}
+ }
+ transport.TLSClientConfig.ServerName = sniName
+ transport.TLSClientConfig.RootCAs = caPool
+
+ return transport
+}
+
+// Configure configures custom token endpoint mode if the required environment variables are present.
+func Configure(clientOptions *policy.ClientOptions) error {
+ kubernetesTokenProxyStr := os.Getenv(AzureKubernetesTokenProxy)
+
+ kubernetesSNIName := os.Getenv(AzureKubernetesSNIName)
+ kubernetesCAFile := os.Getenv(AzureKubernetesCAFile)
+ kubernetesCAData := os.Getenv(AzureKubernetesCAData)
+
+ if kubernetesTokenProxyStr == "" {
+ // custom token proxy is not set, while other Kubernetes-related environment variables are present,
+ // this is likely a configuration issue so erroring out to avoid misconfiguration
+ if kubernetesSNIName != "" || kubernetesCAFile != "" || kubernetesCAData != "" {
+ return errCustomEndpointEnvSetWithoutTokenProxy
+ }
+
+ return nil
+ }
+ tokenProxy, err := parseAndValidate(kubernetesTokenProxyStr)
+ if err != nil {
+ return err
+ }
+
+ // CAFile and CAData are mutually exclusive, at most one can be set.
+ // If none of CAFile or CAData are set, the default system CA pool will be used.
+ if kubernetesCAFile != "" && kubernetesCAData != "" {
+ return errCustomEndpointMultipleCASourcesSet
+ }
+
+ // preload the transport
+ t := &transport{
+ caFile: kubernetesCAFile,
+ caData: []byte(kubernetesCAData),
+ sniName: kubernetesSNIName,
+ tokenProxy: tokenProxy,
+ }
+ if _, err := t.getTokenTransporter(); err != nil {
+ return err
+ }
+
+ clientOptions.Transport = t
+ return nil
+}
+
+// transport redirects requests to the configured proxy.
+//
+// Lock is not needed for internal caData as this transport is called under confidentialClient's lock.
+type transport struct {
+ caFile string
+ caData []byte
+ sniName string
+ tokenProxy *url.URL
+ transport *http.Transport
+}
+
+func (t *transport) Do(req *http.Request) (*http.Response, error) {
+ tr, err := t.getTokenTransporter()
+ if err != nil {
+ return nil, err
+ }
+
+ rewriteProxyRequestURL(req, t.tokenProxy)
+
+ resp, err := tr.RoundTrip(req)
+ if err == nil && resp == nil {
+ // transports must handle this rare case.
+ // Returning an error makes the retry policy try the request again
+ err = errors.New("received nil response")
+ }
+ return resp, err
+}
+
+// getTokenTransporter provides the token transport to use for the request.
+//
+// There are a few scenarios need to be handled:
+// 1. no CA overrides, use default transport. The transport is fixed after set.
+// 2. CA data override provided, use a transport with custom CA pool.
+// This transport is fixed after set.
+// 3. CA file override is provided, use a transport with custom CA pool.
+// This transport needs to be recreated if the CA file content changes.
+func (t *transport) getTokenTransporter() (*http.Transport, error) {
+ if len(t.caData) == 0 && t.caFile == "" {
+ // no custom CA overrides
+ if t.transport == nil {
+ t.transport = createTransport(t.sniName, nil)
+ }
+ return t.transport, nil
+ }
+
+ if t.caFile == "" {
+ // host provided CA bytes in AZURE_KUBERNETES_CA_DATA and can't change
+ // them now, so we need to create a client only if we haven't done so yet
+ if t.transport != nil {
+ return t.transport, nil
+ }
+
+ caPool := x509.NewCertPool()
+ if !caPool.AppendCertsFromPEM([]byte(t.caData)) {
+ return nil, fmt.Errorf("parse CA data: no valid certificates found")
+ }
+
+ t.transport = createTransport(t.sniName, caPool)
+ return t.transport, nil
+ }
+
+ // host provided the CA bytes in a file whose contents it can change,
+ // so we must read that file and maybe create a new client
+ b, err := os.ReadFile(t.caFile)
+ if err != nil {
+ return nil, fmt.Errorf("read CA file %q: %s", t.caFile, err)
+ }
+ if len(b) == 0 {
+ // this can happen during the middle of CA rotation on the host.
+ if t.transport == nil {
+ // if the transport was never created, error out here to force retrying the call later
+ return nil, fmt.Errorf("CA file %q is empty", t.caFile)
+ }
+ // if the transport was already created, just keep using it
+ return t.transport, nil
+ }
+ if !bytes.Equal(b, t.caData) {
+ // CA has changed, rebuild the transport with new CA pool
+ // invariant: t.transport is nil when t.caData is nil (initial call)
+ caPool := x509.NewCertPool()
+ if !caPool.AppendCertsFromPEM([]byte(b)) {
+ return nil, fmt.Errorf("parse CA file %q: no valid certificates found", t.caFile)
+ }
+ if t.transport != nil {
+ t.transport.CloseIdleConnections()
+ }
+ t.transport = createTransport(t.sniName, caPool)
+ t.caData = b
+ }
+
+ return t.transport, nil
+}
+
+// rewriteProxyRequestURL updates the request URL to target the specified URL.
+// Target is the token proxy URL in custom token endpoint mode.
+//
+// proxyURL should be parsed and validated by parseAndValidate before calling.
+func rewriteProxyRequestURL(req *http.Request, proxyURL *url.URL) {
+ reqRawQuery := req.URL.RawQuery
+ // preserve the original path and append it to the proxy URL's path.
+ // proxyURL path is guaranteed to be non-empty.
+ req.URL = proxyURL.JoinPath(req.URL.EscapedPath())
+ // NOTE: proxyURL doesn't include query, req might include query
+ // we just retain the raw query from req.URL
+ req.URL.RawQuery = reqRawQuery
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/logging.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/logging.go
index 1aa1e0fc7c..1f67f7b3f3 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/logging.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/logging.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go
index 0735d1fcbe..02f02fec41 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
@@ -32,9 +29,7 @@ const (
imdsEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token"
miResID = "mi_res_id"
msiEndpoint = "MSI_ENDPOINT"
- msiResID = "msi_res_id"
msiSecret = "MSI_SECRET"
- imdsAPIVersion = "2018-02-01"
azureArcAPIVersion = "2020-06-01"
qpClientID = "client_id"
serviceFabricAPIVersion = "2019-07-01-preview"
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go
index 11b686ccda..d0a5ecf97e 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go
index 9dcc82f013..aa7f9b7d7b 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go
index 053d1785f8..48cc4f39fd 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go
index 5791e7d224..86054e3f85 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go
index 041f11658d..f45f59697b 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
@@ -14,5 +11,5 @@ const (
module = "github.com/Azure/azure-sdk-for-go/sdk/" + component
// Version is the semantic version (see http://semver.org) of this module.
- version = "v1.13.1"
+ version = "v1.14.0"
)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go
index 6fecada2f8..87399aed37 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go
@@ -1,6 +1,3 @@
-//go:build go1.18
-// +build go1.18
-
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
@@ -16,6 +13,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/customtokenproxy"
)
const credNameWorkloadIdentity = "WorkloadIdentityCredential"
@@ -54,6 +52,15 @@ type WorkloadIdentityCredentialOptions struct {
// the application responsible for ensuring the configured authority is valid and trustworthy.
DisableInstanceDiscovery bool
+ // enableAzureProxy determines whether the credential reads proxy configuration from environment variables. When
+ // this value is true and proxy configuration isn't present or this value is false, the credential will request
+ // tokens directly from Entra ID.
+ //
+ // The proxy feature is designed for applications that deploy to many clusters and clusters that host many
+ // applications. See the Azure Kubernetes Service identity bindings documentation for more information on when
+ // to set this option: https://learn.microsoft.com/azure/aks/identity-bindings-concepts
+ enableAzureProxy bool
+
// TenantID of the service principal. Defaults to the value of the environment variable AZURE_TENANT_ID.
TenantID string
@@ -87,14 +94,22 @@ func NewWorkloadIdentityCredential(options *WorkloadIdentityCredentialOptions) (
return nil, errors.New("no tenant ID specified. Check pod configuration or set TenantID in the options")
}
}
+
w := WorkloadIdentityCredential{file: file, mtx: &sync.RWMutex{}}
- caco := ClientAssertionCredentialOptions{
+ caco := &ClientAssertionCredentialOptions{
AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
Cache: options.Cache,
ClientOptions: options.ClientOptions,
DisableInstanceDiscovery: options.DisableInstanceDiscovery,
}
- cred, err := NewClientAssertionCredential(tenantID, clientID, w.getAssertion, &caco)
+
+ if options.enableAzureProxy {
+ if err := customtokenproxy.Configure(&caco.ClientOptions); err != nil {
+ return nil, err
+ }
+ }
+
+ cred, err := NewClientAssertionCredential(tenantID, clientID, w.getAssertion, caco)
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/partitioned_storage.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/partitioned_storage.go
index ff07d4b5a4..5d018e117a 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/partitioned_storage.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/partitioned_storage.go
@@ -200,7 +200,16 @@ func (m *PartitionedManager) aadMetadataFromCache(ctx context.Context, authority
func (m *PartitionedManager) aadMetadata(ctx context.Context, authorityInfo authority.Info) (authority.InstanceDiscoveryMetadata, error) {
discoveryResponse, err := m.requests.AADInstanceDiscovery(ctx, authorityInfo)
if err != nil {
- return authority.InstanceDiscoveryMetadata{}, err
+ // If it's an invalid_instance error, always propagate
+ if strings.Contains(err.Error(), "invalid_instance") {
+ return authority.InstanceDiscoveryMetadata{}, err
+ }
+ // If the caller canceled the context, propagate
+ if ctx.Err() != nil {
+ return authority.InstanceDiscoveryMetadata{}, err
+ }
+ // For transient errors (network failures, HTTP 500, etc.), cache a fallback entry
+ return m.fallbackMetadata(authorityInfo.Host), nil
}
m.aadCacheMu.Lock()
@@ -220,6 +229,27 @@ func (m *PartitionedManager) aadMetadata(ctx context.Context, authorityInfo auth
return m.aadCache[authorityInfo.Host], nil
}
+// fallbackMetadata returns a cached fallback metadata entry for the given host.
+// It first checks the known metadata provider for pre-baked alias data, then
+// falls back to a self-entry. Acquires aadCacheMu.
+func (m *PartitionedManager) fallbackMetadata(host string) authority.InstanceDiscoveryMetadata {
+ m.aadCacheMu.Lock()
+ defer m.aadCacheMu.Unlock()
+ if known, ok := authority.GetKnownMetadata(host); ok {
+ for _, alias := range known.Aliases {
+ m.aadCache[alias] = known
+ }
+ return known
+ }
+ fallback := authority.InstanceDiscoveryMetadata{
+ PreferredNetwork: host,
+ PreferredCache: host,
+ Aliases: []string{host},
+ }
+ m.aadCache[host] = fallback
+ return fallback
+}
+
func (m *PartitionedManager) readAccessToken(envAliases []string, realm, clientID, userAssertionHash string, scopes []string, partitionKey, tokenType, authnSchemeKeyID string) (AccessToken, error) {
m.contractMu.RLock()
defer m.contractMu.RUnlock()
@@ -306,7 +336,7 @@ func (m *PartitionedManager) writeRefreshToken(refreshToken accesstokens.Refresh
m.contractMu.Lock()
defer m.contractMu.Unlock()
key := refreshToken.Key()
- if m.contract.AccessTokensPartition[partitionKey] == nil {
+ if m.contract.RefreshTokensPartition[partitionKey] == nil {
m.contract.RefreshTokensPartition[partitionKey] = make(map[string]accesstokens.RefreshToken)
}
m.contract.RefreshTokensPartition[partitionKey][key] = refreshToken
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go
index 825d8a0f66..8225e860ab 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go
@@ -276,7 +276,16 @@ func (m *Manager) aadMetadata(ctx context.Context, authorityInfo authority.Info)
defer m.aadCacheMu.Unlock()
discoveryResponse, err := m.requests.AADInstanceDiscovery(ctx, authorityInfo)
if err != nil {
- return authority.InstanceDiscoveryMetadata{}, err
+ // If it's an invalid_instance error, always propagate
+ if strings.Contains(err.Error(), "invalid_instance") {
+ return authority.InstanceDiscoveryMetadata{}, err
+ }
+ // If the caller canceled the context, propagate
+ if ctx.Err() != nil {
+ return authority.InstanceDiscoveryMetadata{}, err
+ }
+ // For transient errors (network failures, HTTP 500, etc.), cache a fallback entry
+ return m.fallbackMetadata(authorityInfo.Host), nil
}
for _, metadataEntry := range discoveryResponse.Metadata {
@@ -293,6 +302,25 @@ func (m *Manager) aadMetadata(ctx context.Context, authorityInfo authority.Info)
return m.aadCache[authorityInfo.Host], nil
}
+// fallbackMetadata returns a cached fallback metadata entry for the given host.
+// It first checks the known metadata provider for pre-baked alias data, then
+// falls back to a self-entry. The caller must hold m.aadCacheMu.
+func (m *Manager) fallbackMetadata(host string) authority.InstanceDiscoveryMetadata {
+ if known, ok := authority.GetKnownMetadata(host); ok {
+ for _, alias := range known.Aliases {
+ m.aadCache[alias] = known
+ }
+ return known
+ }
+ fallback := authority.InstanceDiscoveryMetadata{
+ PreferredNetwork: host,
+ PreferredCache: host,
+ Aliases: []string{host},
+ }
+ m.aadCache[host] = fallback
+ return fallback
+}
+
func (m *Manager) readAccessToken(homeID string, envAliases []string, realm, clientID string, scopes []string, tokenType, authnSchemeKeyID, extCacheKey string) AccessToken {
m.contractMu.RLock()
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go
index debd465dba..db6f8b42ee 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go
@@ -20,6 +20,8 @@ import (
"time"
"github.com/google/uuid"
+
+ msalerrors "github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"
)
const (
@@ -61,6 +63,9 @@ var aadTrustedHostList = map[string]bool{
"login.microsoft.com": true,
"sts.windows.net": true,
"login.usgovcloudapi.net": true,
+ "login.sovcloud-identity.fr": true, // Bleu (France sovereign cloud)
+ "login.sovcloud-identity.de": true, // Delos (Germany sovereign cloud)
+ "login.sovcloud-identity.sg": true, // GovSG (Singapore sovereign cloud)
}
// TrustedHost checks if an AAD host is trusted/valid.
@@ -607,6 +612,14 @@ func (c Client) AADInstanceDiscovery(ctx context.Context, authorityInfo Info) (I
endpoint := fmt.Sprintf(aadInstanceDiscoveryEndpoint, discoveryHost)
err = c.Comm.JSONCall(ctx, endpoint, http.Header{}, qv, nil, &resp)
+ if err != nil {
+ var callErr msalerrors.CallErr
+ if errors.As(err, &callErr) && callErr.Resp != nil && callErr.Resp.StatusCode == http.StatusBadRequest {
+ if strings.Contains(callErr.Err.Error(), "invalid_instance") {
+ return resp, fmt.Errorf("invalid_instance: the authority host is not valid: %w", err)
+ }
+ }
+ }
}
return resp, err
}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/known_metadata.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/known_metadata.go
new file mode 100644
index 0000000000..70e83bd712
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/known_metadata.go
@@ -0,0 +1,70 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package authority
+
+// GetKnownMetadata returns the known instance discovery metadata for the given
+// host, if any. Each call returns a fresh struct with its own Aliases slice,
+// so callers may freely modify the result without affecting future calls.
+func GetKnownMetadata(host string) (InstanceDiscoveryMetadata, bool) {
+ switch host {
+ // Public Cloud
+ case "login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net":
+ return InstanceDiscoveryMetadata{
+ PreferredNetwork: "login.microsoftonline.com",
+ PreferredCache: "login.windows.net",
+ Aliases: []string{"login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"},
+ }, true
+ // China Cloud
+ case "login.partner.microsoftonline.cn", "login.chinacloudapi.cn":
+ return InstanceDiscoveryMetadata{
+ PreferredNetwork: "login.partner.microsoftonline.cn",
+ PreferredCache: "login.partner.microsoftonline.cn",
+ Aliases: []string{"login.partner.microsoftonline.cn", "login.chinacloudapi.cn"},
+ }, true
+ // Germany Cloud (legacy)
+ case "login.microsoftonline.de":
+ return InstanceDiscoveryMetadata{
+ PreferredNetwork: "login.microsoftonline.de",
+ PreferredCache: "login.microsoftonline.de",
+ Aliases: []string{"login.microsoftonline.de"},
+ }, true
+ // US Government Cloud
+ case "login.microsoftonline.us", "login.usgovcloudapi.net":
+ return InstanceDiscoveryMetadata{
+ PreferredNetwork: "login.microsoftonline.us",
+ PreferredCache: "login.microsoftonline.us",
+ Aliases: []string{"login.microsoftonline.us", "login.usgovcloudapi.net"},
+ }, true
+ // US Regional
+ case "login-us.microsoftonline.com":
+ return InstanceDiscoveryMetadata{
+ PreferredNetwork: "login-us.microsoftonline.com",
+ PreferredCache: "login-us.microsoftonline.com",
+ Aliases: []string{"login-us.microsoftonline.com"},
+ }, true
+ // Bleu (France sovereign cloud)
+ case "login.sovcloud-identity.fr":
+ return InstanceDiscoveryMetadata{
+ PreferredNetwork: "login.sovcloud-identity.fr",
+ PreferredCache: "login.sovcloud-identity.fr",
+ Aliases: []string{"login.sovcloud-identity.fr"},
+ }, true
+ // Delos (Germany sovereign cloud)
+ case "login.sovcloud-identity.de":
+ return InstanceDiscoveryMetadata{
+ PreferredNetwork: "login.sovcloud-identity.de",
+ PreferredCache: "login.sovcloud-identity.de",
+ Aliases: []string{"login.sovcloud-identity.de"},
+ }, true
+ // GovSG (Singapore sovereign cloud)
+ case "login.sovcloud-identity.sg":
+ return InstanceDiscoveryMetadata{
+ PreferredNetwork: "login.sovcloud-identity.sg",
+ PreferredCache: "login.sovcloud-identity.sg",
+ Aliases: []string{"login.sovcloud-identity.sg"},
+ }, true
+ default:
+ return InstanceDiscoveryMetadata{}, false
+ }
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go
index 7906803669..87e38798ab 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go
@@ -35,7 +35,7 @@ type HTTPClient interface {
CloseIdleConnections()
}
-// Client provides a wrapper to our *http.Client that handles compression and serialization needs.
+// Client provides a wrapper to our *http.Client that handles serialization needs.
type Client struct {
client HTTPClient
}
@@ -50,9 +50,9 @@ func New(httpClient HTTPClient) *Client {
}
// JSONCall connects to the REST endpoint passing the HTTP query values, headers and JSON conversion
-// of body in the HTTP body. It automatically handles compression and decompression with gzip. The response is JSON
-// unmarshalled into resp. resp must be a pointer to a struct. If the body struct contains a field called
-// "AdditionalFields" we use a custom marshal/unmarshal engine.
+// of body in the HTTP body. The response is JSON unmarshalled into resp. resp must be a pointer to
+// a struct. If the body struct contains a field called "AdditionalFields" we use a custom
+// marshal/unmarshal engine.
func (c *Client) JSONCall(ctx context.Context, endpoint string, headers http.Header, qv url.Values, body, resp interface{}) error {
if qv == nil {
qv = url.Values{}
@@ -284,25 +284,17 @@ func (c *Client) checkResp(v reflect.Value) error {
return nil
}
-// readBody reads the body out of an *http.Response. It supports gzip encoded responses.
+// readBody reads the body out of an *http.Response. Any Content-Encoding negotiated by the
+// underlying http.Transport (typically gzip) is transparently decoded by the standard library
+// before we get here.
func (c *Client) readBody(resp *http.Response) ([]byte, error) {
- var reader io.Reader = resp.Body
- switch resp.Header.Get("Content-Encoding") {
- case "":
- // Do nothing
- case "gzip":
- reader = gzipDecompress(resp.Body)
- default:
- return nil, fmt.Errorf("bug: comm.Client.JSONCall(): content was send with unsupported content-encoding %s", resp.Header.Get("Content-Encoding"))
- }
- return io.ReadAll(reader)
+ return io.ReadAll(resp.Body)
}
var testID string
// addStdHeaders adds the standard headers we use on all calls.
func addStdHeaders(headers http.Header) http.Header {
- headers.Set("Accept-Encoding", "gzip")
// So that I can have a static id for tests.
if testID != "" {
headers.Set("client-request-id", testID)
@@ -311,7 +303,7 @@ func addStdHeaders(headers http.Header) http.Header {
headers.Set("client-request-id", uuid.New().String())
headers.Set("Return-Client-Request-Id", "false")
}
- headers.Set("x-client-sku", "MSAL.Go")
+ headers.Set("x-client-sku", version.SKU)
headers.Set("x-client-os", runtime.GOOS)
headers.Set("x-client-cpu", runtime.GOARCH)
headers.Set("x-client-ver", version.Version)
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/compress.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/compress.go
deleted file mode 100644
index 4d3dbfcf0a..0000000000
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/compress.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT license.
-
-package comm
-
-import (
- "compress/gzip"
- "io"
-)
-
-func gzipDecompress(r io.Reader) io.Reader {
- gzipReader, _ := gzip.NewReader(r)
-
- pipeOut, pipeIn := io.Pipe()
- go func() {
- // decompression bomb would have to come from Azure services.
- // If we want to limit, we should do that in comm.do().
- _, err := io.Copy(pipeIn, gzipReader) //nolint
- if err != nil {
- // don't need the error.
- pipeIn.CloseWithError(err) //nolint
- gzipReader.Close()
- return
- }
- if err := gzipReader.Close(); err != nil {
- // don't need the error.
- pipeIn.CloseWithError(err) //nolint
- return
- }
- pipeIn.Close()
- }()
- return pipeOut
-}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version/version.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version/version.go
index 5e551abc83..40da7d5d1e 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version/version.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version/version.go
@@ -4,5 +4,8 @@
// Package version keeps the version number of the client package.
package version
+// SKU is the product name of this SDK communicated to the server.
+const SKU = "MSAL.Go"
+
// Version is the version of this client package that is communicated to the server.
-const Version = "1.4.2"
+const Version = "1.7.2"
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/managedidentity.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/managedidentity.go
index ca3de4325f..ecb0fbeca9 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/managedidentity.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/managedidentity.go
@@ -30,6 +30,8 @@ import (
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version"
+ "github.com/google/uuid"
)
// AuthResult contains the results of one token acquisition operation.
@@ -621,6 +623,9 @@ func createIMDSAuthRequest(ctx context.Context, id ID, resource string) (*http.R
return nil, fmt.Errorf("error creating http request %s", err)
}
req.Header.Set(metaHTTPHeaderName, "true")
+ req.Header.Set("x-client-SKU", version.SKU)
+ req.Header.Set("x-client-Ver", version.Version)
+ req.Header.Set("x-ms-client-request-id", uuid.New().String())
return req, nil
}
diff --git a/vendor/github.com/ProtonMail/go-crypto/AUTHORS b/vendor/github.com/ProtonMail/go-crypto/AUTHORS
new file mode 100644
index 0000000000..2b00ddba0d
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-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/github.com/ProtonMail/go-crypto/CONTRIBUTORS b/vendor/github.com/ProtonMail/go-crypto/CONTRIBUTORS
new file mode 100644
index 0000000000..1fbd3e976f
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-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/github.com/ProtonMail/go-crypto/LICENSE b/vendor/github.com/ProtonMail/go-crypto/LICENSE
new file mode 100644
index 0000000000..6a66aea5ea
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-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/github.com/ProtonMail/go-crypto/PATENTS b/vendor/github.com/ProtonMail/go-crypto/PATENTS
new file mode 100644
index 0000000000..733099041f
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-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/github.com/ProtonMail/go-crypto/bitcurves/bitcurve.go b/vendor/github.com/ProtonMail/go-crypto/bitcurves/bitcurve.go
new file mode 100644
index 0000000000..c85e6befec
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/bitcurves/bitcurve.go
@@ -0,0 +1,381 @@
+package bitcurves
+
+// Copyright 2010 The Go Authors. All rights reserved.
+// Copyright 2011 ThePiachu. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package bitelliptic implements several Koblitz elliptic curves over prime
+// fields.
+
+// This package operates, internally, on Jacobian coordinates. For a given
+// (x, y) position on the curve, the Jacobian coordinates are (x1, y1, z1)
+// where x = x1/z1² and y = y1/z1³. The greatest speedups come when the whole
+// calculation can be performed within the transform (as in ScalarMult and
+// ScalarBaseMult). But even for Add and Double, it's faster to apply and
+// reverse the transform than to operate in affine coordinates.
+
+import (
+ "crypto/elliptic"
+ "io"
+ "math/big"
+ "sync"
+)
+
+// A BitCurve represents a Koblitz Curve with a=0.
+// See http://www.hyperelliptic.org/EFD/g1p/auto-shortw.html
+type BitCurve struct {
+ Name string
+ P *big.Int // the order of the underlying field
+ N *big.Int // the order of the base point
+ B *big.Int // the constant of the BitCurve equation
+ Gx, Gy *big.Int // (x,y) of the base point
+ BitSize int // the size of the underlying field
+}
+
+// Params returns the parameters of the given BitCurve (see BitCurve struct)
+func (bitCurve *BitCurve) Params() (cp *elliptic.CurveParams) {
+ cp = new(elliptic.CurveParams)
+ cp.Name = bitCurve.Name
+ cp.P = bitCurve.P
+ cp.N = bitCurve.N
+ cp.Gx = bitCurve.Gx
+ cp.Gy = bitCurve.Gy
+ cp.BitSize = bitCurve.BitSize
+ return cp
+}
+
+// IsOnCurve returns true if the given (x,y) lies on the BitCurve.
+func (bitCurve *BitCurve) IsOnCurve(x, y *big.Int) bool {
+ // y² = x³ + b
+ y2 := new(big.Int).Mul(y, y) //y²
+ y2.Mod(y2, bitCurve.P) //y²%P
+
+ x3 := new(big.Int).Mul(x, x) //x²
+ x3.Mul(x3, x) //x³
+
+ x3.Add(x3, bitCurve.B) //x³+B
+ x3.Mod(x3, bitCurve.P) //(x³+B)%P
+
+ return x3.Cmp(y2) == 0
+}
+
+// affineFromJacobian reverses the Jacobian transform. See the comment at the
+// top of the file.
+func (bitCurve *BitCurve) affineFromJacobian(x, y, z *big.Int) (xOut, yOut *big.Int) {
+ if z.Cmp(big.NewInt(0)) == 0 {
+ panic("bitcurve: Can't convert to affine with Jacobian Z = 0")
+ }
+ // x = YZ^2 mod P
+ zinv := new(big.Int).ModInverse(z, bitCurve.P)
+ zinvsq := new(big.Int).Mul(zinv, zinv)
+
+ xOut = new(big.Int).Mul(x, zinvsq)
+ xOut.Mod(xOut, bitCurve.P)
+ // y = YZ^3 mod P
+ zinvsq.Mul(zinvsq, zinv)
+ yOut = new(big.Int).Mul(y, zinvsq)
+ yOut.Mod(yOut, bitCurve.P)
+ return xOut, yOut
+}
+
+// Add returns the sum of (x1,y1) and (x2,y2)
+func (bitCurve *BitCurve) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int) {
+ z := new(big.Int).SetInt64(1)
+ x, y, z := bitCurve.addJacobian(x1, y1, z, x2, y2, z)
+ return bitCurve.affineFromJacobian(x, y, z)
+}
+
+// addJacobian takes two points in Jacobian coordinates, (x1, y1, z1) and
+// (x2, y2, z2) and returns their sum, also in Jacobian form.
+func (bitCurve *BitCurve) addJacobian(x1, y1, z1, x2, y2, z2 *big.Int) (*big.Int, *big.Int, *big.Int) {
+ // See http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-add-2007-bl
+ z1z1 := new(big.Int).Mul(z1, z1)
+ z1z1.Mod(z1z1, bitCurve.P)
+ z2z2 := new(big.Int).Mul(z2, z2)
+ z2z2.Mod(z2z2, bitCurve.P)
+
+ u1 := new(big.Int).Mul(x1, z2z2)
+ u1.Mod(u1, bitCurve.P)
+ u2 := new(big.Int).Mul(x2, z1z1)
+ u2.Mod(u2, bitCurve.P)
+ h := new(big.Int).Sub(u2, u1)
+ if h.Sign() == -1 {
+ h.Add(h, bitCurve.P)
+ }
+ i := new(big.Int).Lsh(h, 1)
+ i.Mul(i, i)
+ j := new(big.Int).Mul(h, i)
+
+ s1 := new(big.Int).Mul(y1, z2)
+ s1.Mul(s1, z2z2)
+ s1.Mod(s1, bitCurve.P)
+ s2 := new(big.Int).Mul(y2, z1)
+ s2.Mul(s2, z1z1)
+ s2.Mod(s2, bitCurve.P)
+ r := new(big.Int).Sub(s2, s1)
+ if r.Sign() == -1 {
+ r.Add(r, bitCurve.P)
+ }
+ r.Lsh(r, 1)
+ v := new(big.Int).Mul(u1, i)
+
+ x3 := new(big.Int).Set(r)
+ x3.Mul(x3, x3)
+ x3.Sub(x3, j)
+ x3.Sub(x3, v)
+ x3.Sub(x3, v)
+ x3.Mod(x3, bitCurve.P)
+
+ y3 := new(big.Int).Set(r)
+ v.Sub(v, x3)
+ y3.Mul(y3, v)
+ s1.Mul(s1, j)
+ s1.Lsh(s1, 1)
+ y3.Sub(y3, s1)
+ y3.Mod(y3, bitCurve.P)
+
+ z3 := new(big.Int).Add(z1, z2)
+ z3.Mul(z3, z3)
+ z3.Sub(z3, z1z1)
+ if z3.Sign() == -1 {
+ z3.Add(z3, bitCurve.P)
+ }
+ z3.Sub(z3, z2z2)
+ if z3.Sign() == -1 {
+ z3.Add(z3, bitCurve.P)
+ }
+ z3.Mul(z3, h)
+ z3.Mod(z3, bitCurve.P)
+
+ return x3, y3, z3
+}
+
+// Double returns 2*(x,y)
+func (bitCurve *BitCurve) Double(x1, y1 *big.Int) (*big.Int, *big.Int) {
+ z1 := new(big.Int).SetInt64(1)
+ return bitCurve.affineFromJacobian(bitCurve.doubleJacobian(x1, y1, z1))
+}
+
+// doubleJacobian takes a point in Jacobian coordinates, (x, y, z), and
+// returns its double, also in Jacobian form.
+func (bitCurve *BitCurve) doubleJacobian(x, y, z *big.Int) (*big.Int, *big.Int, *big.Int) {
+ // See http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l
+
+ a := new(big.Int).Mul(x, x) //X1²
+ b := new(big.Int).Mul(y, y) //Y1²
+ c := new(big.Int).Mul(b, b) //B²
+
+ d := new(big.Int).Add(x, b) //X1+B
+ d.Mul(d, d) //(X1+B)²
+ d.Sub(d, a) //(X1+B)²-A
+ d.Sub(d, c) //(X1+B)²-A-C
+ d.Mul(d, big.NewInt(2)) //2*((X1+B)²-A-C)
+
+ e := new(big.Int).Mul(big.NewInt(3), a) //3*A
+ f := new(big.Int).Mul(e, e) //E²
+
+ x3 := new(big.Int).Mul(big.NewInt(2), d) //2*D
+ x3.Sub(f, x3) //F-2*D
+ x3.Mod(x3, bitCurve.P)
+
+ y3 := new(big.Int).Sub(d, x3) //D-X3
+ y3.Mul(e, y3) //E*(D-X3)
+ y3.Sub(y3, new(big.Int).Mul(big.NewInt(8), c)) //E*(D-X3)-8*C
+ y3.Mod(y3, bitCurve.P)
+
+ z3 := new(big.Int).Mul(y, z) //Y1*Z1
+ z3.Mul(big.NewInt(2), z3) //3*Y1*Z1
+ z3.Mod(z3, bitCurve.P)
+
+ return x3, y3, z3
+}
+
+// TODO: double check if it is okay
+// ScalarMult returns k*(Bx,By) where k is a number in big-endian form.
+func (bitCurve *BitCurve) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int) {
+ // We have a slight problem in that the identity of the group (the
+ // point at infinity) cannot be represented in (x, y) form on a finite
+ // machine. Thus the standard add/double algorithm has to be tweaked
+ // slightly: our initial state is not the identity, but x, and we
+ // ignore the first true bit in |k|. If we don't find any true bits in
+ // |k|, then we return nil, nil, because we cannot return the identity
+ // element.
+
+ Bz := new(big.Int).SetInt64(1)
+ x := Bx
+ y := By
+ z := Bz
+
+ seenFirstTrue := false
+ for _, byte := range k {
+ for bitNum := 0; bitNum < 8; bitNum++ {
+ if seenFirstTrue {
+ x, y, z = bitCurve.doubleJacobian(x, y, z)
+ }
+ if byte&0x80 == 0x80 {
+ if !seenFirstTrue {
+ seenFirstTrue = true
+ } else {
+ x, y, z = bitCurve.addJacobian(Bx, By, Bz, x, y, z)
+ }
+ }
+ byte <<= 1
+ }
+ }
+
+ if !seenFirstTrue {
+ return nil, nil
+ }
+
+ return bitCurve.affineFromJacobian(x, y, z)
+}
+
+// ScalarBaseMult returns k*G, where G is the base point of the group and k is
+// an integer in big-endian form.
+func (bitCurve *BitCurve) ScalarBaseMult(k []byte) (*big.Int, *big.Int) {
+ return bitCurve.ScalarMult(bitCurve.Gx, bitCurve.Gy, k)
+}
+
+var mask = []byte{0xff, 0x1, 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f}
+
+// TODO: double check if it is okay
+// GenerateKey returns a public/private key pair. The private key is generated
+// using the given reader, which must return random data.
+func (bitCurve *BitCurve) GenerateKey(rand io.Reader) (priv []byte, x, y *big.Int, err error) {
+ byteLen := (bitCurve.BitSize + 7) >> 3
+ priv = make([]byte, byteLen)
+
+ for x == nil {
+ _, err = io.ReadFull(rand, priv)
+ if err != nil {
+ return
+ }
+ // We have to mask off any excess bits in the case that the size of the
+ // underlying field is not a whole number of bytes.
+ priv[0] &= mask[bitCurve.BitSize%8]
+ // This is because, in tests, rand will return all zeros and we don't
+ // want to get the point at infinity and loop forever.
+ priv[1] ^= 0x42
+ x, y = bitCurve.ScalarBaseMult(priv)
+ }
+ return
+}
+
+// Marshal converts a point into the form specified in section 4.3.6 of ANSI
+// X9.62.
+func (bitCurve *BitCurve) Marshal(x, y *big.Int) []byte {
+ byteLen := (bitCurve.BitSize + 7) >> 3
+
+ ret := make([]byte, 1+2*byteLen)
+ ret[0] = 4 // uncompressed point
+
+ xBytes := x.Bytes()
+ copy(ret[1+byteLen-len(xBytes):], xBytes)
+ yBytes := y.Bytes()
+ copy(ret[1+2*byteLen-len(yBytes):], yBytes)
+ return ret
+}
+
+// Unmarshal converts a point, serialised by Marshal, into an x, y pair. On
+// error, x = nil.
+func (bitCurve *BitCurve) Unmarshal(data []byte) (x, y *big.Int) {
+ byteLen := (bitCurve.BitSize + 7) >> 3
+ if len(data) != 1+2*byteLen {
+ return
+ }
+ if data[0] != 4 { // uncompressed form
+ return
+ }
+ x = new(big.Int).SetBytes(data[1 : 1+byteLen])
+ y = new(big.Int).SetBytes(data[1+byteLen:])
+ return
+}
+
+//curve parameters taken from:
+//http://www.secg.org/collateral/sec2_final.pdf
+
+var initonce sync.Once
+var secp160k1 *BitCurve
+var secp192k1 *BitCurve
+var secp224k1 *BitCurve
+var secp256k1 *BitCurve
+
+func initAll() {
+ initS160()
+ initS192()
+ initS224()
+ initS256()
+}
+
+func initS160() {
+ // See SEC 2 section 2.4.1
+ secp160k1 = new(BitCurve)
+ secp160k1.Name = "secp160k1"
+ secp160k1.P, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73", 16)
+ secp160k1.N, _ = new(big.Int).SetString("0100000000000000000001B8FA16DFAB9ACA16B6B3", 16)
+ secp160k1.B, _ = new(big.Int).SetString("0000000000000000000000000000000000000007", 16)
+ secp160k1.Gx, _ = new(big.Int).SetString("3B4C382CE37AA192A4019E763036F4F5DD4D7EBB", 16)
+ secp160k1.Gy, _ = new(big.Int).SetString("938CF935318FDCED6BC28286531733C3F03C4FEE", 16)
+ secp160k1.BitSize = 160
+}
+
+func initS192() {
+ // See SEC 2 section 2.5.1
+ secp192k1 = new(BitCurve)
+ secp192k1.Name = "secp192k1"
+ secp192k1.P, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37", 16)
+ secp192k1.N, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D", 16)
+ secp192k1.B, _ = new(big.Int).SetString("000000000000000000000000000000000000000000000003", 16)
+ secp192k1.Gx, _ = new(big.Int).SetString("DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D", 16)
+ secp192k1.Gy, _ = new(big.Int).SetString("9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D", 16)
+ secp192k1.BitSize = 192
+}
+
+func initS224() {
+ // See SEC 2 section 2.6.1
+ secp224k1 = new(BitCurve)
+ secp224k1.Name = "secp224k1"
+ secp224k1.P, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D", 16)
+ secp224k1.N, _ = new(big.Int).SetString("010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7", 16)
+ secp224k1.B, _ = new(big.Int).SetString("00000000000000000000000000000000000000000000000000000005", 16)
+ secp224k1.Gx, _ = new(big.Int).SetString("A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C", 16)
+ secp224k1.Gy, _ = new(big.Int).SetString("7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5", 16)
+ secp224k1.BitSize = 224
+}
+
+func initS256() {
+ // See SEC 2 section 2.7.1
+ secp256k1 = new(BitCurve)
+ secp256k1.Name = "secp256k1"
+ secp256k1.P, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", 16)
+ secp256k1.N, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", 16)
+ secp256k1.B, _ = new(big.Int).SetString("0000000000000000000000000000000000000000000000000000000000000007", 16)
+ secp256k1.Gx, _ = new(big.Int).SetString("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798", 16)
+ secp256k1.Gy, _ = new(big.Int).SetString("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8", 16)
+ secp256k1.BitSize = 256
+}
+
+// S160 returns a BitCurve which implements secp160k1 (see SEC 2 section 2.4.1)
+func S160() *BitCurve {
+ initonce.Do(initAll)
+ return secp160k1
+}
+
+// S192 returns a BitCurve which implements secp192k1 (see SEC 2 section 2.5.1)
+func S192() *BitCurve {
+ initonce.Do(initAll)
+ return secp192k1
+}
+
+// S224 returns a BitCurve which implements secp224k1 (see SEC 2 section 2.6.1)
+func S224() *BitCurve {
+ initonce.Do(initAll)
+ return secp224k1
+}
+
+// S256 returns a BitCurve which implements bitcurves (see SEC 2 section 2.7.1)
+func S256() *BitCurve {
+ initonce.Do(initAll)
+ return secp256k1
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/brainpool/brainpool.go b/vendor/github.com/ProtonMail/go-crypto/brainpool/brainpool.go
new file mode 100644
index 0000000000..cb6676de24
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/brainpool/brainpool.go
@@ -0,0 +1,134 @@
+// Package brainpool implements Brainpool elliptic curves.
+// Implementation of rcurves is from github.com/ebfe/brainpool
+// Note that these curves are implemented with naive, non-constant time operations
+// and are likely not suitable for environments where timing attacks are a concern.
+package brainpool
+
+import (
+ "crypto/elliptic"
+ "math/big"
+ "sync"
+)
+
+var (
+ once sync.Once
+ p256t1, p384t1, p512t1 *elliptic.CurveParams
+ p256r1, p384r1, p512r1 *rcurve
+)
+
+func initAll() {
+ initP256t1()
+ initP384t1()
+ initP512t1()
+ initP256r1()
+ initP384r1()
+ initP512r1()
+}
+
+func initP256t1() {
+ p256t1 = &elliptic.CurveParams{Name: "brainpoolP256t1"}
+ p256t1.P, _ = new(big.Int).SetString("A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", 16)
+ p256t1.N, _ = new(big.Int).SetString("A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", 16)
+ p256t1.B, _ = new(big.Int).SetString("662C61C430D84EA4FE66A7733D0B76B7BF93EBC4AF2F49256AE58101FEE92B04", 16)
+ p256t1.Gx, _ = new(big.Int).SetString("A3E8EB3CC1CFE7B7732213B23A656149AFA142C47AAFBC2B79A191562E1305F4", 16)
+ p256t1.Gy, _ = new(big.Int).SetString("2D996C823439C56D7F7B22E14644417E69BCB6DE39D027001DABE8F35B25C9BE", 16)
+ p256t1.BitSize = 256
+}
+
+func initP256r1() {
+ twisted := p256t1
+ params := &elliptic.CurveParams{
+ Name: "brainpoolP256r1",
+ P: twisted.P,
+ N: twisted.N,
+ BitSize: twisted.BitSize,
+ }
+ params.Gx, _ = new(big.Int).SetString("8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262", 16)
+ params.Gy, _ = new(big.Int).SetString("547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997", 16)
+ z, _ := new(big.Int).SetString("3E2D4BD9597B58639AE7AA669CAB9837CF5CF20A2C852D10F655668DFC150EF0", 16)
+ p256r1 = newrcurve(twisted, params, z)
+}
+
+func initP384t1() {
+ p384t1 = &elliptic.CurveParams{Name: "brainpoolP384t1"}
+ p384t1.P, _ = new(big.Int).SetString("8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53", 16)
+ p384t1.N, _ = new(big.Int).SetString("8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565", 16)
+ p384t1.B, _ = new(big.Int).SetString("7F519EADA7BDA81BD826DBA647910F8C4B9346ED8CCDC64E4B1ABD11756DCE1D2074AA263B88805CED70355A33B471EE", 16)
+ p384t1.Gx, _ = new(big.Int).SetString("18DE98B02DB9A306F2AFCD7235F72A819B80AB12EBD653172476FECD462AABFFC4FF191B946A5F54D8D0AA2F418808CC", 16)
+ p384t1.Gy, _ = new(big.Int).SetString("25AB056962D30651A114AFD2755AD336747F93475B7A1FCA3B88F2B6A208CCFE469408584DC2B2912675BF5B9E582928", 16)
+ p384t1.BitSize = 384
+}
+
+func initP384r1() {
+ twisted := p384t1
+ params := &elliptic.CurveParams{
+ Name: "brainpoolP384r1",
+ P: twisted.P,
+ N: twisted.N,
+ BitSize: twisted.BitSize,
+ }
+ params.Gx, _ = new(big.Int).SetString("1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E", 16)
+ params.Gy, _ = new(big.Int).SetString("8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315", 16)
+ z, _ := new(big.Int).SetString("41DFE8DD399331F7166A66076734A89CD0D2BCDB7D068E44E1F378F41ECBAE97D2D63DBC87BCCDDCCC5DA39E8589291C", 16)
+ p384r1 = newrcurve(twisted, params, z)
+}
+
+func initP512t1() {
+ p512t1 = &elliptic.CurveParams{Name: "brainpoolP512t1"}
+ p512t1.P, _ = new(big.Int).SetString("AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3", 16)
+ p512t1.N, _ = new(big.Int).SetString("AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069", 16)
+ p512t1.B, _ = new(big.Int).SetString("7CBBBCF9441CFAB76E1890E46884EAE321F70C0BCB4981527897504BEC3E36A62BCDFA2304976540F6450085F2DAE145C22553B465763689180EA2571867423E", 16)
+ p512t1.Gx, _ = new(big.Int).SetString("640ECE5C12788717B9C1BA06CBC2A6FEBA85842458C56DDE9DB1758D39C0313D82BA51735CDB3EA499AA77A7D6943A64F7A3F25FE26F06B51BAA2696FA9035DA", 16)
+ p512t1.Gy, _ = new(big.Int).SetString("5B534BD595F5AF0FA2C892376C84ACE1BB4E3019B71634C01131159CAE03CEE9D9932184BEEF216BD71DF2DADF86A627306ECFF96DBB8BACE198B61E00F8B332", 16)
+ p512t1.BitSize = 512
+}
+
+func initP512r1() {
+ twisted := p512t1
+ params := &elliptic.CurveParams{
+ Name: "brainpoolP512r1",
+ P: twisted.P,
+ N: twisted.N,
+ BitSize: twisted.BitSize,
+ }
+ params.Gx, _ = new(big.Int).SetString("81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822", 16)
+ params.Gy, _ = new(big.Int).SetString("7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892", 16)
+ z, _ := new(big.Int).SetString("12EE58E6764838B69782136F0F2D3BA06E27695716054092E60A80BEDB212B64E585D90BCE13761F85C3F1D2A64E3BE8FEA2220F01EBA5EEB0F35DBD29D922AB", 16)
+ p512r1 = newrcurve(twisted, params, z)
+}
+
+// P256t1 returns a Curve which implements Brainpool P256t1 (see RFC 5639, section 3.4)
+func P256t1() elliptic.Curve {
+ once.Do(initAll)
+ return p256t1
+}
+
+// P256r1 returns a Curve which implements Brainpool P256r1 (see RFC 5639, section 3.4)
+func P256r1() elliptic.Curve {
+ once.Do(initAll)
+ return p256r1
+}
+
+// P384t1 returns a Curve which implements Brainpool P384t1 (see RFC 5639, section 3.6)
+func P384t1() elliptic.Curve {
+ once.Do(initAll)
+ return p384t1
+}
+
+// P384r1 returns a Curve which implements Brainpool P384r1 (see RFC 5639, section 3.6)
+func P384r1() elliptic.Curve {
+ once.Do(initAll)
+ return p384r1
+}
+
+// P512t1 returns a Curve which implements Brainpool P512t1 (see RFC 5639, section 3.7)
+func P512t1() elliptic.Curve {
+ once.Do(initAll)
+ return p512t1
+}
+
+// P512r1 returns a Curve which implements Brainpool P512r1 (see RFC 5639, section 3.7)
+func P512r1() elliptic.Curve {
+ once.Do(initAll)
+ return p512r1
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/brainpool/rcurve.go b/vendor/github.com/ProtonMail/go-crypto/brainpool/rcurve.go
new file mode 100644
index 0000000000..7e291d6aa4
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/brainpool/rcurve.go
@@ -0,0 +1,83 @@
+package brainpool
+
+import (
+ "crypto/elliptic"
+ "math/big"
+)
+
+var _ elliptic.Curve = (*rcurve)(nil)
+
+type rcurve struct {
+ twisted elliptic.Curve
+ params *elliptic.CurveParams
+ z *big.Int
+ zinv *big.Int
+ z2 *big.Int
+ z3 *big.Int
+ zinv2 *big.Int
+ zinv3 *big.Int
+}
+
+var (
+ two = big.NewInt(2)
+ three = big.NewInt(3)
+)
+
+func newrcurve(twisted elliptic.Curve, params *elliptic.CurveParams, z *big.Int) *rcurve {
+ zinv := new(big.Int).ModInverse(z, params.P)
+ return &rcurve{
+ twisted: twisted,
+ params: params,
+ z: z,
+ zinv: zinv,
+ z2: new(big.Int).Exp(z, two, params.P),
+ z3: new(big.Int).Exp(z, three, params.P),
+ zinv2: new(big.Int).Exp(zinv, two, params.P),
+ zinv3: new(big.Int).Exp(zinv, three, params.P),
+ }
+}
+
+func (curve *rcurve) toTwisted(x, y *big.Int) (*big.Int, *big.Int) {
+ var tx, ty big.Int
+ tx.Mul(x, curve.z2)
+ tx.Mod(&tx, curve.params.P)
+ ty.Mul(y, curve.z3)
+ ty.Mod(&ty, curve.params.P)
+ return &tx, &ty
+}
+
+func (curve *rcurve) fromTwisted(tx, ty *big.Int) (*big.Int, *big.Int) {
+ var x, y big.Int
+ x.Mul(tx, curve.zinv2)
+ x.Mod(&x, curve.params.P)
+ y.Mul(ty, curve.zinv3)
+ y.Mod(&y, curve.params.P)
+ return &x, &y
+}
+
+func (curve *rcurve) Params() *elliptic.CurveParams {
+ return curve.params
+}
+
+func (curve *rcurve) IsOnCurve(x, y *big.Int) bool {
+ return curve.twisted.IsOnCurve(curve.toTwisted(x, y))
+}
+
+func (curve *rcurve) Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int) {
+ tx1, ty1 := curve.toTwisted(x1, y1)
+ tx2, ty2 := curve.toTwisted(x2, y2)
+ return curve.fromTwisted(curve.twisted.Add(tx1, ty1, tx2, ty2))
+}
+
+func (curve *rcurve) Double(x1, y1 *big.Int) (x, y *big.Int) {
+ return curve.fromTwisted(curve.twisted.Double(curve.toTwisted(x1, y1)))
+}
+
+func (curve *rcurve) ScalarMult(x1, y1 *big.Int, scalar []byte) (x, y *big.Int) {
+ tx1, ty1 := curve.toTwisted(x1, y1)
+ return curve.fromTwisted(curve.twisted.ScalarMult(tx1, ty1, scalar))
+}
+
+func (curve *rcurve) ScalarBaseMult(scalar []byte) (x, y *big.Int) {
+ return curve.fromTwisted(curve.twisted.ScalarBaseMult(scalar))
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/eax/eax.go b/vendor/github.com/ProtonMail/go-crypto/eax/eax.go
new file mode 100644
index 0000000000..3ae91d594c
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/eax/eax.go
@@ -0,0 +1,162 @@
+// Copyright (C) 2019 ProtonTech AG
+
+// Package eax provides an implementation of the EAX
+// (encrypt-authenticate-translate) mode of operation, as described in
+// Bellare, Rogaway, and Wagner "THE EAX MODE OF OPERATION: A TWO-PASS
+// AUTHENTICATED-ENCRYPTION SCHEME OPTIMIZED FOR SIMPLICITY AND EFFICIENCY."
+// In FSE'04, volume 3017 of LNCS, 2004
+package eax
+
+import (
+ "crypto/cipher"
+ "crypto/subtle"
+ "errors"
+ "github.com/ProtonMail/go-crypto/internal/byteutil"
+)
+
+const (
+ defaultTagSize = 16
+ defaultNonceSize = 16
+)
+
+type eax struct {
+ block cipher.Block // Only AES-{128, 192, 256} supported
+ tagSize int // At least 12 bytes recommended
+ nonceSize int
+}
+
+func (e *eax) NonceSize() int {
+ return e.nonceSize
+}
+
+func (e *eax) Overhead() int {
+ return e.tagSize
+}
+
+// NewEAX returns an EAX instance with AES-{KEYLENGTH} and default nonce and
+// tag lengths. Supports {128, 192, 256}- bit key length.
+func NewEAX(block cipher.Block) (cipher.AEAD, error) {
+ return NewEAXWithNonceAndTagSize(block, defaultNonceSize, defaultTagSize)
+}
+
+// NewEAXWithNonceAndTagSize returns an EAX instance with AES-{keyLength} and
+// given nonce and tag lengths in bytes. Panics on zero nonceSize and
+// exceedingly long tags.
+//
+// It is recommended to use at least 12 bytes as tag length (see, for instance,
+// NIST SP 800-38D).
+//
+// Only to be used for compatibility with existing cryptosystems with
+// non-standard parameters. For all other cases, prefer NewEAX.
+func NewEAXWithNonceAndTagSize(
+ block cipher.Block, nonceSize, tagSize int) (cipher.AEAD, error) {
+ if nonceSize < 1 {
+ return nil, eaxError("Cannot initialize EAX with nonceSize = 0")
+ }
+ if tagSize > block.BlockSize() {
+ return nil, eaxError("Custom tag length exceeds blocksize")
+ }
+ return &eax{
+ block: block,
+ tagSize: tagSize,
+ nonceSize: nonceSize,
+ }, nil
+}
+
+func (e *eax) Seal(dst, nonce, plaintext, adata []byte) []byte {
+ if len(nonce) > e.nonceSize {
+ panic("crypto/eax: Nonce too long for this instance")
+ }
+ ret, out := byteutil.SliceForAppend(dst, len(plaintext)+e.tagSize)
+ omacNonce := e.omacT(0, nonce)
+ omacAdata := e.omacT(1, adata)
+
+ // Encrypt message using CTR mode and omacNonce as IV
+ ctr := cipher.NewCTR(e.block, omacNonce)
+ ciphertextData := out[:len(plaintext)]
+ ctr.XORKeyStream(ciphertextData, plaintext)
+
+ omacCiphertext := e.omacT(2, ciphertextData)
+
+ tag := out[len(plaintext):]
+ for i := 0; i < e.tagSize; i++ {
+ tag[i] = omacCiphertext[i] ^ omacNonce[i] ^ omacAdata[i]
+ }
+ return ret
+}
+
+func (e *eax) Open(dst, nonce, ciphertext, adata []byte) ([]byte, error) {
+ if len(nonce) > e.nonceSize {
+ panic("crypto/eax: Nonce too long for this instance")
+ }
+ if len(ciphertext) < e.tagSize {
+ return nil, eaxError("Ciphertext shorter than tag length")
+ }
+ sep := len(ciphertext) - e.tagSize
+
+ // Compute tag
+ omacNonce := e.omacT(0, nonce)
+ omacAdata := e.omacT(1, adata)
+ omacCiphertext := e.omacT(2, ciphertext[:sep])
+
+ tag := make([]byte, e.tagSize)
+ for i := 0; i < e.tagSize; i++ {
+ tag[i] = omacCiphertext[i] ^ omacNonce[i] ^ omacAdata[i]
+ }
+
+ // Compare tags
+ if subtle.ConstantTimeCompare(ciphertext[sep:], tag) != 1 {
+ return nil, eaxError("Tag authentication failed")
+ }
+
+ // Decrypt ciphertext
+ ret, out := byteutil.SliceForAppend(dst, len(ciphertext))
+ ctr := cipher.NewCTR(e.block, omacNonce)
+ ctr.XORKeyStream(out, ciphertext[:sep])
+
+ return ret[:sep], nil
+}
+
+// Tweakable OMAC - Calls OMAC_K([t]_n || plaintext)
+func (e *eax) omacT(t byte, plaintext []byte) []byte {
+ blockSize := e.block.BlockSize()
+ byteT := make([]byte, blockSize)
+ byteT[blockSize-1] = t
+ concat := append(byteT, plaintext...)
+ return e.omac(concat)
+}
+
+func (e *eax) omac(plaintext []byte) []byte {
+ blockSize := e.block.BlockSize()
+ // L ← E_K(0^n); B ← 2L; P ← 4L
+ L := make([]byte, blockSize)
+ e.block.Encrypt(L, L)
+ B := byteutil.GfnDouble(L)
+ P := byteutil.GfnDouble(B)
+
+ // CBC with IV = 0
+ cbc := cipher.NewCBCEncrypter(e.block, make([]byte, blockSize))
+ padded := e.pad(plaintext, B, P)
+ cbcCiphertext := make([]byte, len(padded))
+ cbc.CryptBlocks(cbcCiphertext, padded)
+
+ return cbcCiphertext[len(cbcCiphertext)-blockSize:]
+}
+
+func (e *eax) pad(plaintext, B, P []byte) []byte {
+ // if |M| in {n, 2n, 3n, ...}
+ blockSize := e.block.BlockSize()
+ if len(plaintext) != 0 && len(plaintext)%blockSize == 0 {
+ return byteutil.RightXor(plaintext, B)
+ }
+
+ // else return (M || 1 || 0^(n−1−(|M| % n))) xor→ P
+ ending := make([]byte, blockSize-len(plaintext)%blockSize)
+ ending[0] = 0x80
+ padded := append(plaintext, ending...)
+ return byteutil.RightXor(padded, P)
+}
+
+func eaxError(err string) error {
+ return errors.New("crypto/eax: " + err)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/eax/eax_test_vectors.go b/vendor/github.com/ProtonMail/go-crypto/eax/eax_test_vectors.go
new file mode 100644
index 0000000000..ddb53d0790
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/eax/eax_test_vectors.go
@@ -0,0 +1,58 @@
+package eax
+
+// Test vectors from
+// https://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf
+var testVectors = []struct {
+ msg, key, nonce, header, ciphertext string
+}{
+ {"",
+ "233952DEE4D5ED5F9B9C6D6FF80FF478",
+ "62EC67F9C3A4A407FCB2A8C49031A8B3",
+ "6BFB914FD07EAE6B",
+ "E037830E8389F27B025A2D6527E79D01"},
+ {"F7FB",
+ "91945D3F4DCBEE0BF45EF52255F095A4",
+ "BECAF043B0A23D843194BA972C66DEBD",
+ "FA3BFD4806EB53FA",
+ "19DD5C4C9331049D0BDAB0277408F67967E5"},
+ {"1A47CB4933",
+ "01F74AD64077F2E704C0F60ADA3DD523",
+ "70C3DB4F0D26368400A10ED05D2BFF5E",
+ "234A3463C1264AC6",
+ "D851D5BAE03A59F238A23E39199DC9266626C40F80"},
+ {"481C9E39B1",
+ "D07CF6CBB7F313BDDE66B727AFD3C5E8",
+ "8408DFFF3C1A2B1292DC199E46B7D617",
+ "33CCE2EABFF5A79D",
+ "632A9D131AD4C168A4225D8E1FF755939974A7BEDE"},
+ {"40D0C07DA5E4",
+ "35B6D0580005BBC12B0587124557D2C2",
+ "FDB6B06676EEDC5C61D74276E1F8E816",
+ "AEB96EAEBE2970E9",
+ "071DFE16C675CB0677E536F73AFE6A14B74EE49844DD"},
+ {"4DE3B35C3FC039245BD1FB7D",
+ "BD8E6E11475E60B268784C38C62FEB22",
+ "6EAC5C93072D8E8513F750935E46DA1B",
+ "D4482D1CA78DCE0F",
+ "835BB4F15D743E350E728414ABB8644FD6CCB86947C5E10590210A4F"},
+ {"8B0A79306C9CE7ED99DAE4F87F8DD61636",
+ "7C77D6E813BED5AC98BAA417477A2E7D",
+ "1A8C98DCD73D38393B2BF1569DEEFC19",
+ "65D2017990D62528",
+ "02083E3979DA014812F59F11D52630DA30137327D10649B0AA6E1C181DB617D7F2"},
+ {"1BDA122BCE8A8DBAF1877D962B8592DD2D56",
+ "5FFF20CAFAB119CA2FC73549E20F5B0D",
+ "DDE59B97D722156D4D9AFF2BC7559826",
+ "54B9F04E6A09189A",
+ "2EC47B2C4954A489AFC7BA4897EDCDAE8CC33B60450599BD02C96382902AEF7F832A"},
+ {"6CF36720872B8513F6EAB1A8A44438D5EF11",
+ "A4A4782BCFFD3EC5E7EF6D8C34A56123",
+ "B781FCF2F75FA5A8DE97A9CA48E522EC",
+ "899A175897561D7E",
+ "0DE18FD0FDD91E7AF19F1D8EE8733938B1E8E7F6D2231618102FDB7FE55FF1991700"},
+ {"CA40D7446E545FFAED3BD12A740A659FFBBB3CEAB7",
+ "8395FCF1E95BEBD697BD010BC766AAC3",
+ "22E7ADD93CFC6393C57EC0B3C17D6B44",
+ "126735FCC320D25A",
+ "CB8920F87A6C75CFF39627B56E3ED197C552D295A7CFC46AFC253B4652B1AF3795B124AB6E"},
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/eax/random_vectors.go b/vendor/github.com/ProtonMail/go-crypto/eax/random_vectors.go
new file mode 100644
index 0000000000..4eb19f28d9
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/eax/random_vectors.go
@@ -0,0 +1,131 @@
+// These vectors include key length in {128, 192, 256}, tag size 128, and
+// random nonce, header, and plaintext lengths.
+
+// This file was automatically generated.
+
+package eax
+
+var randomVectors = []struct {
+ key, nonce, header, plaintext, ciphertext string
+}{
+ {"DFDE093F36B0356E5A81F609786982E3",
+ "1D8AC604419001816905BA72B14CED7E",
+ "152A1517A998D7A24163FCDD146DE81AC347C8B97088F502093C1ABB8F6E33D9A219C34D7603A18B1F5ABE02E56661B7D7F67E81EC08C1302EF38D80A859486D450E94A4F26AD9E68EEBBC0C857A0FC5CF9E641D63D565A7E361BC8908F5A8DC8FD6",
+ "1C8EAAB71077FE18B39730A3156ADE29C5EE824C7EE86ED2A253B775603FB237116E654F6FEC588DD27F523A0E01246FE73FE348491F2A8E9ABC6CA58D663F71CDBCF4AD798BE46C42AE6EE8B599DB44A1A48D7BBBBA0F7D2750181E1C5E66967F7D57CBD30AFBDA5727",
+ "79E7E150934BBEBF7013F61C60462A14D8B15AF7A248AFB8A344EF021C1500E16666891D6E973D8BB56B71A371F12CA34660C4410C016982B20F547E3762A58B7BF4F20236CADCF559E2BE7D783B13723B2741FC7CDC8997D839E39A3DDD2BADB96743DD7049F1BDB0516A262869915B3F70498AFB7B191BF960"},
+ {"F10619EF02E5D94D7550EB84ED364A21",
+ "8DC0D4F2F745BBAE835CC5574B942D20",
+ "FE561358F2E8DF7E1024FF1AE9A8D36EBD01352214505CB99D644777A8A1F6027FA2BDBFC529A9B91136D5F2416CFC5F0F4EC3A1AFD32BDDA23CA504C5A5CB451785FABF4DFE4CD50D817491991A60615B30286361C100A95D1712F2A45F8E374461F4CA2B",
+ "D7B5A971FC219631D30EFC3664AE3127D9CF3097DAD9C24AC7905D15E8D9B25B026B31D68CAE00975CDB81EB1FD96FD5E1A12E2BB83FA25F1B1D91363457657FC03875C27F2946C5",
+ "2F336ED42D3CC38FC61660C4CD60BA4BD438B05F5965D8B7B399D2E7167F5D34F792D318F94DB15D67463AC449E13D568CC09BFCE32A35EE3EE96A041927680AE329811811E27F2D1E8E657707AF99BA96D13A478D695D59"},
+ {"429F514EFC64D98A698A9247274CFF45",
+ "976AA5EB072F912D126ACEBC954FEC38",
+ "A71D89DC5B6CEDBB7451A27C3C2CAE09126DB4C421",
+ "5632FE62AB1DC549D54D3BC3FC868ACCEDEFD9ECF5E9F8",
+ "848AE4306CA8C7F416F8707625B7F55881C0AB430353A5C967CDA2DA787F581A70E34DBEBB2385"},
+ {"398138F309085F47F8457CDF53895A63",
+ "F8A8A7F2D28E5FFF7BBC2F24353F7A36",
+ "5D633C21BA7764B8855CAB586F3746E236AD486039C83C6B56EFA9C651D38A41D6B20DAEE3418BFEA44B8BD6",
+ "A3BBAA91920AF5E10659818B1B3B300AC79BFC129C8329E75251F73A66D3AE0128EB91D5031E0A65C329DB7D1E9C0493E268",
+ "D078097267606E5FB07CFB7E2B4B718172A82C6A4CEE65D549A4DFB9838003BD2FBF64A7A66988AC1A632FD88F9E9FBB57C5A78AD2E086EACBA3DB68511D81C2970A"},
+ {"7A4151EBD3901B42CBA45DAFB2E931BA",
+ "0FC88ACEE74DD538040321C330974EB8",
+ "250464FB04733BAB934C59E6AD2D6AE8D662CBCFEFBE61E5A308D4211E58C4C25935B72C69107722E946BFCBF416796600542D76AEB73F2B25BF53BAF97BDEB36ED3A7A51C31E7F170EB897457E7C17571D1BA0A908954E9",
+ "88C41F3EBEC23FAB8A362D969CAC810FAD4F7CA6A7F7D0D44F060F92E37E1183768DD4A8C733F71C96058D362A39876D183B86C103DE",
+ "74A25B2182C51096D48A870D80F18E1CE15867778E34FCBA6BD7BFB3739FDCD42AD0F2D9F4EBA29085285C6048C15BCE5E5166F1F962D3337AA88E6062F05523029D0A7F0BF9"},
+ {"BFB147E1CD5459424F8C0271FC0E0DC5",
+ "EABCC126442BF373969EA3015988CC45",
+ "4C0880E1D71AA2C7",
+ "BE1B5EC78FBF73E7A6682B21BA7E0E5D2D1C7ABE",
+ "5660D7C1380E2F306895B1402CB2D6C37876504276B414D120F4CF92FDDDBB293A238EA0"},
+ {"595DD6F52D18BC2CA8EB4EDAA18D9FA3",
+ "0F84B5D36CF4BC3B863313AF3B4D2E97",
+ "30AE6CC5F99580F12A779D98BD379A60948020C0B6FBD5746B30BA3A15C6CD33DAF376C70A9F15B6C0EB410A93161F7958AE23",
+ "8EF3687A1642B070970B0B91462229D1D76ABC154D18211F7152AA9FF368",
+ "317C1DDB11417E5A9CC4DDE7FDFF6659A5AC4B31DE025212580A05CDAC6024D3E4AE7C2966E52B9129E9ECDBED86"},
+ {"44E6F2DC8FDC778AD007137D11410F50",
+ "270A237AD977F7187AA6C158A0BAB24F",
+ "509B0F0EB12E2AA5C5BA2DE553C07FAF4CE0C9E926531AA709A3D6224FCB783ACCF1559E10B1123EBB7D52E8AB54E6B5352A9ED0D04124BF0E9D9BACFD7E32B817B2E625F5EE94A64EDE9E470DE7FE6886C19B294F9F828209FE257A78",
+ "8B3D7815DF25618A5D0C55A601711881483878F113A12EC36CF64900549A3199555528559DC118F789788A55FAFD944E6E99A9CA3F72F238CD3F4D88223F7A745992B3FAED1848",
+ "1CC00D79F7AD82FDA71B58D286E5F34D0CC4CEF30704E771CC1E50746BDF83E182B078DB27149A42BAE619DF0F85B0B1090AD55D3B4471B0D6F6ECCD09C8F876B30081F0E7537A9624F8AAF29DA85E324122EFB4D68A56"},
+ {"BB7BC352A03044B4428D8DBB4B0701FDEC4649FD17B81452",
+ "8B4BBE26CCD9859DCD84884159D6B0A4",
+ "2212BEB0E78E0F044A86944CF33C8D5C80D9DBE1034BF3BCF73611835C7D3A52F5BD2D81B68FD681B68540A496EE5DA16FD8AC8824E60E1EC2042BE28FB0BFAD4E4B03596446BDD8C37D936D9B3D5295BE19F19CF5ACE1D33A46C952CE4DE5C12F92C1DD051E04AEED",
+ "9037234CC44FFF828FABED3A7084AF40FA7ABFF8E0C0EFB57A1CC361E18FC4FAC1AB54F3ABFE9FF77263ACE16C3A",
+ "A9391B805CCD956081E0B63D282BEA46E7025126F1C1631239C33E92AA6F92CD56E5A4C56F00FF9658E93D48AF4EF0EF81628E34AD4DB0CDAEDCD2A17EE7"},
+ {"99C0AD703196D2F60A74E6B378B838B31F82EA861F06FC4E",
+ "92745C018AA708ECFEB1667E9F3F1B01",
+ "828C69F376C0C0EC651C67749C69577D589EE39E51404D80EBF70C8660A8F5FD375473F4A7C611D59CB546A605D67446CE2AA844135FCD78BB5FBC90222A00D42920BB1D7EEDFB0C4672554F583EF23184F89063CDECBE482367B5F9AF3ACBC3AF61392BD94CBCD9B64677",
+ "A879214658FD0A5B0E09836639BF82E05EC7A5EF71D4701934BDA228435C68AC3D5CEB54997878B06A655EEACEFB1345C15867E7FE6C6423660C8B88DF128EBD6BCD85118DBAE16E9252FFB204324E5C8F38CA97759BDBF3CB0083",
+ "51FE87996F194A2585E438B023B345439EA60D1AEBED4650CDAF48A4D4EEC4FC77DC71CC4B09D3BEEF8B7B7AF716CE2B4EFFB3AC9E6323C18AC35E0AA6E2BBBC8889490EB6226C896B0D105EAB42BFE7053CCF00ED66BA94C1BA09A792AA873F0C3B26C5C5F9A936E57B25"},
+ {"7086816D00D648FB8304AA8C9E552E1B69A9955FB59B25D1",
+ "0F45CF7F0BF31CCEB85D9DA10F4D749F",
+ "93F27C60A417D9F0669E86ACC784FC8917B502DAF30A6338F11B30B94D74FEFE2F8BE1BBE2EAD10FAB7EED3C6F72B7C3ECEE1937C32ED4970A6404E139209C05",
+ "877F046601F3CBE4FB1491943FA29487E738F94B99AF206262A1D6FF856C9AA0B8D4D08A54370C98F8E88FA3DCC2B14C1F76D71B2A4C7963AEE8AF960464C5BEC8357AD00DC8",
+ "FE96906B895CE6A8E72BC72344E2C8BB3C63113D70EAFA26C299BAFE77A8A6568172EB447FB3E86648A0AF3512DEB1AAC0819F3EC553903BF28A9FB0F43411237A774BF9EE03E445D280FBB9CD12B9BAAB6EF5E52691"},
+ {"062F65A896D5BF1401BADFF70E91B458E1F9BD4888CB2E4D",
+ "5B11EA1D6008EBB41CF892FCA5B943D1",
+ "BAF4FF5C8242",
+ "A8870E091238355984EB2F7D61A865B9170F440BFF999A5993DD41A10F4440D21FF948DDA2BF663B2E03AC3324492DC5E40262ECC6A65C07672353BE23E7FB3A9D79FF6AA38D97960905A38DECC312CB6A59E5467ECF06C311CD43ADC0B543EDF34FE8BE611F176460D5627CA51F8F8D9FED71F55C",
+ "B10E127A632172CF8AA7539B140D2C9C2590E6F28C3CB892FC498FCE56A34F732FBFF32E79C7B9747D9094E8635A0C084D6F0247F9768FB5FF83493799A9BEC6C39572120C40E9292C8C947AE8573462A9108C36D9D7112E6995AE5867E6C8BB387D1C5D4BEF524F391B9FD9F0A3B4BFA079E915BCD920185CFD38D114C558928BD7D47877"},
+ {"38A8E45D6D705A11AF58AED5A1344896998EACF359F2E26A",
+ "FD82B5B31804FF47D44199B533D0CF84",
+ "DE454D4E62FE879F2050EE3E25853623D3E9AC52EEC1A1779A48CFAF5ECA0BFDE44749391866D1",
+ "B804",
+ "164BB965C05EBE0931A1A63293EDF9C38C27"},
+ {"34C33C97C6D7A0850DA94D78A58DC61EC717CD7574833068",
+ "343BE00DA9483F05C14F2E9EB8EA6AE8",
+ "78312A43EFDE3CAE34A65796FF059A3FE15304EEA5CF1D9306949FE5BF3349D4977D4EBE76C040FE894C5949E4E4D6681153DA87FB9AC5062063CA2EA183566343362370944CE0362D25FC195E124FD60E8682E665D13F2229DDA3E4B2CB1DCA",
+ "CC11BB284B1153578E4A5ED9D937B869DAF00F5B1960C23455CA9CC43F486A3BE0B66254F1041F04FDF459C8640465B6E1D2CF899A381451E8E7FCB50CF87823BE77E24B132BBEEDC72E53369B275E1D8F49ECE59F4F215230AC4FE133FC80E4F634EE80BA4682B62C86",
+ "E7F703DC31A95E3A4919FF957836CB76C063D81702AEA4703E1C2BF30831E58C4609D626EC6810E12EAA5B930F049FF9EFC22C3E3F1EBD4A1FB285CB02A1AC5AD46B425199FC0A85670A5C4E3DAA9636C8F64C199F42F18AAC8EA7457FD377F322DD7752D7D01B946C8F0A97E6113F0D50106F319AFD291AAACE"},
+ {"C6ECF7F053573E403E61B83052A343D93CBCC179D1E835BE",
+ "E280E13D7367042E3AA09A80111B6184",
+ "21486C9D7A9647",
+ "5F2639AFA6F17931853791CD8C92382BBB677FD72D0AB1A080D0E49BFAA21810E963E4FACD422E92F65CBFAD5884A60CD94740DF31AF02F95AA57DA0C4401B0ED906",
+ "5C51DB20755302070C45F52E50128A67C8B2E4ED0EACB7E29998CCE2E8C289DD5655913EC1A51CC3AABE5CDC2402B2BE7D6D4BF6945F266FBD70BA9F37109067157AE7530678B45F64475D4EBFCB5FFF46A5"},
+ {"5EC6CF7401BC57B18EF154E8C38ACCA8959E57D2F3975FF5",
+ "656B41CB3F9CF8C08BAD7EBFC80BD225",
+ "6B817C2906E2AF425861A7EF59BA5801F143EE2A139EE72697CDE168B4",
+ "2C0E1DDC9B1E5389BA63845B18B1F8A1DB062037151BCC56EF7C21C0BB4DAE366636BBA975685D7CC5A94AFBE89C769016388C56FB7B57CE750A12B718A8BDCF70E80E8659A8330EFC8F86640F21735E8C80E23FE43ABF23507CE3F964AE4EC99D",
+ "ED780CF911E6D1AA8C979B889B0B9DC1ABE261832980BDBFB576901D9EF5AB8048998E31A15BE54B3E5845A4D136AD24D0BDA1C3006168DF2F8AC06729CB0818867398150020131D8F04EDF1923758C9EABB5F735DE5EA1758D4BC0ACFCA98AFD202E9839B8720253693B874C65586C6F0"},
+ {"C92F678EB2208662F5BCF3403EC05F5961E957908A3E79421E1D25FC19054153",
+ "DA0F3A40983D92F2D4C01FED33C7A192",
+ "2B6E9D26DB406A0FAB47608657AA10EFC2B4AA5F459B29FF85AC9A40BFFE7AEB04F77E9A11FAAA116D7F6D4DA417671A9AB02C588E0EF59CB1BFB4B1CC931B63A3B3A159FCEC97A04D1E6F0C7E6A9CEF6B0ABB04758A69F1FE754DF4C2610E8C46B6CF413BDB31351D55BEDCB7B4A13A1C98E10984475E0F2F957853",
+ "F37326A80E08",
+ "83519E53E321D334F7C10B568183775C0E9AAE55F806"},
+ {"6847E0491BE57E72995D186D50094B0B3593957A5146798FCE68B287B2FB37B5",
+ "3EE1182AEBB19A02B128F28E1D5F7F99",
+ "D9F35ABB16D776CE",
+ "DB7566ED8EA95BDF837F23DB277BAFBC5E70D1105ADFD0D9EF15475051B1EF94709C67DCA9F8D5",
+ "2CDCED0C9EBD6E2A508822A685F7DCD1CDD99E7A5FCA786C234E7F7F1D27EC49751AD5DCFA30C5EDA87C43CAE3B919B6BBCFE34C8EDA59"},
+ {"82B019673642C08388D3E42075A4D5D587558C229E4AB8F660E37650C4C41A0A",
+ "336F5D681E0410FAE7B607246092C6DC",
+ "D430CBD8FE435B64214E9E9CDC5DE99D31CFCFB8C10AA0587A49DF276611",
+ "998404153AD77003E1737EDE93ED79859EE6DCCA93CB40C4363AA817ABF2DBBD46E42A14A7183B6CC01E12A577888141363D0AE011EB6E8D28C0B235",
+ "9BEF69EEB60BD3D6065707B7557F25292A8872857CFBD24F2F3C088E4450995333088DA50FD9121221C504DF1D0CD5EFE6A12666C5D5BB12282CF4C19906E9CFAB97E9BDF7F49DC17CFC384B"},
+ {"747B2E269B1859F0622C15C8BAD6A725028B1F94B8DB7326948D1E6ED663A8BC",
+ "AB91F7245DDCE3F1C747872D47BE0A8A",
+ "3B03F786EF1DDD76E1D42646DA4CD2A5165DC5383CE86D1A0B5F13F910DC278A4E451EE0192CBA178E13B3BA27FDC7840DF73D2E104B",
+ "6B803F4701114F3E5FE21718845F8416F70F626303F545BE197189E0A2BA396F37CE06D389EB2658BC7D56D67868708F6D0D32",
+ "1570DDB0BCE75AA25D1957A287A2C36B1A5F2270186DA81BA6112B7F43B0F3D1D0ED072591DCF1F1C99BBB25621FC39B896FF9BD9413A2845363A9DCD310C32CF98E57"},
+ {"02E59853FB29AEDA0FE1C5F19180AD99A12FF2F144670BB2B8BADF09AD812E0A",
+ "C691294EF67CD04D1B9242AF83DD1421",
+ "879334DAE3",
+ "1E17F46A98FEF5CBB40759D95354",
+ "FED8C3FF27DDF6313AED444A2985B36CBA268AAD6AAC563C0BA28F6DB5DB"},
+ {"F6C1FB9B4188F2288FF03BD716023198C3582CF2A037FC2F29760916C2B7FCDB",
+ "4228DA0678CA3534588859E77DFF014C",
+ "D8153CAF35539A61DD8D05B3C9B44F01E564FB9348BCD09A1C23B84195171308861058F0A3CD2A55B912A3AAEE06FF4D356C77275828F2157C2FC7C115DA39E443210CCC56BEDB0CC99BBFB227ABD5CC454F4E7F547C7378A659EEB6A7E809101A84F866503CB18D4484E1FA09B3EC7FC75EB2E35270800AA7",
+ "23B660A779AD285704B12EC1C580387A47BEC7B00D452C6570",
+ "5AA642BBABA8E49849002A2FAF31DB8FC7773EFDD656E469CEC19B3206D4174C9A263D0A05484261F6"},
+ {"8FF6086F1FADB9A3FBE245EAC52640C43B39D43F89526BB5A6EBA47710931446",
+ "943188480C99437495958B0AE4831AA9",
+ "AD5CD0BDA426F6EBA23C8EB23DC73FF9FEC173355EDBD6C9344C4C4383F211888F7CE6B29899A6801DF6B38651A7C77150941A",
+ "80CD5EA8D7F81DDF5070B934937912E8F541A5301877528EB41AB60C020968D459960ED8FB73083329841A",
+ "ABAE8EB7F36FCA2362551E72DAC890BA1BB6794797E0FC3B67426EC9372726ED4725D379EA0AC9147E48DCD0005C502863C2C5358A38817C8264B5"},
+ {"A083B54E6B1FE01B65D42FCD248F97BB477A41462BBFE6FD591006C022C8FD84",
+ "B0490F5BD68A52459556B3749ACDF40E",
+ "8892E047DA5CFBBDF7F3CFCBD1BD21C6D4C80774B1826999234394BD3E513CC7C222BB40E1E3140A152F19B3802F0D036C24A590512AD0E8",
+ "D7B15752789DC94ED0F36778A5C7BBB207BEC32BAC66E702B39966F06E381E090C6757653C3D26A81EC6AD6C364D66867A334C91BB0B8A8A4B6EACDF0783D09010AEBA2DD2062308FE99CC1F",
+ "C071280A732ADC93DF272BF1E613B2BB7D46FC6665EF2DC1671F3E211D6BDE1D6ADDD28DF3AA2E47053FC8BB8AE9271EC8BC8B2CFFA320D225B451685B6D23ACEFDD241FE284F8ADC8DB07F456985B14330BBB66E0FB212213E05B3E"},
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/internal/byteutil/byteutil.go b/vendor/github.com/ProtonMail/go-crypto/internal/byteutil/byteutil.go
new file mode 100644
index 0000000000..d558b9bd82
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/internal/byteutil/byteutil.go
@@ -0,0 +1,90 @@
+// Copyright (C) 2019 ProtonTech AG
+// This file contains necessary tools for the aex and ocb packages.
+//
+// These functions SHOULD NOT be used elsewhere, since they are optimized for
+// specific input nature in the EAX and OCB modes of operation.
+
+package byteutil
+
+// GfnDouble computes 2 * input in the field of 2^n elements.
+// The irreducible polynomial in the finite field for n=128 is
+// x^128 + x^7 + x^2 + x + 1 (equals 0x87)
+// Constant-time execution in order to avoid side-channel attacks
+func GfnDouble(input []byte) []byte {
+ if len(input) != 16 {
+ panic("Doubling in GFn only implemented for n = 128")
+ }
+ // If the first bit is zero, return 2L = L << 1
+ // Else return (L << 1) xor 0^120 10000111
+ shifted := ShiftBytesLeft(input)
+ shifted[15] ^= ((input[0] >> 7) * 0x87)
+ return shifted
+}
+
+// ShiftBytesLeft outputs the byte array corresponding to x << 1 in binary.
+func ShiftBytesLeft(x []byte) []byte {
+ l := len(x)
+ dst := make([]byte, l)
+ for i := 0; i < l-1; i++ {
+ dst[i] = (x[i] << 1) | (x[i+1] >> 7)
+ }
+ dst[l-1] = x[l-1] << 1
+ return dst
+}
+
+// ShiftNBytesLeft puts in dst the byte array corresponding to x << n in binary.
+func ShiftNBytesLeft(dst, x []byte, n int) {
+ // Erase first n / 8 bytes
+ copy(dst, x[n/8:])
+
+ // Shift the remaining n % 8 bits
+ bits := uint(n % 8)
+ l := len(dst)
+ for i := 0; i < l-1; i++ {
+ dst[i] = (dst[i] << bits) | (dst[i+1] >> uint(8-bits))
+ }
+ dst[l-1] = dst[l-1] << bits
+
+ // Append trailing zeroes
+ dst = append(dst, make([]byte, n/8)...)
+}
+
+// XorBytesMut replaces X with X XOR Y. len(X) must be >= len(Y).
+func XorBytesMut(X, Y []byte) {
+ for i := 0; i < len(Y); i++ {
+ X[i] ^= Y[i]
+ }
+}
+
+// XorBytes puts X XOR Y into Z. len(Z) and len(X) must be >= len(Y).
+func XorBytes(Z, X, Y []byte) {
+ for i := 0; i < len(Y); i++ {
+ Z[i] = X[i] ^ Y[i]
+ }
+}
+
+// RightXor XORs smaller input (assumed Y) at the right of the larger input (assumed X)
+func RightXor(X, Y []byte) []byte {
+ offset := len(X) - len(Y)
+ xored := make([]byte, len(X))
+ copy(xored, X)
+ for i := 0; i < len(Y); i++ {
+ xored[offset+i] ^= Y[i]
+ }
+ return xored
+}
+
+// SliceForAppend takes a slice and a requested number of bytes. It returns a
+// slice with the contents of the given slice followed by that many bytes and a
+// second slice that aliases into it and contains only the extra bytes. If the
+// original slice has sufficient capacity then no allocation is performed.
+func SliceForAppend(in []byte, n int) (head, tail []byte) {
+ if total := len(in) + n; cap(in) >= total {
+ head = in[:total]
+ } else {
+ head = make([]byte, total)
+ copy(head, in)
+ }
+ tail = head[len(in):]
+ return
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/ocb/ocb.go b/vendor/github.com/ProtonMail/go-crypto/ocb/ocb.go
new file mode 100644
index 0000000000..24f893017b
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/ocb/ocb.go
@@ -0,0 +1,313 @@
+// Copyright (C) 2019 ProtonTech AG
+
+// Package ocb provides an implementation of the OCB (offset codebook) mode of
+// operation, as described in RFC-7253 of the IRTF and in Rogaway, Bellare,
+// Black and Krovetz - OCB: A BLOCK-CIPHER MODE OF OPERATION FOR EFFICIENT
+// AUTHENTICATED ENCRYPTION (2003).
+// Security considerations (from RFC-7253): A private key MUST NOT be used to
+// encrypt more than 2^48 blocks. Tag length should be at least 12 bytes (a
+// brute-force forging adversary succeeds after 2^{tag length} attempts). A
+// single key SHOULD NOT be used to decrypt ciphertext with different tag
+// lengths. Nonces need not be secret, but MUST NOT be reused.
+// This package only supports underlying block ciphers with 128-bit blocks,
+// such as AES-{128, 192, 256}, but may be extended to other sizes.
+package ocb
+
+import (
+ "bytes"
+ "crypto/cipher"
+ "crypto/subtle"
+ "errors"
+ "math/bits"
+
+ "github.com/ProtonMail/go-crypto/internal/byteutil"
+)
+
+type ocb struct {
+ block cipher.Block
+ tagSize int
+ nonceSize int
+ mask mask
+ // Optimized en/decrypt: For each nonce N used to en/decrypt, the 'Ktop'
+ // internal variable can be reused for en/decrypting with nonces sharing
+ // all but the last 6 bits with N. The prefix of the first nonce used to
+ // compute the new Ktop, and the Ktop value itself, are stored in
+ // reusableKtop. If using incremental nonces, this saves one block cipher
+ // call every 63 out of 64 OCB encryptions, and stores one nonce and one
+ // output of the block cipher in memory only.
+ reusableKtop reusableKtop
+}
+
+type mask struct {
+ // L_*, L_$, (L_i)_{i ∈ N}
+ lAst []byte
+ lDol []byte
+ L [][]byte
+}
+
+type reusableKtop struct {
+ noncePrefix []byte
+ Ktop []byte
+}
+
+const (
+ defaultTagSize = 16
+ defaultNonceSize = 15
+)
+
+const (
+ enc = iota
+ dec
+)
+
+func (o *ocb) NonceSize() int {
+ return o.nonceSize
+}
+
+func (o *ocb) Overhead() int {
+ return o.tagSize
+}
+
+// NewOCB returns an OCB instance with the given block cipher and default
+// tag and nonce sizes.
+func NewOCB(block cipher.Block) (cipher.AEAD, error) {
+ return NewOCBWithNonceAndTagSize(block, defaultNonceSize, defaultTagSize)
+}
+
+// NewOCBWithNonceAndTagSize returns an OCB instance with the given block
+// cipher, nonce length, and tag length. Panics on zero nonceSize and
+// exceedingly long tag size.
+//
+// It is recommended to use at least 12 bytes as tag length.
+func NewOCBWithNonceAndTagSize(
+ block cipher.Block, nonceSize, tagSize int) (cipher.AEAD, error) {
+ if block.BlockSize() != 16 {
+ return nil, ocbError("Block cipher must have 128-bit blocks")
+ }
+ if nonceSize < 1 {
+ return nil, ocbError("Incorrect nonce length")
+ }
+ if nonceSize >= block.BlockSize() {
+ return nil, ocbError("Nonce length exceeds blocksize - 1")
+ }
+ if tagSize > block.BlockSize() {
+ return nil, ocbError("Custom tag length exceeds blocksize")
+ }
+ return &ocb{
+ block: block,
+ tagSize: tagSize,
+ nonceSize: nonceSize,
+ mask: initializeMaskTable(block),
+ reusableKtop: reusableKtop{
+ noncePrefix: nil,
+ Ktop: nil,
+ },
+ }, nil
+}
+
+func (o *ocb) Seal(dst, nonce, plaintext, adata []byte) []byte {
+ if len(nonce) > o.nonceSize {
+ panic("crypto/ocb: Incorrect nonce length given to OCB")
+ }
+ sep := len(plaintext)
+ ret, out := byteutil.SliceForAppend(dst, sep+o.tagSize)
+ tag := o.crypt(enc, out[:sep], nonce, adata, plaintext)
+ copy(out[sep:], tag)
+ return ret
+}
+
+func (o *ocb) Open(dst, nonce, ciphertext, adata []byte) ([]byte, error) {
+ if len(nonce) > o.nonceSize {
+ panic("Nonce too long for this instance")
+ }
+ if len(ciphertext) < o.tagSize {
+ return nil, ocbError("Ciphertext shorter than tag length")
+ }
+ sep := len(ciphertext) - o.tagSize
+ ret, out := byteutil.SliceForAppend(dst, sep)
+ ciphertextData := ciphertext[:sep]
+ tag := o.crypt(dec, out, nonce, adata, ciphertextData)
+ if subtle.ConstantTimeCompare(tag, ciphertext[sep:]) == 1 {
+ return ret, nil
+ }
+ for i := range out {
+ out[i] = 0
+ }
+ return nil, ocbError("Tag authentication failed")
+}
+
+// On instruction enc (resp. dec), crypt is the encrypt (resp. decrypt)
+// function. It writes the resulting plain/ciphertext into Y and returns
+// the tag.
+func (o *ocb) crypt(instruction int, Y, nonce, adata, X []byte) []byte {
+ //
+ // Consider X as a sequence of 128-bit blocks
+ //
+ // Note: For encryption (resp. decryption), X is the plaintext (resp., the
+ // ciphertext without the tag).
+ blockSize := o.block.BlockSize()
+
+ //
+ // Nonce-dependent and per-encryption variables
+ //
+ // Zero out the last 6 bits of the nonce into truncatedNonce to see if Ktop
+ // is already computed.
+ truncatedNonce := make([]byte, len(nonce))
+ copy(truncatedNonce, nonce)
+ truncatedNonce[len(truncatedNonce)-1] &= 192
+ var Ktop []byte
+ if bytes.Equal(truncatedNonce, o.reusableKtop.noncePrefix) {
+ Ktop = o.reusableKtop.Ktop
+ } else {
+ // Nonce = num2str(TAGLEN mod 128, 7) || zeros(120 - bitlen(N)) || 1 || N
+ paddedNonce := append(make([]byte, blockSize-1-len(nonce)), 1)
+ paddedNonce = append(paddedNonce, truncatedNonce...)
+ paddedNonce[0] |= byte(((8 * o.tagSize) % (8 * blockSize)) << 1)
+ // Last 6 bits of paddedNonce are already zero. Encrypt into Ktop
+ paddedNonce[blockSize-1] &= 192
+ Ktop = paddedNonce
+ o.block.Encrypt(Ktop, Ktop)
+ o.reusableKtop.noncePrefix = truncatedNonce
+ o.reusableKtop.Ktop = Ktop
+ }
+
+ // Stretch = Ktop || ((lower half of Ktop) XOR (lower half of Ktop << 8))
+ xorHalves := make([]byte, blockSize/2)
+ byteutil.XorBytes(xorHalves, Ktop[:blockSize/2], Ktop[1:1+blockSize/2])
+ stretch := append(Ktop, xorHalves...)
+ bottom := int(nonce[len(nonce)-1] & 63)
+ offset := make([]byte, len(stretch))
+ byteutil.ShiftNBytesLeft(offset, stretch, bottom)
+ offset = offset[:blockSize]
+
+ //
+ // Process any whole blocks
+ //
+ // Note: For encryption Y is ciphertext || tag, for decryption Y is
+ // plaintext || tag.
+ checksum := make([]byte, blockSize)
+ m := len(X) / blockSize
+ for i := 0; i < m; i++ {
+ index := bits.TrailingZeros(uint(i + 1))
+ if len(o.mask.L)-1 < index {
+ o.mask.extendTable(index)
+ }
+ byteutil.XorBytesMut(offset, o.mask.L[bits.TrailingZeros(uint(i+1))])
+ blockX := X[i*blockSize : (i+1)*blockSize]
+ blockY := Y[i*blockSize : (i+1)*blockSize]
+ switch instruction {
+ case enc:
+ byteutil.XorBytesMut(checksum, blockX)
+ byteutil.XorBytes(blockY, blockX, offset)
+ o.block.Encrypt(blockY, blockY)
+ byteutil.XorBytesMut(blockY, offset)
+ case dec:
+ byteutil.XorBytes(blockY, blockX, offset)
+ o.block.Decrypt(blockY, blockY)
+ byteutil.XorBytesMut(blockY, offset)
+ byteutil.XorBytesMut(checksum, blockY)
+ }
+ }
+ //
+ // Process any final partial block and compute raw tag
+ //
+ tag := make([]byte, blockSize)
+ if len(X)%blockSize != 0 {
+ byteutil.XorBytesMut(offset, o.mask.lAst)
+ pad := make([]byte, blockSize)
+ o.block.Encrypt(pad, offset)
+ chunkX := X[blockSize*m:]
+ chunkY := Y[blockSize*m : len(X)]
+ switch instruction {
+ case enc:
+ byteutil.XorBytesMut(checksum, chunkX)
+ checksum[len(chunkX)] ^= 128
+ byteutil.XorBytes(chunkY, chunkX, pad[:len(chunkX)])
+ // P_* || bit(1) || zeroes(127) - len(P_*)
+ case dec:
+ byteutil.XorBytes(chunkY, chunkX, pad[:len(chunkX)])
+ // P_* || bit(1) || zeroes(127) - len(P_*)
+ byteutil.XorBytesMut(checksum, chunkY)
+ checksum[len(chunkY)] ^= 128
+ }
+ }
+ byteutil.XorBytes(tag, checksum, offset)
+ byteutil.XorBytesMut(tag, o.mask.lDol)
+ o.block.Encrypt(tag, tag)
+ byteutil.XorBytesMut(tag, o.hash(adata))
+ return tag[:o.tagSize]
+}
+
+// This hash function is used to compute the tag. Per design, on empty input it
+// returns a slice of zeros, of the same length as the underlying block cipher
+// block size.
+func (o *ocb) hash(adata []byte) []byte {
+ //
+ // Consider A as a sequence of 128-bit blocks
+ //
+ A := make([]byte, len(adata))
+ copy(A, adata)
+ blockSize := o.block.BlockSize()
+
+ //
+ // Process any whole blocks
+ //
+ sum := make([]byte, blockSize)
+ offset := make([]byte, blockSize)
+ m := len(A) / blockSize
+ for i := 0; i < m; i++ {
+ chunk := A[blockSize*i : blockSize*(i+1)]
+ index := bits.TrailingZeros(uint(i + 1))
+ // If the mask table is too short
+ if len(o.mask.L)-1 < index {
+ o.mask.extendTable(index)
+ }
+ byteutil.XorBytesMut(offset, o.mask.L[index])
+ byteutil.XorBytesMut(chunk, offset)
+ o.block.Encrypt(chunk, chunk)
+ byteutil.XorBytesMut(sum, chunk)
+ }
+
+ //
+ // Process any final partial block; compute final hash value
+ //
+ if len(A)%blockSize != 0 {
+ byteutil.XorBytesMut(offset, o.mask.lAst)
+ // Pad block with 1 || 0 ^ 127 - bitlength(a)
+ ending := make([]byte, blockSize-len(A)%blockSize)
+ ending[0] = 0x80
+ encrypted := append(A[blockSize*m:], ending...)
+ byteutil.XorBytesMut(encrypted, offset)
+ o.block.Encrypt(encrypted, encrypted)
+ byteutil.XorBytesMut(sum, encrypted)
+ }
+ return sum
+}
+
+func initializeMaskTable(block cipher.Block) mask {
+ //
+ // Key-dependent variables
+ //
+ lAst := make([]byte, block.BlockSize())
+ block.Encrypt(lAst, lAst)
+ lDol := byteutil.GfnDouble(lAst)
+ L := make([][]byte, 1)
+ L[0] = byteutil.GfnDouble(lDol)
+
+ return mask{
+ lAst: lAst,
+ lDol: lDol,
+ L: L,
+ }
+}
+
+// Extends the L array of mask m up to L[limit], with L[i] = GfnDouble(L[i-1])
+func (m *mask) extendTable(limit int) {
+ for i := len(m.L); i <= limit; i++ {
+ m.L = append(m.L, byteutil.GfnDouble(m.L[i-1]))
+ }
+}
+
+func ocbError(err string) error {
+ return errors.New("crypto/ocb: " + err)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/ocb/random_vectors.go b/vendor/github.com/ProtonMail/go-crypto/ocb/random_vectors.go
new file mode 100644
index 0000000000..0efaf344fd
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/ocb/random_vectors.go
@@ -0,0 +1,136 @@
+// In the test vectors provided by RFC 7253, the "bottom"
+// internal variable, which defines "offset" for the first time, does not
+// exceed 15. However, it can attain values up to 63.
+
+// These vectors include key length in {128, 192, 256}, tag size 128, and
+// random nonce, header, and plaintext lengths.
+
+// This file was automatically generated.
+
+package ocb
+
+var randomVectors = []struct {
+ key, nonce, header, plaintext, ciphertext string
+}{
+
+ {"9438C5D599308EAF13F800D2D31EA7F0",
+ "C38EE4801BEBFFA1CD8635BE",
+ "0E507B7DADD8A98CDFE272D3CB6B3E8332B56AE583FB049C0874D4200BED16BD1A044182434E9DA0E841F182DFD5B3016B34641CED0784F1745F63AB3D0DA22D3351C9EF9A658B8081E24498EBF61FCE40DA6D8E184536",
+ "962D227786FB8913A8BAD5DC3250",
+ "EEDEF5FFA5986D1E3BF86DDD33EF9ADC79DCA06E215FA772CCBA814F63AD"},
+ {"BA7DE631C7D6712167C6724F5B9A2B1D",
+ "35263EBDA05765DC0E71F1F5",
+ "0103257B4224507C0242FEFE821EA7FA42E0A82863E5F8B68F7D881B4B44FA428A2B6B21D2F591260802D8AB6D83",
+ "9D6D1FC93AE8A64E7889B7B2E3521EFA9B920A8DDB692E6F833DDC4A38AFA535E5E2A3ED82CB7E26404AB86C54D01C4668F28398C2DF33D5D561CBA1C8DCFA7A912F5048E545B59483C0E3221F54B14DAA2E4EB657B3BEF9554F34CAD69B2724AE962D3D8A",
+ "E93852D1985C5E775655E937FA79CE5BF28A585F2AF53A5018853B9634BE3C84499AC0081918FDCE0624494D60E25F76ACD6853AC7576E3C350F332249BFCABD4E73CEABC36BE4EDDA40914E598AE74174A0D7442149B26990899491BDDFE8FC54D6C18E83AE9E9A6FFBF5D376565633862EEAD88D"},
+ {"2E74B25289F6FD3E578C24866E9C72A5",
+ "FD912F15025AF8414642BA1D1D",
+ "FB5FB8C26F365EEDAB5FE260C6E3CCD27806729C8335F146063A7F9EA93290E56CF84576EB446350D22AD730547C267B1F0BBB97EB34E1E2C41A",
+ "6C092EBF78F76EE8C1C6E592277D9545BA16EDB67BC7D8480B9827702DC2F8A129E2B08A2CE710CA7E1DA45CE162BB6CD4B512E632116E2211D3C90871EFB06B8D4B902681C7FB",
+ "6AC0A77F26531BF4F354A1737F99E49BE32ECD909A7A71AD69352906F54B08A9CE9B8CA5D724CBFFC5673437F23F630697F3B84117A1431D6FA8CC13A974FB4AD360300522E09511B99E71065D5AC4BBCB1D791E864EF4"},
+ {"E7EC507C802528F790AFF5303A017B17",
+ "4B97A7A568940A9E3CE7A99E93031E",
+ "28349BDC5A09390C480F9B8AA3EDEA3DDB8B9D64BCA322C570B8225DF0E31190DAB25A4014BA39519E02ABFB12B89AA28BBFD29E486E7FB28734258C817B63CED9912DBAFEBB93E2798AB2890DE3B0ACFCFF906AB15563EF7823CE83D27CDB251195E22BD1337BCBDE65E7C2C427321C463C2777BFE5AEAA",
+ "9455B3EA706B74",
+ "7F33BA3EA848D48A96B9530E26888F43EBD4463C9399B6"},
+ {"6C928AA3224736F28EE7378DE0090191",
+ "8936138E2E4C6A13280017A1622D",
+ "6202717F2631565BDCDC57C6584543E72A7C8BD444D0D108ED35069819633C",
+ "DA0691439E5F035F3E455269D14FE5C201C8C9B0A3FE2D3F86BCC59387C868FE65733D388360B31E3CE28B4BF6A8BE636706B536D5720DB66B47CF1C7A5AFD6F61E0EF90F1726D6B0E169F9A768B2B7AE4EE00A17F630AC905FCAAA1B707FFF25B3A1AAE83B504837C64A5639B2A34002B300EC035C9B43654DA55",
+ "B8804D182AB0F0EEB464FA7BD1329AD6154F982013F3765FEDFE09E26DAC078C9C1439BFC1159D6C02A25E3FF83EF852570117B315852AD5EE20E0FA3AA0A626B0E43BC0CEA38B44579DD36803455FB46989B90E6D229F513FD727AF8372517E9488384C515D6067704119C931299A0982EDDFB9C2E86A90C450C077EB222511EC9CCABC9FCFDB19F70088"},
+ {"ECEA315CA4B3F425B0C9957A17805EA4",
+ "664CDAE18403F4F9BA13015A44FC",
+ "642AFB090D6C6DB46783F08B01A3EF2A8FEB5736B531EAC226E7888FCC8505F396818F83105065FACB3267485B9E5E4A0261F621041C08FCCB2A809A49AB5252A91D0971BCC620B9D614BD77E57A0EED2FA5",
+ "6852C31F8083E20E364CEA21BB7854D67CEE812FE1C9ED2425C0932A90D3780728D1BB",
+ "2ECEF962A9695A463ADABB275BDA9FF8B2BA57AEC2F52EFFB700CD9271A74D2A011C24AEA946051BD6291776429B7E681BA33E"},
+ {"4EE616C4A58AAA380878F71A373461F6",
+ "91B8C9C176D9C385E9C47E52",
+ "CDA440B7F9762C572A718AC754EDEECC119E5EE0CCB9FEA4FFB22EEE75087C032EBF3DA9CDD8A28CC010B99ED45143B41A4BA50EA2A005473F89639237838867A57F23B0F0ED3BF22490E4501DAC9C658A9B9F",
+ "D6E645FA9AE410D15B8123FD757FA356A8DBE9258DDB5BE88832E615910993F497EC",
+ "B70ED7BF959FB2AAED4F36174A2A99BFB16992C8CDF369C782C4DB9C73DE78C5DB8E0615F647243B97ACDB24503BC9CADC48"},
+ {"DCD475773136C830D5E3D0C5FE05B7FF",
+ "BB8E1FBB483BE7616A922C4A",
+ "36FEF2E1CB29E76A6EA663FC3AF66ECD7404F466382F7B040AABED62293302B56E8783EF7EBC21B4A16C3E78A7483A0A403F253A2CDC5BBF79DC3DAE6C73F39A961D8FBBE8D41B",
+ "441E886EA38322B2437ECA7DEB5282518865A66780A454E510878E61BFEC3106A3CD93D2A02052E6F9E1832F9791053E3B76BF4C07EFDD6D4106E3027FABB752E60C1AA425416A87D53938163817A1051EBA1D1DEEB4B9B25C7E97368B52E5911A31810B0EC5AF547559B6142D9F4C4A6EF24A4CF75271BF9D48F62B",
+ "1BE4DD2F4E25A6512C2CC71D24BBB07368589A94C2714962CD0ACE5605688F06342587521E75F0ACAFFD86212FB5C34327D238DB36CF2B787794B9A4412E7CD1410EA5DDD2450C265F29CF96013CD213FD2880657694D718558964BC189B4A84AFCF47EB012935483052399DBA5B088B0A0477F20DFE0E85DCB735E21F22A439FB837DD365A93116D063E607"},
+ {"3FBA2B3D30177FFE15C1C59ED2148BB2C091F5615FBA7C07",
+ "FACF804A4BEBF998505FF9DE",
+ "8213B9263B2971A5BDA18DBD02208EE1",
+ "15B323926993B326EA19F892D704439FC478828322AF72118748284A1FD8A6D814E641F70512FD706980337379F31DC63355974738D7FEA87AD2858C0C2EBBFBE74371C21450072373C7B651B334D7C4D43260B9D7CCD3AF9EDB",
+ "6D35DC1469B26E6AAB26272A41B46916397C24C485B61162E640A062D9275BC33DDCFD3D9E1A53B6C8F51AC89B66A41D59B3574197A40D9B6DCF8A4E2A001409C8112F16B9C389E0096179DB914E05D6D11ED0005AD17E1CE105A2F0BAB8F6B1540DEB968B7A5428FF44"},
+ {"53B52B8D4D748BCDF1DDE68857832FA46227FA6E2F32EFA1",
+ "0B0EF53D4606B28D1398355F",
+ "F23882436349094AF98BCACA8218E81581A043B19009E28EFBF2DE37883E04864148CC01D240552CA8844EC1456F42034653067DA67E80F87105FD06E14FF771246C9612867BE4D215F6D761",
+ "F15030679BD4088D42CAC9BF2E9606EAD4798782FA3ED8C57EBE7F84A53236F51B25967C6489D0CD20C9EEA752F9BC",
+ "67B96E2D67C3729C96DAEAEDF821D61C17E648643A2134C5621FEC621186915AD80864BFD1EB5B238BF526A679385E012A457F583AFA78134242E9D9C1B4E4"},
+ {"0272DD80F23399F49BFC320381A5CD8225867245A49A7D41",
+ "5C83F4896D0738E1366B1836",
+ "69B0337289B19F73A12BAEEA857CCAF396C11113715D9500CCCF48BA08CFF12BC8B4BADB3084E63B85719DB5058FA7C2C11DEB096D7943CFA7CAF5",
+ "C01AD10FC8B562CD17C7BC2FAB3E26CBDFF8D7F4DEA816794BBCC12336991712972F52816AABAB244EB43B0137E2BAC1DD413CE79531E78BEF782E6B439612BB3AEF154DE3502784F287958EBC159419F9EBA27916A28D6307324129F506B1DE80C1755A929F87",
+ "FEFE52DD7159C8DD6E8EC2D3D3C0F37AB6CB471A75A071D17EC4ACDD8F3AA4D7D4F7BB559F3C09099E3D9003E5E8AA1F556B79CECDE66F85B08FA5955E6976BF2695EA076388A62D2AD5BAB7CBF1A7F3F4C8D5CDF37CDE99BD3E30B685D9E5EEE48C7C89118EF4878EB89747F28271FA2CC45F8E9E7601"},
+ {"3EEAED04A455D6E5E5AB53CFD5AFD2F2BC625C7BF4BE49A5",
+ "36B88F63ADBB5668588181D774",
+ "D367E3CB3703E762D23C6533188EF7028EFF9D935A3977150361997EC9DEAF1E4794BDE26AA8B53C124980B1362EC86FCDDFC7A90073171C1BAEE351A53234B86C66E8AB92FAE99EC6967A6D3428892D80",
+ "573454C719A9A55E04437BF7CBAAF27563CCCD92ADD5E515CD63305DFF0687E5EEF790C5DCA5C0033E9AB129505E2775438D92B38F08F3B0356BA142C6F694",
+ "E9F79A5B432D9E682C9AAA5661CFC2E49A0FCB81A431E54B42EB73DD3BED3F377FEC556ABA81624BA64A5D739AD41467460088F8D4F442180A9382CA635745473794C382FCDDC49BA4EB6D8A44AE3C"},
+ {"B695C691538F8CBD60F039D0E28894E3693CC7C36D92D79D",
+ "BC099AEB637361BAC536B57618",
+ "BFFF1A65AE38D1DC142C71637319F5F6508E2CB33C9DCB94202B359ED5A5ED8042E7F4F09231D32A7242976677E6F4C549BF65FADC99E5AF43F7A46FD95E16C2",
+ "081DF3FD85B415D803F0BE5AC58CFF0023FDDED99788296C3731D8",
+ "E50C64E3614D94FE69C47092E46ACC9957C6FEA2CCBF96BC62FBABE7424753C75F9C147C42AE26FE171531"},
+ {"C9ACBD2718F0689A1BE9802A551B6B8D9CF5614DAF5E65ED",
+ "B1B0AAF373B8B026EB80422051D8",
+ "6648C0E61AC733C76119D23FB24548D637751387AA2EAE9D80E912B7BD486CAAD9EAF4D7A5FE2B54AAD481E8EC94BB4D558000896E2010462B70C9FED1E7273080D1",
+ "189F591F6CB6D59AFEDD14C341741A8F1037DC0DF00FC57CE65C30F49E860255CEA5DC6019380CC0FE8880BC1A9E685F41C239C38F36E3F2A1388865C5C311059C0A",
+ "922A5E949B61D03BE34AB5F4E58607D4504EA14017BB363DAE3C873059EA7A1C77A746FB78981671D26C2CF6D9F24952D510044CE02A10177E9DB42D0145211DFE6E84369C5E3BC2669EAB4147B2822895F9"},
+ {"7A832BD2CF5BF4919F353CE2A8C86A5E406DA2D52BE16A72",
+ "2F2F17CECF7E5A756D10785A3CB9DB",
+ "61DA05E3788CC2D8405DBA70C7A28E5AF699863C9F72E6C6770126929F5D6FA267F005EBCF49495CB46400958A3AE80D1289D1C671",
+ "44E91121195A41AF14E8CFDBD39A4B517BE0DF1A72977ED8A3EEF8EEDA1166B2EB6DB2C4AE2E74FA0F0C74537F659BFBD141E5DDEC67E64EDA85AABD3F52C85A785B9FB3CECD70E7DF",
+ "BEDF596EA21288D2B84901E188F6EE1468B14D5161D3802DBFE00D60203A24E2AB62714BF272A45551489838C3A7FEAADC177B591836E73684867CCF4E12901DCF2064058726BBA554E84ADC5136F507E961188D4AF06943D3"},
+ {"1508E8AE9079AA15F1CEC4F776B4D11BCCB061B58AA56C18",
+ "BCA625674F41D1E3AB47672DC0C3",
+ "8B12CF84F16360F0EAD2A41BC021530FFCEC7F3579CAE658E10E2D3D81870F65AFCED0C77C6C4C6E6BA424FF23088C796BA6195ABA35094BF1829E089662E7A95FC90750AE16D0C8AFA55DAC789D7735B970B58D4BE7CEC7341DA82A0179A01929C27A59C5063215B859EA43",
+ "E525422519ECE070E82C",
+ "B47BC07C3ED1C0A43BA52C43CBACBCDBB29CAF1001E09FDF7107"},
+ {"7550C2761644E911FE9ADD119BAC07376BEA442845FEAD876D7E7AC1B713E464",
+ "36D2EC25ADD33CDEDF495205BBC923",
+ "7FCFE81A3790DE97FFC3DE160C470847EA7E841177C2F759571CBD837EA004A6CA8C6F4AEBFF2E9FD552D73EB8A30705D58D70C0B67AEEA280CBBF0A477358ACEF1E7508F2735CD9A0E4F9AC92B8C008F575D3B6278F1C18BD01227E3502E5255F3AB1893632AD00C717C588EF652A51A43209E7EE90",
+ "2B1A62F8FDFAA3C16470A21AD307C9A7D03ADE8EF72C69B06F8D738CDE578D7AEFD0D40BD9C022FB9F580DF5394C998ACCCEFC5471A3996FB8F1045A81FDC6F32D13502EA65A211390C8D882B8E0BEFD8DD8CBEF51D1597B124E9F7F",
+ "C873E02A22DB89EB0787DB6A60B99F7E4A0A085D5C4232A81ADCE2D60AA36F92DDC33F93DD8640AC0E08416B187FB382B3EC3EE85A64B0E6EE41C1366A5AD2A282F66605E87031CCBA2FA7B2DA201D975994AADE3DD1EE122AE09604AD489B84BF0C1AB7129EE16C6934850E"},
+ {"A51300285E554FDBDE7F771A9A9A80955639DD87129FAEF74987C91FB9687C71",
+ "81691D5D20EC818FCFF24B33DECC",
+ "C948093218AA9EB2A8E44A87EEA73FC8B6B75A196819A14BD83709EA323E8DF8B491045220E1D88729A38DBCFFB60D3056DAD4564498FD6574F74512945DEB34B69329ACED9FFC05D5D59DFCD5B973E2ACAFE6AD1EF8BBBC49351A2DD12508ED89ED",
+ "EB861165DAF7625F827C6B574ED703F03215",
+ "C6CD1CE76D2B3679C1B5AA1CFD67CCB55444B6BFD3E22C81CBC9BB738796B83E54E3"},
+ {"8CE0156D26FAEB7E0B9B800BBB2E9D4075B5EAC5C62358B0E7F6FCE610223282",
+ "D2A7B94DD12CDACA909D3AD7",
+ "E021A78F374FC271389AB9A3E97077D755",
+ "7C26000B58929F5095E1CEE154F76C2A299248E299F9B5ADE6C403AA1FD4A67FD4E0232F214CE7B919EE7A1027D2B76C57475715CD078461",
+ "C556FB38DF069B56F337B5FF5775CE6EAA16824DFA754F20B78819028EA635C3BB7AA731DE8776B2DCB67DCA2D33EEDF3C7E52EA450013722A41755A0752433ED17BDD5991AAE77A"},
+ {"1E8000A2CE00A561C9920A30BF0D7B983FEF8A1014C8F04C35CA6970E6BA02BD",
+ "65ED3D63F79F90BBFD19775E",
+ "336A8C0B7243582A46B221AA677647FCAE91",
+ "134A8B34824A290E7B",
+ "914FBEF80D0E6E17F8BDBB6097EBF5FBB0554952DC2B9E5151"},
+ {"53D5607BBE690B6E8D8F6D97F3DF2BA853B682597A214B8AA0EA6E598650AF15",
+ "C391A856B9FE234E14BA1AC7BB40FF",
+ "479682BC21349C4BE1641D5E78FE2C79EC1B9CF5470936DCAD9967A4DCD7C4EFADA593BC9EDE71E6A08829B8580901B61E274227E9D918502DE3",
+ "EAD154DC09C5E26C5D26FF33ED148B27120C7F2C23225CC0D0631B03E1F6C6D96FEB88C1A4052ACB4CE746B884B6502931F407021126C6AAB8C514C077A5A38438AE88EE",
+ "938821286EBB671D999B87C032E1D6055392EB564E57970D55E545FC5E8BAB90E6E3E3C0913F6320995FC636D72CD9919657CC38BD51552F4A502D8D1FE56DB33EBAC5092630E69EBB986F0E15CEE9FC8C052501"},
+ {"294362FCC984F440CEA3E9F7D2C06AF20C53AAC1B3738CA2186C914A6E193ABB",
+ "B15B61C8BB39261A8F55AB178EC3",
+ "D0729B6B75BB",
+ "2BD089ADCE9F334BAE3B065996C7D616DD0C27DF4218DCEEA0FBCA0F968837CE26B0876083327E25681FDDD620A32EC0DA12F73FAE826CC94BFF2B90A54D2651",
+ "AC94B25E4E21DE2437B806966CCD5D9385EF0CD4A51AB9FA6DE675C7B8952D67802E9FEC1FDE9F5D1EAB06057498BC0EEA454804FC9D2068982A3E24182D9AC2E7AB9994DDC899A604264583F63D066B"},
+ {"959DBFEB039B1A5B8CE6A44649B602AAA5F98A906DB96143D202CD2024F749D9",
+ "01D7BDB1133E9C347486C1EFA6",
+ "F3843955BD741F379DD750585EDC55E2CDA05CCBA8C1F4622AC2FE35214BC3A019B8BD12C4CC42D9213D1E1556941E8D8450830287FFB3B763A13722DD4140ED9846FB5FFF745D7B0B967D810A068222E10B259AF1D392035B0D83DC1498A6830B11B2418A840212599171E0258A1C203B05362978",
+ "A21811232C950FA8B12237C2EBD6A7CD2C3A155905E9E0C7C120",
+ "63C1CE397B22F1A03F1FA549B43178BC405B152D3C95E977426D519B3DFCA28498823240592B6EEE7A14"},
+ {"096AE499F5294173F34FF2B375F0E5D5AB79D0D03B33B1A74D7D576826345DF4",
+ "0C52B3D11D636E5910A4DD76D32C",
+ "229E9ECA3053789E937447BC719467075B6138A142DA528DA8F0CF8DDF022FD9AF8E74779BA3AC306609",
+ "8B7A00038783E8BAF6EDEAE0C4EAB48FC8FD501A588C7E4A4DB71E3604F2155A97687D3D2FFF8569261375A513CF4398CE0F87CA1658A1050F6EF6C4EA3E25",
+ "C20B6CF8D3C8241825FD90B2EDAC7593600646E579A8D8DAAE9E2E40C3835FE801B2BE4379131452BC5182C90307B176DFBE2049544222FE7783147B690774F6D9D7CEF52A91E61E298E9AA15464AC"},
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_a.go b/vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_a.go
new file mode 100644
index 0000000000..330309ff5f
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_a.go
@@ -0,0 +1,78 @@
+package ocb
+
+import (
+ "encoding/hex"
+)
+
+// Test vectors from https://tools.ietf.org/html/rfc7253. Note that key is
+// shared across tests.
+var testKey, _ = hex.DecodeString("000102030405060708090A0B0C0D0E0F")
+
+var rfc7253testVectors = []struct {
+ nonce, header, plaintext, ciphertext string
+}{
+ {"BBAA99887766554433221100",
+ "",
+ "",
+ "785407BFFFC8AD9EDCC5520AC9111EE6"},
+ {"BBAA99887766554433221101",
+ "0001020304050607",
+ "0001020304050607",
+ "6820B3657B6F615A5725BDA0D3B4EB3A257C9AF1F8F03009"},
+ {"BBAA99887766554433221102",
+ "0001020304050607",
+ "",
+ "81017F8203F081277152FADE694A0A00"},
+ {"BBAA99887766554433221103",
+ "",
+ "0001020304050607",
+ "45DD69F8F5AAE72414054CD1F35D82760B2CD00D2F99BFA9"},
+ {"BBAA99887766554433221104",
+ "000102030405060708090A0B0C0D0E0F",
+ "000102030405060708090A0B0C0D0E0F",
+ "571D535B60B277188BE5147170A9A22C3AD7A4FF3835B8C5701C1CCEC8FC3358"},
+ {"BBAA99887766554433221105",
+ "000102030405060708090A0B0C0D0E0F",
+ "",
+ "8CF761B6902EF764462AD86498CA6B97"},
+ {"BBAA99887766554433221106",
+ "",
+ "000102030405060708090A0B0C0D0E0F",
+ "5CE88EC2E0692706A915C00AEB8B2396F40E1C743F52436BDF06D8FA1ECA343D"},
+ {"BBAA99887766554433221107",
+ "000102030405060708090A0B0C0D0E0F1011121314151617",
+ "000102030405060708090A0B0C0D0E0F1011121314151617",
+ "1CA2207308C87C010756104D8840CE1952F09673A448A122C92C62241051F57356D7F3C90BB0E07F"},
+ {"BBAA99887766554433221108",
+ "000102030405060708090A0B0C0D0E0F1011121314151617",
+ "",
+ "6DC225A071FC1B9F7C69F93B0F1E10DE"},
+ {"BBAA99887766554433221109",
+ "",
+ "000102030405060708090A0B0C0D0E0F1011121314151617",
+ "221BD0DE7FA6FE993ECCD769460A0AF2D6CDED0C395B1C3CE725F32494B9F914D85C0B1EB38357FF"},
+ {"BBAA9988776655443322110A",
+ "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F",
+ "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F",
+ "BD6F6C496201C69296C11EFD138A467ABD3C707924B964DEAFFC40319AF5A48540FBBA186C5553C68AD9F592A79A4240"},
+ {"BBAA9988776655443322110B",
+ "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F",
+ "",
+ "FE80690BEE8A485D11F32965BC9D2A32"},
+ {"BBAA9988776655443322110C",
+ "",
+ "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F",
+ "2942BFC773BDA23CABC6ACFD9BFD5835BD300F0973792EF46040C53F1432BCDFB5E1DDE3BC18A5F840B52E653444D5DF"},
+ {"BBAA9988776655443322110D",
+ "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627",
+ "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627",
+ "D5CA91748410C1751FF8A2F618255B68A0A12E093FF454606E59F9C1D0DDC54B65E8628E568BAD7AED07BA06A4A69483A7035490C5769E60"},
+ {"BBAA9988776655443322110E",
+ "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627",
+ "",
+ "C5CD9D1850C141E358649994EE701B68"},
+ {"BBAA9988776655443322110F",
+ "",
+ "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627",
+ "4412923493C57D5DE0D700F753CCE0D1D2D95060122E9F15A5DDBFC5787E50B5CC55EE507BCB084E479AD363AC366B95A98CA5F3000B1479"},
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_b.go b/vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_b.go
new file mode 100644
index 0000000000..14a3c336fb
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_b.go
@@ -0,0 +1,25 @@
+package ocb
+
+// Second set of test vectors from https://tools.ietf.org/html/rfc7253
+var rfc7253TestVectorTaglen96 = struct {
+ key, nonce, header, plaintext, ciphertext string
+}{"0F0E0D0C0B0A09080706050403020100",
+ "BBAA9988776655443322110D",
+ "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627",
+ "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627",
+ "1792A4E31E0755FB03E31B22116E6C2DDF9EFD6E33D536F1A0124B0A55BAE884ED93481529C76B6AD0C515F4D1CDD4FDAC4F02AA"}
+
+var rfc7253AlgorithmTest = []struct {
+ KEYLEN, TAGLEN int
+ OUTPUT string
+}{
+ {128, 128, "67E944D23256C5E0B6C61FA22FDF1EA2"},
+ {192, 128, "F673F2C3E7174AAE7BAE986CA9F29E17"},
+ {256, 128, "D90EB8E9C977C88B79DD793D7FFA161C"},
+ {128, 96, "77A3D8E73589158D25D01209"},
+ {192, 96, "05D56EAD2752C86BE6932C5E"},
+ {256, 96, "5458359AC23B0CBA9E6330DD"},
+ {128, 64, "192C9B7BD90BA06A"},
+ {192, 64, "0066BC6E0EF34E24"},
+ {256, 64, "7D4EA5D445501CBE"},
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap/keywrap.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap/keywrap.go
new file mode 100644
index 0000000000..3c6251d1ce
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap/keywrap.go
@@ -0,0 +1,153 @@
+// Copyright 2014 Matthew Endsley
+// All rights reserved
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted providing 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 AUTHOR ``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 AUTHOR 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 keywrap is an implementation of the RFC 3394 AES key wrapping
+// algorithm. This is used in OpenPGP with elliptic curve keys.
+package keywrap
+
+import (
+ "crypto/aes"
+ "encoding/binary"
+ "errors"
+)
+
+var (
+ // ErrWrapPlaintext is returned if the plaintext is not a multiple
+ // of 64 bits.
+ ErrWrapPlaintext = errors.New("keywrap: plainText must be a multiple of 64 bits")
+
+ // ErrUnwrapCiphertext is returned if the ciphertext is not a
+ // multiple of 64 bits.
+ ErrUnwrapCiphertext = errors.New("keywrap: cipherText must by a multiple of 64 bits")
+
+ // ErrUnwrapFailed is returned if unwrapping a key fails.
+ ErrUnwrapFailed = errors.New("keywrap: failed to unwrap key")
+
+ // NB: the AES NewCipher call only fails if the key is an invalid length.
+
+ // ErrInvalidKey is returned when the AES key is invalid.
+ ErrInvalidKey = errors.New("keywrap: invalid AES key")
+)
+
+// Wrap a key using the RFC 3394 AES Key Wrap Algorithm.
+func Wrap(key, plainText []byte) ([]byte, error) {
+ if len(plainText)%8 != 0 {
+ return nil, ErrWrapPlaintext
+ }
+
+ c, err := aes.NewCipher(key)
+ if err != nil {
+ return nil, ErrInvalidKey
+ }
+
+ nblocks := len(plainText) / 8
+
+ // 1) Initialize variables.
+ var block [aes.BlockSize]byte
+ // - Set A = IV, an initial value (see 2.2.3)
+ for ii := 0; ii < 8; ii++ {
+ block[ii] = 0xA6
+ }
+
+ // - For i = 1 to n
+ // - Set R[i] = P[i]
+ intermediate := make([]byte, len(plainText))
+ copy(intermediate, plainText)
+
+ // 2) Calculate intermediate values.
+ for ii := 0; ii < 6; ii++ {
+ for jj := 0; jj < nblocks; jj++ {
+ // - B = AES(K, A | R[i])
+ copy(block[8:], intermediate[jj*8:jj*8+8])
+ c.Encrypt(block[:], block[:])
+
+ // - A = MSB(64, B) ^ t where t = (n*j)+1
+ t := uint64(ii*nblocks + jj + 1)
+ val := binary.BigEndian.Uint64(block[:8]) ^ t
+ binary.BigEndian.PutUint64(block[:8], val)
+
+ // - R[i] = LSB(64, B)
+ copy(intermediate[jj*8:jj*8+8], block[8:])
+ }
+ }
+
+ // 3) Output results.
+ // - Set C[0] = A
+ // - For i = 1 to n
+ // - C[i] = R[i]
+ return append(block[:8], intermediate...), nil
+}
+
+// Unwrap a key using the RFC 3394 AES Key Wrap Algorithm.
+func Unwrap(key, cipherText []byte) ([]byte, error) {
+ if len(cipherText)%8 != 0 {
+ return nil, ErrUnwrapCiphertext
+ }
+
+ c, err := aes.NewCipher(key)
+ if err != nil {
+ return nil, ErrInvalidKey
+ }
+
+ nblocks := len(cipherText)/8 - 1
+
+ // 1) Initialize variables.
+ var block [aes.BlockSize]byte
+ // - Set A = C[0]
+ copy(block[:8], cipherText[:8])
+
+ // - For i = 1 to n
+ // - Set R[i] = C[i]
+ intermediate := make([]byte, len(cipherText)-8)
+ copy(intermediate, cipherText[8:])
+
+ // 2) Compute intermediate values.
+ for jj := 5; jj >= 0; jj-- {
+ for ii := nblocks - 1; ii >= 0; ii-- {
+ // - B = AES-1(K, (A ^ t) | R[i]) where t = n*j+1
+ // - A = MSB(64, B)
+ t := uint64(jj*nblocks + ii + 1)
+ val := binary.BigEndian.Uint64(block[:8]) ^ t
+ binary.BigEndian.PutUint64(block[:8], val)
+
+ copy(block[8:], intermediate[ii*8:ii*8+8])
+ c.Decrypt(block[:], block[:])
+
+ // - R[i] = LSB(B, 64)
+ copy(intermediate[ii*8:ii*8+8], block[8:])
+ }
+ }
+
+ // 3) Output results.
+ // - If A is an appropriate initial value (see 2.2.3),
+ for ii := 0; ii < 8; ii++ {
+ if block[ii] != 0xA6 {
+ return nil, ErrUnwrapFailed
+ }
+ }
+
+ // - For i = 1 to n
+ // - P[i] = R[i]
+ return intermediate, nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/armor.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/armor.go
new file mode 100644
index 0000000000..39c9b12231
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/armor.go
@@ -0,0 +1,185 @@
+// Copyright 2010 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 armor implements OpenPGP ASCII Armor, see RFC 4880. OpenPGP Armor is
+// very similar to PEM except that it has an additional CRC checksum.
+package armor // import "github.com/ProtonMail/go-crypto/openpgp/armor"
+
+import (
+ "bufio"
+ "bytes"
+ "encoding/base64"
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+)
+
+// A Block represents an OpenPGP armored structure.
+//
+// The encoded form is:
+//
+// -----BEGIN Type-----
+// Headers
+//
+// base64-encoded Bytes
+// '=' base64 encoded checksum (optional) not checked anymore
+// -----END Type-----
+//
+// where Headers is a possibly empty sequence of Key: Value lines.
+//
+// Since the armored data can be very large, this package presents a streaming
+// interface.
+type Block struct {
+ Type string // The type, taken from the preamble (i.e. "PGP SIGNATURE").
+ Header map[string]string // Optional headers.
+ Body io.Reader // A Reader from which the contents can be read
+ lReader lineReader
+ oReader openpgpReader
+}
+
+var ArmorCorrupt error = errors.StructuralError("armor invalid")
+
+var armorStart = []byte("-----BEGIN ")
+var armorEnd = []byte("-----END ")
+var armorEndOfLine = []byte("-----")
+
+// lineReader wraps a line based reader. It watches for the end of an armor block
+type lineReader struct {
+ in *bufio.Reader
+ buf []byte
+ eof bool
+}
+
+func (l *lineReader) Read(p []byte) (n int, err error) {
+ if l.eof {
+ return 0, io.EOF
+ }
+
+ if len(l.buf) > 0 {
+ n = copy(p, l.buf)
+ l.buf = l.buf[n:]
+ return
+ }
+
+ line, isPrefix, err := l.in.ReadLine()
+ if err != nil {
+ return
+ }
+ if isPrefix {
+ return 0, ArmorCorrupt
+ }
+ // Trim the line to remove any whitespace
+ line = bytes.TrimSpace(line)
+
+ if bytes.HasPrefix(line, armorEnd) {
+ l.eof = true
+ return 0, io.EOF
+ }
+
+ if len(line) == 5 && line[0] == '=' {
+ // This is the checksum line
+ // Don't check the checksum
+
+ l.eof = true
+ return 0, io.EOF
+ }
+
+ if len(line) > 96 {
+ return 0, ArmorCorrupt
+ }
+
+ n = copy(p, line)
+ bytesToSave := len(line) - n
+ if bytesToSave > 0 {
+ if cap(l.buf) < bytesToSave {
+ l.buf = make([]byte, 0, bytesToSave)
+ }
+ l.buf = l.buf[0:bytesToSave]
+ copy(l.buf, line[n:])
+ }
+
+ return
+}
+
+// openpgpReader passes Read calls to the underlying base64 decoder.
+type openpgpReader struct {
+ lReader *lineReader
+ b64Reader io.Reader
+}
+
+func (r *openpgpReader) Read(p []byte) (n int, err error) {
+ n, err = r.b64Reader.Read(p)
+ return
+}
+
+// Decode reads a PGP armored block from the given Reader. It will ignore
+// leading garbage. If it doesn't find a block, it will return nil, io.EOF. The
+// given Reader is not usable after calling this function: an arbitrary amount
+// of data may have been read past the end of the block.
+func Decode(in io.Reader) (p *Block, err error) {
+ r := bufio.NewReaderSize(in, 100)
+ var line []byte
+ ignoreNext := false
+
+TryNextBlock:
+ p = nil
+
+ // Skip leading garbage
+ for {
+ ignoreThis := ignoreNext
+ line, ignoreNext, err = r.ReadLine()
+ if err != nil {
+ return
+ }
+ if ignoreNext || ignoreThis {
+ continue
+ }
+ line = bytes.TrimSpace(line)
+ if len(line) > len(armorStart)+len(armorEndOfLine) && bytes.HasPrefix(line, armorStart) {
+ break
+ }
+ }
+
+ p = new(Block)
+ p.Type = string(line[len(armorStart) : len(line)-len(armorEndOfLine)])
+ p.Header = make(map[string]string)
+ nextIsContinuation := false
+ var lastKey string
+
+ // Read headers
+ for {
+ isContinuation := nextIsContinuation
+ line, nextIsContinuation, err = r.ReadLine()
+ if err != nil {
+ p = nil
+ return
+ }
+ if isContinuation {
+ p.Header[lastKey] += string(line)
+ continue
+ }
+ line = bytes.TrimSpace(line)
+ if len(line) == 0 {
+ break
+ }
+
+ i := bytes.Index(line, []byte(":"))
+ if i == -1 {
+ goto TryNextBlock
+ }
+ lastKey = string(line[:i])
+ var value string
+ if len(line) > i+2 {
+ value = string(line[i+2:])
+ }
+ p.Header[lastKey] = value
+ }
+
+ p.lReader.in = r
+ p.oReader.lReader = &p.lReader
+ p.oReader.b64Reader = base64.NewDecoder(base64.StdEncoding, &p.lReader)
+ p.Body = &p.oReader
+
+ return
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/encode.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/encode.go
new file mode 100644
index 0000000000..550efddf05
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/encode.go
@@ -0,0 +1,206 @@
+// Copyright 2010 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 armor
+
+import (
+ "encoding/base64"
+ "io"
+ "sort"
+)
+
+var armorHeaderSep = []byte(": ")
+var blockEnd = []byte("\n=")
+var newline = []byte("\n")
+var armorEndOfLineOut = []byte("-----\n")
+
+const crc24Init = 0xb704ce
+const crc24Poly = 0x1864cfb
+
+// crc24 calculates the OpenPGP checksum as specified in RFC 4880, section 6.1
+func crc24(crc uint32, d []byte) uint32 {
+ for _, b := range d {
+ crc ^= uint32(b) << 16
+ for i := 0; i < 8; i++ {
+ crc <<= 1
+ if crc&0x1000000 != 0 {
+ crc ^= crc24Poly
+ }
+ }
+ }
+ return crc
+}
+
+// writeSlices writes its arguments to the given Writer.
+func writeSlices(out io.Writer, slices ...[]byte) (err error) {
+ for _, s := range slices {
+ _, err = out.Write(s)
+ if err != nil {
+ return err
+ }
+ }
+ return
+}
+
+// lineBreaker breaks data across several lines, all of the same byte length
+// (except possibly the last). Lines are broken with a single '\n'.
+type lineBreaker struct {
+ lineLength int
+ line []byte
+ used int
+ out io.Writer
+ haveWritten bool
+}
+
+func newLineBreaker(out io.Writer, lineLength int) *lineBreaker {
+ return &lineBreaker{
+ lineLength: lineLength,
+ line: make([]byte, lineLength),
+ used: 0,
+ out: out,
+ }
+}
+
+func (l *lineBreaker) Write(b []byte) (n int, err error) {
+ n = len(b)
+
+ if n == 0 {
+ return
+ }
+
+ if l.used == 0 && l.haveWritten {
+ _, err = l.out.Write([]byte{'\n'})
+ if err != nil {
+ return
+ }
+ }
+
+ if l.used+len(b) < l.lineLength {
+ l.used += copy(l.line[l.used:], b)
+ return
+ }
+
+ l.haveWritten = true
+ _, err = l.out.Write(l.line[0:l.used])
+ if err != nil {
+ return
+ }
+ excess := l.lineLength - l.used
+ l.used = 0
+
+ _, err = l.out.Write(b[0:excess])
+ if err != nil {
+ return
+ }
+
+ _, err = l.Write(b[excess:])
+ return
+}
+
+func (l *lineBreaker) Close() (err error) {
+ if l.used > 0 {
+ _, err = l.out.Write(l.line[0:l.used])
+ if err != nil {
+ return
+ }
+ }
+
+ return
+}
+
+// encoding keeps track of a running CRC24 over the data which has been written
+// to it and outputs a OpenPGP checksum when closed, followed by an armor
+// trailer.
+//
+// It's built into a stack of io.Writers:
+//
+// encoding -> base64 encoder -> lineBreaker -> out
+type encoding struct {
+ out io.Writer
+ breaker *lineBreaker
+ b64 io.WriteCloser
+ crc uint32
+ crcEnabled bool
+ blockType []byte
+}
+
+func (e *encoding) Write(data []byte) (n int, err error) {
+ if e.crcEnabled {
+ e.crc = crc24(e.crc, data)
+ }
+ return e.b64.Write(data)
+}
+
+func (e *encoding) Close() (err error) {
+ err = e.b64.Close()
+ if err != nil {
+ return
+ }
+ e.breaker.Close()
+
+ if e.crcEnabled {
+ var checksumBytes [3]byte
+ checksumBytes[0] = byte(e.crc >> 16)
+ checksumBytes[1] = byte(e.crc >> 8)
+ checksumBytes[2] = byte(e.crc)
+
+ var b64ChecksumBytes [4]byte
+ base64.StdEncoding.Encode(b64ChecksumBytes[:], checksumBytes[:])
+
+ return writeSlices(e.out, blockEnd, b64ChecksumBytes[:], newline, armorEnd, e.blockType, armorEndOfLine)
+ }
+ return writeSlices(e.out, newline, armorEnd, e.blockType, armorEndOfLine)
+}
+
+func encode(out io.Writer, blockType string, headers map[string]string, checksum bool) (w io.WriteCloser, err error) {
+ bType := []byte(blockType)
+ err = writeSlices(out, armorStart, bType, armorEndOfLineOut)
+ if err != nil {
+ return
+ }
+
+ keys := make([]string, len(headers))
+ i := 0
+ for k := range headers {
+ keys[i] = k
+ i++
+ }
+ sort.Strings(keys)
+ for _, k := range keys {
+ err = writeSlices(out, []byte(k), armorHeaderSep, []byte(headers[k]), newline)
+ if err != nil {
+ return
+ }
+ }
+
+ _, err = out.Write(newline)
+ if err != nil {
+ return
+ }
+
+ e := &encoding{
+ out: out,
+ breaker: newLineBreaker(out, 64),
+ blockType: bType,
+ crc: crc24Init,
+ crcEnabled: checksum,
+ }
+ e.b64 = base64.NewEncoder(base64.StdEncoding, e.breaker)
+ return e, nil
+}
+
+// Encode returns a WriteCloser which will encode the data written to it in
+// OpenPGP armor.
+func Encode(out io.Writer, blockType string, headers map[string]string) (w io.WriteCloser, err error) {
+ return encode(out, blockType, headers, true)
+}
+
+// EncodeWithChecksumOption returns a WriteCloser which will encode the data written to it in
+// OpenPGP armor and provides the option to include a checksum.
+// When forming ASCII Armor, the CRC24 footer SHOULD NOT be generated,
+// unless interoperability with implementations that require the CRC24 footer
+// to be present is a concern.
+func EncodeWithChecksumOption(out io.Writer, blockType string, headers map[string]string, doChecksum bool) (w io.WriteCloser, err error) {
+ return encode(out, blockType, headers, doChecksum)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/canonical_text.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/canonical_text.go
new file mode 100644
index 0000000000..5b40e1375d
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/canonical_text.go
@@ -0,0 +1,71 @@
+// 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 openpgp
+
+import (
+ "hash"
+ "io"
+)
+
+// NewCanonicalTextHash reformats text written to it into the canonical
+// form and then applies the hash h. See RFC 4880, section 5.2.1.
+func NewCanonicalTextHash(h hash.Hash) hash.Hash {
+ return &canonicalTextHash{h, 0}
+}
+
+type canonicalTextHash struct {
+ h hash.Hash
+ s int
+}
+
+var newline = []byte{'\r', '\n'}
+
+func writeCanonical(cw io.Writer, buf []byte, s *int) (int, error) {
+ start := 0
+ for i, c := range buf {
+ switch *s {
+ case 0:
+ if c == '\r' {
+ *s = 1
+ } else if c == '\n' {
+ if _, err := cw.Write(buf[start:i]); err != nil {
+ return 0, err
+ }
+ if _, err := cw.Write(newline); err != nil {
+ return 0, err
+ }
+ start = i + 1
+ }
+ case 1:
+ *s = 0
+ }
+ }
+
+ if _, err := cw.Write(buf[start:]); err != nil {
+ return 0, err
+ }
+ return len(buf), nil
+}
+
+func (cth *canonicalTextHash) Write(buf []byte) (int, error) {
+ return writeCanonical(cth.h, buf, &cth.s)
+}
+
+func (cth *canonicalTextHash) Sum(in []byte) []byte {
+ return cth.h.Sum(in)
+}
+
+func (cth *canonicalTextHash) Reset() {
+ cth.h.Reset()
+ cth.s = 0
+}
+
+func (cth *canonicalTextHash) Size() int {
+ return cth.h.Size()
+}
+
+func (cth *canonicalTextHash) BlockSize() int {
+ return cth.h.BlockSize()
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/ecdh/ecdh.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/ecdh/ecdh.go
new file mode 100644
index 0000000000..db8fb163b6
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/ecdh/ecdh.go
@@ -0,0 +1,206 @@
+// 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 ecdh implements ECDH encryption, suitable for OpenPGP,
+// as specified in RFC 6637, section 8.
+package ecdh
+
+import (
+ "bytes"
+ "errors"
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/aes/keywrap"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/ecc"
+)
+
+type KDF struct {
+ Hash algorithm.Hash
+ Cipher algorithm.Cipher
+}
+
+type PublicKey struct {
+ curve ecc.ECDHCurve
+ Point []byte
+ KDF
+}
+
+type PrivateKey struct {
+ PublicKey
+ D []byte
+}
+
+func NewPublicKey(curve ecc.ECDHCurve, kdfHash algorithm.Hash, kdfCipher algorithm.Cipher) *PublicKey {
+ return &PublicKey{
+ curve: curve,
+ KDF: KDF{
+ Hash: kdfHash,
+ Cipher: kdfCipher,
+ },
+ }
+}
+
+func NewPrivateKey(key PublicKey) *PrivateKey {
+ return &PrivateKey{
+ PublicKey: key,
+ }
+}
+
+func (pk *PublicKey) GetCurve() ecc.ECDHCurve {
+ return pk.curve
+}
+
+func (pk *PublicKey) MarshalPoint() []byte {
+ return pk.curve.MarshalBytePoint(pk.Point)
+}
+
+func (pk *PublicKey) UnmarshalPoint(p []byte) error {
+ pk.Point = pk.curve.UnmarshalBytePoint(p)
+ if pk.Point == nil {
+ return errors.New("ecdh: failed to parse EC point")
+ }
+ return nil
+}
+
+func (sk *PrivateKey) MarshalByteSecret() []byte {
+ return sk.curve.MarshalByteSecret(sk.D)
+}
+
+func (sk *PrivateKey) UnmarshalByteSecret(d []byte) error {
+ sk.D = sk.curve.UnmarshalByteSecret(d)
+
+ if sk.D == nil {
+ return errors.New("ecdh: failed to parse scalar")
+ }
+ return nil
+}
+
+func GenerateKey(rand io.Reader, c ecc.ECDHCurve, kdf KDF) (priv *PrivateKey, err error) {
+ priv = new(PrivateKey)
+ priv.PublicKey.curve = c
+ priv.PublicKey.KDF = kdf
+ priv.PublicKey.Point, priv.D, err = c.GenerateECDH(rand)
+ return
+}
+
+func Encrypt(random io.Reader, pub *PublicKey, msg, curveOID, fingerprint []byte) (vsG, c []byte, err error) {
+ if len(msg) > 40 {
+ return nil, nil, errors.New("ecdh: message too long")
+ }
+ // the sender MAY use 21, 13, and 5 bytes of padding for AES-128,
+ // AES-192, and AES-256, respectively, to provide the same number of
+ // octets, 40 total, as an input to the key wrapping method.
+ padding := make([]byte, 40-len(msg))
+ for i := range padding {
+ padding[i] = byte(40 - len(msg))
+ }
+ m := append(msg, padding...)
+
+ ephemeral, zb, err := pub.curve.Encaps(random, pub.Point)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ vsG = pub.curve.MarshalBytePoint(ephemeral)
+
+ z, err := buildKey(pub, zb, curveOID, fingerprint, false, false)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ if c, err = keywrap.Wrap(z, m); err != nil {
+ return nil, nil, err
+ }
+
+ return vsG, c, nil
+
+}
+
+func Decrypt(priv *PrivateKey, vsG, c, curveOID, fingerprint []byte) (msg []byte, err error) {
+ var m []byte
+ zb, err := priv.PublicKey.curve.Decaps(priv.curve.UnmarshalBytePoint(vsG), priv.D)
+
+ // Try buildKey three times to workaround an old bug, see comments in buildKey.
+ for i := 0; i < 3; i++ {
+ var z []byte
+ // RFC6637 §8: "Compute Z = KDF( S, Z_len, Param );"
+ z, err = buildKey(&priv.PublicKey, zb, curveOID, fingerprint, i == 1, i == 2)
+ if err != nil {
+ return nil, err
+ }
+
+ // RFC6637 §8: "Compute C = AESKeyWrap( Z, c ) as per [RFC3394]"
+ m, err = keywrap.Unwrap(z, c)
+ if err == nil {
+ break
+ }
+ }
+
+ // Only return an error after we've tried all (required) variants of buildKey.
+ if err != nil {
+ return nil, err
+ }
+
+ // RFC6637 §8: "m = symm_alg_ID || session key || checksum || pkcs5_padding"
+ // The last byte should be the length of the padding, as per PKCS5; strip it off.
+ return m[:len(m)-int(m[len(m)-1])], nil
+}
+
+func buildKey(pub *PublicKey, zb []byte, curveOID, fingerprint []byte, stripLeading, stripTrailing bool) ([]byte, error) {
+ // Param = curve_OID_len || curve_OID || public_key_alg_ID || 03
+ // || 01 || KDF_hash_ID || KEK_alg_ID for AESKeyWrap
+ // || "Anonymous Sender " || recipient_fingerprint;
+ param := new(bytes.Buffer)
+ if _, err := param.Write(curveOID); err != nil {
+ return nil, err
+ }
+ algKDF := []byte{18, 3, 1, pub.KDF.Hash.Id(), pub.KDF.Cipher.Id()}
+ if _, err := param.Write(algKDF); err != nil {
+ return nil, err
+ }
+ if _, err := param.Write([]byte("Anonymous Sender ")); err != nil {
+ return nil, err
+ }
+ if _, err := param.Write(fingerprint[:]); err != nil {
+ return nil, err
+ }
+
+ // MB = Hash ( 00 || 00 || 00 || 01 || ZB || Param );
+ h := pub.KDF.Hash.New()
+ if _, err := h.Write([]byte{0x0, 0x0, 0x0, 0x1}); err != nil {
+ return nil, err
+ }
+ zbLen := len(zb)
+ i := 0
+ j := zbLen - 1
+ if stripLeading {
+ // Work around old go crypto bug where the leading zeros are missing.
+ for i < zbLen && zb[i] == 0 {
+ i++
+ }
+ }
+ if stripTrailing {
+ // Work around old OpenPGP.js bug where insignificant trailing zeros in
+ // this little-endian number are missing.
+ // (See https://github.com/openpgpjs/openpgpjs/pull/853.)
+ for j >= 0 && zb[j] == 0 {
+ j--
+ }
+ }
+ if _, err := h.Write(zb[i : j+1]); err != nil {
+ return nil, err
+ }
+ if _, err := h.Write(param.Bytes()); err != nil {
+ return nil, err
+ }
+ mb := h.Sum(nil)
+
+ return mb[:pub.KDF.Cipher.KeySize()], nil // return oBits leftmost bits of MB.
+
+}
+
+func Validate(priv *PrivateKey) error {
+ return priv.curve.ValidateECDH(priv.Point, priv.D)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/ecdsa/ecdsa.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/ecdsa/ecdsa.go
new file mode 100644
index 0000000000..f94ae1b2f5
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/ecdsa/ecdsa.go
@@ -0,0 +1,80 @@
+// Package ecdsa implements ECDSA signature, suitable for OpenPGP,
+// as specified in RFC 6637, section 5.
+package ecdsa
+
+import (
+ "errors"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/ecc"
+ "io"
+ "math/big"
+)
+
+type PublicKey struct {
+ X, Y *big.Int
+ curve ecc.ECDSACurve
+}
+
+type PrivateKey struct {
+ PublicKey
+ D *big.Int
+}
+
+func NewPublicKey(curve ecc.ECDSACurve) *PublicKey {
+ return &PublicKey{
+ curve: curve,
+ }
+}
+
+func NewPrivateKey(key PublicKey) *PrivateKey {
+ return &PrivateKey{
+ PublicKey: key,
+ }
+}
+
+func (pk *PublicKey) GetCurve() ecc.ECDSACurve {
+ return pk.curve
+}
+
+func (pk *PublicKey) MarshalPoint() []byte {
+ return pk.curve.MarshalIntegerPoint(pk.X, pk.Y)
+}
+
+func (pk *PublicKey) UnmarshalPoint(p []byte) error {
+ pk.X, pk.Y = pk.curve.UnmarshalIntegerPoint(p)
+ if pk.X == nil {
+ return errors.New("ecdsa: failed to parse EC point")
+ }
+ return nil
+}
+
+func (sk *PrivateKey) MarshalIntegerSecret() []byte {
+ return sk.curve.MarshalIntegerSecret(sk.D)
+}
+
+func (sk *PrivateKey) UnmarshalIntegerSecret(d []byte) error {
+ sk.D = sk.curve.UnmarshalIntegerSecret(d)
+
+ if sk.D == nil {
+ return errors.New("ecdsa: failed to parse scalar")
+ }
+ return nil
+}
+
+func GenerateKey(rand io.Reader, c ecc.ECDSACurve) (priv *PrivateKey, err error) {
+ priv = new(PrivateKey)
+ priv.PublicKey.curve = c
+ priv.PublicKey.X, priv.PublicKey.Y, priv.D, err = c.GenerateECDSA(rand)
+ return
+}
+
+func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err error) {
+ return priv.PublicKey.curve.Sign(rand, priv.X, priv.Y, priv.D, hash)
+}
+
+func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool {
+ return pub.curve.Verify(pub.X, pub.Y, hash, r, s)
+}
+
+func Validate(priv *PrivateKey) error {
+ return priv.curve.ValidateECDSA(priv.X, priv.Y, priv.D.Bytes())
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/ed25519/ed25519.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/ed25519/ed25519.go
new file mode 100644
index 0000000000..6abdf7c446
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/ed25519/ed25519.go
@@ -0,0 +1,115 @@
+// Package ed25519 implements the ed25519 signature algorithm for OpenPGP
+// as defined in the Open PGP crypto refresh.
+package ed25519
+
+import (
+ "crypto/subtle"
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ ed25519lib "github.com/cloudflare/circl/sign/ed25519"
+)
+
+const (
+ // PublicKeySize is the size, in bytes, of public keys in this package.
+ PublicKeySize = ed25519lib.PublicKeySize
+ // SeedSize is the size, in bytes, of private key seeds.
+ // The private key representation used by RFC 8032.
+ SeedSize = ed25519lib.SeedSize
+ // SignatureSize is the size, in bytes, of signatures generated and verified by this package.
+ SignatureSize = ed25519lib.SignatureSize
+)
+
+type PublicKey struct {
+ // Point represents the elliptic curve point of the public key.
+ Point []byte
+}
+
+type PrivateKey struct {
+ PublicKey
+ // Key the private key representation by RFC 8032,
+ // encoded as seed | pub key point.
+ Key []byte
+}
+
+// NewPublicKey creates a new empty ed25519 public key.
+func NewPublicKey() *PublicKey {
+ return &PublicKey{}
+}
+
+// NewPrivateKey creates a new empty private key referencing the public key.
+func NewPrivateKey(key PublicKey) *PrivateKey {
+ return &PrivateKey{
+ PublicKey: key,
+ }
+}
+
+// Seed returns the ed25519 private key secret seed.
+// The private key representation by RFC 8032.
+func (pk *PrivateKey) Seed() []byte {
+ return pk.Key[:SeedSize]
+}
+
+// MarshalByteSecret returns the underlying 32 byte seed of the private key.
+func (pk *PrivateKey) MarshalByteSecret() []byte {
+ return pk.Seed()
+}
+
+// UnmarshalByteSecret computes the private key from the secret seed
+// and stores it in the private key object.
+func (sk *PrivateKey) UnmarshalByteSecret(seed []byte) error {
+ sk.Key = ed25519lib.NewKeyFromSeed(seed)
+ return nil
+}
+
+// GenerateKey generates a fresh private key with the provided randomness source.
+func GenerateKey(rand io.Reader) (*PrivateKey, error) {
+ publicKey, privateKey, err := ed25519lib.GenerateKey(rand)
+ if err != nil {
+ return nil, err
+ }
+ privateKeyOut := new(PrivateKey)
+ privateKeyOut.PublicKey.Point = publicKey[:]
+ privateKeyOut.Key = privateKey[:]
+ return privateKeyOut, nil
+}
+
+// Sign signs a message with the ed25519 algorithm.
+// priv MUST be a valid key! Check this with Validate() before use.
+func Sign(priv *PrivateKey, message []byte) ([]byte, error) {
+ return ed25519lib.Sign(priv.Key, message), nil
+}
+
+// Verify verifies an ed25519 signature.
+func Verify(pub *PublicKey, message []byte, signature []byte) bool {
+ return ed25519lib.Verify(pub.Point, message, signature)
+}
+
+// Validate checks if the ed25519 private key is valid.
+func Validate(priv *PrivateKey) error {
+ expectedPrivateKey := ed25519lib.NewKeyFromSeed(priv.Seed())
+ if subtle.ConstantTimeCompare(priv.Key, expectedPrivateKey) == 0 {
+ return errors.KeyInvalidError("ed25519: invalid ed25519 secret")
+ }
+ if subtle.ConstantTimeCompare(priv.PublicKey.Point, expectedPrivateKey[SeedSize:]) == 0 {
+ return errors.KeyInvalidError("ed25519: invalid ed25519 public key")
+ }
+ return nil
+}
+
+// ENCODING/DECODING signature:
+
+// WriteSignature encodes and writes an ed25519 signature to writer.
+func WriteSignature(writer io.Writer, signature []byte) error {
+ _, err := writer.Write(signature)
+ return err
+}
+
+// ReadSignature decodes an ed25519 signature from a reader.
+func ReadSignature(reader io.Reader) ([]byte, error) {
+ signature := make([]byte, SignatureSize)
+ if _, err := io.ReadFull(reader, signature); err != nil {
+ return nil, err
+ }
+ return signature, nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/ed448/ed448.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/ed448/ed448.go
new file mode 100644
index 0000000000..b11fb4fb17
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/ed448/ed448.go
@@ -0,0 +1,119 @@
+// Package ed448 implements the ed448 signature algorithm for OpenPGP
+// as defined in the Open PGP crypto refresh.
+package ed448
+
+import (
+ "crypto/subtle"
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ ed448lib "github.com/cloudflare/circl/sign/ed448"
+)
+
+const (
+ // PublicKeySize is the size, in bytes, of public keys in this package.
+ PublicKeySize = ed448lib.PublicKeySize
+ // SeedSize is the size, in bytes, of private key seeds.
+ // The private key representation used by RFC 8032.
+ SeedSize = ed448lib.SeedSize
+ // SignatureSize is the size, in bytes, of signatures generated and verified by this package.
+ SignatureSize = ed448lib.SignatureSize
+)
+
+type PublicKey struct {
+ // Point represents the elliptic curve point of the public key.
+ Point []byte
+}
+
+type PrivateKey struct {
+ PublicKey
+ // Key the private key representation by RFC 8032,
+ // encoded as seed | public key point.
+ Key []byte
+}
+
+// NewPublicKey creates a new empty ed448 public key.
+func NewPublicKey() *PublicKey {
+ return &PublicKey{}
+}
+
+// NewPrivateKey creates a new empty private key referencing the public key.
+func NewPrivateKey(key PublicKey) *PrivateKey {
+ return &PrivateKey{
+ PublicKey: key,
+ }
+}
+
+// Seed returns the ed448 private key secret seed.
+// The private key representation by RFC 8032.
+func (pk *PrivateKey) Seed() []byte {
+ return pk.Key[:SeedSize]
+}
+
+// MarshalByteSecret returns the underlying seed of the private key.
+func (pk *PrivateKey) MarshalByteSecret() []byte {
+ return pk.Seed()
+}
+
+// UnmarshalByteSecret computes the private key from the secret seed
+// and stores it in the private key object.
+func (sk *PrivateKey) UnmarshalByteSecret(seed []byte) error {
+ sk.Key = ed448lib.NewKeyFromSeed(seed)
+ return nil
+}
+
+// GenerateKey generates a fresh private key with the provided randomness source.
+func GenerateKey(rand io.Reader) (*PrivateKey, error) {
+ publicKey, privateKey, err := ed448lib.GenerateKey(rand)
+ if err != nil {
+ return nil, err
+ }
+ privateKeyOut := new(PrivateKey)
+ privateKeyOut.PublicKey.Point = publicKey[:]
+ privateKeyOut.Key = privateKey[:]
+ return privateKeyOut, nil
+}
+
+// Sign signs a message with the ed448 algorithm.
+// priv MUST be a valid key! Check this with Validate() before use.
+func Sign(priv *PrivateKey, message []byte) ([]byte, error) {
+ // Ed448 is used with the empty string as a context string.
+ // See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-08#section-13.7
+ return ed448lib.Sign(priv.Key, message, ""), nil
+}
+
+// Verify verifies a ed448 signature
+func Verify(pub *PublicKey, message []byte, signature []byte) bool {
+ // Ed448 is used with the empty string as a context string.
+ // See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-08#section-13.7
+ return ed448lib.Verify(pub.Point, message, signature, "")
+}
+
+// Validate checks if the ed448 private key is valid
+func Validate(priv *PrivateKey) error {
+ expectedPrivateKey := ed448lib.NewKeyFromSeed(priv.Seed())
+ if subtle.ConstantTimeCompare(priv.Key, expectedPrivateKey) == 0 {
+ return errors.KeyInvalidError("ed448: invalid ed448 secret")
+ }
+ if subtle.ConstantTimeCompare(priv.PublicKey.Point, expectedPrivateKey[SeedSize:]) == 0 {
+ return errors.KeyInvalidError("ed448: invalid ed448 public key")
+ }
+ return nil
+}
+
+// ENCODING/DECODING signature:
+
+// WriteSignature encodes and writes an ed448 signature to writer.
+func WriteSignature(writer io.Writer, signature []byte) error {
+ _, err := writer.Write(signature)
+ return err
+}
+
+// ReadSignature decodes an ed448 signature from a reader.
+func ReadSignature(reader io.Reader) ([]byte, error) {
+ signature := make([]byte, SignatureSize)
+ if _, err := io.ReadFull(reader, signature); err != nil {
+ return nil, err
+ }
+ return signature, nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/eddsa/eddsa.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/eddsa/eddsa.go
new file mode 100644
index 0000000000..99ecfc7f12
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/eddsa/eddsa.go
@@ -0,0 +1,91 @@
+// Package eddsa implements EdDSA signature, suitable for OpenPGP, as specified in
+// https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-13.7
+package eddsa
+
+import (
+ "errors"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/ecc"
+ "io"
+)
+
+type PublicKey struct {
+ X []byte
+ curve ecc.EdDSACurve
+}
+
+type PrivateKey struct {
+ PublicKey
+ D []byte
+}
+
+func NewPublicKey(curve ecc.EdDSACurve) *PublicKey {
+ return &PublicKey{
+ curve: curve,
+ }
+}
+
+func NewPrivateKey(key PublicKey) *PrivateKey {
+ return &PrivateKey{
+ PublicKey: key,
+ }
+}
+
+func (pk *PublicKey) GetCurve() ecc.EdDSACurve {
+ return pk.curve
+}
+
+func (pk *PublicKey) MarshalPoint() []byte {
+ return pk.curve.MarshalBytePoint(pk.X)
+}
+
+func (pk *PublicKey) UnmarshalPoint(x []byte) error {
+ pk.X = pk.curve.UnmarshalBytePoint(x)
+
+ if pk.X == nil {
+ return errors.New("eddsa: failed to parse EC point")
+ }
+ return nil
+}
+
+func (sk *PrivateKey) MarshalByteSecret() []byte {
+ return sk.curve.MarshalByteSecret(sk.D)
+}
+
+func (sk *PrivateKey) UnmarshalByteSecret(d []byte) error {
+ sk.D = sk.curve.UnmarshalByteSecret(d)
+
+ if sk.D == nil {
+ return errors.New("eddsa: failed to parse scalar")
+ }
+ return nil
+}
+
+func GenerateKey(rand io.Reader, c ecc.EdDSACurve) (priv *PrivateKey, err error) {
+ priv = new(PrivateKey)
+ priv.PublicKey.curve = c
+ priv.PublicKey.X, priv.D, err = c.GenerateEdDSA(rand)
+ return
+}
+
+func Sign(priv *PrivateKey, message []byte) (r, s []byte, err error) {
+ sig, err := priv.PublicKey.curve.Sign(priv.PublicKey.X, priv.D, message)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ r, s = priv.PublicKey.curve.MarshalSignature(sig)
+ return
+}
+
+func Verify(pub *PublicKey, message, r, s []byte) bool {
+ sig := pub.curve.UnmarshalSignature(r, s)
+ if sig == nil {
+ return false
+ }
+
+ return pub.curve.Verify(pub.X, message, sig)
+}
+
+func Validate(priv *PrivateKey) error {
+ return priv.curve.ValidateEdDSA(priv.PublicKey.X, priv.D)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/elgamal/elgamal.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/elgamal/elgamal.go
new file mode 100644
index 0000000000..bad2774344
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/elgamal/elgamal.go
@@ -0,0 +1,124 @@
+// 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 elgamal implements ElGamal encryption, suitable for OpenPGP,
+// as specified in "A Public-Key Cryptosystem and a Signature Scheme Based on
+// Discrete Logarithms," IEEE Transactions on Information Theory, v. IT-31,
+// n. 4, 1985, pp. 469-472.
+//
+// This form of ElGamal embeds PKCS#1 v1.5 padding, which may make it
+// unsuitable for other protocols. RSA should be used in preference in any
+// case.
+package elgamal // import "github.com/ProtonMail/go-crypto/openpgp/elgamal"
+
+import (
+ "crypto/rand"
+ "crypto/subtle"
+ "errors"
+ "io"
+ "math/big"
+)
+
+// PublicKey represents an ElGamal public key.
+type PublicKey struct {
+ G, P, Y *big.Int
+}
+
+// PrivateKey represents an ElGamal private key.
+type PrivateKey struct {
+ PublicKey
+ X *big.Int
+}
+
+// Encrypt encrypts the given message to the given public key. The result is a
+// pair of integers. Errors can result from reading random, or because msg is
+// too large to be encrypted to the public key.
+func Encrypt(random io.Reader, pub *PublicKey, msg []byte) (c1, c2 *big.Int, err error) {
+ pLen := (pub.P.BitLen() + 7) / 8
+ if len(msg) > pLen-11 {
+ err = errors.New("elgamal: message too long")
+ return
+ }
+
+ // EM = 0x02 || PS || 0x00 || M
+ em := make([]byte, pLen-1)
+ em[0] = 2
+ ps, mm := em[1:len(em)-len(msg)-1], em[len(em)-len(msg):]
+ err = nonZeroRandomBytes(ps, random)
+ if err != nil {
+ return
+ }
+ em[len(em)-len(msg)-1] = 0
+ copy(mm, msg)
+
+ m := new(big.Int).SetBytes(em)
+
+ k, err := rand.Int(random, pub.P)
+ if err != nil {
+ return
+ }
+
+ c1 = new(big.Int).Exp(pub.G, k, pub.P)
+ s := new(big.Int).Exp(pub.Y, k, pub.P)
+ c2 = s.Mul(s, m)
+ c2.Mod(c2, pub.P)
+
+ return
+}
+
+// Decrypt takes two integers, resulting from an ElGamal encryption, and
+// returns the plaintext of the message. An error can result only if the
+// ciphertext is invalid. Users should keep in mind that this is a padding
+// oracle and thus, if exposed to an adaptive chosen ciphertext attack, can
+// be used to break the cryptosystem. See “Chosen Ciphertext Attacks
+// Against Protocols Based on the RSA Encryption Standard PKCS #1”, Daniel
+// Bleichenbacher, Advances in Cryptology (Crypto '98),
+func Decrypt(priv *PrivateKey, c1, c2 *big.Int) (msg []byte, err error) {
+ s := new(big.Int).Exp(c1, priv.X, priv.P)
+ if s.ModInverse(s, priv.P) == nil {
+ return nil, errors.New("elgamal: invalid private key")
+ }
+ s.Mul(s, c2)
+ s.Mod(s, priv.P)
+ em := s.Bytes()
+
+ firstByteIsTwo := subtle.ConstantTimeByteEq(em[0], 2)
+
+ // The remainder of the plaintext must be a string of non-zero random
+ // octets, followed by a 0, followed by the message.
+ // lookingForIndex: 1 iff we are still looking for the zero.
+ // index: the offset of the first zero byte.
+ var lookingForIndex, index int
+ lookingForIndex = 1
+
+ for i := 1; i < len(em); i++ {
+ equals0 := subtle.ConstantTimeByteEq(em[i], 0)
+ index = subtle.ConstantTimeSelect(lookingForIndex&equals0, i, index)
+ lookingForIndex = subtle.ConstantTimeSelect(equals0, 0, lookingForIndex)
+ }
+
+ if firstByteIsTwo != 1 || lookingForIndex != 0 || index < 9 {
+ return nil, errors.New("elgamal: decryption error")
+ }
+ return em[index+1:], nil
+}
+
+// nonZeroRandomBytes fills the given slice with non-zero random octets.
+func nonZeroRandomBytes(s []byte, rand io.Reader) (err error) {
+ _, err = io.ReadFull(rand, s)
+ if err != nil {
+ return
+ }
+
+ for i := 0; i < len(s); i++ {
+ for s[i] == 0 {
+ _, err = io.ReadFull(rand, s[i:i+1])
+ if err != nil {
+ return
+ }
+ }
+ }
+
+ return
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/errors/errors.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/errors/errors.go
new file mode 100644
index 0000000000..2e341507a7
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/errors/errors.go
@@ -0,0 +1,210 @@
+// Copyright 2010 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 errors contains common error types for the OpenPGP packages.
+package errors // import "github.com/ProtonMail/go-crypto/openpgp/errors"
+
+import (
+ "fmt"
+ "strconv"
+)
+
+var (
+ // ErrDecryptSessionKeyParsing is a generic error message for parsing errors in decrypted data
+ // to reduce the risk of oracle attacks.
+ ErrDecryptSessionKeyParsing = DecryptWithSessionKeyError("parsing error")
+ // ErrAEADTagVerification is returned if one of the tag verifications in SEIPDv2 fails
+ ErrAEADTagVerification error = DecryptWithSessionKeyError("AEAD tag verification failed")
+ // ErrMDCHashMismatch
+ ErrMDCHashMismatch error = SignatureError("MDC hash mismatch")
+ // ErrMDCMissing
+ ErrMDCMissing error = SignatureError("MDC packet not found")
+)
+
+// A StructuralError is returned when OpenPGP data is found to be syntactically
+// invalid.
+type StructuralError string
+
+func (s StructuralError) Error() string {
+ return "openpgp: invalid data: " + string(s)
+}
+
+// A DecryptWithSessionKeyError is returned when a failure occurs when reading from symmetrically decrypted data or
+// an authentication tag verification fails.
+// Such an error indicates that the supplied session key is likely wrong or the data got corrupted.
+type DecryptWithSessionKeyError string
+
+func (s DecryptWithSessionKeyError) Error() string {
+ return "openpgp: decryption with session key failed: " + string(s)
+}
+
+// HandleSensitiveParsingError handles parsing errors when reading data from potentially decrypted data.
+// The function makes parsing errors generic to reduce the risk of oracle attacks in SEIPDv1.
+func HandleSensitiveParsingError(err error, decrypted bool) error {
+ if !decrypted {
+ // Data was not encrypted so we return the inner error.
+ return err
+ }
+ // The data is read from a stream that decrypts using a session key;
+ // therefore, we need to handle parsing errors appropriately.
+ // This is essential to mitigate the risk of oracle attacks.
+ if decError, ok := err.(*DecryptWithSessionKeyError); ok {
+ return decError
+ }
+ if decError, ok := err.(DecryptWithSessionKeyError); ok {
+ return decError
+ }
+ return ErrDecryptSessionKeyParsing
+}
+
+// UnsupportedError indicates that, although the OpenPGP data is valid, it
+// makes use of currently unimplemented features.
+type UnsupportedError string
+
+func (s UnsupportedError) Error() string {
+ return "openpgp: unsupported feature: " + string(s)
+}
+
+// InvalidArgumentError indicates that the caller is in error and passed an
+// incorrect value.
+type InvalidArgumentError string
+
+func (i InvalidArgumentError) Error() string {
+ return "openpgp: invalid argument: " + string(i)
+}
+
+// SignatureError indicates that a syntactically valid signature failed to
+// validate.
+type SignatureError string
+
+func (b SignatureError) Error() string {
+ return "openpgp: invalid signature: " + string(b)
+}
+
+type signatureExpiredError int
+
+func (se signatureExpiredError) Error() string {
+ return "openpgp: signature expired"
+}
+
+var ErrSignatureExpired error = signatureExpiredError(0)
+
+type keyExpiredError int
+
+func (ke keyExpiredError) Error() string {
+ return "openpgp: key expired"
+}
+
+var ErrSignatureOlderThanKey error = signatureOlderThanKeyError(0)
+
+type signatureOlderThanKeyError int
+
+func (ske signatureOlderThanKeyError) Error() string {
+ return "openpgp: signature is older than the key"
+}
+
+var ErrKeyExpired error = keyExpiredError(0)
+
+type keyIncorrectError int
+
+func (ki keyIncorrectError) Error() string {
+ return "openpgp: incorrect key"
+}
+
+var ErrKeyIncorrect error = keyIncorrectError(0)
+
+// KeyInvalidError indicates that the public key parameters are invalid
+// as they do not match the private ones
+type KeyInvalidError string
+
+func (e KeyInvalidError) Error() string {
+ return "openpgp: invalid key: " + string(e)
+}
+
+type unknownIssuerError int
+
+func (unknownIssuerError) Error() string {
+ return "openpgp: signature made by unknown entity"
+}
+
+var ErrUnknownIssuer error = unknownIssuerError(0)
+
+type keyRevokedError int
+
+func (keyRevokedError) Error() string {
+ return "openpgp: signature made by revoked key"
+}
+
+var ErrKeyRevoked error = keyRevokedError(0)
+
+type WeakAlgorithmError string
+
+func (e WeakAlgorithmError) Error() string {
+ return "openpgp: weak algorithms are rejected: " + string(e)
+}
+
+type UnknownPacketTypeError uint8
+
+func (upte UnknownPacketTypeError) Error() string {
+ return "openpgp: unknown packet type: " + strconv.Itoa(int(upte))
+}
+
+type CriticalUnknownPacketTypeError uint8
+
+func (upte CriticalUnknownPacketTypeError) Error() string {
+ return "openpgp: unknown critical packet type: " + strconv.Itoa(int(upte))
+}
+
+// AEADError indicates that there is a problem when initializing or using a
+// AEAD instance, configuration struct, nonces or index values.
+type AEADError string
+
+func (ae AEADError) Error() string {
+ return "openpgp: aead error: " + string(ae)
+}
+
+// ErrDummyPrivateKey results when operations are attempted on a private key
+// that is just a dummy key. See
+// https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=doc/DETAILS;h=fe55ae16ab4e26d8356dc574c9e8bc935e71aef1;hb=23191d7851eae2217ecdac6484349849a24fd94a#l1109
+type ErrDummyPrivateKey string
+
+func (dke ErrDummyPrivateKey) Error() string {
+ return "openpgp: s2k GNU dummy key: " + string(dke)
+}
+
+// ErrMalformedMessage results when the packet sequence is incorrect
+type ErrMalformedMessage string
+
+func (dke ErrMalformedMessage) Error() string {
+ return "openpgp: malformed message " + string(dke)
+}
+
+type messageTooLargeError int
+
+func (e messageTooLargeError) Error() string {
+ return "openpgp: decompressed message size exceeds provided limit"
+}
+
+// ErrMessageTooLarge is returned if the read data from
+// a compressed packet exceeds the provided limit.
+var ErrMessageTooLarge error = messageTooLargeError(0)
+
+// ErrEncryptionKeySelection is returned if encryption key selection fails (v2 API).
+type ErrEncryptionKeySelection struct {
+ PrimaryKeyId string
+ PrimaryKeyErr error
+ EncSelectionKeyId *string
+ EncSelectionErr error
+}
+
+func (eks ErrEncryptionKeySelection) Error() string {
+ prefix := fmt.Sprintf("openpgp: key selection for primary key %s:", eks.PrimaryKeyId)
+ if eks.PrimaryKeyErr != nil {
+ return fmt.Sprintf("%s invalid primary key: %s", prefix, eks.PrimaryKeyErr)
+ }
+ if eks.EncSelectionKeyId != nil {
+ return fmt.Sprintf("%s invalid encryption key %s: %s", prefix, *eks.EncSelectionKeyId, eks.EncSelectionErr)
+ }
+ return fmt.Sprintf("%s no encryption key: %s", prefix, eks.EncSelectionErr)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/hash.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/hash.go
new file mode 100644
index 0000000000..526bd7777f
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/hash.go
@@ -0,0 +1,24 @@
+package openpgp
+
+import (
+ "crypto"
+
+ "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm"
+)
+
+// HashIdToHash returns a crypto.Hash which corresponds to the given OpenPGP
+// hash id.
+func HashIdToHash(id byte) (h crypto.Hash, ok bool) {
+ return algorithm.HashIdToHash(id)
+}
+
+// HashIdToString returns the name of the hash function corresponding to the
+// given OpenPGP hash id.
+func HashIdToString(id byte) (name string, ok bool) {
+ return algorithm.HashIdToString(id)
+}
+
+// HashToHashId returns an OpenPGP hash id which corresponds the given Hash.
+func HashToHashId(h crypto.Hash) (id byte, ok bool) {
+ return algorithm.HashToHashId(h)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/aead.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/aead.go
new file mode 100644
index 0000000000..d067065186
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/aead.go
@@ -0,0 +1,65 @@
+// Copyright (C) 2019 ProtonTech AG
+
+package algorithm
+
+import (
+ "crypto/cipher"
+ "github.com/ProtonMail/go-crypto/eax"
+ "github.com/ProtonMail/go-crypto/ocb"
+)
+
+// AEADMode defines the Authenticated Encryption with Associated Data mode of
+// operation.
+type AEADMode uint8
+
+// Supported modes of operation (see RFC4880bis [EAX] and RFC7253)
+const (
+ AEADModeEAX = AEADMode(1)
+ AEADModeOCB = AEADMode(2)
+ AEADModeGCM = AEADMode(3)
+)
+
+// TagLength returns the length in bytes of authentication tags.
+func (mode AEADMode) TagLength() int {
+ switch mode {
+ case AEADModeEAX:
+ return 16
+ case AEADModeOCB:
+ return 16
+ case AEADModeGCM:
+ return 16
+ default:
+ return 0
+ }
+}
+
+// NonceLength returns the length in bytes of nonces.
+func (mode AEADMode) NonceLength() int {
+ switch mode {
+ case AEADModeEAX:
+ return 16
+ case AEADModeOCB:
+ return 15
+ case AEADModeGCM:
+ return 12
+ default:
+ return 0
+ }
+}
+
+// New returns a fresh instance of the given mode
+func (mode AEADMode) New(block cipher.Block) (alg cipher.AEAD) {
+ var err error
+ switch mode {
+ case AEADModeEAX:
+ alg, err = eax.NewEAX(block)
+ case AEADModeOCB:
+ alg, err = ocb.NewOCB(block)
+ case AEADModeGCM:
+ alg, err = cipher.NewGCM(block)
+ }
+ if err != nil {
+ panic(err.Error())
+ }
+ return alg
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/cipher.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/cipher.go
new file mode 100644
index 0000000000..c76a75bcda
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/cipher.go
@@ -0,0 +1,97 @@
+// 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 algorithm
+
+import (
+ "crypto/aes"
+ "crypto/cipher"
+ "crypto/des"
+
+ "golang.org/x/crypto/cast5"
+)
+
+// Cipher is an official symmetric key cipher algorithm. See RFC 4880,
+// section 9.2.
+type Cipher interface {
+ // Id returns the algorithm ID, as a byte, of the cipher.
+ Id() uint8
+ // KeySize returns the key size, in bytes, of the cipher.
+ KeySize() int
+ // BlockSize returns the block size, in bytes, of the cipher.
+ BlockSize() int
+ // New returns a fresh instance of the given cipher.
+ New(key []byte) cipher.Block
+}
+
+// The following constants mirror the OpenPGP standard (RFC 4880).
+const (
+ TripleDES = CipherFunction(2)
+ CAST5 = CipherFunction(3)
+ AES128 = CipherFunction(7)
+ AES192 = CipherFunction(8)
+ AES256 = CipherFunction(9)
+)
+
+// CipherById represents the different block ciphers specified for OpenPGP. See
+// http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-13
+var CipherById = map[uint8]Cipher{
+ TripleDES.Id(): TripleDES,
+ CAST5.Id(): CAST5,
+ AES128.Id(): AES128,
+ AES192.Id(): AES192,
+ AES256.Id(): AES256,
+}
+
+type CipherFunction uint8
+
+// ID returns the algorithm Id, as a byte, of cipher.
+func (sk CipherFunction) Id() uint8 {
+ return uint8(sk)
+}
+
+// KeySize returns the key size, in bytes, of cipher.
+func (cipher CipherFunction) KeySize() int {
+ switch cipher {
+ case CAST5:
+ return cast5.KeySize
+ case AES128:
+ return 16
+ case AES192, TripleDES:
+ return 24
+ case AES256:
+ return 32
+ }
+ return 0
+}
+
+// BlockSize returns the block size, in bytes, of cipher.
+func (cipher CipherFunction) BlockSize() int {
+ switch cipher {
+ case TripleDES:
+ return des.BlockSize
+ case CAST5:
+ return 8
+ case AES128, AES192, AES256:
+ return 16
+ }
+ return 0
+}
+
+// New returns a fresh instance of the given cipher.
+func (cipher CipherFunction) New(key []byte) (block cipher.Block) {
+ var err error
+ switch cipher {
+ case TripleDES:
+ block, err = des.NewTripleDESCipher(key)
+ case CAST5:
+ block, err = cast5.NewCipher(key)
+ case AES128, AES192, AES256:
+ block, err = aes.NewCipher(key)
+ }
+ if err != nil {
+ panic(err.Error())
+ }
+ return
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/hash.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/hash.go
new file mode 100644
index 0000000000..d1a00fc749
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/hash.go
@@ -0,0 +1,143 @@
+// 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 algorithm
+
+import (
+ "crypto"
+ "fmt"
+ "hash"
+)
+
+// Hash is an official hash function algorithm. See RFC 4880, section 9.4.
+type Hash interface {
+ // Id returns the algorithm ID, as a byte, of Hash.
+ Id() uint8
+ // Available reports whether the given hash function is linked into the binary.
+ Available() bool
+ // HashFunc simply returns the value of h so that Hash implements SignerOpts.
+ HashFunc() crypto.Hash
+ // New returns a new hash.Hash calculating the given hash function. New
+ // panics if the hash function is not linked into the binary.
+ New() hash.Hash
+ // Size returns the length, in bytes, of a digest resulting from the given
+ // hash function. It doesn't require that the hash function in question be
+ // linked into the program.
+ Size() int
+ // String is the name of the hash function corresponding to the given
+ // OpenPGP hash id.
+ String() string
+}
+
+// The following vars mirror the crypto/Hash supported hash functions.
+var (
+ SHA1 Hash = cryptoHash{2, crypto.SHA1}
+ SHA256 Hash = cryptoHash{8, crypto.SHA256}
+ SHA384 Hash = cryptoHash{9, crypto.SHA384}
+ SHA512 Hash = cryptoHash{10, crypto.SHA512}
+ SHA224 Hash = cryptoHash{11, crypto.SHA224}
+ SHA3_256 Hash = cryptoHash{12, crypto.SHA3_256}
+ SHA3_512 Hash = cryptoHash{14, crypto.SHA3_512}
+)
+
+// HashById represents the different hash functions specified for OpenPGP. See
+// http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-14
+var (
+ HashById = map[uint8]Hash{
+ SHA256.Id(): SHA256,
+ SHA384.Id(): SHA384,
+ SHA512.Id(): SHA512,
+ SHA224.Id(): SHA224,
+ SHA3_256.Id(): SHA3_256,
+ SHA3_512.Id(): SHA3_512,
+ }
+)
+
+// cryptoHash contains pairs relating OpenPGP's hash identifier with
+// Go's crypto.Hash type. See RFC 4880, section 9.4.
+type cryptoHash struct {
+ id uint8
+ crypto.Hash
+}
+
+// Id returns the algorithm ID, as a byte, of cryptoHash.
+func (h cryptoHash) Id() uint8 {
+ return h.id
+}
+
+var hashNames = map[uint8]string{
+ SHA256.Id(): "SHA256",
+ SHA384.Id(): "SHA384",
+ SHA512.Id(): "SHA512",
+ SHA224.Id(): "SHA224",
+ SHA3_256.Id(): "SHA3-256",
+ SHA3_512.Id(): "SHA3-512",
+}
+
+func (h cryptoHash) String() string {
+ s, ok := hashNames[h.id]
+ if !ok {
+ panic(fmt.Sprintf("Unsupported hash function %d", h.id))
+ }
+ return s
+}
+
+// HashIdToHash returns a crypto.Hash which corresponds to the given OpenPGP
+// hash id.
+func HashIdToHash(id byte) (h crypto.Hash, ok bool) {
+ if hash, ok := HashById[id]; ok {
+ return hash.HashFunc(), true
+ }
+ return 0, false
+}
+
+// HashIdToHashWithSha1 returns a crypto.Hash which corresponds to the given OpenPGP
+// hash id, allowing sha1.
+func HashIdToHashWithSha1(id byte) (h crypto.Hash, ok bool) {
+ if hash, ok := HashById[id]; ok {
+ return hash.HashFunc(), true
+ }
+
+ if id == SHA1.Id() {
+ return SHA1.HashFunc(), true
+ }
+
+ return 0, false
+}
+
+// HashIdToString returns the name of the hash function corresponding to the
+// given OpenPGP hash id.
+func HashIdToString(id byte) (name string, ok bool) {
+ if hash, ok := HashById[id]; ok {
+ return hash.String(), true
+ }
+ return "", false
+}
+
+// HashToHashId returns an OpenPGP hash id which corresponds the given Hash.
+func HashToHashId(h crypto.Hash) (id byte, ok bool) {
+ for id, hash := range HashById {
+ if hash.HashFunc() == h {
+ return id, true
+ }
+ }
+
+ return 0, false
+}
+
+// HashToHashIdWithSha1 returns an OpenPGP hash id which corresponds the given Hash,
+// allowing instances of SHA1
+func HashToHashIdWithSha1(h crypto.Hash) (id byte, ok bool) {
+ for id, hash := range HashById {
+ if hash.HashFunc() == h {
+ return id, true
+ }
+ }
+
+ if h == SHA1.HashFunc() {
+ return SHA1.Id(), true
+ }
+
+ return 0, false
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.go
new file mode 100644
index 0000000000..e047b3b3bd
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.go
@@ -0,0 +1,177 @@
+// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA.
+package ecc
+
+import (
+ "crypto/subtle"
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ x25519lib "github.com/cloudflare/circl/dh/x25519"
+)
+
+type curve25519 struct{}
+
+func NewCurve25519() *curve25519 {
+ return &curve25519{}
+}
+
+func (c *curve25519) GetCurveName() string {
+ return "curve25519"
+}
+
+// MarshalBytePoint encodes the public point from native format, adding the prefix.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6
+func (c *curve25519) MarshalBytePoint(point []byte) []byte {
+ return append([]byte{0x40}, point...)
+}
+
+// UnmarshalBytePoint decodes the public point to native format, removing the prefix.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6
+func (c *curve25519) UnmarshalBytePoint(point []byte) []byte {
+ if len(point) != x25519lib.Size+1 {
+ return nil
+ }
+
+ // Remove prefix
+ return point[1:]
+}
+
+// MarshalByteSecret encodes the secret scalar from native format.
+// Note that the EC secret scalar differs from the definition of public keys in
+// [Curve25519] in two ways: (1) the byte-ordering is big-endian, which is
+// more uniform with how big integers are represented in OpenPGP, and (2) the
+// leading zeros are truncated.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6.1.1
+// Note that leading zero bytes are stripped later when encoding as an MPI.
+func (c *curve25519) MarshalByteSecret(secret []byte) []byte {
+ d := make([]byte, x25519lib.Size)
+ copyReversed(d, secret)
+
+ // The following ensures that the private key is a number of the form
+ // 2^{254} + 8 * [0, 2^{251}), in order to avoid the small subgroup of
+ // the curve.
+ //
+ // This masking is done internally in the underlying lib and so is unnecessary
+ // for security, but OpenPGP implementations require that private keys be
+ // pre-masked.
+ d[0] &= 127
+ d[0] |= 64
+ d[31] &= 248
+
+ return d
+}
+
+// UnmarshalByteSecret decodes the secret scalar from native format.
+// Note that the EC secret scalar differs from the definition of public keys in
+// [Curve25519] in two ways: (1) the byte-ordering is big-endian, which is
+// more uniform with how big integers are represented in OpenPGP, and (2) the
+// leading zeros are truncated.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6.1.1
+func (c *curve25519) UnmarshalByteSecret(d []byte) []byte {
+ if len(d) > x25519lib.Size {
+ return nil
+ }
+
+ // Ensure truncated leading bytes are re-added
+ secret := make([]byte, x25519lib.Size)
+ copyReversed(secret, d)
+
+ return secret
+}
+
+// generateKeyPairBytes Generates a private-public key-pair.
+// 'priv' is a private key; a little-endian scalar belonging to the set
+// 2^{254} + 8 * [0, 2^{251}), in order to avoid the small subgroup of the
+// curve. 'pub' is simply 'priv' * G where G is the base point.
+// See https://cr.yp.to/ecdh.html and RFC7748, sec 5.
+func (c *curve25519) generateKeyPairBytes(rand io.Reader) (priv, pub x25519lib.Key, err error) {
+ _, err = io.ReadFull(rand, priv[:])
+ if err != nil {
+ return
+ }
+
+ x25519lib.KeyGen(&pub, &priv)
+ return
+}
+
+func (c *curve25519) GenerateECDH(rand io.Reader) (point []byte, secret []byte, err error) {
+ priv, pub, err := c.generateKeyPairBytes(rand)
+ if err != nil {
+ return
+ }
+
+ return pub[:], priv[:], nil
+}
+
+func (c *genericCurve) MaskSecret(secret []byte) []byte {
+ return secret
+}
+
+func (c *curve25519) Encaps(rand io.Reader, point []byte) (ephemeral, sharedSecret []byte, err error) {
+ // RFC6637 §8: "Generate an ephemeral key pair {v, V=vG}"
+ // ephemeralPrivate corresponds to `v`.
+ // ephemeralPublic corresponds to `V`.
+ ephemeralPrivate, ephemeralPublic, err := c.generateKeyPairBytes(rand)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ // RFC6637 §8: "Obtain the authenticated recipient public key R"
+ // pubKey corresponds to `R`.
+ var pubKey x25519lib.Key
+ copy(pubKey[:], point)
+
+ // RFC6637 §8: "Compute the shared point S = vR"
+ // "VB = convert point V to the octet string"
+ // sharedPoint corresponds to `VB`.
+ var sharedPoint x25519lib.Key
+ ok := x25519lib.Shared(&sharedPoint, &ephemeralPrivate, &pubKey)
+ if !ok {
+ return nil, nil, errors.KeyInvalidError("ecc: the public key is a low order point")
+ }
+
+ return ephemeralPublic[:], sharedPoint[:], nil
+}
+
+func (c *curve25519) Decaps(vsG, secret []byte) (sharedSecret []byte, err error) {
+ var ephemeralPublic, decodedPrivate, sharedPoint x25519lib.Key
+ // RFC6637 §8: "The decryption is the inverse of the method given."
+ // All quoted descriptions in comments below describe encryption, and
+ // the reverse is performed.
+ // vsG corresponds to `VB` in RFC6637 §8 .
+
+ // RFC6637 §8: "VB = convert point V to the octet string"
+ copy(ephemeralPublic[:], vsG)
+
+ // decodedPrivate corresponds to `r` in RFC6637 §8 .
+ copy(decodedPrivate[:], secret)
+
+ // RFC6637 §8: "Note that the recipient obtains the shared secret by calculating
+ // S = rV = rvG, where (r,R) is the recipient's key pair."
+ // sharedPoint corresponds to `S`.
+ ok := x25519lib.Shared(&sharedPoint, &decodedPrivate, &ephemeralPublic)
+ if !ok {
+ return nil, errors.KeyInvalidError("ecc: the public key is a low order point")
+ }
+
+ return sharedPoint[:], nil
+}
+
+func (c *curve25519) ValidateECDH(point []byte, secret []byte) (err error) {
+ var pk, sk x25519lib.Key
+ copy(sk[:], secret)
+ x25519lib.KeyGen(&pk, &sk)
+
+ if subtle.ConstantTimeCompare(point, pk[:]) == 0 {
+ return errors.KeyInvalidError("ecc: invalid curve25519 public point")
+ }
+
+ return nil
+}
+
+func copyReversed(out []byte, in []byte) {
+ l := len(in)
+ for i := 0; i < l; i++ {
+ out[i] = in[l-i-1]
+ }
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve_info.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve_info.go
new file mode 100644
index 0000000000..0da2d0d852
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve_info.go
@@ -0,0 +1,143 @@
+// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA.
+package ecc
+
+import (
+ "bytes"
+ "crypto/elliptic"
+
+ "github.com/ProtonMail/go-crypto/bitcurves"
+ "github.com/ProtonMail/go-crypto/brainpool"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/encoding"
+)
+
+const Curve25519GenName = "Curve25519"
+
+type CurveInfo struct {
+ GenName string
+ Oid *encoding.OID
+ Curve Curve
+}
+
+var Curves = []CurveInfo{
+ {
+ // NIST P-256
+ GenName: "P256",
+ Oid: encoding.NewOID([]byte{0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07}),
+ Curve: NewGenericCurve(elliptic.P256()),
+ },
+ {
+ // NIST P-384
+ GenName: "P384",
+ Oid: encoding.NewOID([]byte{0x2B, 0x81, 0x04, 0x00, 0x22}),
+ Curve: NewGenericCurve(elliptic.P384()),
+ },
+ {
+ // NIST P-521
+ GenName: "P521",
+ Oid: encoding.NewOID([]byte{0x2B, 0x81, 0x04, 0x00, 0x23}),
+ Curve: NewGenericCurve(elliptic.P521()),
+ },
+ {
+ // SecP256k1
+ GenName: "SecP256k1",
+ Oid: encoding.NewOID([]byte{0x2B, 0x81, 0x04, 0x00, 0x0A}),
+ Curve: NewGenericCurve(bitcurves.S256()),
+ },
+ {
+ // Curve25519
+ GenName: Curve25519GenName,
+ Oid: encoding.NewOID([]byte{0x2B, 0x06, 0x01, 0x04, 0x01, 0x97, 0x55, 0x01, 0x05, 0x01}),
+ Curve: NewCurve25519(),
+ },
+ {
+ // x448
+ GenName: "Curve448",
+ Oid: encoding.NewOID([]byte{0x2B, 0x65, 0x6F}),
+ Curve: NewX448(),
+ },
+ {
+ // Ed25519
+ GenName: Curve25519GenName,
+ Oid: encoding.NewOID([]byte{0x2B, 0x06, 0x01, 0x04, 0x01, 0xDA, 0x47, 0x0F, 0x01}),
+ Curve: NewEd25519(),
+ },
+ {
+ // Ed448
+ GenName: "Curve448",
+ Oid: encoding.NewOID([]byte{0x2B, 0x65, 0x71}),
+ Curve: NewEd448(),
+ },
+ {
+ // BrainpoolP256r1
+ GenName: "BrainpoolP256",
+ Oid: encoding.NewOID([]byte{0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x07}),
+ Curve: NewGenericCurve(brainpool.P256r1()),
+ },
+ {
+ // BrainpoolP384r1
+ GenName: "BrainpoolP384",
+ Oid: encoding.NewOID([]byte{0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0B}),
+ Curve: NewGenericCurve(brainpool.P384r1()),
+ },
+ {
+ // BrainpoolP512r1
+ GenName: "BrainpoolP512",
+ Oid: encoding.NewOID([]byte{0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0D}),
+ Curve: NewGenericCurve(brainpool.P512r1()),
+ },
+}
+
+func FindByCurve(curve Curve) *CurveInfo {
+ for _, curveInfo := range Curves {
+ if curveInfo.Curve.GetCurveName() == curve.GetCurveName() {
+ return &curveInfo
+ }
+ }
+ return nil
+}
+
+func FindByOid(oid encoding.Field) *CurveInfo {
+ var rawBytes = oid.Bytes()
+ for _, curveInfo := range Curves {
+ if bytes.Equal(curveInfo.Oid.Bytes(), rawBytes) {
+ return &curveInfo
+ }
+ }
+ return nil
+}
+
+func FindEdDSAByGenName(curveGenName string) EdDSACurve {
+ for _, curveInfo := range Curves {
+ if curveInfo.GenName == curveGenName {
+ curve, ok := curveInfo.Curve.(EdDSACurve)
+ if ok {
+ return curve
+ }
+ }
+ }
+ return nil
+}
+
+func FindECDSAByGenName(curveGenName string) ECDSACurve {
+ for _, curveInfo := range Curves {
+ if curveInfo.GenName == curveGenName {
+ curve, ok := curveInfo.Curve.(ECDSACurve)
+ if ok {
+ return curve
+ }
+ }
+ }
+ return nil
+}
+
+func FindECDHByGenName(curveGenName string) ECDHCurve {
+ for _, curveInfo := range Curves {
+ if curveInfo.GenName == curveGenName {
+ curve, ok := curveInfo.Curve.(ECDHCurve)
+ if ok {
+ return curve
+ }
+ }
+ }
+ return nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curves.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curves.go
new file mode 100644
index 0000000000..5ed9c93b3d
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curves.go
@@ -0,0 +1,48 @@
+// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA.
+package ecc
+
+import (
+ "io"
+ "math/big"
+)
+
+type Curve interface {
+ GetCurveName() string
+}
+
+type ECDSACurve interface {
+ Curve
+ MarshalIntegerPoint(x, y *big.Int) []byte
+ UnmarshalIntegerPoint([]byte) (x, y *big.Int)
+ MarshalIntegerSecret(d *big.Int) []byte
+ UnmarshalIntegerSecret(d []byte) *big.Int
+ GenerateECDSA(rand io.Reader) (x, y, secret *big.Int, err error)
+ Sign(rand io.Reader, x, y, d *big.Int, hash []byte) (r, s *big.Int, err error)
+ Verify(x, y *big.Int, hash []byte, r, s *big.Int) bool
+ ValidateECDSA(x, y *big.Int, secret []byte) error
+}
+
+type EdDSACurve interface {
+ Curve
+ MarshalBytePoint(x []byte) []byte
+ UnmarshalBytePoint([]byte) (x []byte)
+ MarshalByteSecret(d []byte) []byte
+ UnmarshalByteSecret(d []byte) []byte
+ MarshalSignature(sig []byte) (r, s []byte)
+ UnmarshalSignature(r, s []byte) (sig []byte)
+ GenerateEdDSA(rand io.Reader) (pub, priv []byte, err error)
+ Sign(publicKey, privateKey, message []byte) (sig []byte, err error)
+ Verify(publicKey, message, sig []byte) bool
+ ValidateEdDSA(publicKey, privateKey []byte) (err error)
+}
+type ECDHCurve interface {
+ Curve
+ MarshalBytePoint([]byte) (encoded []byte)
+ UnmarshalBytePoint(encoded []byte) []byte
+ MarshalByteSecret(d []byte) []byte
+ UnmarshalByteSecret(d []byte) []byte
+ GenerateECDH(rand io.Reader) (point []byte, secret []byte, err error)
+ Encaps(rand io.Reader, point []byte) (ephemeral, sharedSecret []byte, err error)
+ Decaps(ephemeral, secret []byte) (sharedSecret []byte, err error)
+ ValidateECDH(public []byte, secret []byte) error
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed25519.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed25519.go
new file mode 100644
index 0000000000..5a4c3a8596
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed25519.go
@@ -0,0 +1,120 @@
+// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA.
+package ecc
+
+import (
+ "bytes"
+ "crypto/subtle"
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ ed25519lib "github.com/cloudflare/circl/sign/ed25519"
+)
+
+const ed25519Size = 32
+
+type ed25519 struct{}
+
+func NewEd25519() *ed25519 {
+ return &ed25519{}
+}
+
+func (c *ed25519) GetCurveName() string {
+ return "ed25519"
+}
+
+// MarshalBytePoint encodes the public point from native format, adding the prefix.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5
+func (c *ed25519) MarshalBytePoint(x []byte) []byte {
+ return append([]byte{0x40}, x...)
+}
+
+// UnmarshalBytePoint decodes a point from prefixed format to native.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5
+func (c *ed25519) UnmarshalBytePoint(point []byte) (x []byte) {
+ if len(point) != ed25519lib.PublicKeySize+1 {
+ return nil
+ }
+
+ // Return unprefixed
+ return point[1:]
+}
+
+// MarshalByteSecret encodes a scalar in native format.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5
+func (c *ed25519) MarshalByteSecret(d []byte) []byte {
+ return d
+}
+
+// UnmarshalByteSecret decodes a scalar in native format and re-adds the stripped leading zeroes
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5
+func (c *ed25519) UnmarshalByteSecret(s []byte) (d []byte) {
+ if len(s) > ed25519lib.SeedSize {
+ return nil
+ }
+
+ // Handle stripped leading zeroes
+ d = make([]byte, ed25519lib.SeedSize)
+ copy(d[ed25519lib.SeedSize-len(s):], s)
+ return
+}
+
+// MarshalSignature splits a signature in R and S.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.2.3.3.1
+func (c *ed25519) MarshalSignature(sig []byte) (r, s []byte) {
+ return sig[:ed25519Size], sig[ed25519Size:]
+}
+
+// UnmarshalSignature decodes R and S in the native format, re-adding the stripped leading zeroes
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.2.3.3.1
+func (c *ed25519) UnmarshalSignature(r, s []byte) (sig []byte) {
+ // Check size
+ if len(r) > 32 || len(s) > 32 {
+ return nil
+ }
+
+ sig = make([]byte, ed25519lib.SignatureSize)
+
+ // Handle stripped leading zeroes
+ copy(sig[ed25519Size-len(r):ed25519Size], r)
+ copy(sig[ed25519lib.SignatureSize-len(s):], s)
+ return sig
+}
+
+func (c *ed25519) GenerateEdDSA(rand io.Reader) (pub, priv []byte, err error) {
+ pk, sk, err := ed25519lib.GenerateKey(rand)
+
+ if err != nil {
+ return nil, nil, err
+ }
+
+ return pk, sk[:ed25519lib.SeedSize], nil
+}
+
+func getEd25519Sk(publicKey, privateKey []byte) ed25519lib.PrivateKey {
+ privateKeyCap, privateKeyLen, publicKeyLen := cap(privateKey), len(privateKey), len(publicKey)
+
+ if privateKeyCap >= privateKeyLen+publicKeyLen &&
+ bytes.Equal(privateKey[privateKeyLen:privateKeyLen+publicKeyLen], publicKey) {
+ return privateKey[:privateKeyLen+publicKeyLen]
+ }
+
+ return append(privateKey[:privateKeyLen:privateKeyLen], publicKey...)
+}
+
+func (c *ed25519) Sign(publicKey, privateKey, message []byte) (sig []byte, err error) {
+ sig = ed25519lib.Sign(getEd25519Sk(publicKey, privateKey), message)
+ return sig, nil
+}
+
+func (c *ed25519) Verify(publicKey, message, sig []byte) bool {
+ return ed25519lib.Verify(publicKey, message, sig)
+}
+
+func (c *ed25519) ValidateEdDSA(publicKey, privateKey []byte) (err error) {
+ priv := getEd25519Sk(publicKey, privateKey)
+ expectedPriv := ed25519lib.NewKeyFromSeed(priv.Seed())
+ if subtle.ConstantTimeCompare(priv, expectedPriv) == 0 {
+ return errors.KeyInvalidError("ecc: invalid ed25519 secret")
+ }
+ return nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed448.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed448.go
new file mode 100644
index 0000000000..b6edda7480
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed448.go
@@ -0,0 +1,119 @@
+// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA.
+package ecc
+
+import (
+ "bytes"
+ "crypto/subtle"
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ ed448lib "github.com/cloudflare/circl/sign/ed448"
+)
+
+type ed448 struct{}
+
+func NewEd448() *ed448 {
+ return &ed448{}
+}
+
+func (c *ed448) GetCurveName() string {
+ return "ed448"
+}
+
+// MarshalBytePoint encodes the public point from native format, adding the prefix.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5
+func (c *ed448) MarshalBytePoint(x []byte) []byte {
+ // Return prefixed
+ return append([]byte{0x40}, x...)
+}
+
+// UnmarshalBytePoint decodes a point from prefixed format to native.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5
+func (c *ed448) UnmarshalBytePoint(point []byte) (x []byte) {
+ if len(point) != ed448lib.PublicKeySize+1 {
+ return nil
+ }
+
+ // Strip prefix
+ return point[1:]
+}
+
+// MarshalByteSecret encoded a scalar from native format to prefixed.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5
+func (c *ed448) MarshalByteSecret(d []byte) []byte {
+ // Return prefixed
+ return append([]byte{0x40}, d...)
+}
+
+// UnmarshalByteSecret decodes a scalar from prefixed format to native.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5
+func (c *ed448) UnmarshalByteSecret(s []byte) (d []byte) {
+ // Check prefixed size
+ if len(s) != ed448lib.SeedSize+1 {
+ return nil
+ }
+
+ // Strip prefix
+ return s[1:]
+}
+
+// MarshalSignature splits a signature in R and S, where R is in prefixed native format and
+// S is an MPI with value zero.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.2.3.3.2
+func (c *ed448) MarshalSignature(sig []byte) (r, s []byte) {
+ return append([]byte{0x40}, sig...), []byte{}
+}
+
+// UnmarshalSignature decodes R and S in the native format. Only R is used, in prefixed native format.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.2.3.3.2
+func (c *ed448) UnmarshalSignature(r, s []byte) (sig []byte) {
+ if len(r) != ed448lib.SignatureSize+1 {
+ return nil
+ }
+
+ return r[1:]
+}
+
+func (c *ed448) GenerateEdDSA(rand io.Reader) (pub, priv []byte, err error) {
+ pk, sk, err := ed448lib.GenerateKey(rand)
+
+ if err != nil {
+ return nil, nil, err
+ }
+
+ return pk, sk[:ed448lib.SeedSize], nil
+}
+
+func getEd448Sk(publicKey, privateKey []byte) ed448lib.PrivateKey {
+ privateKeyCap, privateKeyLen, publicKeyLen := cap(privateKey), len(privateKey), len(publicKey)
+
+ if privateKeyCap >= privateKeyLen+publicKeyLen &&
+ bytes.Equal(privateKey[privateKeyLen:privateKeyLen+publicKeyLen], publicKey) {
+ return privateKey[:privateKeyLen+publicKeyLen]
+ }
+
+ return append(privateKey[:privateKeyLen:privateKeyLen], publicKey...)
+}
+
+func (c *ed448) Sign(publicKey, privateKey, message []byte) (sig []byte, err error) {
+ // Ed448 is used with the empty string as a context string.
+ // See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-13.7
+ sig = ed448lib.Sign(getEd448Sk(publicKey, privateKey), message, "")
+
+ return sig, nil
+}
+
+func (c *ed448) Verify(publicKey, message, sig []byte) bool {
+ // Ed448 is used with the empty string as a context string.
+ // See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-13.7
+ return ed448lib.Verify(publicKey, message, sig, "")
+}
+
+func (c *ed448) ValidateEdDSA(publicKey, privateKey []byte) (err error) {
+ priv := getEd448Sk(publicKey, privateKey)
+ expectedPriv := ed448lib.NewKeyFromSeed(priv.Seed())
+ if subtle.ConstantTimeCompare(priv, expectedPriv) == 0 {
+ return errors.KeyInvalidError("ecc: invalid ed448 secret")
+ }
+ return nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/generic.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/generic.go
new file mode 100644
index 0000000000..1408e11203
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/generic.go
@@ -0,0 +1,152 @@
+// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA.
+package ecc
+
+import (
+ "crypto/ecdsa"
+ "crypto/elliptic"
+ "fmt"
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "io"
+ "math/big"
+)
+
+type genericCurve struct {
+ Curve elliptic.Curve
+}
+
+func NewGenericCurve(c elliptic.Curve) *genericCurve {
+ return &genericCurve{
+ Curve: c,
+ }
+}
+
+func (c *genericCurve) GetCurveName() string {
+ return c.Curve.Params().Name
+}
+
+func (c *genericCurve) MarshalBytePoint(point []byte) []byte {
+ return point
+}
+
+func (c *genericCurve) UnmarshalBytePoint(point []byte) []byte {
+ return point
+}
+
+func (c *genericCurve) MarshalIntegerPoint(x, y *big.Int) []byte {
+ return elliptic.Marshal(c.Curve, x, y)
+}
+
+func (c *genericCurve) UnmarshalIntegerPoint(point []byte) (x, y *big.Int) {
+ return elliptic.Unmarshal(c.Curve, point)
+}
+
+func (c *genericCurve) MarshalByteSecret(d []byte) []byte {
+ return d
+}
+
+func (c *genericCurve) UnmarshalByteSecret(d []byte) []byte {
+ return d
+}
+
+func (c *genericCurve) MarshalIntegerSecret(d *big.Int) []byte {
+ return d.Bytes()
+}
+
+func (c *genericCurve) UnmarshalIntegerSecret(d []byte) *big.Int {
+ return new(big.Int).SetBytes(d)
+}
+
+func (c *genericCurve) GenerateECDH(rand io.Reader) (point, secret []byte, err error) {
+ secret, x, y, err := elliptic.GenerateKey(c.Curve, rand)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ point = elliptic.Marshal(c.Curve, x, y)
+ return point, secret, nil
+}
+
+func (c *genericCurve) GenerateECDSA(rand io.Reader) (x, y, secret *big.Int, err error) {
+ priv, err := ecdsa.GenerateKey(c.Curve, rand)
+ if err != nil {
+ return
+ }
+
+ return priv.X, priv.Y, priv.D, nil
+}
+
+func (c *genericCurve) Encaps(rand io.Reader, point []byte) (ephemeral, sharedSecret []byte, err error) {
+ xP, yP := elliptic.Unmarshal(c.Curve, point)
+ if xP == nil {
+ return nil, nil, errors.KeyInvalidError(fmt.Sprintf("ecc (%s): invalid point", c.Curve.Params().Name))
+ }
+
+ d, x, y, err := elliptic.GenerateKey(c.Curve, rand)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ vsG := elliptic.Marshal(c.Curve, x, y)
+ zbBig, _ := c.Curve.ScalarMult(xP, yP, d)
+
+ byteLen := (c.Curve.Params().BitSize + 7) >> 3
+ zb := make([]byte, byteLen)
+ zbBytes := zbBig.Bytes()
+ copy(zb[byteLen-len(zbBytes):], zbBytes)
+
+ return vsG, zb, nil
+}
+
+func (c *genericCurve) Decaps(ephemeral, secret []byte) (sharedSecret []byte, err error) {
+ x, y := elliptic.Unmarshal(c.Curve, ephemeral)
+ if x == nil {
+ return nil, errors.KeyInvalidError(fmt.Sprintf("ecc (%s): invalid point", c.Curve.Params().Name))
+ }
+ zbBig, _ := c.Curve.ScalarMult(x, y, secret)
+ byteLen := (c.Curve.Params().BitSize + 7) >> 3
+ zb := make([]byte, byteLen)
+ zbBytes := zbBig.Bytes()
+ copy(zb[byteLen-len(zbBytes):], zbBytes)
+
+ return zb, nil
+}
+
+func (c *genericCurve) Sign(rand io.Reader, x, y, d *big.Int, hash []byte) (r, s *big.Int, err error) {
+ priv := &ecdsa.PrivateKey{D: d, PublicKey: ecdsa.PublicKey{X: x, Y: y, Curve: c.Curve}}
+ return ecdsa.Sign(rand, priv, hash)
+}
+
+func (c *genericCurve) Verify(x, y *big.Int, hash []byte, r, s *big.Int) bool {
+ pub := &ecdsa.PublicKey{X: x, Y: y, Curve: c.Curve}
+ return ecdsa.Verify(pub, hash, r, s)
+}
+
+func (c *genericCurve) validate(xP, yP *big.Int, secret []byte) error {
+ // the public point should not be at infinity (0,0)
+ zero := new(big.Int)
+ if xP.Cmp(zero) == 0 && yP.Cmp(zero) == 0 {
+ return errors.KeyInvalidError(fmt.Sprintf("ecc (%s): infinity point", c.Curve.Params().Name))
+ }
+
+ // re-derive the public point Q' = (X,Y) = dG
+ // to compare to declared Q in public key
+ expectedX, expectedY := c.Curve.ScalarBaseMult(secret)
+ if xP.Cmp(expectedX) != 0 || yP.Cmp(expectedY) != 0 {
+ return errors.KeyInvalidError(fmt.Sprintf("ecc (%s): invalid point", c.Curve.Params().Name))
+ }
+
+ return nil
+}
+
+func (c *genericCurve) ValidateECDSA(xP, yP *big.Int, secret []byte) error {
+ return c.validate(xP, yP, secret)
+}
+
+func (c *genericCurve) ValidateECDH(point []byte, secret []byte) error {
+ xP, yP := elliptic.Unmarshal(c.Curve, point)
+ if xP == nil {
+ return errors.KeyInvalidError(fmt.Sprintf("ecc (%s): invalid point", c.Curve.Params().Name))
+ }
+
+ return c.validate(xP, yP, secret)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/x448.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/x448.go
new file mode 100644
index 0000000000..df04262e9e
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/x448.go
@@ -0,0 +1,107 @@
+// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA.
+package ecc
+
+import (
+ "crypto/subtle"
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ x448lib "github.com/cloudflare/circl/dh/x448"
+)
+
+type x448 struct{}
+
+func NewX448() *x448 {
+ return &x448{}
+}
+
+func (c *x448) GetCurveName() string {
+ return "x448"
+}
+
+// MarshalBytePoint encodes the public point from native format, adding the prefix.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6
+func (c *x448) MarshalBytePoint(point []byte) []byte {
+ return append([]byte{0x40}, point...)
+}
+
+// UnmarshalBytePoint decodes a point from prefixed format to native.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6
+func (c *x448) UnmarshalBytePoint(point []byte) []byte {
+ if len(point) != x448lib.Size+1 {
+ return nil
+ }
+
+ return point[1:]
+}
+
+// MarshalByteSecret encoded a scalar from native format to prefixed.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6.1.2
+func (c *x448) MarshalByteSecret(d []byte) []byte {
+ return append([]byte{0x40}, d...)
+}
+
+// UnmarshalByteSecret decodes a scalar from prefixed format to native.
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6.1.2
+func (c *x448) UnmarshalByteSecret(d []byte) []byte {
+ if len(d) != x448lib.Size+1 {
+ return nil
+ }
+
+ // Store without prefix
+ return d[1:]
+}
+
+func (c *x448) generateKeyPairBytes(rand io.Reader) (sk, pk x448lib.Key, err error) {
+ if _, err = rand.Read(sk[:]); err != nil {
+ return
+ }
+
+ x448lib.KeyGen(&pk, &sk)
+ return
+}
+
+func (c *x448) GenerateECDH(rand io.Reader) (point []byte, secret []byte, err error) {
+ priv, pub, err := c.generateKeyPairBytes(rand)
+ if err != nil {
+ return
+ }
+
+ return pub[:], priv[:], nil
+}
+
+func (c *x448) Encaps(rand io.Reader, point []byte) (ephemeral, sharedSecret []byte, err error) {
+ var pk, ss x448lib.Key
+ seed, e, err := c.generateKeyPairBytes(rand)
+ if err != nil {
+ return nil, nil, err
+ }
+ copy(pk[:], point)
+ x448lib.Shared(&ss, &seed, &pk)
+
+ return e[:], ss[:], nil
+}
+
+func (c *x448) Decaps(ephemeral, secret []byte) (sharedSecret []byte, err error) {
+ var ss, sk, e x448lib.Key
+
+ copy(sk[:], secret)
+ copy(e[:], ephemeral)
+ x448lib.Shared(&ss, &sk, &e)
+
+ return ss[:], nil
+}
+
+func (c *x448) ValidateECDH(point []byte, secret []byte) error {
+ var sk, pk, expectedPk x448lib.Key
+
+ copy(pk[:], point)
+ copy(sk[:], secret)
+ x448lib.KeyGen(&expectedPk, &sk)
+
+ if subtle.ConstantTimeCompare(expectedPk[:], pk[:]) == 0 {
+ return errors.KeyInvalidError("ecc: invalid curve25519 public point")
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/encoding.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/encoding.go
new file mode 100644
index 0000000000..6c921481b7
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/encoding.go
@@ -0,0 +1,27 @@
+// 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 encoding implements openpgp packet field encodings as specified in
+// RFC 4880 and 6637.
+package encoding
+
+import "io"
+
+// Field is an encoded field of an openpgp packet.
+type Field interface {
+ // Bytes returns the decoded data.
+ Bytes() []byte
+
+ // BitLength is the size in bits of the decoded data.
+ BitLength() uint16
+
+ // EncodedBytes returns the encoded data.
+ EncodedBytes() []byte
+
+ // EncodedLength is the size in bytes of the encoded data.
+ EncodedLength() uint16
+
+ // ReadFrom reads the next Field from r.
+ ReadFrom(r io.Reader) (int64, error)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/mpi.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/mpi.go
new file mode 100644
index 0000000000..02e5e695c3
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/mpi.go
@@ -0,0 +1,91 @@
+// 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 encoding
+
+import (
+ "io"
+ "math/big"
+ "math/bits"
+)
+
+// An MPI is used to store the contents of a big integer, along with the bit
+// length that was specified in the original input. This allows the MPI to be
+// reserialized exactly.
+type MPI struct {
+ bytes []byte
+ bitLength uint16
+}
+
+// NewMPI returns a MPI initialized with bytes.
+func NewMPI(bytes []byte) *MPI {
+ for len(bytes) != 0 && bytes[0] == 0 {
+ bytes = bytes[1:]
+ }
+ if len(bytes) == 0 {
+ bitLength := uint16(0)
+ return &MPI{bytes, bitLength}
+ }
+ bitLength := 8*uint16(len(bytes)-1) + uint16(bits.Len8(bytes[0]))
+ return &MPI{bytes, bitLength}
+}
+
+// Bytes returns the decoded data.
+func (m *MPI) Bytes() []byte {
+ return m.bytes
+}
+
+// BitLength is the size in bits of the decoded data.
+func (m *MPI) BitLength() uint16 {
+ return m.bitLength
+}
+
+// EncodedBytes returns the encoded data.
+func (m *MPI) EncodedBytes() []byte {
+ return append([]byte{byte(m.bitLength >> 8), byte(m.bitLength)}, m.bytes...)
+}
+
+// EncodedLength is the size in bytes of the encoded data.
+func (m *MPI) EncodedLength() uint16 {
+ return uint16(2 + len(m.bytes))
+}
+
+// ReadFrom reads into m the next MPI from r.
+func (m *MPI) ReadFrom(r io.Reader) (int64, error) {
+ var buf [2]byte
+ n, err := io.ReadFull(r, buf[0:])
+ if err != nil {
+ if err == io.EOF {
+ err = io.ErrUnexpectedEOF
+ }
+ return int64(n), err
+ }
+
+ m.bitLength = uint16(buf[0])<<8 | uint16(buf[1])
+ m.bytes = make([]byte, (int(m.bitLength)+7)/8)
+
+ nn, err := io.ReadFull(r, m.bytes)
+ if err == io.EOF {
+ err = io.ErrUnexpectedEOF
+ }
+
+ // remove leading zero bytes from malformed GnuPG encoded MPIs:
+ // https://bugs.gnupg.org/gnupg/issue1853
+ // for _, b := range m.bytes {
+ // if b != 0 {
+ // break
+ // }
+ // m.bytes = m.bytes[1:]
+ // m.bitLength -= 8
+ // }
+
+ return int64(n) + int64(nn), err
+}
+
+// SetBig initializes m with the bits from n.
+func (m *MPI) SetBig(n *big.Int) *MPI {
+ m.bytes = n.Bytes()
+ m.bitLength = uint16(n.BitLen())
+ return m
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/oid.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/oid.go
new file mode 100644
index 0000000000..c9df9fe232
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/oid.go
@@ -0,0 +1,88 @@
+// 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 encoding
+
+import (
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+)
+
+// OID is used to store a variable-length field with a one-octet size
+// prefix. See https://tools.ietf.org/html/rfc6637#section-9.
+type OID struct {
+ bytes []byte
+}
+
+const (
+ // maxOID is the maximum number of bytes in a OID.
+ maxOID = 254
+ // reservedOIDLength1 and reservedOIDLength2 are OID lengths that the RFC
+ // specifies are reserved.
+ reservedOIDLength1 = 0
+ reservedOIDLength2 = 0xff
+)
+
+// NewOID returns a OID initialized with bytes.
+func NewOID(bytes []byte) *OID {
+ switch len(bytes) {
+ case reservedOIDLength1, reservedOIDLength2:
+ panic("encoding: NewOID argument length is reserved")
+ default:
+ if len(bytes) > maxOID {
+ panic("encoding: NewOID argument too large")
+ }
+ }
+
+ return &OID{
+ bytes: bytes,
+ }
+}
+
+// Bytes returns the decoded data.
+func (o *OID) Bytes() []byte {
+ return o.bytes
+}
+
+// BitLength is the size in bits of the decoded data.
+func (o *OID) BitLength() uint16 {
+ return uint16(len(o.bytes) * 8)
+}
+
+// EncodedBytes returns the encoded data.
+func (o *OID) EncodedBytes() []byte {
+ return append([]byte{byte(len(o.bytes))}, o.bytes...)
+}
+
+// EncodedLength is the size in bytes of the encoded data.
+func (o *OID) EncodedLength() uint16 {
+ return uint16(1 + len(o.bytes))
+}
+
+// ReadFrom reads into b the next OID from r.
+func (o *OID) ReadFrom(r io.Reader) (int64, error) {
+ var buf [1]byte
+ n, err := io.ReadFull(r, buf[:])
+ if err != nil {
+ if err == io.EOF {
+ err = io.ErrUnexpectedEOF
+ }
+ return int64(n), err
+ }
+
+ switch buf[0] {
+ case reservedOIDLength1, reservedOIDLength2:
+ return int64(n), errors.UnsupportedError("reserved for future extensions")
+ }
+
+ o.bytes = make([]byte, buf[0])
+
+ nn, err := io.ReadFull(r, o.bytes)
+ if err == io.EOF {
+ err = io.ErrUnexpectedEOF
+ }
+
+ return int64(n) + int64(nn), err
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/key_generation.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/key_generation.go
new file mode 100644
index 0000000000..77213f66be
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/key_generation.go
@@ -0,0 +1,456 @@
+// 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 openpgp
+
+import (
+ "crypto"
+ "crypto/rand"
+ "crypto/rsa"
+ goerrors "errors"
+ "io"
+ "math/big"
+ "time"
+
+ "github.com/ProtonMail/go-crypto/openpgp/ecdh"
+ "github.com/ProtonMail/go-crypto/openpgp/ecdsa"
+ "github.com/ProtonMail/go-crypto/openpgp/ed25519"
+ "github.com/ProtonMail/go-crypto/openpgp/ed448"
+ "github.com/ProtonMail/go-crypto/openpgp/eddsa"
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/ecc"
+ "github.com/ProtonMail/go-crypto/openpgp/packet"
+ "github.com/ProtonMail/go-crypto/openpgp/x25519"
+ "github.com/ProtonMail/go-crypto/openpgp/x448"
+)
+
+// NewEntity returns an Entity that contains a fresh RSA/RSA keypair with a
+// single identity composed of the given full name, comment and email, any of
+// which may be empty but must not contain any of "()<>\x00".
+// If config is nil, sensible defaults will be used.
+func NewEntity(name, comment, email string, config *packet.Config) (*Entity, error) {
+ creationTime := config.Now()
+ keyLifetimeSecs := config.KeyLifetime()
+
+ // Generate a primary signing key
+ primaryPrivRaw, err := newSigner(config)
+ if err != nil {
+ return nil, err
+ }
+ primary := packet.NewSignerPrivateKey(creationTime, primaryPrivRaw)
+ if config.V6() {
+ if err := primary.UpgradeToV6(); err != nil {
+ return nil, err
+ }
+ }
+
+ e := &Entity{
+ PrimaryKey: &primary.PublicKey,
+ PrivateKey: primary,
+ Identities: make(map[string]*Identity),
+ Subkeys: []Subkey{},
+ Signatures: []*packet.Signature{},
+ }
+
+ if config.V6() {
+ // In v6 keys algorithm preferences should be stored in direct key signatures
+ selfSignature := createSignaturePacket(&primary.PublicKey, packet.SigTypeDirectSignature, config)
+ err = writeKeyProperties(selfSignature, creationTime, keyLifetimeSecs, config)
+ if err != nil {
+ return nil, err
+ }
+ err = selfSignature.SignDirectKeyBinding(&primary.PublicKey, primary, config)
+ if err != nil {
+ return nil, err
+ }
+ e.Signatures = append(e.Signatures, selfSignature)
+ e.SelfSignature = selfSignature
+ }
+
+ err = e.addUserId(name, comment, email, config, creationTime, keyLifetimeSecs, !config.V6())
+ if err != nil {
+ return nil, err
+ }
+
+ // NOTE: No key expiry here, but we will not return this subkey in EncryptionKey()
+ // if the primary/master key has expired.
+ err = e.addEncryptionSubkey(config, creationTime, 0)
+ if err != nil {
+ return nil, err
+ }
+
+ return e, nil
+}
+
+func (t *Entity) AddUserId(name, comment, email string, config *packet.Config) error {
+ creationTime := config.Now()
+ keyLifetimeSecs := config.KeyLifetime()
+ return t.addUserId(name, comment, email, config, creationTime, keyLifetimeSecs, !config.V6())
+}
+
+func writeKeyProperties(selfSignature *packet.Signature, creationTime time.Time, keyLifetimeSecs uint32, config *packet.Config) error {
+ advertiseAead := config.AEAD() != nil
+
+ selfSignature.CreationTime = creationTime
+ selfSignature.KeyLifetimeSecs = &keyLifetimeSecs
+ selfSignature.FlagsValid = true
+ selfSignature.FlagSign = true
+ selfSignature.FlagCertify = true
+ selfSignature.SEIPDv1 = true // true by default, see 5.8 vs. 5.14
+ selfSignature.SEIPDv2 = advertiseAead
+
+ // Set the PreferredHash for the SelfSignature from the packet.Config.
+ // If it is not the must-implement algorithm from rfc4880bis, append that.
+ hash, ok := algorithm.HashToHashId(config.Hash())
+ if !ok {
+ return errors.UnsupportedError("unsupported preferred hash function")
+ }
+
+ selfSignature.PreferredHash = []uint8{hash}
+ if config.Hash() != crypto.SHA256 {
+ selfSignature.PreferredHash = append(selfSignature.PreferredHash, hashToHashId(crypto.SHA256))
+ }
+
+ // Likewise for DefaultCipher.
+ selfSignature.PreferredSymmetric = []uint8{uint8(config.Cipher())}
+ if config.Cipher() != packet.CipherAES128 {
+ selfSignature.PreferredSymmetric = append(selfSignature.PreferredSymmetric, uint8(packet.CipherAES128))
+ }
+
+ // We set CompressionNone as the preferred compression algorithm because
+ // of compression side channel attacks, then append the configured
+ // DefaultCompressionAlgo if any is set (to signal support for cases
+ // where the application knows that using compression is safe).
+ selfSignature.PreferredCompression = []uint8{uint8(packet.CompressionNone)}
+ if config.Compression() != packet.CompressionNone {
+ selfSignature.PreferredCompression = append(selfSignature.PreferredCompression, uint8(config.Compression()))
+ }
+
+ if advertiseAead {
+ // Get the preferred AEAD mode from the packet.Config.
+ // If it is not the must-implement algorithm from rfc9580, append that.
+ modes := []uint8{uint8(config.AEAD().Mode())}
+ if config.AEAD().Mode() != packet.AEADModeOCB {
+ modes = append(modes, uint8(packet.AEADModeOCB))
+ }
+
+ // For preferred (AES256, GCM), we'll generate (AES256, GCM), (AES256, OCB), (AES128, GCM), (AES128, OCB)
+ for _, cipher := range selfSignature.PreferredSymmetric {
+ for _, mode := range modes {
+ selfSignature.PreferredCipherSuites = append(selfSignature.PreferredCipherSuites, [2]uint8{cipher, mode})
+ }
+ }
+ }
+ return nil
+}
+
+func (t *Entity) addUserId(name, comment, email string, config *packet.Config, creationTime time.Time, keyLifetimeSecs uint32, writeProperties bool) error {
+ uid := packet.NewUserId(name, comment, email)
+ if uid == nil {
+ return errors.InvalidArgumentError("user id field contained invalid characters")
+ }
+
+ if _, ok := t.Identities[uid.Id]; ok {
+ return errors.InvalidArgumentError("user id exist")
+ }
+
+ primary := t.PrivateKey
+ isPrimaryId := len(t.Identities) == 0
+ selfSignature := createSignaturePacket(&primary.PublicKey, packet.SigTypePositiveCert, config)
+ if writeProperties {
+ err := writeKeyProperties(selfSignature, creationTime, keyLifetimeSecs, config)
+ if err != nil {
+ return err
+ }
+ }
+ selfSignature.IsPrimaryId = &isPrimaryId
+
+ // User ID binding signature
+ err := selfSignature.SignUserId(uid.Id, &primary.PublicKey, primary, config)
+ if err != nil {
+ return err
+ }
+ t.Identities[uid.Id] = &Identity{
+ Name: uid.Id,
+ UserId: uid,
+ SelfSignature: selfSignature,
+ Signatures: []*packet.Signature{selfSignature},
+ }
+ return nil
+}
+
+// AddSigningSubkey adds a signing keypair as a subkey to the Entity.
+// If config is nil, sensible defaults will be used.
+func (e *Entity) AddSigningSubkey(config *packet.Config) error {
+ creationTime := config.Now()
+ keyLifetimeSecs := config.KeyLifetime()
+
+ subPrivRaw, err := newSigner(config)
+ if err != nil {
+ return err
+ }
+ sub := packet.NewSignerPrivateKey(creationTime, subPrivRaw)
+ sub.IsSubkey = true
+ if config.V6() {
+ if err := sub.UpgradeToV6(); err != nil {
+ return err
+ }
+ }
+
+ subkey := Subkey{
+ PublicKey: &sub.PublicKey,
+ PrivateKey: sub,
+ }
+ subkey.Sig = createSignaturePacket(e.PrimaryKey, packet.SigTypeSubkeyBinding, config)
+ subkey.Sig.CreationTime = creationTime
+ subkey.Sig.KeyLifetimeSecs = &keyLifetimeSecs
+ subkey.Sig.FlagsValid = true
+ subkey.Sig.FlagSign = true
+ subkey.Sig.EmbeddedSignature = createSignaturePacket(subkey.PublicKey, packet.SigTypePrimaryKeyBinding, config)
+ subkey.Sig.EmbeddedSignature.CreationTime = creationTime
+
+ err = subkey.Sig.EmbeddedSignature.CrossSignKey(subkey.PublicKey, e.PrimaryKey, subkey.PrivateKey, config)
+ if err != nil {
+ return err
+ }
+
+ err = subkey.Sig.SignKey(subkey.PublicKey, e.PrivateKey, config)
+ if err != nil {
+ return err
+ }
+
+ e.Subkeys = append(e.Subkeys, subkey)
+ return nil
+}
+
+// AddEncryptionSubkey adds an encryption keypair as a subkey to the Entity.
+// If config is nil, sensible defaults will be used.
+func (e *Entity) AddEncryptionSubkey(config *packet.Config) error {
+ creationTime := config.Now()
+ keyLifetimeSecs := config.KeyLifetime()
+ return e.addEncryptionSubkey(config, creationTime, keyLifetimeSecs)
+}
+
+func (e *Entity) addEncryptionSubkey(config *packet.Config, creationTime time.Time, keyLifetimeSecs uint32) error {
+ subPrivRaw, err := newDecrypter(config)
+ if err != nil {
+ return err
+ }
+ sub := packet.NewDecrypterPrivateKey(creationTime, subPrivRaw)
+ sub.IsSubkey = true
+ if config.V6() {
+ if err := sub.UpgradeToV6(); err != nil {
+ return err
+ }
+ }
+
+ subkey := Subkey{
+ PublicKey: &sub.PublicKey,
+ PrivateKey: sub,
+ }
+ subkey.Sig = createSignaturePacket(e.PrimaryKey, packet.SigTypeSubkeyBinding, config)
+ subkey.Sig.CreationTime = creationTime
+ subkey.Sig.KeyLifetimeSecs = &keyLifetimeSecs
+ subkey.Sig.FlagsValid = true
+ subkey.Sig.FlagEncryptStorage = true
+ subkey.Sig.FlagEncryptCommunications = true
+
+ err = subkey.Sig.SignKey(subkey.PublicKey, e.PrivateKey, config)
+ if err != nil {
+ return err
+ }
+
+ e.Subkeys = append(e.Subkeys, subkey)
+ return nil
+}
+
+// Generates a signing key
+func newSigner(config *packet.Config) (signer interface{}, err error) {
+ switch config.PublicKeyAlgorithm() {
+ case packet.PubKeyAlgoRSA:
+ bits := config.RSAModulusBits()
+ if bits < 1024 {
+ return nil, errors.InvalidArgumentError("bits must be >= 1024")
+ }
+ if config != nil && len(config.RSAPrimes) >= 2 {
+ primes := config.RSAPrimes[0:2]
+ config.RSAPrimes = config.RSAPrimes[2:]
+ return generateRSAKeyWithPrimes(config.Random(), 2, bits, primes)
+ }
+ return rsa.GenerateKey(config.Random(), bits)
+ case packet.PubKeyAlgoEdDSA:
+ if config.V6() {
+ // Implementations MUST NOT accept or generate v6 key material
+ // using the deprecated OIDs.
+ return nil, errors.InvalidArgumentError("EdDSALegacy cannot be used for v6 keys")
+ }
+ curve := ecc.FindEdDSAByGenName(string(config.CurveName()))
+ if curve == nil {
+ return nil, errors.InvalidArgumentError("unsupported curve")
+ }
+
+ priv, err := eddsa.GenerateKey(config.Random(), curve)
+ if err != nil {
+ return nil, err
+ }
+ return priv, nil
+ case packet.PubKeyAlgoECDSA:
+ curve := ecc.FindECDSAByGenName(string(config.CurveName()))
+ if curve == nil {
+ return nil, errors.InvalidArgumentError("unsupported curve")
+ }
+
+ priv, err := ecdsa.GenerateKey(config.Random(), curve)
+ if err != nil {
+ return nil, err
+ }
+ return priv, nil
+ case packet.PubKeyAlgoEd25519:
+ priv, err := ed25519.GenerateKey(config.Random())
+ if err != nil {
+ return nil, err
+ }
+ return priv, nil
+ case packet.PubKeyAlgoEd448:
+ priv, err := ed448.GenerateKey(config.Random())
+ if err != nil {
+ return nil, err
+ }
+ return priv, nil
+ default:
+ return nil, errors.InvalidArgumentError("unsupported public key algorithm")
+ }
+}
+
+// Generates an encryption/decryption key
+func newDecrypter(config *packet.Config) (decrypter interface{}, err error) {
+ switch config.PublicKeyAlgorithm() {
+ case packet.PubKeyAlgoRSA:
+ bits := config.RSAModulusBits()
+ if bits < 1024 {
+ return nil, errors.InvalidArgumentError("bits must be >= 1024")
+ }
+ if config != nil && len(config.RSAPrimes) >= 2 {
+ primes := config.RSAPrimes[0:2]
+ config.RSAPrimes = config.RSAPrimes[2:]
+ return generateRSAKeyWithPrimes(config.Random(), 2, bits, primes)
+ }
+ return rsa.GenerateKey(config.Random(), bits)
+ case packet.PubKeyAlgoEdDSA, packet.PubKeyAlgoECDSA:
+ fallthrough // When passing EdDSA or ECDSA, we generate an ECDH subkey
+ case packet.PubKeyAlgoECDH:
+ if config.V6() &&
+ (config.CurveName() == packet.Curve25519 ||
+ config.CurveName() == packet.Curve448) {
+ // Implementations MUST NOT accept or generate v6 key material
+ // using the deprecated OIDs.
+ return nil, errors.InvalidArgumentError("ECDH with Curve25519/448 legacy cannot be used for v6 keys")
+ }
+ var kdf = ecdh.KDF{
+ Hash: algorithm.SHA512,
+ Cipher: algorithm.AES256,
+ }
+ curve := ecc.FindECDHByGenName(string(config.CurveName()))
+ if curve == nil {
+ return nil, errors.InvalidArgumentError("unsupported curve")
+ }
+ return ecdh.GenerateKey(config.Random(), curve, kdf)
+ case packet.PubKeyAlgoEd25519, packet.PubKeyAlgoX25519: // When passing Ed25519, we generate an x25519 subkey
+ return x25519.GenerateKey(config.Random())
+ case packet.PubKeyAlgoEd448, packet.PubKeyAlgoX448: // When passing Ed448, we generate an x448 subkey
+ return x448.GenerateKey(config.Random())
+ default:
+ return nil, errors.InvalidArgumentError("unsupported public key algorithm")
+ }
+}
+
+var bigOne = big.NewInt(1)
+
+// generateRSAKeyWithPrimes generates a multi-prime RSA keypair of the
+// given bit size, using the given random source and pre-populated primes.
+func generateRSAKeyWithPrimes(random io.Reader, nprimes int, bits int, prepopulatedPrimes []*big.Int) (*rsa.PrivateKey, error) {
+ priv := new(rsa.PrivateKey)
+ priv.E = 65537
+
+ if nprimes < 2 {
+ return nil, goerrors.New("generateRSAKeyWithPrimes: nprimes must be >= 2")
+ }
+
+ if bits < 1024 {
+ return nil, goerrors.New("generateRSAKeyWithPrimes: bits must be >= 1024")
+ }
+
+ primes := make([]*big.Int, nprimes)
+
+NextSetOfPrimes:
+ for {
+ todo := bits
+ // crypto/rand should set the top two bits in each prime.
+ // Thus each prime has the form
+ // p_i = 2^bitlen(p_i) × 0.11... (in base 2).
+ // And the product is:
+ // P = 2^todo × α
+ // where α is the product of nprimes numbers of the form 0.11...
+ //
+ // If α < 1/2 (which can happen for nprimes > 2), we need to
+ // shift todo to compensate for lost bits: the mean value of 0.11...
+ // is 7/8, so todo + shift - nprimes * log2(7/8) ~= bits - 1/2
+ // will give good results.
+ if nprimes >= 7 {
+ todo += (nprimes - 2) / 5
+ }
+ for i := 0; i < nprimes; i++ {
+ var err error
+ if len(prepopulatedPrimes) == 0 {
+ primes[i], err = rand.Prime(random, todo/(nprimes-i))
+ if err != nil {
+ return nil, err
+ }
+ } else {
+ primes[i] = prepopulatedPrimes[0]
+ prepopulatedPrimes = prepopulatedPrimes[1:]
+ }
+
+ todo -= primes[i].BitLen()
+ }
+
+ // Make sure that primes is pairwise unequal.
+ for i, prime := range primes {
+ for j := 0; j < i; j++ {
+ if prime.Cmp(primes[j]) == 0 {
+ continue NextSetOfPrimes
+ }
+ }
+ }
+
+ n := new(big.Int).Set(bigOne)
+ totient := new(big.Int).Set(bigOne)
+ pminus1 := new(big.Int)
+ for _, prime := range primes {
+ n.Mul(n, prime)
+ pminus1.Sub(prime, bigOne)
+ totient.Mul(totient, pminus1)
+ }
+ if n.BitLen() != bits {
+ // This should never happen for nprimes == 2 because
+ // crypto/rand should set the top two bits in each prime.
+ // For nprimes > 2 we hope it does not happen often.
+ continue NextSetOfPrimes
+ }
+
+ priv.D = new(big.Int)
+ e := big.NewInt(int64(priv.E))
+ ok := priv.D.ModInverse(e, totient)
+
+ if ok != nil {
+ priv.Primes = primes
+ priv.N = n
+ break
+ }
+ }
+
+ priv.Precompute()
+ return priv, nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go
new file mode 100644
index 0000000000..a071353e2e
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go
@@ -0,0 +1,901 @@
+// 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 openpgp
+
+import (
+ goerrors "errors"
+ "fmt"
+ "io"
+ "time"
+
+ "github.com/ProtonMail/go-crypto/openpgp/armor"
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "github.com/ProtonMail/go-crypto/openpgp/packet"
+)
+
+// PublicKeyType is the armor type for a PGP public key.
+var PublicKeyType = "PGP PUBLIC KEY BLOCK"
+
+// PrivateKeyType is the armor type for a PGP private key.
+var PrivateKeyType = "PGP PRIVATE KEY BLOCK"
+
+// An Entity represents the components of an OpenPGP key: a primary public key
+// (which must be a signing key), one or more identities claimed by that key,
+// and zero or more subkeys, which may be encryption keys.
+type Entity struct {
+ PrimaryKey *packet.PublicKey
+ PrivateKey *packet.PrivateKey
+ Identities map[string]*Identity // indexed by Identity.Name
+ Revocations []*packet.Signature
+ Subkeys []Subkey
+ SelfSignature *packet.Signature // Direct-key self signature of the PrimaryKey (contains primary key properties in v6)
+ Signatures []*packet.Signature // all (potentially unverified) self-signatures, revocations, and third-party signatures
+}
+
+// An Identity represents an identity claimed by an Entity and zero or more
+// assertions by other entities about that claim.
+type Identity struct {
+ Name string // by convention, has the form "Full Name (comment) "
+ UserId *packet.UserId
+ SelfSignature *packet.Signature
+ Revocations []*packet.Signature
+ Signatures []*packet.Signature // all (potentially unverified) self-signatures, revocations, and third-party signatures
+}
+
+// A Subkey is an additional public key in an Entity. Subkeys can be used for
+// encryption.
+type Subkey struct {
+ PublicKey *packet.PublicKey
+ PrivateKey *packet.PrivateKey
+ Sig *packet.Signature
+ Revocations []*packet.Signature
+}
+
+// A Key identifies a specific public key in an Entity. This is either the
+// Entity's primary key or a subkey.
+type Key struct {
+ Entity *Entity
+ PublicKey *packet.PublicKey
+ PrivateKey *packet.PrivateKey
+ SelfSignature *packet.Signature
+ Revocations []*packet.Signature
+}
+
+// A KeyRing provides access to public and private keys.
+type KeyRing interface {
+ // KeysById returns the set of keys that have the given key id.
+ KeysById(id uint64) []Key
+ // KeysByIdAndUsage returns the set of keys with the given id
+ // that also meet the key usage given by requiredUsage.
+ // The requiredUsage is expressed as the bitwise-OR of
+ // packet.KeyFlag* values.
+ KeysByIdUsage(id uint64, requiredUsage byte) []Key
+ // DecryptionKeys returns all private keys that are valid for
+ // decryption.
+ DecryptionKeys() []Key
+}
+
+// PrimaryIdentity returns an Identity, preferring non-revoked identities,
+// identities marked as primary, or the latest-created identity, in that order.
+func (e *Entity) PrimaryIdentity() *Identity {
+ var primaryIdentity *Identity
+ for _, ident := range e.Identities {
+ if shouldPreferIdentity(primaryIdentity, ident) {
+ primaryIdentity = ident
+ }
+ }
+ return primaryIdentity
+}
+
+func shouldPreferIdentity(existingId, potentialNewId *Identity) bool {
+ if existingId == nil {
+ return true
+ }
+
+ if len(existingId.Revocations) > len(potentialNewId.Revocations) {
+ return true
+ }
+
+ if len(existingId.Revocations) < len(potentialNewId.Revocations) {
+ return false
+ }
+
+ if existingId.SelfSignature == nil {
+ return true
+ }
+
+ if existingId.SelfSignature.IsPrimaryId != nil && *existingId.SelfSignature.IsPrimaryId &&
+ !(potentialNewId.SelfSignature.IsPrimaryId != nil && *potentialNewId.SelfSignature.IsPrimaryId) {
+ return false
+ }
+
+ if !(existingId.SelfSignature.IsPrimaryId != nil && *existingId.SelfSignature.IsPrimaryId) &&
+ potentialNewId.SelfSignature.IsPrimaryId != nil && *potentialNewId.SelfSignature.IsPrimaryId {
+ return true
+ }
+
+ return potentialNewId.SelfSignature.CreationTime.After(existingId.SelfSignature.CreationTime)
+}
+
+// EncryptionKey returns the best candidate Key for encrypting a message to the
+// given Entity.
+func (e *Entity) EncryptionKey(now time.Time) (Key, bool) {
+ // Fail to find any encryption key if the...
+ primarySelfSignature, primaryIdentity := e.PrimarySelfSignature()
+ if primarySelfSignature == nil || // no self-signature found
+ e.PrimaryKey.KeyExpired(primarySelfSignature, now) || // primary key has expired
+ e.Revoked(now) || // primary key has been revoked
+ primarySelfSignature.SigExpired(now) || // user ID or or direct self-signature has expired
+ (primaryIdentity != nil && primaryIdentity.Revoked(now)) { // user ID has been revoked (for v4 keys)
+ return Key{}, false
+ }
+
+ // Iterate the keys to find the newest, unexpired one
+ candidateSubkey := -1
+ var maxTime time.Time
+ for i, subkey := range e.Subkeys {
+ if subkey.Sig.FlagsValid &&
+ subkey.Sig.FlagEncryptCommunications &&
+ subkey.PublicKey.PubKeyAlgo.CanEncrypt() &&
+ !subkey.PublicKey.KeyExpired(subkey.Sig, now) &&
+ !subkey.Sig.SigExpired(now) &&
+ !subkey.Revoked(now) &&
+ (maxTime.IsZero() || subkey.Sig.CreationTime.After(maxTime)) {
+ candidateSubkey = i
+ maxTime = subkey.Sig.CreationTime
+ }
+ }
+
+ if candidateSubkey != -1 {
+ subkey := e.Subkeys[candidateSubkey]
+ return Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig, subkey.Revocations}, true
+ }
+
+ // If we don't have any subkeys for encryption and the primary key
+ // is marked as OK to encrypt with, then we can use it.
+ if primarySelfSignature.FlagsValid && primarySelfSignature.FlagEncryptCommunications &&
+ e.PrimaryKey.PubKeyAlgo.CanEncrypt() {
+ return Key{e, e.PrimaryKey, e.PrivateKey, primarySelfSignature, e.Revocations}, true
+ }
+
+ return Key{}, false
+}
+
+// CertificationKey return the best candidate Key for certifying a key with this
+// Entity.
+func (e *Entity) CertificationKey(now time.Time) (Key, bool) {
+ return e.CertificationKeyById(now, 0)
+}
+
+// CertificationKeyById return the Key for key certification with this
+// Entity and keyID.
+func (e *Entity) CertificationKeyById(now time.Time, id uint64) (Key, bool) {
+ return e.signingKeyByIdUsage(now, id, packet.KeyFlagCertify)
+}
+
+// SigningKey return the best candidate Key for signing a message with this
+// Entity.
+func (e *Entity) SigningKey(now time.Time) (Key, bool) {
+ return e.SigningKeyById(now, 0)
+}
+
+// SigningKeyById return the Key for signing a message with this
+// Entity and keyID.
+func (e *Entity) SigningKeyById(now time.Time, id uint64) (Key, bool) {
+ return e.signingKeyByIdUsage(now, id, packet.KeyFlagSign)
+}
+
+func (e *Entity) signingKeyByIdUsage(now time.Time, id uint64, flags int) (Key, bool) {
+ // Fail to find any signing key if the...
+ primarySelfSignature, primaryIdentity := e.PrimarySelfSignature()
+ if primarySelfSignature == nil || // no self-signature found
+ e.PrimaryKey.KeyExpired(primarySelfSignature, now) || // primary key has expired
+ e.Revoked(now) || // primary key has been revoked
+ primarySelfSignature.SigExpired(now) || // user ID or direct self-signature has expired
+ (primaryIdentity != nil && primaryIdentity.Revoked(now)) { // user ID has been revoked (for v4 keys)
+ return Key{}, false
+ }
+
+ // Iterate the keys to find the newest, unexpired one
+ candidateSubkey := -1
+ var maxTime time.Time
+ for idx, subkey := range e.Subkeys {
+ if subkey.Sig.FlagsValid &&
+ (flags&packet.KeyFlagCertify == 0 || subkey.Sig.FlagCertify) &&
+ (flags&packet.KeyFlagSign == 0 || subkey.Sig.FlagSign) &&
+ subkey.PublicKey.PubKeyAlgo.CanSign() &&
+ !subkey.PublicKey.KeyExpired(subkey.Sig, now) &&
+ !subkey.Sig.SigExpired(now) &&
+ !subkey.Revoked(now) &&
+ (maxTime.IsZero() || subkey.Sig.CreationTime.After(maxTime)) &&
+ (id == 0 || subkey.PublicKey.KeyId == id) {
+ candidateSubkey = idx
+ maxTime = subkey.Sig.CreationTime
+ }
+ }
+
+ if candidateSubkey != -1 {
+ subkey := e.Subkeys[candidateSubkey]
+ return Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig, subkey.Revocations}, true
+ }
+
+ // If we don't have any subkeys for signing and the primary key
+ // is marked as OK to sign with, then we can use it.
+ if primarySelfSignature.FlagsValid &&
+ (flags&packet.KeyFlagCertify == 0 || primarySelfSignature.FlagCertify) &&
+ (flags&packet.KeyFlagSign == 0 || primarySelfSignature.FlagSign) &&
+ e.PrimaryKey.PubKeyAlgo.CanSign() &&
+ (id == 0 || e.PrimaryKey.KeyId == id) {
+ return Key{e, e.PrimaryKey, e.PrivateKey, primarySelfSignature, e.Revocations}, true
+ }
+
+ // No keys with a valid Signing Flag or no keys matched the id passed in
+ return Key{}, false
+}
+
+func revoked(revocations []*packet.Signature, now time.Time) bool {
+ for _, revocation := range revocations {
+ if revocation.RevocationReason != nil && *revocation.RevocationReason == packet.KeyCompromised {
+ // If the key is compromised, the key is considered revoked even before the revocation date.
+ return true
+ }
+ if !revocation.SigExpired(now) {
+ return true
+ }
+ }
+ return false
+}
+
+// Revoked returns whether the entity has any direct key revocation signatures.
+// Note that third-party revocation signatures are not supported.
+// Note also that Identity and Subkey revocation should be checked separately.
+func (e *Entity) Revoked(now time.Time) bool {
+ return revoked(e.Revocations, now)
+}
+
+// EncryptPrivateKeys encrypts all non-encrypted keys in the entity with the same key
+// derived from the provided passphrase. Public keys and dummy keys are ignored,
+// and don't cause an error to be returned.
+func (e *Entity) EncryptPrivateKeys(passphrase []byte, config *packet.Config) error {
+ var keysToEncrypt []*packet.PrivateKey
+ // Add entity private key to encrypt.
+ if e.PrivateKey != nil && !e.PrivateKey.Dummy() && !e.PrivateKey.Encrypted {
+ keysToEncrypt = append(keysToEncrypt, e.PrivateKey)
+ }
+
+ // Add subkeys to encrypt.
+ for _, sub := range e.Subkeys {
+ if sub.PrivateKey != nil && !sub.PrivateKey.Dummy() && !sub.PrivateKey.Encrypted {
+ keysToEncrypt = append(keysToEncrypt, sub.PrivateKey)
+ }
+ }
+ return packet.EncryptPrivateKeys(keysToEncrypt, passphrase, config)
+}
+
+// DecryptPrivateKeys decrypts all encrypted keys in the entity with the given passphrase.
+// Avoids recomputation of similar s2k key derivations. Public keys and dummy keys are ignored,
+// and don't cause an error to be returned.
+func (e *Entity) DecryptPrivateKeys(passphrase []byte) error {
+ var keysToDecrypt []*packet.PrivateKey
+ // Add entity private key to decrypt.
+ if e.PrivateKey != nil && !e.PrivateKey.Dummy() && e.PrivateKey.Encrypted {
+ keysToDecrypt = append(keysToDecrypt, e.PrivateKey)
+ }
+
+ // Add subkeys to decrypt.
+ for _, sub := range e.Subkeys {
+ if sub.PrivateKey != nil && !sub.PrivateKey.Dummy() && sub.PrivateKey.Encrypted {
+ keysToDecrypt = append(keysToDecrypt, sub.PrivateKey)
+ }
+ }
+ return packet.DecryptPrivateKeys(keysToDecrypt, passphrase)
+}
+
+// Revoked returns whether the identity has been revoked by a self-signature.
+// Note that third-party revocation signatures are not supported.
+func (i *Identity) Revoked(now time.Time) bool {
+ return revoked(i.Revocations, now)
+}
+
+// Revoked returns whether the subkey has been revoked by a self-signature.
+// Note that third-party revocation signatures are not supported.
+func (s *Subkey) Revoked(now time.Time) bool {
+ return revoked(s.Revocations, now)
+}
+
+// Revoked returns whether the key or subkey has been revoked by a self-signature.
+// Note that third-party revocation signatures are not supported.
+// Note also that Identity revocation should be checked separately.
+// Normally, it's not necessary to call this function, except on keys returned by
+// KeysById or KeysByIdUsage.
+func (key *Key) Revoked(now time.Time) bool {
+ return revoked(key.Revocations, now)
+}
+
+// An EntityList contains one or more Entities.
+type EntityList []*Entity
+
+// KeysById returns the set of keys that have the given key id.
+func (el EntityList) KeysById(id uint64) (keys []Key) {
+ for _, e := range el {
+ if e.PrimaryKey.KeyId == id {
+ selfSig, _ := e.PrimarySelfSignature()
+ keys = append(keys, Key{e, e.PrimaryKey, e.PrivateKey, selfSig, e.Revocations})
+ }
+
+ for _, subKey := range e.Subkeys {
+ if subKey.PublicKey.KeyId == id {
+ keys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, subKey.Sig, subKey.Revocations})
+ }
+ }
+ }
+ return
+}
+
+// KeysByIdAndUsage returns the set of keys with the given id that also meet
+// the key usage given by requiredUsage. The requiredUsage is expressed as
+// the bitwise-OR of packet.KeyFlag* values.
+func (el EntityList) KeysByIdUsage(id uint64, requiredUsage byte) (keys []Key) {
+ for _, key := range el.KeysById(id) {
+ if requiredUsage != 0 {
+ if key.SelfSignature == nil || !key.SelfSignature.FlagsValid {
+ continue
+ }
+
+ var usage byte
+ if key.SelfSignature.FlagCertify {
+ usage |= packet.KeyFlagCertify
+ }
+ if key.SelfSignature.FlagSign {
+ usage |= packet.KeyFlagSign
+ }
+ if key.SelfSignature.FlagEncryptCommunications {
+ usage |= packet.KeyFlagEncryptCommunications
+ }
+ if key.SelfSignature.FlagEncryptStorage {
+ usage |= packet.KeyFlagEncryptStorage
+ }
+ if usage&requiredUsage != requiredUsage {
+ continue
+ }
+ }
+
+ keys = append(keys, key)
+ }
+ return
+}
+
+// DecryptionKeys returns all private keys that are valid for decryption.
+func (el EntityList) DecryptionKeys() (keys []Key) {
+ for _, e := range el {
+ for _, subKey := range e.Subkeys {
+ if subKey.PrivateKey != nil && subKey.Sig.FlagsValid && (subKey.Sig.FlagEncryptStorage || subKey.Sig.FlagEncryptCommunications) {
+ keys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, subKey.Sig, subKey.Revocations})
+ }
+ }
+ }
+ return
+}
+
+// ReadArmoredKeyRing reads one or more public/private keys from an armor keyring file.
+func ReadArmoredKeyRing(r io.Reader) (EntityList, error) {
+ block, err := armor.Decode(r)
+ if err == io.EOF {
+ return nil, errors.InvalidArgumentError("no armored data found")
+ }
+ if err != nil {
+ return nil, err
+ }
+ if block.Type != PublicKeyType && block.Type != PrivateKeyType {
+ return nil, errors.InvalidArgumentError("expected public or private key block, got: " + block.Type)
+ }
+
+ return ReadKeyRing(block.Body)
+}
+
+// ReadKeyRing reads one or more public/private keys. Unsupported keys are
+// ignored as long as at least a single valid key is found.
+func ReadKeyRing(r io.Reader) (el EntityList, err error) {
+ packets := packet.NewReader(r)
+ var lastUnsupportedError error
+
+ for {
+ var e *Entity
+ e, err = ReadEntity(packets)
+ if err != nil {
+ // TODO: warn about skipped unsupported/unreadable keys
+ if _, ok := err.(errors.UnsupportedError); ok {
+ lastUnsupportedError = err
+ err = readToNextPublicKey(packets)
+ } else if _, ok := err.(errors.StructuralError); ok {
+ // Skip unreadable, badly-formatted keys
+ lastUnsupportedError = err
+ err = readToNextPublicKey(packets)
+ }
+ if err == io.EOF {
+ err = nil
+ break
+ }
+ if err != nil {
+ el = nil
+ break
+ }
+ } else {
+ el = append(el, e)
+ }
+ }
+
+ if len(el) == 0 && err == nil {
+ err = lastUnsupportedError
+ }
+ return
+}
+
+// readToNextPublicKey reads packets until the start of the entity and leaves
+// the first packet of the new entity in the Reader.
+func readToNextPublicKey(packets *packet.Reader) (err error) {
+ var p packet.Packet
+ for {
+ p, err = packets.Next()
+ if err == io.EOF {
+ return
+ } else if err != nil {
+ if _, ok := err.(errors.UnsupportedError); ok {
+ continue
+ }
+ return
+ }
+
+ if pk, ok := p.(*packet.PublicKey); ok && !pk.IsSubkey {
+ packets.Unread(p)
+ return
+ }
+ }
+}
+
+// ReadEntity reads an entity (public key, identities, subkeys etc) from the
+// given Reader.
+func ReadEntity(packets *packet.Reader) (*Entity, error) {
+ e := new(Entity)
+ e.Identities = make(map[string]*Identity)
+
+ p, err := packets.Next()
+ if err != nil {
+ return nil, err
+ }
+
+ var ok bool
+ if e.PrimaryKey, ok = p.(*packet.PublicKey); !ok {
+ if e.PrivateKey, ok = p.(*packet.PrivateKey); !ok {
+ packets.Unread(p)
+ return nil, errors.StructuralError("first packet was not a public/private key")
+ }
+ e.PrimaryKey = &e.PrivateKey.PublicKey
+ }
+
+ if !e.PrimaryKey.PubKeyAlgo.CanSign() {
+ return nil, errors.StructuralError("primary key cannot be used for signatures")
+ }
+
+ var revocations []*packet.Signature
+ var directSignatures []*packet.Signature
+EachPacket:
+ for {
+ p, err := packets.Next()
+ if err == io.EOF {
+ break
+ } else if err != nil {
+ return nil, err
+ }
+
+ switch pkt := p.(type) {
+ case *packet.UserId:
+ if err := addUserID(e, packets, pkt); err != nil {
+ return nil, err
+ }
+ case *packet.Signature:
+ if pkt.SigType == packet.SigTypeKeyRevocation {
+ revocations = append(revocations, pkt)
+ } else if pkt.SigType == packet.SigTypeDirectSignature {
+ directSignatures = append(directSignatures, pkt)
+ }
+ // Else, ignoring the signature as it does not follow anything
+ // we would know to attach it to.
+ case *packet.PrivateKey:
+ if !pkt.IsSubkey {
+ packets.Unread(p)
+ break EachPacket
+ }
+ err = addSubkey(e, packets, &pkt.PublicKey, pkt)
+ if err != nil {
+ return nil, err
+ }
+ case *packet.PublicKey:
+ if !pkt.IsSubkey {
+ packets.Unread(p)
+ break EachPacket
+ }
+ err = addSubkey(e, packets, pkt, nil)
+ if err != nil {
+ return nil, err
+ }
+ default:
+ // we ignore unknown packets.
+ }
+ }
+
+ if len(e.Identities) == 0 && e.PrimaryKey.Version < 6 {
+ return nil, errors.StructuralError(fmt.Sprintf("v%d entity without any identities", e.PrimaryKey.Version))
+ }
+
+ // An implementation MUST ensure that a valid direct-key signature is present before using a v6 key.
+ if e.PrimaryKey.Version == 6 {
+ if len(directSignatures) == 0 {
+ return nil, errors.StructuralError("v6 entity without a valid direct-key signature")
+ }
+ // Select main direct key signature.
+ var mainDirectKeySelfSignature *packet.Signature
+ for _, directSignature := range directSignatures {
+ if directSignature.SigType == packet.SigTypeDirectSignature &&
+ directSignature.CheckKeyIdOrFingerprint(e.PrimaryKey) &&
+ (mainDirectKeySelfSignature == nil ||
+ directSignature.CreationTime.After(mainDirectKeySelfSignature.CreationTime)) {
+ mainDirectKeySelfSignature = directSignature
+ }
+ }
+ if mainDirectKeySelfSignature == nil {
+ return nil, errors.StructuralError("no valid direct-key self-signature for v6 primary key found")
+ }
+ // Check that the main self-signature is valid.
+ err = e.PrimaryKey.VerifyDirectKeySignature(mainDirectKeySelfSignature)
+ if err != nil {
+ return nil, errors.StructuralError("invalid direct-key self-signature for v6 primary key")
+ }
+ e.SelfSignature = mainDirectKeySelfSignature
+ e.Signatures = directSignatures
+ }
+
+ for _, revocation := range revocations {
+ err = e.PrimaryKey.VerifyRevocationSignature(revocation)
+ if err == nil {
+ e.Revocations = append(e.Revocations, revocation)
+ } else {
+ // TODO: RFC 4880 5.2.3.15 defines revocation keys.
+ return nil, errors.StructuralError("revocation signature signed by alternate key")
+ }
+ }
+
+ return e, nil
+}
+
+func addUserID(e *Entity, packets *packet.Reader, pkt *packet.UserId) error {
+ // Make a new Identity object, that we might wind up throwing away.
+ // We'll only add it if we get a valid self-signature over this
+ // userID.
+ identity := new(Identity)
+ identity.Name = pkt.Id
+ identity.UserId = pkt
+
+ for {
+ p, err := packets.Next()
+ if err == io.EOF {
+ break
+ } else if err != nil {
+ return err
+ }
+
+ sig, ok := p.(*packet.Signature)
+ if !ok {
+ packets.Unread(p)
+ break
+ }
+
+ if sig.SigType != packet.SigTypeGenericCert &&
+ sig.SigType != packet.SigTypePersonaCert &&
+ sig.SigType != packet.SigTypeCasualCert &&
+ sig.SigType != packet.SigTypePositiveCert &&
+ sig.SigType != packet.SigTypeCertificationRevocation {
+ return errors.StructuralError("user ID signature with wrong type")
+ }
+
+ if sig.CheckKeyIdOrFingerprint(e.PrimaryKey) {
+ if err = e.PrimaryKey.VerifyUserIdSignature(pkt.Id, e.PrimaryKey, sig); err != nil {
+ return errors.StructuralError("user ID self-signature invalid: " + err.Error())
+ }
+ if sig.SigType == packet.SigTypeCertificationRevocation {
+ identity.Revocations = append(identity.Revocations, sig)
+ } else if identity.SelfSignature == nil || sig.CreationTime.After(identity.SelfSignature.CreationTime) {
+ identity.SelfSignature = sig
+ }
+ identity.Signatures = append(identity.Signatures, sig)
+ e.Identities[pkt.Id] = identity
+ } else {
+ identity.Signatures = append(identity.Signatures, sig)
+ }
+ }
+
+ return nil
+}
+
+func addSubkey(e *Entity, packets *packet.Reader, pub *packet.PublicKey, priv *packet.PrivateKey) error {
+ var subKey Subkey
+ subKey.PublicKey = pub
+ subKey.PrivateKey = priv
+
+ for {
+ p, err := packets.Next()
+ if err == io.EOF {
+ break
+ } else if err != nil {
+ return errors.StructuralError("subkey signature invalid: " + err.Error())
+ }
+
+ sig, ok := p.(*packet.Signature)
+ if !ok {
+ packets.Unread(p)
+ break
+ }
+
+ if sig.SigType != packet.SigTypeSubkeyBinding && sig.SigType != packet.SigTypeSubkeyRevocation {
+ return errors.StructuralError("subkey signature with wrong type")
+ }
+
+ if err := e.PrimaryKey.VerifyKeySignature(subKey.PublicKey, sig); err != nil {
+ return errors.StructuralError("subkey signature invalid: " + err.Error())
+ }
+
+ switch sig.SigType {
+ case packet.SigTypeSubkeyRevocation:
+ subKey.Revocations = append(subKey.Revocations, sig)
+ case packet.SigTypeSubkeyBinding:
+ if subKey.Sig == nil || sig.CreationTime.After(subKey.Sig.CreationTime) {
+ subKey.Sig = sig
+ }
+ }
+ }
+
+ if subKey.Sig == nil {
+ return errors.StructuralError("subkey packet not followed by signature")
+ }
+
+ e.Subkeys = append(e.Subkeys, subKey)
+
+ return nil
+}
+
+// SerializePrivate serializes an Entity, including private key material, but
+// excluding signatures from other entities, to the given Writer.
+// Identities and subkeys are re-signed in case they changed since NewEntry.
+// If config is nil, sensible defaults will be used.
+func (e *Entity) SerializePrivate(w io.Writer, config *packet.Config) (err error) {
+ if e.PrivateKey.Dummy() {
+ return errors.ErrDummyPrivateKey("dummy private key cannot re-sign identities")
+ }
+ return e.serializePrivate(w, config, true)
+}
+
+// SerializePrivateWithoutSigning serializes an Entity, including private key
+// material, but excluding signatures from other entities, to the given Writer.
+// Self-signatures of identities and subkeys are not re-signed. This is useful
+// when serializing GNU dummy keys, among other things.
+// If config is nil, sensible defaults will be used.
+func (e *Entity) SerializePrivateWithoutSigning(w io.Writer, config *packet.Config) (err error) {
+ return e.serializePrivate(w, config, false)
+}
+
+func (e *Entity) serializePrivate(w io.Writer, config *packet.Config, reSign bool) (err error) {
+ if e.PrivateKey == nil {
+ return goerrors.New("openpgp: private key is missing")
+ }
+ err = e.PrivateKey.Serialize(w)
+ if err != nil {
+ return
+ }
+ for _, revocation := range e.Revocations {
+ err := revocation.Serialize(w)
+ if err != nil {
+ return err
+ }
+ }
+ for _, directSignature := range e.Signatures {
+ err := directSignature.Serialize(w)
+ if err != nil {
+ return err
+ }
+ }
+ for _, ident := range e.Identities {
+ err = ident.UserId.Serialize(w)
+ if err != nil {
+ return
+ }
+ if reSign {
+ if ident.SelfSignature == nil {
+ return goerrors.New("openpgp: can't re-sign identity without valid self-signature")
+ }
+ err = ident.SelfSignature.SignUserId(ident.UserId.Id, e.PrimaryKey, e.PrivateKey, config)
+ if err != nil {
+ return
+ }
+ }
+ for _, sig := range ident.Signatures {
+ err = sig.Serialize(w)
+ if err != nil {
+ return err
+ }
+ }
+ }
+ for _, subkey := range e.Subkeys {
+ err = subkey.PrivateKey.Serialize(w)
+ if err != nil {
+ return
+ }
+ if reSign {
+ err = subkey.Sig.SignKey(subkey.PublicKey, e.PrivateKey, config)
+ if err != nil {
+ return
+ }
+ if subkey.Sig.EmbeddedSignature != nil {
+ err = subkey.Sig.EmbeddedSignature.CrossSignKey(subkey.PublicKey, e.PrimaryKey,
+ subkey.PrivateKey, config)
+ if err != nil {
+ return
+ }
+ }
+ }
+ for _, revocation := range subkey.Revocations {
+ err := revocation.Serialize(w)
+ if err != nil {
+ return err
+ }
+ }
+ err = subkey.Sig.Serialize(w)
+ if err != nil {
+ return
+ }
+ }
+ return nil
+}
+
+// Serialize writes the public part of the given Entity to w, including
+// signatures from other entities. No private key material will be output.
+func (e *Entity) Serialize(w io.Writer) error {
+ err := e.PrimaryKey.Serialize(w)
+ if err != nil {
+ return err
+ }
+ for _, revocation := range e.Revocations {
+ err := revocation.Serialize(w)
+ if err != nil {
+ return err
+ }
+ }
+ for _, directSignature := range e.Signatures {
+ err := directSignature.Serialize(w)
+ if err != nil {
+ return err
+ }
+ }
+ for _, ident := range e.Identities {
+ err = ident.UserId.Serialize(w)
+ if err != nil {
+ return err
+ }
+ for _, sig := range ident.Signatures {
+ err = sig.Serialize(w)
+ if err != nil {
+ return err
+ }
+ }
+ }
+ for _, subkey := range e.Subkeys {
+ err = subkey.PublicKey.Serialize(w)
+ if err != nil {
+ return err
+ }
+ for _, revocation := range subkey.Revocations {
+ err := revocation.Serialize(w)
+ if err != nil {
+ return err
+ }
+ }
+ err = subkey.Sig.Serialize(w)
+ if err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// SignIdentity adds a signature to e, from signer, attesting that identity is
+// associated with e. The provided identity must already be an element of
+// e.Identities and the private key of signer must have been decrypted if
+// necessary.
+// If config is nil, sensible defaults will be used.
+func (e *Entity) SignIdentity(identity string, signer *Entity, config *packet.Config) error {
+ certificationKey, ok := signer.CertificationKey(config.Now())
+ if !ok {
+ return errors.InvalidArgumentError("no valid certification key found")
+ }
+
+ if certificationKey.PrivateKey.Encrypted {
+ return errors.InvalidArgumentError("signing Entity's private key must be decrypted")
+ }
+
+ ident, ok := e.Identities[identity]
+ if !ok {
+ return errors.InvalidArgumentError("given identity string not found in Entity")
+ }
+
+ sig := createSignaturePacket(certificationKey.PublicKey, packet.SigTypeGenericCert, config)
+
+ signingUserID := config.SigningUserId()
+ if signingUserID != "" {
+ if _, ok := signer.Identities[signingUserID]; !ok {
+ return errors.InvalidArgumentError("signer identity string not found in signer Entity")
+ }
+ sig.SignerUserId = &signingUserID
+ }
+
+ if err := sig.SignUserId(identity, e.PrimaryKey, certificationKey.PrivateKey, config); err != nil {
+ return err
+ }
+ ident.Signatures = append(ident.Signatures, sig)
+ return nil
+}
+
+// RevokeKey generates a key revocation signature (packet.SigTypeKeyRevocation) with the
+// specified reason code and text (RFC4880 section-5.2.3.23).
+// If config is nil, sensible defaults will be used.
+func (e *Entity) RevokeKey(reason packet.ReasonForRevocation, reasonText string, config *packet.Config) error {
+ revSig := createSignaturePacket(e.PrimaryKey, packet.SigTypeKeyRevocation, config)
+ revSig.RevocationReason = &reason
+ revSig.RevocationReasonText = reasonText
+
+ if err := revSig.RevokeKey(e.PrimaryKey, e.PrivateKey, config); err != nil {
+ return err
+ }
+ e.Revocations = append(e.Revocations, revSig)
+ return nil
+}
+
+// RevokeSubkey generates a subkey revocation signature (packet.SigTypeSubkeyRevocation) for
+// a subkey with the specified reason code and text (RFC4880 section-5.2.3.23).
+// If config is nil, sensible defaults will be used.
+func (e *Entity) RevokeSubkey(sk *Subkey, reason packet.ReasonForRevocation, reasonText string, config *packet.Config) error {
+ if err := e.PrimaryKey.VerifyKeySignature(sk.PublicKey, sk.Sig); err != nil {
+ return errors.InvalidArgumentError("given subkey is not associated with this key")
+ }
+
+ revSig := createSignaturePacket(e.PrimaryKey, packet.SigTypeSubkeyRevocation, config)
+ revSig.RevocationReason = &reason
+ revSig.RevocationReasonText = reasonText
+
+ if err := revSig.RevokeSubkey(sk.PublicKey, e.PrivateKey, config); err != nil {
+ return err
+ }
+
+ sk.Revocations = append(sk.Revocations, revSig)
+ return nil
+}
+
+func (e *Entity) primaryDirectSignature() *packet.Signature {
+ return e.SelfSignature
+}
+
+// PrimarySelfSignature searches the entity for the self-signature that stores key preferences.
+// For V4 keys, returns the self-signature of the primary identity, and the identity.
+// For V6 keys, returns the latest valid direct-key self-signature, and no identity (nil).
+// This self-signature is to be used to check the key expiration,
+// algorithm preferences, and so on.
+func (e *Entity) PrimarySelfSignature() (*packet.Signature, *Identity) {
+ if e.PrimaryKey.Version == 6 {
+ return e.primaryDirectSignature(), nil
+ }
+ primaryIdentity := e.PrimaryIdentity()
+ if primaryIdentity == nil {
+ return nil, nil
+ }
+ return primaryIdentity.SelfSignature, primaryIdentity
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/keys_test_data.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/keys_test_data.go
new file mode 100644
index 0000000000..108fd096f3
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/keys_test_data.go
@@ -0,0 +1,538 @@
+package openpgp
+
+const expiringKeyHex = "c6c04d0451d0c680010800abbb021fd03ffc4e96618901180c3fdcb060ee69eeead97b91256d11420d80b5f1b51930248044130bd300605cf8a05b7a40d3d8cfb0a910be2e3db50dcd50a9c54064c2a5550801daa834ff4480b33d3d3ca495ff8a4e84a886977d17d998f881241a874083d8b995beab555b6d22b8a4817ab17ac3e7304f7d4d2c05c495fb2218348d3bc13651db1d92732e368a9dd7dcefa6eddff30b94706a9aaee47e9d39321460b740c59c6fc3c2fd8ab6c0fb868cb87c0051f0321301fe0f0e1820b15e7fb7063395769b525005c7e30a7ce85984f5cac00504e7b4fdc45d74958de8388436fd5c7ba9ea121f1c851b5911dd1b47a14d81a09e92ef37721e2325b6790011010001cd00c2c07b041001080025050251d0c680050900278d00060b09070803020415080a0203160201021901021b03021e01000a0910e7b484133a890a35ae4b0800a1beb82e7f28eaf5273d6af9d3391314f6280b2b624eaca2851f89a9ebcaf80ac589ebd509f168bc4322106ca2e2ce77a76e071a3c7444787d65216b5f05e82c77928860b92aace3b7d0327db59492f422eb9dfab7249266d37429870b091a98aba8724c2259ebf8f85093f21255eafa75aa841e31d94f2ac891b9755fed455e539044ee69fc47950b80e003fc9f298d695660f28329eaa38037c367efde1727458e514faf990d439a21461b719edaddf9296d3d0647b43ca56cb8dbf63b4fcf8b9968e7928c463470fab3b98e44d0d95645062f94b2d04fe56bd52822b71934db8ce845622c40b92fcbe765a142e7f38b61a6aa9606c8e8858dcd3b6eb1894acec04d0451d1f06b01080088bea67444e1789390e7c0335c86775502d58ec783d99c8ef4e06de235ed3dd4b0467f6f358d818c7d8989d43ec6d69fcbc8c32632d5a1b605e3fa8e41d695fcdcaa535936cd0157f9040dce362519803b908eafe838bb13216c885c6f93e9e8d5745607f0d062322085d6bdc760969149a8ff8dd9f5c18d9bfe2e6f63a06e17694cf1f67587c6fb70e9aebf90ffc528ca3b615ac7c9d4a21ea4f7c06f2e98fbbd90a859b8608bf9ea638e3a54289ce44c283110d0c45fa458de6251cd6e7baf71f80f12c8978340490fd90c92b81736ae902ed958e478dceae2835953d189c45d182aff02ea2be61b81d8e94430f041d638647b43e2fcb45fd512fbf5068b810011010001c2c06504180108000f050251d1f06b050900081095021b0c000a0910e7b484133a890a35e63407fe2ec88d6d1e6c9ce7553ece0cb2524747217bad29f251d33df84599ffcc900141a355abd62126800744068a5e05dc167056aa9205273dc7765a2ed49db15c2a83b8d6e6429c902136f1e12229086c1c10c0053242c2a4ae1930db58163387a48cad64607ff2153c320e42843dec28e3fce90e7399d63ac0affa2fee1f0adc0953c89eb3f46ef1d6c04328ed13b491669d5120a3782e3ffb7c69575fb77eebd108794f4dda9d34be2bae57e8e59ec8ebfda2f6f06104b2321be408ea146e2db482b00c5055c8618de36ac9716f80da2617e225556d0fce61b01c8cea2d1e0ea982c31711060ca370f2739366e1e708f38405d784b49d16a26cf62d152eae734327cec04d0451d1f07b010800d5af91c5e7c2fd8951c8d254eab0c97cdcb66822f868b79b78c366255059a68fd74ebca9adb9b970cd9e586690e6e0756705432306878c897b10a4b4ca0005966f99ac8fa4e6f9caf54bf8e53844544beee9872a7ac64c119cf1393d96e674254b661f61ee975633d0e8a8672531edb6bb8e211204e7754a9efa802342118eee850beea742bac95a3f706cc2024cf6037a308bb68162b2f53b9a6346a96e6d31871a2456186e24a1c7a82b82ac04afdfd57cd7fb9ba77a9c760d40b76a170f7be525e5fb6a9848cc726e806187710d9b190387df28700f321f988a392899f93815cc937f309129eb94d5299c5547cb2c085898e6639496e70d746c9d3fb9881d0011010001c2c06504180108000f050251d1f07b050900266305021b0c000a0910e7b484133a890a35bff207fd10dfe8c4a6ea1dd30568012b6fd6891a763c87ad0f7a1d112aad9e8e3239378a3b85588c235865bac2e614348cb4f216d7217f53b3ef48c192e0a4d31d64d7bfa5faccf21155965fa156e887056db644a05ad08a85cc6152d1377d9e37b46f4ff462bbe68ace2dc586ef90070314576c985d8037c2ba63f0a7dc17a62e15bd77e88bc61d9d00858979709f12304264a4cf4225c5cf86f12c8e19486cb9cdcc69f18f027e5f16f4ca8b50e28b3115eaff3a345acd21f624aef81f6ede515c1b55b26b84c1e32264754eab672d5489b287e7277ea855e0a5ff2aa9e8b8c76d579a964ec225255f4d57bf66639ccb34b64798846943e162a41096a7002ca21c7f56"
+const subkeyUsageHex = "988d04533a52bc010400d26af43085558f65b9e7dbc90cb9238015259aed5e954637adcfa2181548b2d0b60c65f1f42ec5081cbf1bc0a8aa4900acfb77070837c58f26012fbce297d70afe96e759ad63531f0037538e70dbf8e384569b9720d99d8eb39d8d0a2947233ed242436cb6ac7dfe74123354b3d0119b5c235d3dd9c9d6c004f8ffaf67ad8583001101000188b7041f010200210502533b8552170c8001ce094aa433f7040bb2ddf0be3893cb843d0fe70c020700000a0910a42704b92866382aa98404009d63d916a27543da4221c60087c33f1c44bec9998c5438018ed370cca4962876c748e94b73eb39c58eb698063f3fd6346d58dd2a11c0247934c4a9d71f24754f7468f96fb24c3e791dd2392b62f626148ad724189498cbf993db2df7c0cdc2d677c35da0f16cb16c9ce7c33b4de65a4a91b1d21a130ae9cc26067718910ef8e2b417556d627261203c756d627261407379642e65642e61753e88b80413010200220502533a52bc021b03060b090807030206150802090a0b0416020301021e01021780000a0910a42704b92866382a47840400c0c2bd04f5fca586de408b395b3c280a278259c93eaaa8b79a53b97003f8ed502a8a00446dd9947fb462677e4fcac0dac2f0701847d15130aadb6cd9e0705ea0cf5f92f129136c7be21a718d46c8e641eb7f044f2adae573e11ae423a0a9ca51324f03a8a2f34b91fa40c3cc764bee4dccadedb54c768ba0469b683ea53f1c29b88d04533a52bc01040099c92a5d6f8b744224da27bc2369127c35269b58bec179de6bbc038f749344222f85a31933224f26b70243c4e4b2d242f0c4777eaef7b5502f9dad6d8bf3aaeb471210674b74de2d7078af497d55f5cdad97c7bedfbc1b41e8065a97c9c3d344b21fc81d27723af8e374bc595da26ea242dccb6ae497be26eea57e563ed517e90011010001889f0418010200090502533a52bc021b0c000a0910a42704b92866382afa1403ff70284c2de8a043ff51d8d29772602fa98009b7861c540535f874f2c230af8caf5638151a636b21f8255003997ccd29747fdd06777bb24f9593bd7d98a3e887689bf902f999915fcc94625ae487e5d13e6616f89090ebc4fdc7eb5cad8943e4056995bb61c6af37f8043016876a958ec7ebf39c43d20d53b7f546cfa83e8d2604b88d04533b8283010400c0b529316dbdf58b4c54461e7e669dc11c09eb7f73819f178ccd4177b9182b91d138605fcf1e463262fabefa73f94a52b5e15d1904635541c7ea540f07050ce0fb51b73e6f88644cec86e91107c957a114f69554548a85295d2b70bd0b203992f76eb5d493d86d9eabcaa7ef3fc7db7e458438db3fcdb0ca1cc97c638439a9170011010001889f0418010200090502533b8283021b0c000a0910a42704b92866382adc6d0400cfff6258485a21675adb7a811c3e19ebca18851533f75a7ba317950b9997fda8d1a4c8c76505c08c04b6c2cc31dc704d33da36a21273f2b388a1a706f7c3378b66d887197a525936ed9a69acb57fe7f718133da85ec742001c5d1864e9c6c8ea1b94f1c3759cebfd93b18606066c063a63be86085b7e37bdbc65f9a915bf084bb901a204533b85cd110400aed3d2c52af2b38b5b67904b0ef73d6dd7aef86adb770e2b153cd22489654dcc91730892087bb9856ae2d9f7ed1eb48f214243fe86bfe87b349ebd7c30e630e49c07b21fdabf78b7a95c8b7f969e97e3d33f2e074c63552ba64a2ded7badc05ce0ea2be6d53485f6900c7860c7aa76560376ce963d7271b9b54638a4028b573f00a0d8854bfcdb04986141568046202192263b9b67350400aaa1049dbc7943141ef590a70dcb028d730371d92ea4863de715f7f0f16d168bd3dc266c2450457d46dcbbf0b071547e5fbee7700a820c3750b236335d8d5848adb3c0da010e998908dfd93d961480084f3aea20b247034f8988eccb5546efaa35a92d0451df3aaf1aee5aa36a4c4d462c760ecd9cebcabfbe1412b1f21450f203fd126687cd486496e971a87fd9e1a8a765fe654baa219a6871ab97768596ab05c26c1aeea8f1a2c72395a58dbc12ef9640d2b95784e974a4d2d5a9b17c25fedacfe551bda52602de8f6d2e48443f5dd1a2a2a8e6a5e70ecdb88cd6e766ad9745c7ee91d78cc55c3d06536b49c3fee6c3d0b6ff0fb2bf13a314f57c953b8f4d93bf88e70418010200090502533b85cd021b0200520910a42704b92866382a47200419110200060502533b85cd000a091042ce2c64bc0ba99214b2009e26b26852c8b13b10c35768e40e78fbbb48bd084100a0c79d9ea0844fa5853dd3c85ff3ecae6f2c9dd6c557aa04008bbbc964cd65b9b8299d4ebf31f41cc7264b8cf33a00e82c5af022331fac79efc9563a822497ba012953cefe2629f1242fcdcb911dbb2315985bab060bfd58261ace3c654bdbbe2e8ed27a46e836490145c86dc7bae15c011f7e1ffc33730109b9338cd9f483e7cef3d2f396aab5bd80efb6646d7e778270ee99d934d187dd98"
+const revokedKeyHex = "988d045331ce82010400c4fdf7b40a5477f206e6ee278eaef888ca73bf9128a9eef9f2f1ddb8b7b71a4c07cfa241f028a04edb405e4d916c61d6beabc333813dc7b484d2b3c52ee233c6a79b1eea4e9cc51596ba9cd5ac5aeb9df62d86ea051055b79d03f8a4fa9f38386f5bd17529138f3325d46801514ea9047977e0829ed728e68636802796801be10011010001889f04200102000905025331d0e3021d03000a0910a401d9f09a34f7c042aa040086631196405b7e6af71026b88e98012eab44aa9849f6ef3fa930c7c9f23deaedba9db1538830f8652fb7648ec3fcade8dbcbf9eaf428e83c6cbcc272201bfe2fbb90d41963397a7c0637a1a9d9448ce695d9790db2dc95433ad7be19eb3de72dacf1d6db82c3644c13eae2a3d072b99bb341debba012c5ce4006a7d34a1f4b94b444526567205265766f6b657220283c52656727732022424d204261726973746122204b657920262530305c303e5c29203c72656740626d626172697374612e636f2e61753e88b704130102002205025331ce82021b03060b090807030206150802090a0b0416020301021e01021780000a0910a401d9f09a34f7c0019c03f75edfbeb6a73e7225ad3cc52724e2872e04260d7daf0d693c170d8c4b243b8767bc7785763533febc62ec2600c30603c433c095453ede59ff2fcabeb84ce32e0ed9d5cf15ffcbc816202b64370d4d77c1e9077d74e94a16fb4fa2e5bec23a56d7a73cf275f91691ae1801a976fcde09e981a2f6327ac27ea1fecf3185df0d56889c04100102000605025331cfb5000a0910fe9645554e8266b64b4303fc084075396674fb6f778d302ac07cef6bc0b5d07b66b2004c44aef711cbac79617ef06d836b4957522d8772dd94bf41a2f4ac8b1ee6d70c57503f837445a74765a076d07b829b8111fc2a918423ddb817ead7ca2a613ef0bfb9c6b3562aec6c3cf3c75ef3031d81d95f6563e4cdcc9960bcb386c5d757b104fcca5fe11fc709df884604101102000605025331cfe7000a09107b15a67f0b3ddc0317f6009e360beea58f29c1d963a22b962b80788c3fa6c84e009d148cfde6b351469b8eae91187eff07ad9d08fcaab88d045331ce820104009f25e20a42b904f3fa555530fe5c46737cf7bd076c35a2a0d22b11f7e0b61a69320b768f4a80fe13980ce380d1cfc4a0cd8fbe2d2e2ef85416668b77208baa65bf973fe8e500e78cc310d7c8705cdb34328bf80e24f0385fce5845c33bc7943cf6b11b02348a23da0bf6428e57c05135f2dc6bd7c1ce325d666d5a5fd2fd5e410011010001889f04180102000905025331ce82021b0c000a0910a401d9f09a34f7c0418003fe34feafcbeaef348a800a0d908a7a6809cc7304017d820f70f0474d5e23cb17e38b67dc6dca282c6ca00961f4ec9edf2738d0f087b1d81e4871ef08e1798010863afb4eac4c44a376cb343be929c5be66a78cfd4456ae9ec6a99d97f4e1c3ff3583351db2147a65c0acef5c003fb544ab3a2e2dc4d43646f58b811a6c3a369d1f"
+const revokedSubkeyHex = "988d04533121f6010400aefc803a3e4bb1a61c86e8a86d2726c6a43e0079e9f2713f1fa017e9854c83877f4aced8e331d675c67ea83ddab80aacbfa0b9040bb12d96f5a3d6be09455e2a76546cbd21677537db941cab710216b6d24ec277ee0bd65b910f416737ed120f6b93a9d3b306245c8cfd8394606fdb462e5cf43c551438d2864506c63367fc890011010001b41d416c696365203c616c69636540626d626172697374612e636f2e61753e88bb041301020025021b03060b090807030206150802090a0b0416020301021e01021780050253312798021901000a09104ef7e4beccde97f015a803ff5448437780f63263b0df8442a995e7f76c221351a51edd06f2063d8166cf3157aada4923dfc44aa0f2a6a4da5cf83b7fe722ba8ab416c976e77c6b5682e7f1069026673bd0de56ba06fd5d7a9f177607f277d9b55ff940a638c3e68525c67517e2b3d976899b93ca267f705b3e5efad7d61220e96b618a4497eab8d04403d23f8846041011020006050253312910000a09107b15a67f0b3ddc03d96e009f50b6365d86c4be5d5e9d0ea42d5e56f5794c617700a0ab274e19c2827780016d23417ce89e0a2c0d987d889c04100102000605025331cf7a000a0910a401d9f09a34f7c0ee970400aca292f213041c9f3b3fc49148cbda9d84afee6183c8dd6c5ff2600b29482db5fecd4303797be1ee6d544a20a858080fec43412061c9a71fae4039fd58013b4ae341273e6c66ad4c7cdd9e68245bedb260562e7b166f2461a1032f2b38c0e0e5715fb3d1656979e052b55ca827a76f872b78a9fdae64bc298170bfcebedc1271b41a416c696365203c616c696365407379646973702e6f722e61753e88b804130102002205025331278b021b03060b090807030206150802090a0b0416020301021e01021780000a09104ef7e4beccde97f06a7003fa03c3af68d272ebc1fa08aa72a03b02189c26496a2833d90450801c4e42c5b5f51ad96ce2d2c9cef4b7c02a6a2fcf1412d6a2d486098eb762f5010a201819c17fd2888aec8eda20c65a3b75744de7ee5cc8ac7bfc470cbe3cb982720405a27a3c6a8c229cfe36905f881b02ed5680f6a8f05866efb9d6c5844897e631deb949ca8846041011020006050253312910000a09107b15a67f0b3ddc0347bc009f7fa35db59147469eb6f2c5aaf6428accb138b22800a0caa2f5f0874bacc5909c652a57a31beda65eddd5889c04100102000605025331cf7a000a0910a401d9f09a34f7c0316403ff46f2a5c101256627f16384d34a38fb47a6c88ba60506843e532d91614339fccae5f884a5741e7582ffaf292ba38ee10a270a05f139bde3814b6a077e8cd2db0f105ebea2a83af70d385f13b507fac2ad93ff79d84950328bb86f3074745a8b7f9b64990fb142e2a12976e27e8d09a28dc5621f957ac49091116da410ac3cbde1b88d04533121f6010400cbd785b56905e4192e2fb62a720727d43c4fa487821203cf72138b884b78b701093243e1d8c92a0248a6c0203a5a88693da34af357499abacaf4b3309c640797d03093870a323b4b6f37865f6eaa2838148a67df4735d43a90ca87942554cdf1c4a751b1e75f9fd4ce4e97e278d6c1c7ed59d33441df7d084f3f02beb68896c70011010001889f0418010200090502533121f6021b0c000a09104ef7e4beccde97f0b98b03fc0a5ccf6a372995835a2f5da33b282a7d612c0ab2a97f59cf9fff73e9110981aac2858c41399afa29624a7fd8a0add11654e3d882c0fd199e161bdad65e5e2548f7b68a437ea64293db1246e3011cbb94dc1bcdeaf0f2539bd88ff16d95547144d97cead6a8c5927660a91e6db0d16eb36b7b49a3525b54d1644e65599b032b7eb901a204533127a0110400bd3edaa09eff9809c4edc2c2a0ebe52e53c50a19c1e49ab78e6167bf61473bb08f2050d78a5cbbc6ed66aff7b42cd503f16b4a0b99fa1609681fca9b7ce2bbb1a5b3864d6cdda4d7ef7849d156d534dea30fb0efb9e4cf8959a2b2ce623905882d5430b995a15c3b9fe92906086788b891002924f94abe139b42cbbfaaabe42f00a0b65dc1a1ad27d798adbcb5b5ad02d2688c89477b03ff4eebb6f7b15a73b96a96bed201c0e5e4ea27e4c6e2dd1005b94d4b90137a5b1cf5e01c6226c070c4cc999938101578877ee76d296b9aab8246d57049caacf489e80a3f40589cade790a020b1ac146d6f7a6241184b8c7fcde680eae3188f5dcbe846d7f7bdad34f6fcfca08413e19c1d5df83fc7c7c627d493492e009c2f52a80400a2fe82de87136fd2e8845888c4431b032ba29d9a29a804277e31002a8201fb8591a3e55c7a0d0881496caf8b9fb07544a5a4879291d0dc026a0ea9e5bd88eb4aa4947bbd694b25012e208a250d65ddc6f1eea59d3aed3b4ec15fcab85e2afaa23a40ab1ef9ce3e11e1bc1c34a0e758e7aa64deb8739276df0af7d4121f834a9b88e70418010200090502533127a0021b02005209104ef7e4beccde97f047200419110200060502533127a0000a0910dbce4ee19529437fe045009c0b32f5ead48ee8a7e98fac0dea3d3e6c0e2c552500a0ad71fadc5007cfaf842d9b7db3335a8cdad15d3d1a6404009b08e2c68fe8f3b45c1bb72a4b3278cdf3012aa0f229883ad74aa1f6000bb90b18301b2f85372ca5d6b9bf478d235b733b1b197d19ccca48e9daf8e890cb64546b4ce1b178faccfff07003c172a2d4f5ebaba9f57153955f3f61a9b80a4f5cb959908f8b211b03b7026a8a82fc612bfedd3794969bcf458c4ce92be215a1176ab88d045331d144010400a5063000c5aaf34953c1aa3bfc95045b3aab9882b9a8027fecfe2142dc6b47ba8aca667399990244d513dd0504716908c17d92c65e74219e004f7b83fc125e575dd58efec3ab6dd22e3580106998523dea42ec75bf9aa111734c82df54630bebdff20fe981cfc36c76f865eb1c2fb62c9e85bc3a6e5015a361a2eb1c8431578d0011010001889f04280102000905025331d433021d03000a09104ef7e4beccde97f02e5503ff5e0630d1b65291f4882b6d40a29da4616bb5088717d469fbcc3648b8276de04a04988b1f1b9f3e18f52265c1f8b6c85861691c1a6b8a3a25a1809a0b32ad330aec5667cb4262f4450649184e8113849b05e5ad06a316ea80c001e8e71838190339a6e48bbde30647bcf245134b9a97fa875c1d83a9862cae87ffd7e2c4ce3a1b89013d04180102000905025331d144021b0200a809104ef7e4beccde97f09d2004190102000605025331d144000a0910677815e371c2fd23522203fe22ab62b8e7a151383cea3edd3a12995693911426f8ccf125e1f6426388c0010f88d9ca7da2224aee8d1c12135998640c5e1813d55a93df472faae75bef858457248db41b4505827590aeccf6f9eb646da7f980655dd3050c6897feddddaca90676dee856d66db8923477d251712bb9b3186b4d0114daf7d6b59272b53218dd1da94a03ff64006fcbe71211e5daecd9961fba66cdb6de3f914882c58ba5beddeba7dcb950c1156d7fba18c19ea880dccc800eae335deec34e3b84ac75ffa24864f782f87815cda1c0f634b3dd2fa67cea30811d21723d21d9551fa12ccbcfa62b6d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UYhsU9ytaDAJmvf9DujxEOsN5G1YJep
+54JCKVCkM/y585Zcnn+yxk/XwqoNQ0/iJUT9qRrZWvoeasxhl1PQcwihCwss44A+
+YXaAt3hbk+6LEQuZoYS73yR3WHj+42tfm7YxRGeubXfgCEz/brETEWXMh4pe0vCL
+bfWrmfSPq2rDegYcAybxRQz0lF8PAAoJEO3UDQUIHpI/exkH/0vQfdHA8g/N4T6E
+i6b1CUVBAkvtdJpCATZjWPhXmShOw62gkDw306vHPilL4SCvEEi4KzG72zkp6VsB
+DSRcpxCwT4mHue+duiy53/aRMtSJ+vDfiV1Vhq+3sWAck/yUtfDU9/u4eFaiNok1
+8/Gd7reyuZt5CiJnpdPpjCwelK21l2w7sHAnJF55ITXdOxI8oG3BRKufz0z5lyDY
+s2tXYmhhQIggdgelN8LbcMhWs/PBbtUr6uZlNJG2lW1yscD4aI529VjwJlCeo745
+U7pO4eF05VViUJ2mmfoivL3tkhoTUWhx8xs8xCUcCg8DoEoSIhxtOmoTPR22Z9BL
+6LCg2mg=
+=Dhm4
+-----END PGP PUBLIC KEY BLOCK-----`
+
+const goodCrossSignatureKey = `-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1
+
+mI0EVUqeVwEEAMufHRrMPWK3gyvi0O0tABCs/oON9zV9KDZlr1a1M91ShCSFwCPo
+7r80PxdWVWcj0V5h50/CJYtpN3eE/mUIgW2z1uDYQF1OzrQ8ubrksfsJvpAhENom
+lTQEppv9mV8qhcM278teb7TX0pgrUHLYF5CfPdp1L957JLLXoQR/lwLVABEBAAG0
+E2dvb2Qtc2lnbmluZy1zdWJrZXmIuAQTAQIAIgUCVUqeVwIbAwYLCQgHAwIGFQgC
+CQoLBBYCAwECHgECF4AACgkQNRjL95IRWP69XQQAlH6+eyXJN4DZTLX78KGjHrsw
+6FCvxxClEPtPUjcJy/1KCRQmtLAt9PbbA78dvgzjDeZMZqRAwdjyJhjyg/fkU2OH
+7wq4ktjUu+dLcOBb+BFMEY+YjKZ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rDh42aE0OAQD8xn4G6CN8UtW9xihXOY6FpxiJ/sMc2VaneeUd34oa
+4g==
+=XZm8
+-----END PGP PRIVATE KEY BLOCK-----`
+
+// https://tests.sequoia-pgp.org/#Certificate_expiration
+// P _ U p
+const expiringPrimaryUIDKey = `-----BEGIN PGP PUBLIC KEY BLOCK-----
+
+xsDNBF2lnPIBDAC5cL9PQoQLTMuhjbYvb4Ncuuo0bfmgPRFywX53jPhoFf4Zg6mv
+/seOXpgecTdOcVttfzC8ycIKrt3aQTiwOG/ctaR4Bk/t6ayNFfdUNxHWk4WCKzdz
+/56fW2O0F23qIRd8UUJp5IIlN4RDdRCtdhVQIAuzvp2oVy/LaS2kxQoKvph/5pQ/
+5whqsyroEWDJoSV0yOb25B/iwk/pLUFoyhDG9bj0kIzDxrEqW+7Ba8nocQlecMF3
+X5KMN5kp2zraLv9dlBBpWW43XktjcCZgMy20SouraVma8Je/ECwUWYUiAZxLIlMv
+9CurEOtxUw6N3RdOtLmYZS9uEnn5y1UkF88o8Nku890uk6BrewFzJyLAx5wRZ4F0
+qV/yq36UWQ0JB/AUGhHVPdFf6pl6eaxBwT5GXvbBUibtf8YI2og5RsgTWtXfU7eb
+SGXrl5ZMpbA6mbfhd0R8aPxWfmDWiIOhBufhMCvUHh1sApMKVZnvIff9/0Dca3wb
+vLIwa3T4CyshfT0AEQEAAc0hQm9iIEJhYmJhZ2UgPGJvYkBvcGVucGdwLmV4YW1w
+bGU+wsFcBBMBCgCQBYJhesp/BYkEWQPJBQsJCAcCCRD7/MgqAV5zMEcUAAAAAAAe
+ACBzYWx0QG5vdGF0aW9ucy5zZXF1b2lhLXBncC5vcmeEOQlNyTLFkc9I/elp+BpY
+495V7KatqtDmsyDr+zDAdwYVCgkICwIEFgIDAQIXgAIbAwIeARYhBNGmbhojsYLJ
+mA94jPv8yCoBXnMwAABSCQv/av8hKyynMtXVKFuWOGJw0mR8auDm84WdhMFRZg8t
+yTJ1L88+Ny4WUAFeqo2j7DU2yPGrm5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`-----BEGIN PGP PRIVATE KEY BLOCK-----
+Comment: gpg (GnuPG) 2.2.27 with libgcrypt 1.9.4
+
+lFgEYvTtQBYJKwYBBAHaRw8BAQdAxsNXLbrk5xOjpO24VhOMvQ0/F+JcyIkckMDH
+X3FIGxcAAQDFOlunZWYuPsCx5JLp78vKqUTfgef9TGG4oD6I/Sa0zBMstCJHb2xh
+bmcgR29waGVyIDxnb2xhbmdAZXhhbXBsZS5vcmc+iJAEExYIADgWIQSFQHEOazmo
+h1ldII4MvfnLQ4JBNwUCYvTtQAIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAK
+CRAMvfnLQ4JBN5yeAQCKdry8B5ScCPrev2+UByMCss7Sdu5RhomCFsHdNPLcKAEA
+8ugei+1owHsV+3cGwWWzKk6sLa8ZN87i3SKuOGp9DQycXQRi9O1AEgorBgEEAZdV
+AQUBAQdA5CubPp8l7lrVQ25h7Hx5XN2C8xanRnnpcjzEooCaEA0DAQgHAAD/Rpc+
+sOZUXrFk9HOWB1XU41LoWbDBoG8sP8RWAVYwD5AQRYh4BBgWCAAgFiEEhUBxDms5
+qIdZXSCODL35y0OCQTcFAmL07UACGwwACgkQDL35y0OCQTcvdwEA7lb5g/YisrEf
+iq660uwMGoepLUfvtqKzuQ6heYe83y0BAN65Ffg5HYOJzUEi0kZQRf7OhdtuL2kJ
+SRXn8DmCTfEB
+=cELM
+-----END PGP PRIVATE KEY BLOCK-----`
+
+const curve448PrivateKey = `-----BEGIN PGP PRIVATE KEY BLOCK-----
+Comment: C1DB 65D5 80D7 B922 7254 4B1E A699 9895 FABA CE52
+
+xYUEYV2UmRYDK2VxAc9AFyxgh5xnSbyt50TWl558mw9xdMN+/UBLr5+UMP8IsrvV
+MdXuTIE8CyaUQKSotHtH2RkYEXj5nsMAAAHPQIbTMSzjIWug8UFECzAex5FHgAgH
+gYF3RK+TS8D24wX8kOu2C/NoVxwGY+p+i0JHaB+7yljriSKAGxs6wsBEBB8WCgCD
+BYJhXZSZBY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Svh
+-----END PGP PRIVATE KEY BLOCK-----`
+
+const keyWithNotation = `-----BEGIN PGP PRIVATE KEY BLOCK-----
+
+xVgEY9gIshYJKwYBBAHaRw8BAQdAF25fSM8OpFlXZhop4Qpqo5ywGZ4jgWlR
+ppjhIKDthREAAQC+LFpzFcMJYcjxGKzBGHN0Px2jU4d04YSRnFAik+lVVQ6u
+zRdUZXN0IDx0ZXN0QGV4YW1wbGUuY29tPsLACgQQFgoAfAUCY9gIsgQLCQcI
+CRD/utJOCym8pR0UgAAAAAAQAAR0ZXh0QGV4YW1wbGUuY29tdGVzdB8UAAAA
+AAASAARiaW5hcnlAZXhhbXBsZS5jb20AAQIDAxUICgQWAAIBAhkBAhsDAh4B
+FiEEEMCQTUVGKgCX5rDQ/7rSTgspvKUAAPl5AP9Npz90LxzrB97Qr2DrGwfG
+wuYn4FSYwtuPfZHHeoIabwD/QEbvpQJ/NBb9EAZuow4Rirlt1yv19mmnF+j5
+8yUzhQjHXQRj2AiyEgorBgEEAZdVAQUBAQdARXAo30DmKcyUg6co7OUm0RNT
+z9iqFbDBzA8A47JEt1MDAQgHAAD/XKK3lBm0SqMR558HLWdBrNG6NqKuqb5X
+joCML987ZNgRD8J4BBgWCAAqBQJj2AiyCRD/utJOCym8pQIbDBYhBBDAkE1F
+RioAl+aw0P+60k4LKbylAADRxgEAg7UfBDiDPp5LHcW9D+SgFHk6+GyEU4ev
+VppQxdtxPvAA/34snHBX7Twnip1nMt7P4e2hDiw/hwQ7oqioOvc6jMkP
+=Z8YJ
+-----END PGP PRIVATE KEY BLOCK-----
+`
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_config.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_config.go
new file mode 100644
index 0000000000..ef100d372b
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_config.go
@@ -0,0 +1,67 @@
+// Copyright (C) 2019 ProtonTech AG
+
+package packet
+
+import "math/bits"
+
+// CipherSuite contains a combination of Cipher and Mode
+type CipherSuite struct {
+ // The cipher function
+ Cipher CipherFunction
+ // The AEAD mode of operation.
+ Mode AEADMode
+}
+
+// AEADConfig collects a number of AEAD parameters along with sensible defaults.
+// A nil AEADConfig is valid and results in all default values.
+type AEADConfig struct {
+ // The AEAD mode of operation.
+ DefaultMode AEADMode
+ // Amount of octets in each chunk of data
+ ChunkSize uint64
+}
+
+// Mode returns the AEAD mode of operation.
+func (conf *AEADConfig) Mode() AEADMode {
+ // If no preference is specified, OCB is used (which is mandatory to implement).
+ if conf == nil || conf.DefaultMode == 0 {
+ return AEADModeOCB
+ }
+
+ mode := conf.DefaultMode
+ if mode != AEADModeEAX && mode != AEADModeOCB && mode != AEADModeGCM {
+ panic("AEAD mode unsupported")
+ }
+ return mode
+}
+
+// ChunkSizeByte returns the byte indicating the chunk size. The effective
+// chunk size is computed with the formula uint64(1) << (chunkSizeByte + 6)
+// limit chunkSizeByte to 16 which equals to 2^22 = 4 MiB
+// https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-5.13.2
+func (conf *AEADConfig) ChunkSizeByte() byte {
+ if conf == nil || conf.ChunkSize == 0 {
+ return 12 // 1 << (12 + 6) == 262144 bytes
+ }
+
+ chunkSize := conf.ChunkSize
+ exponent := bits.Len64(chunkSize) - 1
+ switch {
+ case exponent < 6:
+ exponent = 6
+ case exponent > 22:
+ exponent = 22
+ }
+
+ return byte(exponent - 6)
+}
+
+// decodeAEADChunkSize returns the effective chunk size. In 32-bit systems, the
+// maximum returned value is 1 << 30.
+func decodeAEADChunkSize(c byte) int {
+ size := uint64(1 << (c + 6))
+ if size != uint64(int(size)) {
+ return 1 << 30
+ }
+ return int(size)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_crypter.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_crypter.go
new file mode 100644
index 0000000000..5e46046563
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_crypter.go
@@ -0,0 +1,250 @@
+// Copyright (C) 2019 ProtonTech AG
+
+package packet
+
+import (
+ "crypto/cipher"
+ "encoding/binary"
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+)
+
+// aeadCrypter is an AEAD opener/sealer, its configuration, and data for en/decryption.
+type aeadCrypter struct {
+ aead cipher.AEAD
+ chunkSize int
+ nonce []byte
+ associatedData []byte // Chunk-independent associated data
+ chunkIndex []byte // Chunk counter
+ packetTag packetType // SEIP packet (v2) or AEAD Encrypted Data packet
+ bytesProcessed int // Amount of plaintext bytes encrypted/decrypted
+}
+
+// computeNonce takes the incremental index and computes an eXclusive OR with
+// the least significant 8 bytes of the receivers' initial nonce (see sec.
+// 5.16.1 and 5.16.2). It returns the resulting nonce.
+func (wo *aeadCrypter) computeNextNonce() (nonce []byte) {
+ if wo.packetTag == packetTypeSymmetricallyEncryptedIntegrityProtected {
+ return wo.nonce
+ }
+
+ nonce = make([]byte, len(wo.nonce))
+ copy(nonce, wo.nonce)
+ offset := len(wo.nonce) - 8
+ for i := 0; i < 8; i++ {
+ nonce[i+offset] ^= wo.chunkIndex[i]
+ }
+ return
+}
+
+// incrementIndex performs an integer increment by 1 of the integer represented by the
+// slice, modifying it accordingly.
+func (wo *aeadCrypter) incrementIndex() error {
+ index := wo.chunkIndex
+ if len(index) == 0 {
+ return errors.AEADError("Index has length 0")
+ }
+ for i := len(index) - 1; i >= 0; i-- {
+ if index[i] < 255 {
+ index[i]++
+ return nil
+ }
+ index[i] = 0
+ }
+ return errors.AEADError("cannot further increment index")
+}
+
+// aeadDecrypter reads and decrypts bytes. It buffers extra decrypted bytes when
+// necessary, similar to aeadEncrypter.
+type aeadDecrypter struct {
+ aeadCrypter // Embedded ciphertext opener
+ reader io.Reader // 'reader' is a partialLengthReader
+ chunkBytes []byte
+ peekedBytes []byte // Used to detect last chunk
+ buffer []byte // Buffered decrypted bytes
+}
+
+// Read decrypts bytes and reads them into dst. It decrypts when necessary and
+// buffers extra decrypted bytes. It returns the number of bytes copied into dst
+// and an error.
+func (ar *aeadDecrypter) Read(dst []byte) (n int, err error) {
+ // Return buffered plaintext bytes from previous calls
+ if len(ar.buffer) > 0 {
+ n = copy(dst, ar.buffer)
+ ar.buffer = ar.buffer[n:]
+ return
+ }
+
+ // Read a chunk
+ tagLen := ar.aead.Overhead()
+ copy(ar.chunkBytes, ar.peekedBytes) // Copy bytes peeked in previous chunk or in initialization
+ bytesRead, errRead := io.ReadFull(ar.reader, ar.chunkBytes[tagLen:])
+ if errRead != nil && errRead != io.EOF && errRead != io.ErrUnexpectedEOF {
+ return 0, errRead
+ }
+
+ if bytesRead > 0 {
+ ar.peekedBytes = ar.chunkBytes[bytesRead:bytesRead+tagLen]
+
+ decrypted, errChunk := ar.openChunk(ar.chunkBytes[:bytesRead])
+ if errChunk != nil {
+ return 0, errChunk
+ }
+
+ // Return decrypted bytes, buffering if necessary
+ n = copy(dst, decrypted)
+ ar.buffer = decrypted[n:]
+ return
+ }
+
+ return 0, io.EOF
+}
+
+// Close checks the final authentication tag of the stream.
+// In the future, this function could also be used to wipe the reader
+// and peeked & decrypted bytes, if necessary.
+func (ar *aeadDecrypter) Close() (err error) {
+ errChunk := ar.validateFinalTag(ar.peekedBytes)
+ if errChunk != nil {
+ return errChunk
+ }
+ return nil
+}
+
+// openChunk decrypts and checks integrity of an encrypted chunk, returning
+// the underlying plaintext and an error. It accesses peeked bytes from next
+// chunk, to identify the last chunk and decrypt/validate accordingly.
+func (ar *aeadDecrypter) openChunk(data []byte) ([]byte, error) {
+ adata := ar.associatedData
+ if ar.aeadCrypter.packetTag == packetTypeAEADEncrypted {
+ adata = append(ar.associatedData, ar.chunkIndex...)
+ }
+
+ nonce := ar.computeNextNonce()
+ plainChunk, err := ar.aead.Open(data[:0:len(data)], nonce, data, adata)
+ if err != nil {
+ return nil, errors.ErrAEADTagVerification
+ }
+ ar.bytesProcessed += len(plainChunk)
+ if err = ar.aeadCrypter.incrementIndex(); err != nil {
+ return nil, err
+ }
+ return plainChunk, nil
+}
+
+// Checks the summary tag. It takes into account the total decrypted bytes into
+// the associated data. It returns an error, or nil if the tag is valid.
+func (ar *aeadDecrypter) validateFinalTag(tag []byte) error {
+ // Associated: tag, version, cipher, aead, chunk size, ...
+ amountBytes := make([]byte, 8)
+ binary.BigEndian.PutUint64(amountBytes, uint64(ar.bytesProcessed))
+
+ adata := ar.associatedData
+ if ar.aeadCrypter.packetTag == packetTypeAEADEncrypted {
+ // ... index ...
+ adata = append(ar.associatedData, ar.chunkIndex...)
+ }
+
+ // ... and total number of encrypted octets
+ adata = append(adata, amountBytes...)
+ nonce := ar.computeNextNonce()
+ if _, err := ar.aead.Open(nil, nonce, tag, adata); err != nil {
+ return errors.ErrAEADTagVerification
+ }
+ return nil
+}
+
+// aeadEncrypter encrypts and writes bytes. It encrypts when necessary according
+// to the AEAD block size, and buffers the extra encrypted bytes for next write.
+type aeadEncrypter struct {
+ aeadCrypter // Embedded plaintext sealer
+ writer io.WriteCloser // 'writer' is a partialLengthWriter
+ chunkBytes []byte
+ offset int
+}
+
+// Write encrypts and writes bytes. It encrypts when necessary and buffers extra
+// plaintext bytes for next call. When the stream is finished, Close() MUST be
+// called to append the final tag.
+func (aw *aeadEncrypter) Write(plaintextBytes []byte) (n int, err error) {
+ for n != len(plaintextBytes) {
+ copied := copy(aw.chunkBytes[aw.offset:aw.chunkSize], plaintextBytes[n:])
+ n += copied
+ aw.offset += copied
+
+ if aw.offset == aw.chunkSize {
+ encryptedChunk, err := aw.sealChunk(aw.chunkBytes[:aw.offset])
+ if err != nil {
+ return n, err
+ }
+ _, err = aw.writer.Write(encryptedChunk)
+ if err != nil {
+ return n, err
+ }
+ aw.offset = 0
+ }
+ }
+ return
+}
+
+// Close encrypts and writes the remaining buffered plaintext if any, appends
+// the final authentication tag, and closes the embedded writer. This function
+// MUST be called at the end of a stream.
+func (aw *aeadEncrypter) Close() (err error) {
+ // Encrypt and write a chunk if there's buffered data left, or if we haven't
+ // written any chunks yet.
+ if aw.offset > 0 || aw.bytesProcessed == 0 {
+ lastEncryptedChunk, err := aw.sealChunk(aw.chunkBytes[:aw.offset])
+ if err != nil {
+ return err
+ }
+ _, err = aw.writer.Write(lastEncryptedChunk)
+ if err != nil {
+ return err
+ }
+ }
+ // Compute final tag (associated data: packet tag, version, cipher, aead,
+ // chunk size...
+ adata := aw.associatedData
+
+ if aw.aeadCrypter.packetTag == packetTypeAEADEncrypted {
+ // ... index ...
+ adata = append(aw.associatedData, aw.chunkIndex...)
+ }
+
+ // ... and total number of encrypted octets
+ amountBytes := make([]byte, 8)
+ binary.BigEndian.PutUint64(amountBytes, uint64(aw.bytesProcessed))
+ adata = append(adata, amountBytes...)
+
+ nonce := aw.computeNextNonce()
+ finalTag := aw.aead.Seal(nil, nonce, nil, adata)
+ _, err = aw.writer.Write(finalTag)
+ if err != nil {
+ return err
+ }
+ return aw.writer.Close()
+}
+
+// sealChunk Encrypts and authenticates the given chunk.
+func (aw *aeadEncrypter) sealChunk(data []byte) ([]byte, error) {
+ if len(data) > aw.chunkSize {
+ return nil, errors.AEADError("chunk exceeds maximum length")
+ }
+ if aw.associatedData == nil {
+ return nil, errors.AEADError("can't seal without headers")
+ }
+ adata := aw.associatedData
+ if aw.aeadCrypter.packetTag == packetTypeAEADEncrypted {
+ adata = append(aw.associatedData, aw.chunkIndex...)
+ }
+
+ nonce := aw.computeNextNonce()
+ encrypted := aw.aead.Seal(data[:0], nonce, data, adata)
+ aw.bytesProcessed += len(data)
+ if err := aw.aeadCrypter.incrementIndex(); err != nil {
+ return nil, err
+ }
+ return encrypted, nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_encrypted.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_encrypted.go
new file mode 100644
index 0000000000..583765d87c
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_encrypted.go
@@ -0,0 +1,100 @@
+// Copyright (C) 2019 ProtonTech AG
+
+package packet
+
+import (
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm"
+)
+
+// AEADEncrypted represents an AEAD Encrypted Packet.
+// See https://www.ietf.org/archive/id/draft-koch-openpgp-2015-rfc4880bis-00.html#name-aead-encrypted-data-packet-t
+type AEADEncrypted struct {
+ cipher CipherFunction
+ mode AEADMode
+ chunkSizeByte byte
+ Contents io.Reader // Encrypted chunks and tags
+ initialNonce []byte // Referred to as IV in RFC4880-bis
+}
+
+// Only currently defined version
+const aeadEncryptedVersion = 1
+
+func (ae *AEADEncrypted) parse(buf io.Reader) error {
+ headerData := make([]byte, 4)
+ if n, err := io.ReadFull(buf, headerData); n < 4 {
+ return errors.AEADError("could not read aead header:" + err.Error())
+ }
+ // Read initial nonce
+ mode := AEADMode(headerData[2])
+ nonceLen := mode.IvLength()
+
+ // This packet supports only EAX and OCB
+ // https://www.ietf.org/archive/id/draft-koch-openpgp-2015-rfc4880bis-00.html#name-aead-encrypted-data-packet-t
+ if nonceLen == 0 || mode > AEADModeOCB {
+ return errors.AEADError("unknown mode")
+ }
+
+ initialNonce := make([]byte, nonceLen)
+ if n, err := io.ReadFull(buf, initialNonce); n < nonceLen {
+ return errors.AEADError("could not read aead nonce:" + err.Error())
+ }
+ ae.Contents = buf
+ ae.initialNonce = initialNonce
+ c := headerData[1]
+ if _, ok := algorithm.CipherById[c]; !ok {
+ return errors.UnsupportedError("unknown cipher: " + string(c))
+ }
+ ae.cipher = CipherFunction(c)
+ ae.mode = mode
+ ae.chunkSizeByte = headerData[3]
+ return nil
+}
+
+// Decrypt returns a io.ReadCloser from which decrypted bytes can be read, or
+// an error.
+func (ae *AEADEncrypted) Decrypt(ciph CipherFunction, key []byte) (io.ReadCloser, error) {
+ return ae.decrypt(key)
+}
+
+// decrypt prepares an aeadCrypter and returns a ReadCloser from which
+// decrypted bytes can be read (see aeadDecrypter.Read()).
+func (ae *AEADEncrypted) decrypt(key []byte) (io.ReadCloser, error) {
+ blockCipher := ae.cipher.new(key)
+ aead := ae.mode.new(blockCipher)
+ // Carry the first tagLen bytes
+ chunkSize := decodeAEADChunkSize(ae.chunkSizeByte)
+ tagLen := ae.mode.TagLength()
+ chunkBytes := make([]byte, chunkSize+tagLen*2)
+ peekedBytes := chunkBytes[chunkSize+tagLen:]
+ n, err := io.ReadFull(ae.Contents, peekedBytes)
+ if n < tagLen || (err != nil && err != io.EOF) {
+ return nil, errors.AEADError("Not enough data to decrypt:" + err.Error())
+ }
+
+ return &aeadDecrypter{
+ aeadCrypter: aeadCrypter{
+ aead: aead,
+ chunkSize: chunkSize,
+ nonce: ae.initialNonce,
+ associatedData: ae.associatedData(),
+ chunkIndex: make([]byte, 8),
+ packetTag: packetTypeAEADEncrypted,
+ },
+ reader: ae.Contents,
+ chunkBytes: chunkBytes,
+ peekedBytes: peekedBytes,
+ }, nil
+}
+
+// associatedData for chunks: tag, version, cipher, mode, chunk size byte
+func (ae *AEADEncrypted) associatedData() []byte {
+ return []byte{
+ 0xD4,
+ aeadEncryptedVersion,
+ byte(ae.cipher),
+ byte(ae.mode),
+ ae.chunkSizeByte}
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/compressed.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/compressed.go
new file mode 100644
index 0000000000..931f55a4e8
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/compressed.go
@@ -0,0 +1,192 @@
+// 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 packet
+
+import (
+ "compress/bzip2"
+ "compress/flate"
+ "compress/zlib"
+ "io"
+ "strconv"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+)
+
+// Compressed represents a compressed OpenPGP packet. The decompressed contents
+// will contain more OpenPGP packets. See RFC 4880, section 5.6.
+type Compressed struct {
+ Body io.Reader
+}
+
+const (
+ NoCompression = flate.NoCompression
+ BestSpeed = flate.BestSpeed
+ BestCompression = flate.BestCompression
+ DefaultCompression = flate.DefaultCompression
+)
+
+// CompressionConfig contains compressor configuration settings.
+type CompressionConfig struct {
+ // Level is the compression level to use. It must be set to
+ // between -1 and 9, with -1 causing the compressor to use the
+ // default compression level, 0 causing the compressor to use
+ // no compression and 1 to 9 representing increasing (better,
+ // slower) compression levels. If Level is less than -1 or
+ // more then 9, a non-nil error will be returned during
+ // encryption. See the constants above for convenient common
+ // settings for Level.
+ Level int
+}
+
+// decompressionReader ensures that the whole compression packet is read.
+type decompressionReader struct {
+ compressed io.Reader
+ decompressed io.ReadCloser
+ readAll bool
+}
+
+func newDecompressionReader(r io.Reader, decompressor io.ReadCloser) *decompressionReader {
+ return &decompressionReader{
+ compressed: r,
+ decompressed: decompressor,
+ }
+}
+
+func (dr *decompressionReader) Read(data []byte) (n int, err error) {
+ if dr.readAll {
+ return 0, io.EOF
+ }
+ n, err = dr.decompressed.Read(data)
+ if err == io.EOF {
+ dr.readAll = true
+ // Close the decompressor.
+ if errDec := dr.decompressed.Close(); errDec != nil {
+ return n, errDec
+ }
+ // Consume all remaining data from the compressed packet.
+ consumeAll(dr.compressed)
+ }
+ return n, err
+}
+
+func (c *Compressed) parse(r io.Reader) error {
+ var buf [1]byte
+ _, err := readFull(r, buf[:])
+ if err != nil {
+ return err
+ }
+
+ switch buf[0] {
+ case 0:
+ c.Body = r
+ case 1:
+ c.Body = newDecompressionReader(r, flate.NewReader(r))
+ case 2:
+ decompressor, err := zlib.NewReader(r)
+ if err != nil {
+ return err
+ }
+ c.Body = newDecompressionReader(r, decompressor)
+ case 3:
+ c.Body = newDecompressionReader(r, io.NopCloser(bzip2.NewReader(r)))
+ default:
+ err = errors.UnsupportedError("unknown compression algorithm: " + strconv.Itoa(int(buf[0])))
+ }
+
+ return err
+}
+
+// LimitedBodyReader wraps the provided body reader with a limiter that restricts
+// the number of bytes read to the specified limit.
+// If limit is nil, the reader is unbounded.
+func (c *Compressed) LimitedBodyReader(limit *int64) io.Reader {
+ if limit == nil {
+ return c.Body
+ }
+ return &LimitReader{R: c.Body, N: *limit}
+}
+
+// compressedWriterCloser represents the serialized compression stream
+// header and the compressor. Its Close() method ensures that both the
+// compressor and serialized stream header are closed. Its Write()
+// method writes to the compressor.
+type compressedWriteCloser struct {
+ sh io.Closer // Stream Header
+ c io.WriteCloser // Compressor
+}
+
+func (cwc compressedWriteCloser) Write(p []byte) (int, error) {
+ return cwc.c.Write(p)
+}
+
+func (cwc compressedWriteCloser) Close() (err error) {
+ err = cwc.c.Close()
+ if err != nil {
+ return err
+ }
+
+ return cwc.sh.Close()
+}
+
+// SerializeCompressed serializes a compressed data packet to w and
+// returns a WriteCloser to which the literal data packets themselves
+// can be written and which MUST be closed on completion. If cc is
+// nil, sensible defaults will be used to configure the compression
+// algorithm.
+func SerializeCompressed(w io.WriteCloser, algo CompressionAlgo, cc *CompressionConfig) (literaldata io.WriteCloser, err error) {
+ compressed, err := serializeStreamHeader(w, packetTypeCompressed)
+ if err != nil {
+ return
+ }
+
+ _, err = compressed.Write([]byte{uint8(algo)})
+ if err != nil {
+ return
+ }
+
+ level := DefaultCompression
+ if cc != nil {
+ level = cc.Level
+ }
+
+ var compressor io.WriteCloser
+ switch algo {
+ case CompressionZIP:
+ compressor, err = flate.NewWriter(compressed, level)
+ case CompressionZLIB:
+ compressor, err = zlib.NewWriterLevel(compressed, level)
+ default:
+ s := strconv.Itoa(int(algo))
+ err = errors.UnsupportedError("Unsupported compression algorithm: " + s)
+ }
+ if err != nil {
+ return
+ }
+
+ literaldata = compressedWriteCloser{compressed, compressor}
+
+ return
+}
+
+// LimitReader is an io.Reader that fails with MessageToLarge if read bytes exceed N.
+type LimitReader struct {
+ R io.Reader // underlying reader
+ N int64 // max bytes allowed
+}
+
+func (l *LimitReader) Read(p []byte) (int, error) {
+ if l.N <= 0 {
+ return 0, errors.ErrMessageTooLarge
+ }
+
+ n, err := l.R.Read(p)
+ l.N -= int64(n)
+
+ if err == nil && l.N <= 0 {
+ err = errors.ErrMessageTooLarge
+ }
+
+ return n, err
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/config.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/config.go
new file mode 100644
index 0000000000..142be0aa05
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/config.go
@@ -0,0 +1,460 @@
+// 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 packet
+
+import (
+ "crypto"
+ "crypto/rand"
+ "io"
+ "math/big"
+ "time"
+
+ "github.com/ProtonMail/go-crypto/openpgp/s2k"
+)
+
+var (
+ defaultRejectPublicKeyAlgorithms = map[PublicKeyAlgorithm]bool{
+ PubKeyAlgoElGamal: true,
+ PubKeyAlgoDSA: true,
+ }
+ defaultRejectHashAlgorithms = map[crypto.Hash]bool{
+ crypto.MD5: true,
+ crypto.RIPEMD160: true,
+ }
+ defaultRejectMessageHashAlgorithms = map[crypto.Hash]bool{
+ crypto.SHA1: true,
+ crypto.MD5: true,
+ crypto.RIPEMD160: true,
+ }
+ defaultRejectCurves = map[Curve]bool{
+ CurveSecP256k1: true,
+ }
+)
+
+// A global feature flag to indicate v5 support.
+// Can be set via a build tag, e.g.: `go build -tags v5 ./...`
+// If the build tag is missing config_v5.go will set it to true.
+//
+// Disables parsing of v5 keys and v5 signatures.
+// These are non-standard entities, which in the crypto-refresh have been superseded
+// by v6 keys, v6 signatures and SEIPDv2 encrypted data, respectively.
+var V5Disabled = false
+
+// Config collects a number of parameters along with sensible defaults.
+// A nil *Config is valid and results in all default values.
+type Config struct {
+ // Rand provides the source of entropy.
+ // If nil, the crypto/rand Reader is used.
+ Rand io.Reader
+ // DefaultHash is the default hash function to be used.
+ // If zero, SHA-256 is used.
+ DefaultHash crypto.Hash
+ // DefaultCipher is the cipher to be used.
+ // If zero, AES-128 is used.
+ DefaultCipher CipherFunction
+ // Time returns the current time as the number of seconds since the
+ // epoch. If Time is nil, time.Now is used.
+ Time func() time.Time
+ // DefaultCompressionAlgo is the compression algorithm to be
+ // applied to the plaintext before encryption. If zero, no
+ // compression is done.
+ DefaultCompressionAlgo CompressionAlgo
+ // CompressionConfig configures the compression settings.
+ CompressionConfig *CompressionConfig
+ // S2K (String to Key) config, used for key derivation in the context of secret key encryption
+ // and password-encrypted data.
+ // If nil, the default configuration is used
+ S2KConfig *s2k.Config
+ // Iteration count for Iterated S2K (String to Key).
+ // Only used if sk2.Mode is nil.
+ // This value is duplicated here from s2k.Config for backwards compatibility.
+ // It determines the strength of the passphrase stretching when
+ // the said passphrase is hashed to produce a key. S2KCount
+ // should be between 65536 and 65011712, inclusive. If Config
+ // is nil or S2KCount is 0, the value 16777216 used. Not all
+ // values in the above range can be represented. S2KCount will
+ // be rounded up to the next representable value if it cannot
+ // be encoded exactly. When set, it is strongly encrouraged to
+ // use a value that is at least 65536. See RFC 4880 Section
+ // 3.7.1.3.
+ //
+ // Deprecated: SK2Count should be configured in S2KConfig instead.
+ S2KCount int
+ // RSABits is the number of bits in new RSA keys made with NewEntity.
+ // If zero, then 2048 bit keys are created.
+ RSABits int
+ // The public key algorithm to use - will always create a signing primary
+ // key and encryption subkey.
+ Algorithm PublicKeyAlgorithm
+ // Some known primes that are optionally prepopulated by the caller
+ RSAPrimes []*big.Int
+ // Curve configures the desired packet.Curve if the Algorithm is PubKeyAlgoECDSA,
+ // PubKeyAlgoEdDSA, or PubKeyAlgoECDH. If empty Curve25519 is used.
+ Curve Curve
+ // AEADConfig configures the use of the new AEAD Encrypted Data Packet,
+ // defined in the draft of the next version of the OpenPGP specification.
+ // If a non-nil AEADConfig is passed, usage of this packet is enabled. By
+ // default, it is disabled. See the documentation of AEADConfig for more
+ // configuration options related to AEAD.
+ // **Note: using this option may break compatibility with other OpenPGP
+ // implementations, as well as future versions of this library.**
+ AEADConfig *AEADConfig
+ // V6Keys configures version 6 key generation. If false, this package still
+ // supports version 6 keys, but produces version 4 keys.
+ V6Keys bool
+ // Minimum RSA key size allowed for key generation and message signing, verification and encryption.
+ MinRSABits uint16
+ // Reject insecure algorithms, only works with v2 api
+ RejectPublicKeyAlgorithms map[PublicKeyAlgorithm]bool
+ RejectHashAlgorithms map[crypto.Hash]bool
+ RejectMessageHashAlgorithms map[crypto.Hash]bool
+ RejectCurves map[Curve]bool
+ // "The validity period of the key. This is the number of seconds after
+ // the key creation time that the key expires. If this is not present
+ // or has a value of zero, the key never expires. This is found only on
+ // a self-signature.""
+ // https://tools.ietf.org/html/rfc4880#section-5.2.3.6
+ KeyLifetimeSecs uint32
+ // "The validity period of the signature. This is the number of seconds
+ // after the signature creation time that the signature expires. If
+ // this is not present or has a value of zero, it never expires."
+ // https://tools.ietf.org/html/rfc4880#section-5.2.3.10
+ SigLifetimeSecs uint32
+ // SigningKeyId is used to specify the signing key to use (by Key ID).
+ // By default, the signing key is selected automatically, preferring
+ // signing subkeys if available.
+ SigningKeyId uint64
+ // SigningIdentity is used to specify a user ID (packet Signer's User ID, type 28)
+ // when producing a generic certification signature onto an existing user ID.
+ // The identity must be present in the signer Entity.
+ SigningIdentity string
+ // InsecureAllowUnauthenticatedMessages controls, whether it is tolerated to read
+ // encrypted messages without Modification Detection Code (MDC).
+ // MDC is mandated by the IETF OpenPGP Crypto Refresh draft and has long been implemented
+ // in most OpenPGP implementations. Messages without MDC are considered unnecessarily
+ // insecure and should be prevented whenever possible.
+ // In case one needs to deal with messages from very old OpenPGP implementations, there
+ // might be no other way than to tolerate the missing MDC. Setting this flag, allows this
+ // mode of operation. It should be considered a measure of last resort.
+ InsecureAllowUnauthenticatedMessages bool
+ // InsecureAllowDecryptionWithSigningKeys allows decryption with keys marked as signing keys in the v2 API.
+ // This setting is potentially insecure, but it is needed as some libraries
+ // ignored key flags when selecting a key for encryption.
+ // Not relevant for the v1 API, as all keys were allowed in decryption.
+ InsecureAllowDecryptionWithSigningKeys bool
+ // KnownNotations is a map of Notation Data names to bools, which controls
+ // the notation names that are allowed to be present in critical Notation Data
+ // signature subpackets.
+ KnownNotations map[string]bool
+ // SignatureNotations is a list of Notations to be added to any signatures.
+ SignatureNotations []*Notation
+ // CheckIntendedRecipients controls, whether the OpenPGP Intended Recipient Fingerprint feature
+ // should be enabled for encryption and decryption.
+ // (See https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-12.html#name-intended-recipient-fingerpr).
+ // When the flag is set, encryption produces Intended Recipient Fingerprint signature sub-packets and decryption
+ // checks whether the key it was encrypted to is one of the included fingerprints in the signature.
+ // If the flag is disabled, no Intended Recipient Fingerprint sub-packets are created or checked.
+ // The default behavior, when the config or flag is nil, is to enable the feature.
+ CheckIntendedRecipients *bool
+ // CacheSessionKey controls if decryption should return the session key used for decryption.
+ // If the flag is set, the session key is cached in the message details struct.
+ CacheSessionKey bool
+ // CheckPacketSequence is a flag that controls if the pgp message reader should strictly check
+ // that the packet sequence conforms with the grammar mandated by rfc4880.
+ // The default behavior, when the config or flag is nil, is to check the packet sequence.
+ CheckPacketSequence *bool
+ // NonDeterministicSignaturesViaNotation is a flag to enable randomization of signatures.
+ // If true, a salt notation is used to randomize signatures generated by v4 and v5 keys
+ // (v6 signatures are always non-deterministic, by design).
+ // This protects EdDSA signatures from potentially leaking the secret key in case of faults (i.e. bitflips) which, in principle, could occur
+ // during the signing computation. It is added to signatures of any algo for simplicity, and as it may also serve as protection in case of
+ // weaknesses in the hash algo, potentially hindering e.g. some chosen-prefix attacks.
+ // The default behavior, when the config or flag is nil, is to enable the feature.
+ NonDeterministicSignaturesViaNotation *bool
+
+ // InsecureAllowAllKeyFlagsWhenMissing determines how a key without valid key flags is handled.
+ // When set to true, a key without flags is treated as if all flags are enabled.
+ // This behavior is consistent with GPG.
+ InsecureAllowAllKeyFlagsWhenMissing bool
+ // InsecureGenerateNonCriticalKeyFlags causes the "Key Flags" signature subpacket
+ // to be non-critical in newly generated signatures.
+ // This may be needed for keys to be accepted by older clients who do not recognize
+ // the subpacket.
+ // For example, rpm 4.14.3-150400.59.3.1 in OpenSUSE Leap 15.4 does not recognize it.
+ InsecureGenerateNonCriticalKeyFlags bool
+ // InsecureGenerateNonCriticalSignatureCreationTime causes the "Signature Creation Time" signature subpacket
+ // to be non-critical in newly generated signatures.
+ // This may be needed for keys to be accepted by older clients who do not recognize
+ // the subpacket.
+ // For example, yum 3.4.3-168 in CentOS 7 and yum 3.4.3-158 in Amazon Linux 2 do not recognize it.
+ InsecureGenerateNonCriticalSignatureCreationTime bool
+
+ // MaxDecompressedMessageSize specifies the maximum number of bytes that can be
+ // read from a compressed packet. This serves as an upper limit to prevent
+ // excessively large decompressed messages.
+ MaxDecompressedMessageSize *int64
+}
+
+func (c *Config) Random() io.Reader {
+ if c == nil || c.Rand == nil {
+ return rand.Reader
+ }
+ return c.Rand
+}
+
+func (c *Config) Hash() crypto.Hash {
+ if c == nil || uint(c.DefaultHash) == 0 {
+ return crypto.SHA256
+ }
+ return c.DefaultHash
+}
+
+func (c *Config) Cipher() CipherFunction {
+ if c == nil || uint8(c.DefaultCipher) == 0 {
+ return CipherAES128
+ }
+ return c.DefaultCipher
+}
+
+func (c *Config) Now() time.Time {
+ if c == nil || c.Time == nil {
+ return time.Now().Truncate(time.Second)
+ }
+ return c.Time().Truncate(time.Second)
+}
+
+// KeyLifetime returns the validity period of the key.
+func (c *Config) KeyLifetime() uint32 {
+ if c == nil {
+ return 0
+ }
+ return c.KeyLifetimeSecs
+}
+
+// SigLifetime returns the validity period of the signature.
+func (c *Config) SigLifetime() uint32 {
+ if c == nil {
+ return 0
+ }
+ return c.SigLifetimeSecs
+}
+
+func (c *Config) Compression() CompressionAlgo {
+ if c == nil {
+ return CompressionNone
+ }
+ return c.DefaultCompressionAlgo
+}
+
+func (c *Config) RSAModulusBits() int {
+ if c == nil || c.RSABits == 0 {
+ return 2048
+ }
+ return c.RSABits
+}
+
+func (c *Config) PublicKeyAlgorithm() PublicKeyAlgorithm {
+ if c == nil || c.Algorithm == 0 {
+ return PubKeyAlgoRSA
+ }
+ return c.Algorithm
+}
+
+func (c *Config) CurveName() Curve {
+ if c == nil || c.Curve == "" {
+ return Curve25519
+ }
+ return c.Curve
+}
+
+// Deprecated: The hash iterations should now be queried via the S2K() method.
+func (c *Config) PasswordHashIterations() int {
+ if c == nil || c.S2KCount == 0 {
+ return 0
+ }
+ return c.S2KCount
+}
+
+func (c *Config) S2K() *s2k.Config {
+ if c == nil {
+ return nil
+ }
+ // for backwards compatibility
+ if c.S2KCount > 0 && c.S2KConfig == nil {
+ return &s2k.Config{
+ S2KCount: c.S2KCount,
+ }
+ }
+ return c.S2KConfig
+}
+
+func (c *Config) AEAD() *AEADConfig {
+ if c == nil {
+ return nil
+ }
+ return c.AEADConfig
+}
+
+func (c *Config) SigningKey() uint64 {
+ if c == nil {
+ return 0
+ }
+ return c.SigningKeyId
+}
+
+func (c *Config) SigningUserId() string {
+ if c == nil {
+ return ""
+ }
+ return c.SigningIdentity
+}
+
+func (c *Config) AllowUnauthenticatedMessages() bool {
+ if c == nil {
+ return false
+ }
+ return c.InsecureAllowUnauthenticatedMessages
+}
+
+func (c *Config) AllowDecryptionWithSigningKeys() bool {
+ if c == nil {
+ return false
+ }
+ return c.InsecureAllowDecryptionWithSigningKeys
+}
+
+func (c *Config) KnownNotation(notationName string) bool {
+ if c == nil {
+ return false
+ }
+ return c.KnownNotations[notationName]
+}
+
+func (c *Config) Notations() []*Notation {
+ if c == nil {
+ return nil
+ }
+ return c.SignatureNotations
+}
+
+func (c *Config) V6() bool {
+ if c == nil {
+ return false
+ }
+ return c.V6Keys
+}
+
+func (c *Config) IntendedRecipients() bool {
+ if c == nil || c.CheckIntendedRecipients == nil {
+ return true
+ }
+ return *c.CheckIntendedRecipients
+}
+
+func (c *Config) RetrieveSessionKey() bool {
+ if c == nil {
+ return false
+ }
+ return c.CacheSessionKey
+}
+
+func (c *Config) MinimumRSABits() uint16 {
+ if c == nil || c.MinRSABits == 0 {
+ return 2047
+ }
+ return c.MinRSABits
+}
+
+func (c *Config) RejectPublicKeyAlgorithm(alg PublicKeyAlgorithm) bool {
+ var rejectedAlgorithms map[PublicKeyAlgorithm]bool
+ if c == nil || c.RejectPublicKeyAlgorithms == nil {
+ // Default
+ rejectedAlgorithms = defaultRejectPublicKeyAlgorithms
+ } else {
+ rejectedAlgorithms = c.RejectPublicKeyAlgorithms
+ }
+ return rejectedAlgorithms[alg]
+}
+
+func (c *Config) RejectHashAlgorithm(hash crypto.Hash) bool {
+ var rejectedAlgorithms map[crypto.Hash]bool
+ if c == nil || c.RejectHashAlgorithms == nil {
+ // Default
+ rejectedAlgorithms = defaultRejectHashAlgorithms
+ } else {
+ rejectedAlgorithms = c.RejectHashAlgorithms
+ }
+ return rejectedAlgorithms[hash]
+}
+
+func (c *Config) RejectMessageHashAlgorithm(hash crypto.Hash) bool {
+ var rejectedAlgorithms map[crypto.Hash]bool
+ if c == nil || c.RejectMessageHashAlgorithms == nil {
+ // Default
+ rejectedAlgorithms = defaultRejectMessageHashAlgorithms
+ } else {
+ rejectedAlgorithms = c.RejectMessageHashAlgorithms
+ }
+ return rejectedAlgorithms[hash]
+}
+
+func (c *Config) RejectCurve(curve Curve) bool {
+ var rejectedCurve map[Curve]bool
+ if c == nil || c.RejectCurves == nil {
+ // Default
+ rejectedCurve = defaultRejectCurves
+ } else {
+ rejectedCurve = c.RejectCurves
+ }
+ return rejectedCurve[curve]
+}
+
+func (c *Config) StrictPacketSequence() bool {
+ if c == nil || c.CheckPacketSequence == nil {
+ return true
+ }
+ return *c.CheckPacketSequence
+}
+
+func (c *Config) RandomizeSignaturesViaNotation() bool {
+ if c == nil || c.NonDeterministicSignaturesViaNotation == nil {
+ return true
+ }
+ return *c.NonDeterministicSignaturesViaNotation
+}
+
+func (c *Config) AllowAllKeyFlagsWhenMissing() bool {
+ if c == nil {
+ return false
+ }
+ return c.InsecureAllowAllKeyFlagsWhenMissing
+}
+
+func (c *Config) GenerateNonCriticalKeyFlags() bool {
+ if c == nil {
+ return false
+ }
+ return c.InsecureGenerateNonCriticalKeyFlags
+}
+
+func (c *Config) GenerateNonCriticalSignatureCreationTime() bool {
+ if c == nil {
+ return false
+ }
+ return c.InsecureGenerateNonCriticalSignatureCreationTime
+}
+
+func (c *Config) DecompressedMessageSizeLimit() *int64 {
+ if c == nil {
+ return nil
+ }
+ return c.MaxDecompressedMessageSize
+}
+
+// BoolPointer is a helper function to set a boolean pointer in the Config.
+// e.g., config.CheckPacketSequence = BoolPointer(true)
+func BoolPointer(value bool) *bool {
+ return &value
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/config_v5.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/config_v5.go
new file mode 100644
index 0000000000..f2415906b9
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/config_v5.go
@@ -0,0 +1,7 @@
+//go:build !v5
+
+package packet
+
+func init() {
+ V5Disabled = true
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/encrypted_key.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/encrypted_key.go
new file mode 100644
index 0000000000..b90bb28911
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/encrypted_key.go
@@ -0,0 +1,584 @@
+// 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 packet
+
+import (
+ "bytes"
+ "crypto"
+ "crypto/rsa"
+ "encoding/binary"
+ "encoding/hex"
+ "io"
+ "math/big"
+ "strconv"
+
+ "github.com/ProtonMail/go-crypto/openpgp/ecdh"
+ "github.com/ProtonMail/go-crypto/openpgp/elgamal"
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/encoding"
+ "github.com/ProtonMail/go-crypto/openpgp/x25519"
+ "github.com/ProtonMail/go-crypto/openpgp/x448"
+)
+
+// EncryptedKey represents a public-key encrypted session key. See RFC 4880,
+// section 5.1.
+type EncryptedKey struct {
+ Version int
+ KeyId uint64
+ KeyVersion int // v6
+ KeyFingerprint []byte // v6
+ Algo PublicKeyAlgorithm
+ CipherFunc CipherFunction // only valid after a successful Decrypt for a v3 packet
+ Key []byte // only valid after a successful Decrypt
+
+ encryptedMPI1, encryptedMPI2 encoding.Field
+ ephemeralPublicX25519 *x25519.PublicKey // used for x25519
+ ephemeralPublicX448 *x448.PublicKey // used for x448
+ encryptedSession []byte // used for x25519 and x448
+}
+
+func (e *EncryptedKey) parse(r io.Reader) (err error) {
+ var buf [8]byte
+ _, err = readFull(r, buf[:versionSize])
+ if err != nil {
+ return
+ }
+ e.Version = int(buf[0])
+ if e.Version != 3 && e.Version != 6 {
+ return errors.UnsupportedError("unknown EncryptedKey version " + strconv.Itoa(int(buf[0])))
+ }
+ if e.Version == 6 {
+ //Read a one-octet size of the following two fields.
+ if _, err = readFull(r, buf[:1]); err != nil {
+ return
+ }
+ // The size may also be zero, and the key version and
+ // fingerprint omitted for an "anonymous recipient"
+ if buf[0] != 0 {
+ // non-anonymous case
+ _, err = readFull(r, buf[:versionSize])
+ if err != nil {
+ return
+ }
+ e.KeyVersion = int(buf[0])
+ if e.KeyVersion != 4 && e.KeyVersion != 6 {
+ return errors.UnsupportedError("unknown public key version " + strconv.Itoa(e.KeyVersion))
+ }
+ var fingerprint []byte
+ if e.KeyVersion == 6 {
+ fingerprint = make([]byte, fingerprintSizeV6)
+ } else if e.KeyVersion == 4 {
+ fingerprint = make([]byte, fingerprintSize)
+ }
+ _, err = readFull(r, fingerprint)
+ if err != nil {
+ return
+ }
+ e.KeyFingerprint = fingerprint
+ if e.KeyVersion == 6 {
+ e.KeyId = binary.BigEndian.Uint64(e.KeyFingerprint[:keyIdSize])
+ } else if e.KeyVersion == 4 {
+ e.KeyId = binary.BigEndian.Uint64(e.KeyFingerprint[fingerprintSize-keyIdSize : fingerprintSize])
+ }
+ }
+ } else {
+ _, err = readFull(r, buf[:8])
+ if err != nil {
+ return
+ }
+ e.KeyId = binary.BigEndian.Uint64(buf[:keyIdSize])
+ }
+
+ _, err = readFull(r, buf[:1])
+ if err != nil {
+ return
+ }
+ e.Algo = PublicKeyAlgorithm(buf[0])
+ var cipherFunction byte
+ switch e.Algo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly:
+ e.encryptedMPI1 = new(encoding.MPI)
+ if _, err = e.encryptedMPI1.ReadFrom(r); err != nil {
+ return
+ }
+ case PubKeyAlgoElGamal:
+ e.encryptedMPI1 = new(encoding.MPI)
+ if _, err = e.encryptedMPI1.ReadFrom(r); err != nil {
+ return
+ }
+
+ e.encryptedMPI2 = new(encoding.MPI)
+ if _, err = e.encryptedMPI2.ReadFrom(r); err != nil {
+ return
+ }
+ case PubKeyAlgoECDH:
+ e.encryptedMPI1 = new(encoding.MPI)
+ if _, err = e.encryptedMPI1.ReadFrom(r); err != nil {
+ return
+ }
+
+ e.encryptedMPI2 = new(encoding.OID)
+ if _, err = e.encryptedMPI2.ReadFrom(r); err != nil {
+ return
+ }
+ case PubKeyAlgoX25519:
+ e.ephemeralPublicX25519, e.encryptedSession, cipherFunction, err = x25519.DecodeFields(r, e.Version == 6)
+ if err != nil {
+ return
+ }
+ case PubKeyAlgoX448:
+ e.ephemeralPublicX448, e.encryptedSession, cipherFunction, err = x448.DecodeFields(r, e.Version == 6)
+ if err != nil {
+ return
+ }
+ }
+ if e.Version < 6 {
+ switch e.Algo {
+ case PubKeyAlgoX25519, PubKeyAlgoX448:
+ e.CipherFunc = CipherFunction(cipherFunction)
+ // Check for validiy is in the Decrypt method
+ }
+ }
+
+ _, err = consumeAll(r)
+ return
+}
+
+// Decrypt decrypts an encrypted session key with the given private key. The
+// private key must have been decrypted first.
+// If config is nil, sensible defaults will be used.
+func (e *EncryptedKey) Decrypt(priv *PrivateKey, config *Config) error {
+ if e.Version < 6 && e.KeyId != 0 && e.KeyId != priv.KeyId {
+ return errors.InvalidArgumentError("cannot decrypt encrypted session key for key id " + strconv.FormatUint(e.KeyId, 16) + " with private key id " + strconv.FormatUint(priv.KeyId, 16))
+ }
+ if e.Version == 6 && e.KeyVersion != 0 && !bytes.Equal(e.KeyFingerprint, priv.Fingerprint) {
+ return errors.InvalidArgumentError("cannot decrypt encrypted session key for key fingerprint " + hex.EncodeToString(e.KeyFingerprint) + " with private key fingerprint " + hex.EncodeToString(priv.Fingerprint))
+ }
+ if e.Algo != priv.PubKeyAlgo {
+ return errors.InvalidArgumentError("cannot decrypt encrypted session key of type " + strconv.Itoa(int(e.Algo)) + " with private key of type " + strconv.Itoa(int(priv.PubKeyAlgo)))
+ }
+ if priv.Dummy() {
+ return errors.ErrDummyPrivateKey("dummy key found")
+ }
+
+ var err error
+ var b []byte
+
+ // TODO(agl): use session key decryption routines here to avoid
+ // padding oracle attacks.
+ switch priv.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly:
+ // Supports both *rsa.PrivateKey and crypto.Decrypter
+ k := priv.PrivateKey.(crypto.Decrypter)
+ b, err = k.Decrypt(config.Random(), padToKeySize(k.Public().(*rsa.PublicKey), e.encryptedMPI1.Bytes()), nil)
+ case PubKeyAlgoElGamal:
+ c1 := new(big.Int).SetBytes(e.encryptedMPI1.Bytes())
+ c2 := new(big.Int).SetBytes(e.encryptedMPI2.Bytes())
+ b, err = elgamal.Decrypt(priv.PrivateKey.(*elgamal.PrivateKey), c1, c2)
+ case PubKeyAlgoECDH:
+ vsG := e.encryptedMPI1.Bytes()
+ m := e.encryptedMPI2.Bytes()
+ oid := priv.PublicKey.oid.EncodedBytes()
+ fp := priv.PublicKey.Fingerprint[:]
+ if priv.PublicKey.Version == 5 {
+ // For v5 the, the fingerprint must be restricted to 20 bytes
+ fp = fp[:20]
+ }
+ b, err = ecdh.Decrypt(priv.PrivateKey.(*ecdh.PrivateKey), vsG, m, oid, fp)
+ case PubKeyAlgoX25519:
+ b, err = x25519.Decrypt(priv.PrivateKey.(*x25519.PrivateKey), e.ephemeralPublicX25519, e.encryptedSession)
+ case PubKeyAlgoX448:
+ b, err = x448.Decrypt(priv.PrivateKey.(*x448.PrivateKey), e.ephemeralPublicX448, e.encryptedSession)
+ default:
+ err = errors.InvalidArgumentError("cannot decrypt encrypted session key with private key of type " + strconv.Itoa(int(priv.PubKeyAlgo)))
+ }
+ if err != nil {
+ return err
+ }
+
+ var key []byte
+ switch priv.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoElGamal, PubKeyAlgoECDH:
+ keyOffset := 0
+ if e.Version < 6 {
+ e.CipherFunc = CipherFunction(b[0])
+ keyOffset = 1
+ if !e.CipherFunc.IsSupported() {
+ return errors.UnsupportedError("unsupported encryption function")
+ }
+ }
+ key, err = decodeChecksumKey(b[keyOffset:])
+ if err != nil {
+ return err
+ }
+ case PubKeyAlgoX25519, PubKeyAlgoX448:
+ if e.Version < 6 {
+ switch e.CipherFunc {
+ case CipherAES128, CipherAES192, CipherAES256:
+ break
+ default:
+ return errors.StructuralError("v3 PKESK mandates AES as cipher function for x25519 and x448")
+ }
+ }
+ key = b[:]
+ default:
+ return errors.UnsupportedError("unsupported algorithm for decryption")
+ }
+ e.Key = key
+ return nil
+}
+
+// Serialize writes the encrypted key packet, e, to w.
+func (e *EncryptedKey) Serialize(w io.Writer) error {
+ var encodedLength int
+ switch e.Algo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly:
+ encodedLength = int(e.encryptedMPI1.EncodedLength())
+ case PubKeyAlgoElGamal:
+ encodedLength = int(e.encryptedMPI1.EncodedLength()) + int(e.encryptedMPI2.EncodedLength())
+ case PubKeyAlgoECDH:
+ encodedLength = int(e.encryptedMPI1.EncodedLength()) + int(e.encryptedMPI2.EncodedLength())
+ case PubKeyAlgoX25519:
+ encodedLength = x25519.EncodedFieldsLength(e.encryptedSession, e.Version == 6)
+ case PubKeyAlgoX448:
+ encodedLength = x448.EncodedFieldsLength(e.encryptedSession, e.Version == 6)
+ default:
+ return errors.InvalidArgumentError("don't know how to serialize encrypted key type " + strconv.Itoa(int(e.Algo)))
+ }
+
+ packetLen := versionSize /* version */ + keyIdSize /* key id */ + algorithmSize /* algo */ + encodedLength
+ if e.Version == 6 {
+ packetLen = versionSize /* version */ + algorithmSize /* algo */ + encodedLength + keyVersionSize /* key version */
+ if e.KeyVersion == 6 {
+ packetLen += fingerprintSizeV6
+ } else if e.KeyVersion == 4 {
+ packetLen += fingerprintSize
+ }
+ }
+
+ err := serializeHeader(w, packetTypeEncryptedKey, packetLen)
+ if err != nil {
+ return err
+ }
+
+ _, err = w.Write([]byte{byte(e.Version)})
+ if err != nil {
+ return err
+ }
+ if e.Version == 6 {
+ _, err = w.Write([]byte{byte(e.KeyVersion)})
+ if err != nil {
+ return err
+ }
+ // The key version number may also be zero,
+ // and the fingerprint omitted
+ if e.KeyVersion != 0 {
+ _, err = w.Write(e.KeyFingerprint)
+ if err != nil {
+ return err
+ }
+ }
+ } else {
+ // Write KeyID
+ err = binary.Write(w, binary.BigEndian, e.KeyId)
+ if err != nil {
+ return err
+ }
+ }
+ _, err = w.Write([]byte{byte(e.Algo)})
+ if err != nil {
+ return err
+ }
+
+ switch e.Algo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly:
+ _, err := w.Write(e.encryptedMPI1.EncodedBytes())
+ return err
+ case PubKeyAlgoElGamal:
+ if _, err := w.Write(e.encryptedMPI1.EncodedBytes()); err != nil {
+ return err
+ }
+ _, err := w.Write(e.encryptedMPI2.EncodedBytes())
+ return err
+ case PubKeyAlgoECDH:
+ if _, err := w.Write(e.encryptedMPI1.EncodedBytes()); err != nil {
+ return err
+ }
+ _, err := w.Write(e.encryptedMPI2.EncodedBytes())
+ return err
+ case PubKeyAlgoX25519:
+ err := x25519.EncodeFields(w, e.ephemeralPublicX25519, e.encryptedSession, byte(e.CipherFunc), e.Version == 6)
+ return err
+ case PubKeyAlgoX448:
+ err := x448.EncodeFields(w, e.ephemeralPublicX448, e.encryptedSession, byte(e.CipherFunc), e.Version == 6)
+ return err
+ default:
+ panic("internal error")
+ }
+}
+
+// SerializeEncryptedKeyAEAD serializes an encrypted key packet to w that contains
+// key, encrypted to pub.
+// If aeadSupported is set, PKESK v6 is used, otherwise v3.
+// Note: aeadSupported MUST match the value passed to SerializeSymmetricallyEncrypted.
+// If config is nil, sensible defaults will be used.
+func SerializeEncryptedKeyAEAD(w io.Writer, pub *PublicKey, cipherFunc CipherFunction, aeadSupported bool, key []byte, config *Config) error {
+ return SerializeEncryptedKeyAEADwithHiddenOption(w, pub, cipherFunc, aeadSupported, key, false, config)
+}
+
+// SerializeEncryptedKeyAEADwithHiddenOption serializes an encrypted key packet to w that contains
+// key, encrypted to pub.
+// Offers the hidden flag option to indicated if the PKESK packet should include a wildcard KeyID.
+// If aeadSupported is set, PKESK v6 is used, otherwise v3.
+// Note: aeadSupported MUST match the value passed to SerializeSymmetricallyEncrypted.
+// If config is nil, sensible defaults will be used.
+func SerializeEncryptedKeyAEADwithHiddenOption(w io.Writer, pub *PublicKey, cipherFunc CipherFunction, aeadSupported bool, key []byte, hidden bool, config *Config) error {
+ var buf [36]byte // max possible header size is v6
+ lenHeaderWritten := versionSize
+ version := 3
+
+ if aeadSupported {
+ version = 6
+ }
+ // An implementation MUST NOT generate ElGamal v6 PKESKs.
+ if version == 6 && pub.PubKeyAlgo == PubKeyAlgoElGamal {
+ return errors.InvalidArgumentError("ElGamal v6 PKESK are not allowed")
+ }
+ // In v3 PKESKs, for x25519 and x448, mandate using AES
+ if version == 3 && (pub.PubKeyAlgo == PubKeyAlgoX25519 || pub.PubKeyAlgo == PubKeyAlgoX448) {
+ switch cipherFunc {
+ case CipherAES128, CipherAES192, CipherAES256:
+ break
+ default:
+ return errors.InvalidArgumentError("v3 PKESK mandates AES for x25519 and x448")
+ }
+ }
+
+ buf[0] = byte(version)
+
+ // If hidden is set, the key should be hidden
+ // An implementation MAY accept or use a Key ID of all zeros,
+ // or a key version of zero and no key fingerprint, to hide the intended decryption key.
+ // See Section 5.1.8. in the open pgp crypto refresh
+ if version == 6 {
+ if !hidden {
+ // A one-octet size of the following two fields.
+ buf[1] = byte(keyVersionSize + len(pub.Fingerprint))
+ // A one octet key version number.
+ buf[2] = byte(pub.Version)
+ lenHeaderWritten += keyVersionSize + 1
+ // The fingerprint of the public key
+ copy(buf[lenHeaderWritten:lenHeaderWritten+len(pub.Fingerprint)], pub.Fingerprint)
+ lenHeaderWritten += len(pub.Fingerprint)
+ } else {
+ // The size may also be zero, and the key version
+ // and fingerprint omitted for an "anonymous recipient"
+ buf[1] = 0
+ lenHeaderWritten += 1
+ }
+ } else {
+ if !hidden {
+ binary.BigEndian.PutUint64(buf[versionSize:(versionSize+keyIdSize)], pub.KeyId)
+ }
+ lenHeaderWritten += keyIdSize
+ }
+ buf[lenHeaderWritten] = byte(pub.PubKeyAlgo)
+ lenHeaderWritten += algorithmSize
+
+ var keyBlock []byte
+ switch pub.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoElGamal, PubKeyAlgoECDH:
+ lenKeyBlock := len(key) + 2
+ if version < 6 {
+ lenKeyBlock += 1 // cipher type included
+ }
+ keyBlock = make([]byte, lenKeyBlock)
+ keyOffset := 0
+ if version < 6 {
+ keyBlock[0] = byte(cipherFunc)
+ keyOffset = 1
+ }
+ encodeChecksumKey(keyBlock[keyOffset:], key)
+ case PubKeyAlgoX25519, PubKeyAlgoX448:
+ // algorithm is added in plaintext below
+ keyBlock = key
+ }
+
+ switch pub.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly:
+ return serializeEncryptedKeyRSA(w, config.Random(), buf[:lenHeaderWritten], pub.PublicKey.(*rsa.PublicKey), keyBlock)
+ case PubKeyAlgoElGamal:
+ return serializeEncryptedKeyElGamal(w, config.Random(), buf[:lenHeaderWritten], pub.PublicKey.(*elgamal.PublicKey), keyBlock)
+ case PubKeyAlgoECDH:
+ return serializeEncryptedKeyECDH(w, config.Random(), buf[:lenHeaderWritten], pub.PublicKey.(*ecdh.PublicKey), keyBlock, pub.oid, pub.Fingerprint)
+ case PubKeyAlgoX25519:
+ return serializeEncryptedKeyX25519(w, config.Random(), buf[:lenHeaderWritten], pub.PublicKey.(*x25519.PublicKey), keyBlock, byte(cipherFunc), version)
+ case PubKeyAlgoX448:
+ return serializeEncryptedKeyX448(w, config.Random(), buf[:lenHeaderWritten], pub.PublicKey.(*x448.PublicKey), keyBlock, byte(cipherFunc), version)
+ case PubKeyAlgoDSA, PubKeyAlgoRSASignOnly:
+ return errors.InvalidArgumentError("cannot encrypt to public key of type " + strconv.Itoa(int(pub.PubKeyAlgo)))
+ }
+
+ return errors.UnsupportedError("encrypting a key to public key of type " + strconv.Itoa(int(pub.PubKeyAlgo)))
+}
+
+// SerializeEncryptedKey serializes an encrypted key packet to w that contains
+// key, encrypted to pub.
+// PKESKv6 is used if config.AEAD() is not nil.
+// If config is nil, sensible defaults will be used.
+// Deprecated: Use SerializeEncryptedKeyAEAD instead.
+func SerializeEncryptedKey(w io.Writer, pub *PublicKey, cipherFunc CipherFunction, key []byte, config *Config) error {
+ return SerializeEncryptedKeyAEAD(w, pub, cipherFunc, config.AEAD() != nil, key, config)
+}
+
+// SerializeEncryptedKeyWithHiddenOption serializes an encrypted key packet to w that contains
+// key, encrypted to pub. PKESKv6 is used if config.AEAD() is not nil.
+// The hidden option controls if the packet should be anonymous, i.e., omit key metadata.
+// If config is nil, sensible defaults will be used.
+// Deprecated: Use SerializeEncryptedKeyAEADwithHiddenOption instead.
+func SerializeEncryptedKeyWithHiddenOption(w io.Writer, pub *PublicKey, cipherFunc CipherFunction, key []byte, hidden bool, config *Config) error {
+ return SerializeEncryptedKeyAEADwithHiddenOption(w, pub, cipherFunc, config.AEAD() != nil, key, hidden, config)
+}
+
+func serializeEncryptedKeyRSA(w io.Writer, rand io.Reader, header []byte, pub *rsa.PublicKey, keyBlock []byte) error {
+ cipherText, err := rsa.EncryptPKCS1v15(rand, pub, keyBlock)
+ if err != nil {
+ return errors.InvalidArgumentError("RSA encryption failed: " + err.Error())
+ }
+
+ cipherMPI := encoding.NewMPI(cipherText)
+ packetLen := len(header) /* header length */ + int(cipherMPI.EncodedLength())
+
+ err = serializeHeader(w, packetTypeEncryptedKey, packetLen)
+ if err != nil {
+ return err
+ }
+ _, err = w.Write(header[:])
+ if err != nil {
+ return err
+ }
+ _, err = w.Write(cipherMPI.EncodedBytes())
+ return err
+}
+
+func serializeEncryptedKeyElGamal(w io.Writer, rand io.Reader, header []byte, pub *elgamal.PublicKey, keyBlock []byte) error {
+ c1, c2, err := elgamal.Encrypt(rand, pub, keyBlock)
+ if err != nil {
+ return errors.InvalidArgumentError("ElGamal encryption failed: " + err.Error())
+ }
+
+ packetLen := len(header) /* header length */
+ packetLen += 2 /* mpi size */ + (c1.BitLen()+7)/8
+ packetLen += 2 /* mpi size */ + (c2.BitLen()+7)/8
+
+ err = serializeHeader(w, packetTypeEncryptedKey, packetLen)
+ if err != nil {
+ return err
+ }
+ _, err = w.Write(header[:])
+ if err != nil {
+ return err
+ }
+ if _, err = w.Write(new(encoding.MPI).SetBig(c1).EncodedBytes()); err != nil {
+ return err
+ }
+ _, err = w.Write(new(encoding.MPI).SetBig(c2).EncodedBytes())
+ return err
+}
+
+func serializeEncryptedKeyECDH(w io.Writer, rand io.Reader, header []byte, pub *ecdh.PublicKey, keyBlock []byte, oid encoding.Field, fingerprint []byte) error {
+ vsG, c, err := ecdh.Encrypt(rand, pub, keyBlock, oid.EncodedBytes(), fingerprint)
+ if err != nil {
+ return errors.InvalidArgumentError("ECDH encryption failed: " + err.Error())
+ }
+
+ g := encoding.NewMPI(vsG)
+ m := encoding.NewOID(c)
+
+ packetLen := len(header) /* header length */
+ packetLen += int(g.EncodedLength()) + int(m.EncodedLength())
+
+ err = serializeHeader(w, packetTypeEncryptedKey, packetLen)
+ if err != nil {
+ return err
+ }
+
+ _, err = w.Write(header[:])
+ if err != nil {
+ return err
+ }
+ if _, err = w.Write(g.EncodedBytes()); err != nil {
+ return err
+ }
+ _, err = w.Write(m.EncodedBytes())
+ return err
+}
+
+func serializeEncryptedKeyX25519(w io.Writer, rand io.Reader, header []byte, pub *x25519.PublicKey, keyBlock []byte, cipherFunc byte, version int) error {
+ ephemeralPublicX25519, ciphertext, err := x25519.Encrypt(rand, pub, keyBlock)
+ if err != nil {
+ return errors.InvalidArgumentError("x25519 encryption failed: " + err.Error())
+ }
+
+ packetLen := len(header) /* header length */
+ packetLen += x25519.EncodedFieldsLength(ciphertext, version == 6)
+
+ err = serializeHeader(w, packetTypeEncryptedKey, packetLen)
+ if err != nil {
+ return err
+ }
+
+ _, err = w.Write(header[:])
+ if err != nil {
+ return err
+ }
+ return x25519.EncodeFields(w, ephemeralPublicX25519, ciphertext, cipherFunc, version == 6)
+}
+
+func serializeEncryptedKeyX448(w io.Writer, rand io.Reader, header []byte, pub *x448.PublicKey, keyBlock []byte, cipherFunc byte, version int) error {
+ ephemeralPublicX448, ciphertext, err := x448.Encrypt(rand, pub, keyBlock)
+ if err != nil {
+ return errors.InvalidArgumentError("x448 encryption failed: " + err.Error())
+ }
+
+ packetLen := len(header) /* header length */
+ packetLen += x448.EncodedFieldsLength(ciphertext, version == 6)
+
+ err = serializeHeader(w, packetTypeEncryptedKey, packetLen)
+ if err != nil {
+ return err
+ }
+
+ _, err = w.Write(header[:])
+ if err != nil {
+ return err
+ }
+ return x448.EncodeFields(w, ephemeralPublicX448, ciphertext, cipherFunc, version == 6)
+}
+
+func checksumKeyMaterial(key []byte) uint16 {
+ var checksum uint16
+ for _, v := range key {
+ checksum += uint16(v)
+ }
+ return checksum
+}
+
+func decodeChecksumKey(msg []byte) (key []byte, err error) {
+ key = msg[:len(msg)-2]
+ expectedChecksum := uint16(msg[len(msg)-2])<<8 | uint16(msg[len(msg)-1])
+ checksum := checksumKeyMaterial(key)
+ if checksum != expectedChecksum {
+ err = errors.StructuralError("session key checksum is incorrect")
+ }
+ return
+}
+
+func encodeChecksumKey(buffer []byte, key []byte) {
+ copy(buffer, key)
+ checksum := checksumKeyMaterial(key)
+ buffer[len(key)] = byte(checksum >> 8)
+ buffer[len(key)+1] = byte(checksum)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/literal.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/literal.go
new file mode 100644
index 0000000000..8a028c8a17
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/literal.go
@@ -0,0 +1,91 @@
+// 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 packet
+
+import (
+ "encoding/binary"
+ "io"
+)
+
+// LiteralData represents an encrypted file. See RFC 4880, section 5.9.
+type LiteralData struct {
+ Format uint8
+ IsBinary bool
+ FileName string
+ Time uint32 // Unix epoch time. Either creation time or modification time. 0 means undefined.
+ Body io.Reader
+}
+
+// ForEyesOnly returns whether the contents of the LiteralData have been marked
+// as especially sensitive.
+func (l *LiteralData) ForEyesOnly() bool {
+ return l.FileName == "_CONSOLE"
+}
+
+func (l *LiteralData) parse(r io.Reader) (err error) {
+ var buf [256]byte
+
+ _, err = readFull(r, buf[:2])
+ if err != nil {
+ return
+ }
+
+ l.Format = buf[0]
+ l.IsBinary = l.Format == 'b'
+ fileNameLen := int(buf[1])
+
+ _, err = readFull(r, buf[:fileNameLen])
+ if err != nil {
+ return
+ }
+
+ l.FileName = string(buf[:fileNameLen])
+
+ _, err = readFull(r, buf[:4])
+ if err != nil {
+ return
+ }
+
+ l.Time = binary.BigEndian.Uint32(buf[:4])
+ l.Body = r
+ return
+}
+
+// SerializeLiteral serializes a literal data packet to w and returns a
+// WriteCloser to which the data itself can be written and which MUST be closed
+// on completion. The fileName is truncated to 255 bytes.
+func SerializeLiteral(w io.WriteCloser, isBinary bool, fileName string, time uint32) (plaintext io.WriteCloser, err error) {
+ var buf [4]byte
+ buf[0] = 'b'
+ if !isBinary {
+ buf[0] = 'u'
+ }
+ if len(fileName) > 255 {
+ fileName = fileName[:255]
+ }
+ buf[1] = byte(len(fileName))
+
+ inner, err := serializeStreamHeader(w, packetTypeLiteralData)
+ if err != nil {
+ return
+ }
+
+ _, err = inner.Write(buf[:2])
+ if err != nil {
+ return
+ }
+ _, err = inner.Write([]byte(fileName))
+ if err != nil {
+ return
+ }
+ binary.BigEndian.PutUint32(buf[:], time)
+ _, err = inner.Write(buf[:])
+ if err != nil {
+ return
+ }
+
+ plaintext = inner
+ return
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/marker.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/marker.go
new file mode 100644
index 0000000000..1ee378ba3c
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/marker.go
@@ -0,0 +1,33 @@
+package packet
+
+import (
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+)
+
+type Marker struct{}
+
+const markerString = "PGP"
+
+// parse just checks if the packet contains "PGP".
+func (m *Marker) parse(reader io.Reader) error {
+ var buffer [3]byte
+ if _, err := io.ReadFull(reader, buffer[:]); err != nil {
+ return err
+ }
+ if string(buffer[:]) != markerString {
+ return errors.StructuralError("invalid marker packet")
+ }
+ return nil
+}
+
+// SerializeMarker writes a marker packet to writer.
+func SerializeMarker(writer io.Writer) error {
+ err := serializeHeader(writer, packetTypeMarker, len(markerString))
+ if err != nil {
+ return err
+ }
+ _, err = writer.Write([]byte(markerString))
+ return err
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/notation.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/notation.go
new file mode 100644
index 0000000000..2c3e3f50b2
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/notation.go
@@ -0,0 +1,29 @@
+package packet
+
+// Notation type represents a Notation Data subpacket
+// see https://tools.ietf.org/html/rfc4880#section-5.2.3.16
+type Notation struct {
+ Name string
+ Value []byte
+ IsCritical bool
+ IsHumanReadable bool
+}
+
+func (notation *Notation) getData() []byte {
+ nameData := []byte(notation.Name)
+ nameLen := len(nameData)
+ valueLen := len(notation.Value)
+
+ data := make([]byte, 8+nameLen+valueLen)
+ if notation.IsHumanReadable {
+ data[0] = 0x80
+ }
+
+ data[4] = byte(nameLen >> 8)
+ data[5] = byte(nameLen)
+ data[6] = byte(valueLen >> 8)
+ data[7] = byte(valueLen)
+ copy(data[8:8+nameLen], nameData)
+ copy(data[8+nameLen:], notation.Value)
+ return data
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/ocfb.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/ocfb.go
new file mode 100644
index 0000000000..4f26d0a00b
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/ocfb.go
@@ -0,0 +1,137 @@
+// Copyright 2010 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.
+
+// OpenPGP CFB Mode. http://tools.ietf.org/html/rfc4880#section-13.9
+
+package packet
+
+import (
+ "crypto/cipher"
+)
+
+type ocfbEncrypter struct {
+ b cipher.Block
+ fre []byte
+ outUsed int
+}
+
+// An OCFBResyncOption determines if the "resynchronization step" of OCFB is
+// performed.
+type OCFBResyncOption bool
+
+const (
+ OCFBResync OCFBResyncOption = true
+ OCFBNoResync OCFBResyncOption = false
+)
+
+// NewOCFBEncrypter returns a cipher.Stream which encrypts data with OpenPGP's
+// cipher feedback mode using the given cipher.Block, and an initial amount of
+// ciphertext. randData must be random bytes and be the same length as the
+// cipher.Block's block size. Resync determines if the "resynchronization step"
+// from RFC 4880, 13.9 step 7 is performed. Different parts of OpenPGP vary on
+// this point.
+func NewOCFBEncrypter(block cipher.Block, randData []byte, resync OCFBResyncOption) (cipher.Stream, []byte) {
+ blockSize := block.BlockSize()
+ if len(randData) != blockSize {
+ return nil, nil
+ }
+
+ x := &ocfbEncrypter{
+ b: block,
+ fre: make([]byte, blockSize),
+ outUsed: 0,
+ }
+ prefix := make([]byte, blockSize+2)
+
+ block.Encrypt(x.fre, x.fre)
+ for i := 0; i < blockSize; i++ {
+ prefix[i] = randData[i] ^ x.fre[i]
+ }
+
+ block.Encrypt(x.fre, prefix[:blockSize])
+ prefix[blockSize] = x.fre[0] ^ randData[blockSize-2]
+ prefix[blockSize+1] = x.fre[1] ^ randData[blockSize-1]
+
+ if resync {
+ block.Encrypt(x.fre, prefix[2:])
+ } else {
+ x.fre[0] = prefix[blockSize]
+ x.fre[1] = prefix[blockSize+1]
+ x.outUsed = 2
+ }
+ return x, prefix
+}
+
+func (x *ocfbEncrypter) XORKeyStream(dst, src []byte) {
+ for i := 0; i < len(src); i++ {
+ if x.outUsed == len(x.fre) {
+ x.b.Encrypt(x.fre, x.fre)
+ x.outUsed = 0
+ }
+
+ x.fre[x.outUsed] ^= src[i]
+ dst[i] = x.fre[x.outUsed]
+ x.outUsed++
+ }
+}
+
+type ocfbDecrypter struct {
+ b cipher.Block
+ fre []byte
+ outUsed int
+}
+
+// NewOCFBDecrypter returns a cipher.Stream which decrypts data with OpenPGP's
+// cipher feedback mode using the given cipher.Block. Prefix must be the first
+// blockSize + 2 bytes of the ciphertext, where blockSize is the cipher.Block's
+// block size. On successful exit, blockSize+2 bytes of decrypted data are written into
+// prefix. Resync determines if the "resynchronization step" from RFC 4880,
+// 13.9 step 7 is performed. Different parts of OpenPGP vary on this point.
+func NewOCFBDecrypter(block cipher.Block, prefix []byte, resync OCFBResyncOption) cipher.Stream {
+ blockSize := block.BlockSize()
+ if len(prefix) != blockSize+2 {
+ return nil
+ }
+
+ x := &ocfbDecrypter{
+ b: block,
+ fre: make([]byte, blockSize),
+ outUsed: 0,
+ }
+ prefixCopy := make([]byte, len(prefix))
+ copy(prefixCopy, prefix)
+
+ block.Encrypt(x.fre, x.fre)
+ for i := 0; i < blockSize; i++ {
+ prefixCopy[i] ^= x.fre[i]
+ }
+
+ block.Encrypt(x.fre, prefix[:blockSize])
+ prefixCopy[blockSize] ^= x.fre[0]
+ prefixCopy[blockSize+1] ^= x.fre[1]
+
+ if resync {
+ block.Encrypt(x.fre, prefix[2:])
+ } else {
+ x.fre[0] = prefix[blockSize]
+ x.fre[1] = prefix[blockSize+1]
+ x.outUsed = 2
+ }
+ copy(prefix, prefixCopy)
+ return x
+}
+
+func (x *ocfbDecrypter) XORKeyStream(dst, src []byte) {
+ for i := 0; i < len(src); i++ {
+ if x.outUsed == len(x.fre) {
+ x.b.Encrypt(x.fre, x.fre)
+ x.outUsed = 0
+ }
+
+ c := src[i]
+ dst[i] = x.fre[x.outUsed] ^ src[i]
+ x.fre[x.outUsed] = c
+ x.outUsed++
+ }
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/one_pass_signature.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/one_pass_signature.go
new file mode 100644
index 0000000000..f393c4063b
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/one_pass_signature.go
@@ -0,0 +1,157 @@
+// 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 packet
+
+import (
+ "crypto"
+ "encoding/binary"
+ "io"
+ "strconv"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm"
+)
+
+// OnePassSignature represents a one-pass signature packet. See RFC 4880,
+// section 5.4.
+type OnePassSignature struct {
+ Version int
+ SigType SignatureType
+ Hash crypto.Hash
+ PubKeyAlgo PublicKeyAlgorithm
+ KeyId uint64
+ IsLast bool
+ Salt []byte // v6 only
+ KeyFingerprint []byte // v6 only
+}
+
+func (ops *OnePassSignature) parse(r io.Reader) (err error) {
+ var buf [8]byte
+ // Read: version | signature type | hash algorithm | public-key algorithm
+ _, err = readFull(r, buf[:4])
+ if err != nil {
+ return
+ }
+ if buf[0] != 3 && buf[0] != 6 {
+ return errors.UnsupportedError("one-pass-signature packet version " + strconv.Itoa(int(buf[0])))
+ }
+ ops.Version = int(buf[0])
+
+ var ok bool
+ ops.Hash, ok = algorithm.HashIdToHashWithSha1(buf[2])
+ if !ok {
+ return errors.UnsupportedError("hash function: " + strconv.Itoa(int(buf[2])))
+ }
+
+ ops.SigType = SignatureType(buf[1])
+ ops.PubKeyAlgo = PublicKeyAlgorithm(buf[3])
+
+ if ops.Version == 6 {
+ // Only for v6, a variable-length field containing the salt
+ _, err = readFull(r, buf[:1])
+ if err != nil {
+ return
+ }
+ saltLength := int(buf[0])
+ var expectedSaltLength int
+ expectedSaltLength, err = SaltLengthForHash(ops.Hash)
+ if err != nil {
+ return
+ }
+ if saltLength != expectedSaltLength {
+ err = errors.StructuralError("unexpected salt size for the given hash algorithm")
+ return
+ }
+ salt := make([]byte, expectedSaltLength)
+ _, err = readFull(r, salt)
+ if err != nil {
+ return
+ }
+ ops.Salt = salt
+
+ // Only for v6 packets, 32 octets of the fingerprint of the signing key.
+ fingerprint := make([]byte, 32)
+ _, err = readFull(r, fingerprint)
+ if err != nil {
+ return
+ }
+ ops.KeyFingerprint = fingerprint
+ ops.KeyId = binary.BigEndian.Uint64(ops.KeyFingerprint[:8])
+ } else {
+ _, err = readFull(r, buf[:8])
+ if err != nil {
+ return
+ }
+ ops.KeyId = binary.BigEndian.Uint64(buf[:8])
+ }
+
+ _, err = readFull(r, buf[:1])
+ if err != nil {
+ return
+ }
+ ops.IsLast = buf[0] != 0
+ return
+}
+
+// Serialize marshals the given OnePassSignature to w.
+func (ops *OnePassSignature) Serialize(w io.Writer) error {
+ //v3 length 1+1+1+1+8+1 =
+ packetLength := 13
+ if ops.Version == 6 {
+ // v6 length 1+1+1+1+1+len(salt)+32+1 =
+ packetLength = 38 + len(ops.Salt)
+ }
+
+ if err := serializeHeader(w, packetTypeOnePassSignature, packetLength); err != nil {
+ return err
+ }
+
+ var buf [8]byte
+ buf[0] = byte(ops.Version)
+ buf[1] = uint8(ops.SigType)
+ var ok bool
+ buf[2], ok = algorithm.HashToHashIdWithSha1(ops.Hash)
+ if !ok {
+ return errors.UnsupportedError("hash type: " + strconv.Itoa(int(ops.Hash)))
+ }
+ buf[3] = uint8(ops.PubKeyAlgo)
+
+ _, err := w.Write(buf[:4])
+ if err != nil {
+ return err
+ }
+
+ if ops.Version == 6 {
+ // write salt for v6 signatures
+ _, err := w.Write([]byte{uint8(len(ops.Salt))})
+ if err != nil {
+ return err
+ }
+ _, err = w.Write(ops.Salt)
+ if err != nil {
+ return err
+ }
+
+ // write fingerprint v6 signatures
+ _, err = w.Write(ops.KeyFingerprint)
+ if err != nil {
+ return err
+ }
+ } else {
+ binary.BigEndian.PutUint64(buf[:8], ops.KeyId)
+ _, err := w.Write(buf[:8])
+ if err != nil {
+ return err
+ }
+ }
+
+ isLast := []byte{byte(0)}
+ if ops.IsLast {
+ isLast[0] = 1
+ }
+
+ _, err = w.Write(isLast)
+ return err
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/opaque.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/opaque.go
new file mode 100644
index 0000000000..cef7c661d3
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/opaque.go
@@ -0,0 +1,170 @@
+// 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 packet
+
+import (
+ "bytes"
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+)
+
+// OpaquePacket represents an OpenPGP packet as raw, unparsed data. This is
+// useful for splitting and storing the original packet contents separately,
+// handling unsupported packet types or accessing parts of the packet not yet
+// implemented by this package.
+type OpaquePacket struct {
+ // Packet type
+ Tag uint8
+ // Reason why the packet was parsed opaquely
+ Reason error
+ // Binary contents of the packet data
+ Contents []byte
+}
+
+func (op *OpaquePacket) parse(r io.Reader) (err error) {
+ op.Contents, err = io.ReadAll(r)
+ return
+}
+
+// Serialize marshals the packet to a writer in its original form, including
+// the packet header.
+func (op *OpaquePacket) Serialize(w io.Writer) (err error) {
+ err = serializeHeader(w, packetType(op.Tag), len(op.Contents))
+ if err == nil {
+ _, err = w.Write(op.Contents)
+ }
+ return
+}
+
+// Parse attempts to parse the opaque contents into a structure supported by
+// this package. If the packet is not known then the result will be another
+// OpaquePacket.
+func (op *OpaquePacket) Parse() (p Packet, err error) {
+ hdr := bytes.NewBuffer(nil)
+ err = serializeHeader(hdr, packetType(op.Tag), len(op.Contents))
+ if err != nil {
+ op.Reason = err
+ return op, err
+ }
+ p, err = Read(io.MultiReader(hdr, bytes.NewBuffer(op.Contents)))
+ if err != nil {
+ op.Reason = err
+ p = op
+ }
+ return
+}
+
+// OpaqueReader reads OpaquePackets from an io.Reader.
+type OpaqueReader struct {
+ r io.Reader
+}
+
+func NewOpaqueReader(r io.Reader) *OpaqueReader {
+ return &OpaqueReader{r: r}
+}
+
+// Read the next OpaquePacket.
+func (or *OpaqueReader) Next() (op *OpaquePacket, err error) {
+ tag, _, contents, err := readHeader(or.r)
+ if err != nil {
+ return
+ }
+ op = &OpaquePacket{Tag: uint8(tag), Reason: err}
+ err = op.parse(contents)
+ if err != nil {
+ consumeAll(contents)
+ }
+ return
+}
+
+// OpaqueSubpacket represents an unparsed OpenPGP subpacket,
+// as found in signature and user attribute packets.
+type OpaqueSubpacket struct {
+ SubType uint8
+ EncodedLength []byte // Store the original encoded length for signature verifications.
+ Contents []byte
+}
+
+// OpaqueSubpackets extracts opaque, unparsed OpenPGP subpackets from
+// their byte representation.
+func OpaqueSubpackets(contents []byte) (result []*OpaqueSubpacket, err error) {
+ var (
+ subHeaderLen int
+ subPacket *OpaqueSubpacket
+ )
+ for len(contents) > 0 {
+ subHeaderLen, subPacket, err = nextSubpacket(contents)
+ if err != nil {
+ break
+ }
+ result = append(result, subPacket)
+ contents = contents[subHeaderLen+len(subPacket.Contents):]
+ }
+ return
+}
+
+func nextSubpacket(contents []byte) (subHeaderLen int, subPacket *OpaqueSubpacket, err error) {
+ // RFC 4880, section 5.2.3.1
+ var subLen uint32
+ var encodedLength []byte
+ if len(contents) < 1 {
+ goto Truncated
+ }
+ subPacket = &OpaqueSubpacket{}
+ switch {
+ case contents[0] < 192:
+ subHeaderLen = 2 // 1 length byte, 1 subtype byte
+ if len(contents) < subHeaderLen {
+ goto Truncated
+ }
+ encodedLength = contents[0:1]
+ subLen = uint32(contents[0])
+ contents = contents[1:]
+ case contents[0] < 255:
+ subHeaderLen = 3 // 2 length bytes, 1 subtype
+ if len(contents) < subHeaderLen {
+ goto Truncated
+ }
+ encodedLength = contents[0:2]
+ subLen = uint32(contents[0]-192)<<8 + uint32(contents[1]) + 192
+ contents = contents[2:]
+ default:
+ subHeaderLen = 6 // 5 length bytes, 1 subtype
+ if len(contents) < subHeaderLen {
+ goto Truncated
+ }
+ encodedLength = contents[0:5]
+ subLen = uint32(contents[1])<<24 |
+ uint32(contents[2])<<16 |
+ uint32(contents[3])<<8 |
+ uint32(contents[4])
+ contents = contents[5:]
+
+ }
+ if subLen > uint32(len(contents)) || subLen == 0 {
+ goto Truncated
+ }
+ subPacket.SubType = contents[0]
+ subPacket.EncodedLength = encodedLength
+ subPacket.Contents = contents[1:subLen]
+ return
+Truncated:
+ err = errors.StructuralError("subpacket truncated")
+ return
+}
+
+func (osp *OpaqueSubpacket) Serialize(w io.Writer) (err error) {
+ buf := make([]byte, 6)
+ copy(buf, osp.EncodedLength)
+ n := len(osp.EncodedLength)
+
+ buf[n] = osp.SubType
+ if _, err = w.Write(buf[:n+1]); err != nil {
+ return
+ }
+ _, err = w.Write(osp.Contents)
+ return
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/packet.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/packet.go
new file mode 100644
index 0000000000..1e92e22c97
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/packet.go
@@ -0,0 +1,675 @@
+// 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 packet implements parsing and serialization of OpenPGP packets, as
+// specified in RFC 4880.
+package packet // import "github.com/ProtonMail/go-crypto/openpgp/packet"
+
+import (
+ "bytes"
+ "crypto/cipher"
+ "crypto/rsa"
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm"
+)
+
+// readFull is the same as io.ReadFull except that reading zero bytes returns
+// ErrUnexpectedEOF rather than EOF.
+func readFull(r io.Reader, buf []byte) (n int, err error) {
+ n, err = io.ReadFull(r, buf)
+ if err == io.EOF {
+ err = io.ErrUnexpectedEOF
+ }
+ return
+}
+
+// readLength reads an OpenPGP length from r. See RFC 4880, section 4.2.2.
+func readLength(r io.Reader) (length int64, isPartial bool, err error) {
+ var buf [4]byte
+ _, err = readFull(r, buf[:1])
+ if err != nil {
+ return
+ }
+ switch {
+ case buf[0] < 192:
+ length = int64(buf[0])
+ case buf[0] < 224:
+ length = int64(buf[0]-192) << 8
+ _, err = readFull(r, buf[0:1])
+ if err != nil {
+ return
+ }
+ length += int64(buf[0]) + 192
+ case buf[0] < 255:
+ length = int64(1) << (buf[0] & 0x1f)
+ isPartial = true
+ default:
+ _, err = readFull(r, buf[0:4])
+ if err != nil {
+ return
+ }
+ length = int64(buf[0])<<24 |
+ int64(buf[1])<<16 |
+ int64(buf[2])<<8 |
+ int64(buf[3])
+ }
+ return
+}
+
+// partialLengthReader wraps an io.Reader and handles OpenPGP partial lengths.
+// The continuation lengths are parsed and removed from the stream and EOF is
+// returned at the end of the packet. See RFC 4880, section 4.2.2.4.
+type partialLengthReader struct {
+ r io.Reader
+ remaining int64
+ isPartial bool
+}
+
+func (r *partialLengthReader) Read(p []byte) (n int, err error) {
+ for r.remaining == 0 {
+ if !r.isPartial {
+ return 0, io.EOF
+ }
+ r.remaining, r.isPartial, err = readLength(r.r)
+ if err != nil {
+ return 0, err
+ }
+ }
+
+ toRead := int64(len(p))
+ if toRead > r.remaining {
+ toRead = r.remaining
+ }
+
+ n, err = r.r.Read(p[:int(toRead)])
+ r.remaining -= int64(n)
+ if n < int(toRead) && err == io.EOF {
+ err = io.ErrUnexpectedEOF
+ }
+ return
+}
+
+// partialLengthWriter writes a stream of data using OpenPGP partial lengths.
+// See RFC 4880, section 4.2.2.4.
+type partialLengthWriter struct {
+ w io.WriteCloser
+ buf bytes.Buffer
+ lengthByte [1]byte
+}
+
+func (w *partialLengthWriter) Write(p []byte) (n int, err error) {
+ bufLen := w.buf.Len()
+ if bufLen > 512 {
+ for power := uint(30); ; power-- {
+ l := 1 << power
+ if bufLen >= l {
+ w.lengthByte[0] = 224 + uint8(power)
+ _, err = w.w.Write(w.lengthByte[:])
+ if err != nil {
+ return
+ }
+ var m int
+ m, err = w.w.Write(w.buf.Next(l))
+ if err != nil {
+ return
+ }
+ if m != l {
+ return 0, io.ErrShortWrite
+ }
+ break
+ }
+ }
+ }
+ return w.buf.Write(p)
+}
+
+func (w *partialLengthWriter) Close() (err error) {
+ len := w.buf.Len()
+ err = serializeLength(w.w, len)
+ if err != nil {
+ return err
+ }
+ _, err = w.buf.WriteTo(w.w)
+ if err != nil {
+ return err
+ }
+ return w.w.Close()
+}
+
+// A spanReader is an io.LimitReader, but it returns ErrUnexpectedEOF if the
+// underlying Reader returns EOF before the limit has been reached.
+type spanReader struct {
+ r io.Reader
+ n int64
+}
+
+func (l *spanReader) Read(p []byte) (n int, err error) {
+ if l.n <= 0 {
+ return 0, io.EOF
+ }
+ if int64(len(p)) > l.n {
+ p = p[0:l.n]
+ }
+ n, err = l.r.Read(p)
+ l.n -= int64(n)
+ if l.n > 0 && err == io.EOF {
+ err = io.ErrUnexpectedEOF
+ }
+ return
+}
+
+// readHeader parses a packet header and returns an io.Reader which will return
+// the contents of the packet. See RFC 4880, section 4.2.
+func readHeader(r io.Reader) (tag packetType, length int64, contents io.Reader, err error) {
+ var buf [4]byte
+ _, err = io.ReadFull(r, buf[:1])
+ if err != nil {
+ return
+ }
+ if buf[0]&0x80 == 0 {
+ err = errors.StructuralError("tag byte does not have MSB set")
+ return
+ }
+ if buf[0]&0x40 == 0 {
+ // Old format packet
+ tag = packetType((buf[0] & 0x3f) >> 2)
+ lengthType := buf[0] & 3
+ if lengthType == 3 {
+ length = -1
+ contents = r
+ return
+ }
+ lengthBytes := 1 << lengthType
+ _, err = readFull(r, buf[0:lengthBytes])
+ if err != nil {
+ return
+ }
+ for i := 0; i < lengthBytes; i++ {
+ length <<= 8
+ length |= int64(buf[i])
+ }
+ contents = &spanReader{r, length}
+ return
+ }
+
+ // New format packet
+ tag = packetType(buf[0] & 0x3f)
+ length, isPartial, err := readLength(r)
+ if err != nil {
+ return
+ }
+ if isPartial {
+ contents = &partialLengthReader{
+ remaining: length,
+ isPartial: true,
+ r: r,
+ }
+ length = -1
+ } else {
+ contents = &spanReader{r, length}
+ }
+ return
+}
+
+// serializeHeader writes an OpenPGP packet header to w. See RFC 4880, section
+// 4.2.
+func serializeHeader(w io.Writer, ptype packetType, length int) (err error) {
+ err = serializeType(w, ptype)
+ if err != nil {
+ return
+ }
+ return serializeLength(w, length)
+}
+
+// serializeType writes an OpenPGP packet type to w. See RFC 4880, section
+// 4.2.
+func serializeType(w io.Writer, ptype packetType) (err error) {
+ var buf [1]byte
+ buf[0] = 0x80 | 0x40 | byte(ptype)
+ _, err = w.Write(buf[:])
+ return
+}
+
+// serializeLength writes an OpenPGP packet length to w. See RFC 4880, section
+// 4.2.2.
+func serializeLength(w io.Writer, length int) (err error) {
+ var buf [5]byte
+ var n int
+
+ if length < 192 {
+ buf[0] = byte(length)
+ n = 1
+ } else if length < 8384 {
+ length -= 192
+ buf[0] = 192 + byte(length>>8)
+ buf[1] = byte(length)
+ n = 2
+ } else {
+ buf[0] = 255
+ buf[1] = byte(length >> 24)
+ buf[2] = byte(length >> 16)
+ buf[3] = byte(length >> 8)
+ buf[4] = byte(length)
+ n = 5
+ }
+
+ _, err = w.Write(buf[:n])
+ return
+}
+
+// serializeStreamHeader writes an OpenPGP packet header to w where the
+// length of the packet is unknown. It returns a io.WriteCloser which can be
+// used to write the contents of the packet. See RFC 4880, section 4.2.
+func serializeStreamHeader(w io.WriteCloser, ptype packetType) (out io.WriteCloser, err error) {
+ err = serializeType(w, ptype)
+ if err != nil {
+ return
+ }
+ out = &partialLengthWriter{w: w}
+ return
+}
+
+// Packet represents an OpenPGP packet. Users are expected to try casting
+// instances of this interface to specific packet types.
+type Packet interface {
+ parse(io.Reader) error
+}
+
+// consumeAll reads from the given Reader until error, returning the number of
+// bytes read.
+func consumeAll(r io.Reader) (n int64, err error) {
+ var m int
+ var buf [1024]byte
+
+ for {
+ m, err = r.Read(buf[:])
+ n += int64(m)
+ if err == io.EOF {
+ err = nil
+ return
+ }
+ if err != nil {
+ return
+ }
+ }
+}
+
+// packetType represents the numeric ids of the different OpenPGP packet types. See
+// http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-2
+type packetType uint8
+
+const (
+ packetTypeEncryptedKey packetType = 1
+ packetTypeSignature packetType = 2
+ packetTypeSymmetricKeyEncrypted packetType = 3
+ packetTypeOnePassSignature packetType = 4
+ packetTypePrivateKey packetType = 5
+ packetTypePublicKey packetType = 6
+ packetTypePrivateSubkey packetType = 7
+ packetTypeCompressed packetType = 8
+ packetTypeSymmetricallyEncrypted packetType = 9
+ packetTypeMarker packetType = 10
+ packetTypeLiteralData packetType = 11
+ packetTypeTrust packetType = 12
+ packetTypeUserId packetType = 13
+ packetTypePublicSubkey packetType = 14
+ packetTypeUserAttribute packetType = 17
+ packetTypeSymmetricallyEncryptedIntegrityProtected packetType = 18
+ packetTypeAEADEncrypted packetType = 20
+ packetPadding packetType = 21
+)
+
+// EncryptedDataPacket holds encrypted data. It is currently implemented by
+// SymmetricallyEncrypted and AEADEncrypted.
+type EncryptedDataPacket interface {
+ Decrypt(CipherFunction, []byte) (io.ReadCloser, error)
+}
+
+// Read reads a single OpenPGP packet from the given io.Reader. If there is an
+// error parsing a packet, the whole packet is consumed from the input.
+func Read(r io.Reader) (p Packet, err error) {
+ tag, len, contents, err := readHeader(r)
+ if err != nil {
+ return
+ }
+
+ switch tag {
+ case packetTypeEncryptedKey:
+ p = new(EncryptedKey)
+ case packetTypeSignature:
+ p = new(Signature)
+ case packetTypeSymmetricKeyEncrypted:
+ p = new(SymmetricKeyEncrypted)
+ case packetTypeOnePassSignature:
+ p = new(OnePassSignature)
+ case packetTypePrivateKey, packetTypePrivateSubkey:
+ pk := new(PrivateKey)
+ if tag == packetTypePrivateSubkey {
+ pk.IsSubkey = true
+ }
+ p = pk
+ case packetTypePublicKey, packetTypePublicSubkey:
+ isSubkey := tag == packetTypePublicSubkey
+ p = &PublicKey{IsSubkey: isSubkey}
+ case packetTypeCompressed:
+ p = new(Compressed)
+ case packetTypeSymmetricallyEncrypted:
+ p = new(SymmetricallyEncrypted)
+ case packetTypeLiteralData:
+ p = new(LiteralData)
+ case packetTypeUserId:
+ p = new(UserId)
+ case packetTypeUserAttribute:
+ p = new(UserAttribute)
+ case packetTypeSymmetricallyEncryptedIntegrityProtected:
+ se := new(SymmetricallyEncrypted)
+ se.IntegrityProtected = true
+ p = se
+ case packetTypeAEADEncrypted:
+ p = new(AEADEncrypted)
+ case packetPadding:
+ p = Padding(len)
+ case packetTypeMarker:
+ p = new(Marker)
+ case packetTypeTrust:
+ // Not implemented, just consume
+ err = errors.UnknownPacketTypeError(tag)
+ default:
+ // Packet Tags from 0 to 39 are critical.
+ // Packet Tags from 40 to 63 are non-critical.
+ if tag < 40 {
+ err = errors.CriticalUnknownPacketTypeError(tag)
+ } else {
+ err = errors.UnknownPacketTypeError(tag)
+ }
+ }
+ if p != nil {
+ err = p.parse(contents)
+ }
+ if err != nil {
+ consumeAll(contents)
+ }
+ return
+}
+
+// ReadWithCheck reads a single OpenPGP message packet from the given io.Reader. If there is an
+// error parsing a packet, the whole packet is consumed from the input.
+// ReadWithCheck additionally checks if the OpenPGP message packet sequence adheres
+// to the packet composition rules in rfc4880, if not throws an error.
+func ReadWithCheck(r io.Reader, sequence *SequenceVerifier) (p Packet, msgErr error, err error) {
+ tag, len, contents, err := readHeader(r)
+ if err != nil {
+ return
+ }
+ switch tag {
+ case packetTypeEncryptedKey:
+ msgErr = sequence.Next(ESKSymbol)
+ p = new(EncryptedKey)
+ case packetTypeSignature:
+ msgErr = sequence.Next(SigSymbol)
+ p = new(Signature)
+ case packetTypeSymmetricKeyEncrypted:
+ msgErr = sequence.Next(ESKSymbol)
+ p = new(SymmetricKeyEncrypted)
+ case packetTypeOnePassSignature:
+ msgErr = sequence.Next(OPSSymbol)
+ p = new(OnePassSignature)
+ case packetTypeCompressed:
+ msgErr = sequence.Next(CompSymbol)
+ p = new(Compressed)
+ case packetTypeSymmetricallyEncrypted:
+ msgErr = sequence.Next(EncSymbol)
+ p = new(SymmetricallyEncrypted)
+ case packetTypeLiteralData:
+ msgErr = sequence.Next(LDSymbol)
+ p = new(LiteralData)
+ case packetTypeSymmetricallyEncryptedIntegrityProtected:
+ msgErr = sequence.Next(EncSymbol)
+ se := new(SymmetricallyEncrypted)
+ se.IntegrityProtected = true
+ p = se
+ case packetTypeAEADEncrypted:
+ msgErr = sequence.Next(EncSymbol)
+ p = new(AEADEncrypted)
+ case packetPadding:
+ p = Padding(len)
+ case packetTypeMarker:
+ p = new(Marker)
+ case packetTypeTrust:
+ // Not implemented, just consume
+ err = errors.UnknownPacketTypeError(tag)
+ case packetTypePrivateKey,
+ packetTypePrivateSubkey,
+ packetTypePublicKey,
+ packetTypePublicSubkey,
+ packetTypeUserId,
+ packetTypeUserAttribute:
+ msgErr = sequence.Next(UnknownSymbol)
+ consumeAll(contents)
+ default:
+ // Packet Tags from 0 to 39 are critical.
+ // Packet Tags from 40 to 63 are non-critical.
+ if tag < 40 {
+ err = errors.CriticalUnknownPacketTypeError(tag)
+ } else {
+ err = errors.UnknownPacketTypeError(tag)
+ }
+ }
+ if p != nil {
+ err = p.parse(contents)
+ }
+ if err != nil {
+ consumeAll(contents)
+ }
+ return
+}
+
+// SignatureType represents the different semantic meanings of an OpenPGP
+// signature. See RFC 4880, section 5.2.1.
+type SignatureType uint8
+
+const (
+ SigTypeBinary SignatureType = 0x00
+ SigTypeText SignatureType = 0x01
+ SigTypeGenericCert SignatureType = 0x10
+ SigTypePersonaCert SignatureType = 0x11
+ SigTypeCasualCert SignatureType = 0x12
+ SigTypePositiveCert SignatureType = 0x13
+ SigTypeSubkeyBinding SignatureType = 0x18
+ SigTypePrimaryKeyBinding SignatureType = 0x19
+ SigTypeDirectSignature SignatureType = 0x1F
+ SigTypeKeyRevocation SignatureType = 0x20
+ SigTypeSubkeyRevocation SignatureType = 0x28
+ SigTypeCertificationRevocation SignatureType = 0x30
+)
+
+// PublicKeyAlgorithm represents the different public key system specified for
+// OpenPGP. See
+// http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-12
+type PublicKeyAlgorithm uint8
+
+const (
+ PubKeyAlgoRSA PublicKeyAlgorithm = 1
+ PubKeyAlgoElGamal PublicKeyAlgorithm = 16
+ PubKeyAlgoDSA PublicKeyAlgorithm = 17
+ // RFC 6637, Section 5.
+ PubKeyAlgoECDH PublicKeyAlgorithm = 18
+ PubKeyAlgoECDSA PublicKeyAlgorithm = 19
+ // https://www.ietf.org/archive/id/draft-koch-eddsa-for-openpgp-04.txt
+ PubKeyAlgoEdDSA PublicKeyAlgorithm = 22
+ // https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh
+ PubKeyAlgoX25519 PublicKeyAlgorithm = 25
+ PubKeyAlgoX448 PublicKeyAlgorithm = 26
+ PubKeyAlgoEd25519 PublicKeyAlgorithm = 27
+ PubKeyAlgoEd448 PublicKeyAlgorithm = 28
+
+ // Deprecated in RFC 4880, Section 13.5. Use key flags instead.
+ PubKeyAlgoRSAEncryptOnly PublicKeyAlgorithm = 2
+ PubKeyAlgoRSASignOnly PublicKeyAlgorithm = 3
+)
+
+// CanEncrypt returns true if it's possible to encrypt a message to a public
+// key of the given type.
+func (pka PublicKeyAlgorithm) CanEncrypt() bool {
+ switch pka {
+ case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoElGamal, PubKeyAlgoECDH, PubKeyAlgoX25519, PubKeyAlgoX448:
+ return true
+ }
+ return false
+}
+
+// CanSign returns true if it's possible for a public key of the given type to
+// sign a message.
+func (pka PublicKeyAlgorithm) CanSign() bool {
+ switch pka {
+ case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA, PubKeyAlgoECDSA, PubKeyAlgoEdDSA, PubKeyAlgoEd25519, PubKeyAlgoEd448:
+ return true
+ }
+ return false
+}
+
+// CipherFunction represents the different block ciphers specified for OpenPGP. See
+// http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-13
+type CipherFunction algorithm.CipherFunction
+
+const (
+ Cipher3DES CipherFunction = 2
+ CipherCAST5 CipherFunction = 3
+ CipherAES128 CipherFunction = 7
+ CipherAES192 CipherFunction = 8
+ CipherAES256 CipherFunction = 9
+)
+
+// KeySize returns the key size, in bytes, of cipher.
+func (cipher CipherFunction) KeySize() int {
+ return algorithm.CipherFunction(cipher).KeySize()
+}
+
+// IsSupported returns true if the cipher is supported from the library
+func (cipher CipherFunction) IsSupported() bool {
+ return algorithm.CipherFunction(cipher).KeySize() > 0
+}
+
+// blockSize returns the block size, in bytes, of cipher.
+func (cipher CipherFunction) blockSize() int {
+ return algorithm.CipherFunction(cipher).BlockSize()
+}
+
+// new returns a fresh instance of the given cipher.
+func (cipher CipherFunction) new(key []byte) (block cipher.Block) {
+ return algorithm.CipherFunction(cipher).New(key)
+}
+
+// padToKeySize left-pads a MPI with zeroes to match the length of the
+// specified RSA public.
+func padToKeySize(pub *rsa.PublicKey, b []byte) []byte {
+ k := (pub.N.BitLen() + 7) / 8
+ if len(b) >= k {
+ return b
+ }
+ bb := make([]byte, k)
+ copy(bb[len(bb)-len(b):], b)
+ return bb
+}
+
+// CompressionAlgo Represents the different compression algorithms
+// supported by OpenPGP (except for BZIP2, which is not currently
+// supported). See Section 9.3 of RFC 4880.
+type CompressionAlgo uint8
+
+const (
+ CompressionNone CompressionAlgo = 0
+ CompressionZIP CompressionAlgo = 1
+ CompressionZLIB CompressionAlgo = 2
+)
+
+// AEADMode represents the different Authenticated Encryption with Associated
+// Data specified for OpenPGP.
+// See https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-9.6
+type AEADMode algorithm.AEADMode
+
+const (
+ AEADModeEAX AEADMode = 1
+ AEADModeOCB AEADMode = 2
+ AEADModeGCM AEADMode = 3
+)
+
+func (mode AEADMode) IvLength() int {
+ return algorithm.AEADMode(mode).NonceLength()
+}
+
+func (mode AEADMode) TagLength() int {
+ return algorithm.AEADMode(mode).TagLength()
+}
+
+// IsSupported returns true if the aead mode is supported from the library
+func (mode AEADMode) IsSupported() bool {
+ return algorithm.AEADMode(mode).TagLength() > 0
+}
+
+// new returns a fresh instance of the given mode.
+func (mode AEADMode) new(block cipher.Block) cipher.AEAD {
+ return algorithm.AEADMode(mode).New(block)
+}
+
+// ReasonForRevocation represents a revocation reason code as per RFC4880
+// section 5.2.3.23.
+type ReasonForRevocation uint8
+
+const (
+ NoReason ReasonForRevocation = 0
+ KeySuperseded ReasonForRevocation = 1
+ KeyCompromised ReasonForRevocation = 2
+ KeyRetired ReasonForRevocation = 3
+ UserIDNotValid ReasonForRevocation = 32
+ Unknown ReasonForRevocation = 200
+)
+
+func NewReasonForRevocation(value byte) ReasonForRevocation {
+ if value < 4 || value == 32 {
+ return ReasonForRevocation(value)
+ }
+ return Unknown
+}
+
+// Curve is a mapping to supported ECC curves for key generation.
+// See https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-06.html#name-curve-specific-wire-formats
+type Curve string
+
+const (
+ Curve25519 Curve = "Curve25519"
+ Curve448 Curve = "Curve448"
+ CurveNistP256 Curve = "P256"
+ CurveNistP384 Curve = "P384"
+ CurveNistP521 Curve = "P521"
+ CurveSecP256k1 Curve = "SecP256k1"
+ CurveBrainpoolP256 Curve = "BrainpoolP256"
+ CurveBrainpoolP384 Curve = "BrainpoolP384"
+ CurveBrainpoolP512 Curve = "BrainpoolP512"
+)
+
+// TrustLevel represents a trust level per RFC4880 5.2.3.13
+type TrustLevel uint8
+
+// TrustAmount represents a trust amount per RFC4880 5.2.3.13
+type TrustAmount uint8
+
+const (
+ // versionSize is the length in bytes of the version value.
+ versionSize = 1
+ // algorithmSize is the length in bytes of the key algorithm value.
+ algorithmSize = 1
+ // keyVersionSize is the length in bytes of the key version value
+ keyVersionSize = 1
+ // keyIdSize is the length in bytes of the key identifier value.
+ keyIdSize = 8
+ // timestampSize is the length in bytes of encoded timestamps.
+ timestampSize = 4
+ // fingerprintSizeV6 is the length in bytes of the key fingerprint in v6.
+ fingerprintSizeV6 = 32
+ // fingerprintSize is the length in bytes of the key fingerprint.
+ fingerprintSize = 20
+)
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/packet_sequence.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/packet_sequence.go
new file mode 100644
index 0000000000..55a8a56c2d
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/packet_sequence.go
@@ -0,0 +1,222 @@
+package packet
+
+// This file implements the pushdown automata (PDA) from PGPainless (Paul Schaub)
+// to verify pgp packet sequences. See Paul's blogpost for more details:
+// https://blog.jabberhead.tk/2022/10/26/implementing-packet-sequence-validation-using-pushdown-automata/
+import (
+ "fmt"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+)
+
+func NewErrMalformedMessage(from State, input InputSymbol, stackSymbol StackSymbol) errors.ErrMalformedMessage {
+ return errors.ErrMalformedMessage(fmt.Sprintf("state %d, input symbol %d, stack symbol %d ", from, input, stackSymbol))
+}
+
+// InputSymbol defines the input alphabet of the PDA
+type InputSymbol uint8
+
+const (
+ LDSymbol InputSymbol = iota
+ SigSymbol
+ OPSSymbol
+ CompSymbol
+ ESKSymbol
+ EncSymbol
+ EOSSymbol
+ UnknownSymbol
+)
+
+// StackSymbol defines the stack alphabet of the PDA
+type StackSymbol int8
+
+const (
+ MsgStackSymbol StackSymbol = iota
+ OpsStackSymbol
+ KeyStackSymbol
+ EndStackSymbol
+ EmptyStackSymbol
+)
+
+// State defines the states of the PDA
+type State int8
+
+const (
+ OpenPGPMessage State = iota
+ ESKMessage
+ LiteralMessage
+ CompressedMessage
+ EncryptedMessage
+ ValidMessage
+)
+
+// transition represents a state transition in the PDA
+type transition func(input InputSymbol, stackSymbol StackSymbol) (State, []StackSymbol, bool, error)
+
+// SequenceVerifier is a pushdown automata to verify
+// PGP messages packet sequences according to rfc4880.
+type SequenceVerifier struct {
+ stack []StackSymbol
+ state State
+}
+
+// Next performs a state transition with the given input symbol.
+// If the transition fails a ErrMalformedMessage is returned.
+func (sv *SequenceVerifier) Next(input InputSymbol) error {
+ for {
+ stackSymbol := sv.popStack()
+ transitionFunc := getTransition(sv.state)
+ nextState, newStackSymbols, redo, err := transitionFunc(input, stackSymbol)
+ if err != nil {
+ return err
+ }
+ if redo {
+ sv.pushStack(stackSymbol)
+ }
+ for _, newStackSymbol := range newStackSymbols {
+ sv.pushStack(newStackSymbol)
+ }
+ sv.state = nextState
+ if !redo {
+ break
+ }
+ }
+ return nil
+}
+
+// Valid returns true if RDA is in a valid state.
+func (sv *SequenceVerifier) Valid() bool {
+ return sv.state == ValidMessage && len(sv.stack) == 0
+}
+
+func (sv *SequenceVerifier) AssertValid() error {
+ if !sv.Valid() {
+ return errors.ErrMalformedMessage("invalid message")
+ }
+ return nil
+}
+
+func NewSequenceVerifier() *SequenceVerifier {
+ return &SequenceVerifier{
+ stack: []StackSymbol{EndStackSymbol, MsgStackSymbol},
+ state: OpenPGPMessage,
+ }
+}
+
+func (sv *SequenceVerifier) popStack() StackSymbol {
+ if len(sv.stack) == 0 {
+ return EmptyStackSymbol
+ }
+ elemIndex := len(sv.stack) - 1
+ stackSymbol := sv.stack[elemIndex]
+ sv.stack = sv.stack[:elemIndex]
+ return stackSymbol
+}
+
+func (sv *SequenceVerifier) pushStack(stackSymbol StackSymbol) {
+ sv.stack = append(sv.stack, stackSymbol)
+}
+
+func getTransition(from State) transition {
+ switch from {
+ case OpenPGPMessage:
+ return fromOpenPGPMessage
+ case LiteralMessage:
+ return fromLiteralMessage
+ case CompressedMessage:
+ return fromCompressedMessage
+ case EncryptedMessage:
+ return fromEncryptedMessage
+ case ESKMessage:
+ return fromESKMessage
+ case ValidMessage:
+ return fromValidMessage
+ }
+ return nil
+}
+
+// fromOpenPGPMessage is the transition for the state OpenPGPMessage.
+func fromOpenPGPMessage(input InputSymbol, stackSymbol StackSymbol) (State, []StackSymbol, bool, error) {
+ if stackSymbol != MsgStackSymbol {
+ return 0, nil, false, NewErrMalformedMessage(OpenPGPMessage, input, stackSymbol)
+ }
+ switch input {
+ case LDSymbol:
+ return LiteralMessage, nil, false, nil
+ case SigSymbol:
+ return OpenPGPMessage, []StackSymbol{MsgStackSymbol}, false, nil
+ case OPSSymbol:
+ return OpenPGPMessage, []StackSymbol{OpsStackSymbol, MsgStackSymbol}, false, nil
+ case CompSymbol:
+ return CompressedMessage, nil, false, nil
+ case ESKSymbol:
+ return ESKMessage, []StackSymbol{KeyStackSymbol}, false, nil
+ case EncSymbol:
+ return EncryptedMessage, nil, false, nil
+ }
+ return 0, nil, false, NewErrMalformedMessage(OpenPGPMessage, input, stackSymbol)
+}
+
+// fromESKMessage is the transition for the state ESKMessage.
+func fromESKMessage(input InputSymbol, stackSymbol StackSymbol) (State, []StackSymbol, bool, error) {
+ if stackSymbol != KeyStackSymbol {
+ return 0, nil, false, NewErrMalformedMessage(ESKMessage, input, stackSymbol)
+ }
+ switch input {
+ case ESKSymbol:
+ return ESKMessage, []StackSymbol{KeyStackSymbol}, false, nil
+ case EncSymbol:
+ return EncryptedMessage, nil, false, nil
+ }
+ return 0, nil, false, NewErrMalformedMessage(ESKMessage, input, stackSymbol)
+}
+
+// fromLiteralMessage is the transition for the state LiteralMessage.
+func fromLiteralMessage(input InputSymbol, stackSymbol StackSymbol) (State, []StackSymbol, bool, error) {
+ switch input {
+ case SigSymbol:
+ if stackSymbol == OpsStackSymbol {
+ return LiteralMessage, nil, false, nil
+ }
+ case EOSSymbol:
+ if stackSymbol == EndStackSymbol {
+ return ValidMessage, nil, false, nil
+ }
+ }
+ return 0, nil, false, NewErrMalformedMessage(LiteralMessage, input, stackSymbol)
+}
+
+// fromLiteralMessage is the transition for the state CompressedMessage.
+func fromCompressedMessage(input InputSymbol, stackSymbol StackSymbol) (State, []StackSymbol, bool, error) {
+ switch input {
+ case SigSymbol:
+ if stackSymbol == OpsStackSymbol {
+ return CompressedMessage, nil, false, nil
+ }
+ case EOSSymbol:
+ if stackSymbol == EndStackSymbol {
+ return ValidMessage, nil, false, nil
+ }
+ }
+ return OpenPGPMessage, []StackSymbol{MsgStackSymbol}, true, nil
+}
+
+// fromEncryptedMessage is the transition for the state EncryptedMessage.
+func fromEncryptedMessage(input InputSymbol, stackSymbol StackSymbol) (State, []StackSymbol, bool, error) {
+ switch input {
+ case SigSymbol:
+ if stackSymbol == OpsStackSymbol {
+ return EncryptedMessage, nil, false, nil
+ }
+ case EOSSymbol:
+ if stackSymbol == EndStackSymbol {
+ return ValidMessage, nil, false, nil
+ }
+ }
+ return OpenPGPMessage, []StackSymbol{MsgStackSymbol}, true, nil
+}
+
+// fromValidMessage is the transition for the state ValidMessage.
+func fromValidMessage(input InputSymbol, stackSymbol StackSymbol) (State, []StackSymbol, bool, error) {
+ return 0, nil, false, NewErrMalformedMessage(ValidMessage, input, stackSymbol)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/packet_unsupported.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/packet_unsupported.go
new file mode 100644
index 0000000000..2d714723cf
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/packet_unsupported.go
@@ -0,0 +1,24 @@
+package packet
+
+import (
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+)
+
+// UnsupportedPackage represents a OpenPGP packet with a known packet type
+// but with unsupported content.
+type UnsupportedPacket struct {
+ IncompletePacket Packet
+ Error errors.UnsupportedError
+}
+
+// Implements the Packet interface
+func (up *UnsupportedPacket) parse(read io.Reader) error {
+ err := up.IncompletePacket.parse(read)
+ if castedErr, ok := err.(errors.UnsupportedError); ok {
+ up.Error = castedErr
+ return nil
+ }
+ return err
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/padding.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/padding.go
new file mode 100644
index 0000000000..3b6a7045d1
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/padding.go
@@ -0,0 +1,26 @@
+package packet
+
+import (
+ "io"
+)
+
+// Padding type represents a Padding Packet (Tag 21).
+// The padding type is represented by the length of its padding.
+// see https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh#name-padding-packet-tag-21
+type Padding int
+
+// parse just ignores the padding content.
+func (pad Padding) parse(reader io.Reader) error {
+ _, err := io.CopyN(io.Discard, reader, int64(pad))
+ return err
+}
+
+// SerializePadding writes the padding to writer.
+func (pad Padding) SerializePadding(writer io.Writer, rand io.Reader) error {
+ err := serializeHeader(writer, packetPadding, int(pad))
+ if err != nil {
+ return err
+ }
+ _, err = io.CopyN(writer, rand, int64(pad))
+ return err
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key.go
new file mode 100644
index 0000000000..f04e6c6b87
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key.go
@@ -0,0 +1,1191 @@
+// 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 packet
+
+import (
+ "bytes"
+ "crypto"
+ "crypto/cipher"
+ "crypto/dsa"
+ "crypto/rsa"
+ "crypto/sha1"
+ "crypto/sha256"
+ "crypto/subtle"
+ "fmt"
+ "io"
+ "math/big"
+ "strconv"
+ "time"
+
+ "github.com/ProtonMail/go-crypto/openpgp/ecdh"
+ "github.com/ProtonMail/go-crypto/openpgp/ecdsa"
+ "github.com/ProtonMail/go-crypto/openpgp/ed25519"
+ "github.com/ProtonMail/go-crypto/openpgp/ed448"
+ "github.com/ProtonMail/go-crypto/openpgp/eddsa"
+ "github.com/ProtonMail/go-crypto/openpgp/elgamal"
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/encoding"
+ "github.com/ProtonMail/go-crypto/openpgp/s2k"
+ "github.com/ProtonMail/go-crypto/openpgp/x25519"
+ "github.com/ProtonMail/go-crypto/openpgp/x448"
+ "golang.org/x/crypto/hkdf"
+)
+
+// PrivateKey represents a possibly encrypted private key. See RFC 4880,
+// section 5.5.3.
+type PrivateKey struct {
+ PublicKey
+ Encrypted bool // if true then the private key is unavailable until Decrypt has been called.
+ encryptedData []byte
+ cipher CipherFunction
+ s2k func(out, in []byte)
+ aead AEADMode // only relevant if S2KAEAD is enabled
+ // An *{rsa|dsa|elgamal|ecdh|ecdsa|ed25519|ed448}.PrivateKey or
+ // crypto.Signer/crypto.Decrypter (Decryptor RSA only).
+ PrivateKey interface{}
+ iv []byte
+
+ // Type of encryption of the S2K packet
+ // Allowed values are 0 (Not encrypted), 253 (AEAD), 254 (SHA1), or
+ // 255 (2-byte checksum)
+ s2kType S2KType
+ // Full parameters of the S2K packet
+ s2kParams *s2k.Params
+}
+
+// S2KType s2k packet type
+type S2KType uint8
+
+const (
+ // S2KNON unencrypt
+ S2KNON S2KType = 0
+ // S2KAEAD use authenticated encryption
+ S2KAEAD S2KType = 253
+ // S2KSHA1 sha1 sum check
+ S2KSHA1 S2KType = 254
+ // S2KCHECKSUM sum check
+ S2KCHECKSUM S2KType = 255
+)
+
+func NewRSAPrivateKey(creationTime time.Time, priv *rsa.PrivateKey) *PrivateKey {
+ pk := new(PrivateKey)
+ pk.PublicKey = *NewRSAPublicKey(creationTime, &priv.PublicKey)
+ pk.PrivateKey = priv
+ return pk
+}
+
+func NewDSAPrivateKey(creationTime time.Time, priv *dsa.PrivateKey) *PrivateKey {
+ pk := new(PrivateKey)
+ pk.PublicKey = *NewDSAPublicKey(creationTime, &priv.PublicKey)
+ pk.PrivateKey = priv
+ return pk
+}
+
+func NewElGamalPrivateKey(creationTime time.Time, priv *elgamal.PrivateKey) *PrivateKey {
+ pk := new(PrivateKey)
+ pk.PublicKey = *NewElGamalPublicKey(creationTime, &priv.PublicKey)
+ pk.PrivateKey = priv
+ return pk
+}
+
+func NewECDSAPrivateKey(creationTime time.Time, priv *ecdsa.PrivateKey) *PrivateKey {
+ pk := new(PrivateKey)
+ pk.PublicKey = *NewECDSAPublicKey(creationTime, &priv.PublicKey)
+ pk.PrivateKey = priv
+ return pk
+}
+
+func NewEdDSAPrivateKey(creationTime time.Time, priv *eddsa.PrivateKey) *PrivateKey {
+ pk := new(PrivateKey)
+ pk.PublicKey = *NewEdDSAPublicKey(creationTime, &priv.PublicKey)
+ pk.PrivateKey = priv
+ return pk
+}
+
+func NewECDHPrivateKey(creationTime time.Time, priv *ecdh.PrivateKey) *PrivateKey {
+ pk := new(PrivateKey)
+ pk.PublicKey = *NewECDHPublicKey(creationTime, &priv.PublicKey)
+ pk.PrivateKey = priv
+ return pk
+}
+
+func NewX25519PrivateKey(creationTime time.Time, priv *x25519.PrivateKey) *PrivateKey {
+ pk := new(PrivateKey)
+ pk.PublicKey = *NewX25519PublicKey(creationTime, &priv.PublicKey)
+ pk.PrivateKey = priv
+ return pk
+}
+
+func NewX448PrivateKey(creationTime time.Time, priv *x448.PrivateKey) *PrivateKey {
+ pk := new(PrivateKey)
+ pk.PublicKey = *NewX448PublicKey(creationTime, &priv.PublicKey)
+ pk.PrivateKey = priv
+ return pk
+}
+
+func NewEd25519PrivateKey(creationTime time.Time, priv *ed25519.PrivateKey) *PrivateKey {
+ pk := new(PrivateKey)
+ pk.PublicKey = *NewEd25519PublicKey(creationTime, &priv.PublicKey)
+ pk.PrivateKey = priv
+ return pk
+}
+
+func NewEd448PrivateKey(creationTime time.Time, priv *ed448.PrivateKey) *PrivateKey {
+ pk := new(PrivateKey)
+ pk.PublicKey = *NewEd448PublicKey(creationTime, &priv.PublicKey)
+ pk.PrivateKey = priv
+ return pk
+}
+
+// NewSignerPrivateKey creates a PrivateKey from a crypto.Signer that
+// implements RSA, ECDSA or EdDSA.
+func NewSignerPrivateKey(creationTime time.Time, signer interface{}) *PrivateKey {
+ pk := new(PrivateKey)
+ // In general, the public Keys should be used as pointers. We still
+ // type-switch on the values, for backwards-compatibility.
+ switch pubkey := signer.(type) {
+ case *rsa.PrivateKey:
+ pk.PublicKey = *NewRSAPublicKey(creationTime, &pubkey.PublicKey)
+ case rsa.PrivateKey:
+ pk.PublicKey = *NewRSAPublicKey(creationTime, &pubkey.PublicKey)
+ case *ecdsa.PrivateKey:
+ pk.PublicKey = *NewECDSAPublicKey(creationTime, &pubkey.PublicKey)
+ case ecdsa.PrivateKey:
+ pk.PublicKey = *NewECDSAPublicKey(creationTime, &pubkey.PublicKey)
+ case *eddsa.PrivateKey:
+ pk.PublicKey = *NewEdDSAPublicKey(creationTime, &pubkey.PublicKey)
+ case eddsa.PrivateKey:
+ pk.PublicKey = *NewEdDSAPublicKey(creationTime, &pubkey.PublicKey)
+ case *ed25519.PrivateKey:
+ pk.PublicKey = *NewEd25519PublicKey(creationTime, &pubkey.PublicKey)
+ case ed25519.PrivateKey:
+ pk.PublicKey = *NewEd25519PublicKey(creationTime, &pubkey.PublicKey)
+ case *ed448.PrivateKey:
+ pk.PublicKey = *NewEd448PublicKey(creationTime, &pubkey.PublicKey)
+ case ed448.PrivateKey:
+ pk.PublicKey = *NewEd448PublicKey(creationTime, &pubkey.PublicKey)
+ default:
+ panic("openpgp: unknown signer type in NewSignerPrivateKey")
+ }
+ pk.PrivateKey = signer
+ return pk
+}
+
+// NewDecrypterPrivateKey creates a PrivateKey from a *{rsa|elgamal|ecdh|x25519|x448}.PrivateKey.
+func NewDecrypterPrivateKey(creationTime time.Time, decrypter interface{}) *PrivateKey {
+ pk := new(PrivateKey)
+ switch priv := decrypter.(type) {
+ case *rsa.PrivateKey:
+ pk.PublicKey = *NewRSAPublicKey(creationTime, &priv.PublicKey)
+ case *elgamal.PrivateKey:
+ pk.PublicKey = *NewElGamalPublicKey(creationTime, &priv.PublicKey)
+ case *ecdh.PrivateKey:
+ pk.PublicKey = *NewECDHPublicKey(creationTime, &priv.PublicKey)
+ case *x25519.PrivateKey:
+ pk.PublicKey = *NewX25519PublicKey(creationTime, &priv.PublicKey)
+ case *x448.PrivateKey:
+ pk.PublicKey = *NewX448PublicKey(creationTime, &priv.PublicKey)
+ default:
+ panic("openpgp: unknown decrypter type in NewDecrypterPrivateKey")
+ }
+ pk.PrivateKey = decrypter
+ return pk
+}
+
+func (pk *PrivateKey) parse(r io.Reader) (err error) {
+ err = (&pk.PublicKey).parse(r)
+ if err != nil {
+ return
+ }
+ v5 := pk.PublicKey.Version == 5
+ v6 := pk.PublicKey.Version == 6
+
+ if V5Disabled && v5 {
+ return errors.UnsupportedError("support for parsing v5 entities is disabled; build with `-tags v5` if needed")
+ }
+
+ var buf [1]byte
+ _, err = readFull(r, buf[:])
+ if err != nil {
+ return
+ }
+ pk.s2kType = S2KType(buf[0])
+ var optCount [1]byte
+ if v5 || (v6 && pk.s2kType != S2KNON) {
+ if _, err = readFull(r, optCount[:]); err != nil {
+ return
+ }
+ }
+
+ switch pk.s2kType {
+ case S2KNON:
+ pk.s2k = nil
+ pk.Encrypted = false
+ case S2KSHA1, S2KCHECKSUM, S2KAEAD:
+ if (v5 || v6) && pk.s2kType == S2KCHECKSUM {
+ return errors.StructuralError(fmt.Sprintf("wrong s2k identifier for version %d", pk.Version))
+ }
+ _, err = readFull(r, buf[:])
+ if err != nil {
+ return
+ }
+ pk.cipher = CipherFunction(buf[0])
+ if pk.cipher != 0 && !pk.cipher.IsSupported() {
+ return errors.UnsupportedError("unsupported cipher function in private key")
+ }
+ // [Optional] If string-to-key usage octet was 253,
+ // a one-octet AEAD algorithm.
+ if pk.s2kType == S2KAEAD {
+ _, err = readFull(r, buf[:])
+ if err != nil {
+ return
+ }
+ pk.aead = AEADMode(buf[0])
+ if !pk.aead.IsSupported() {
+ return errors.UnsupportedError("unsupported aead mode in private key")
+ }
+ }
+
+ // [Optional] Only for a version 6 packet,
+ // and if string-to-key usage octet was 255, 254, or 253,
+ // an one-octet count of the following field.
+ if v6 {
+ _, err = readFull(r, buf[:])
+ if err != nil {
+ return
+ }
+ }
+
+ pk.s2kParams, err = s2k.ParseIntoParams(r)
+ if err != nil {
+ return
+ }
+ if pk.s2kParams.Dummy() {
+ return
+ }
+ if pk.s2kParams.Mode() == s2k.Argon2S2K && pk.s2kType != S2KAEAD {
+ return errors.StructuralError("using Argon2 S2K without AEAD is not allowed")
+ }
+ if pk.s2kParams.Mode() == s2k.SimpleS2K && pk.Version == 6 {
+ return errors.StructuralError("using Simple S2K with version 6 keys is not allowed")
+ }
+ pk.s2k, err = pk.s2kParams.Function()
+ if err != nil {
+ return
+ }
+ pk.Encrypted = true
+ default:
+ return errors.UnsupportedError("deprecated s2k function in private key")
+ }
+
+ if pk.Encrypted {
+ var ivSize int
+ // If the S2K usage octet was 253, the IV is of the size expected by the AEAD mode,
+ // unless it's a version 5 key, in which case it's the size of the symmetric cipher's block size.
+ // For all other S2K modes, it's always the block size.
+ if !v5 && pk.s2kType == S2KAEAD {
+ ivSize = pk.aead.IvLength()
+ } else {
+ ivSize = pk.cipher.blockSize()
+ }
+
+ if ivSize == 0 {
+ return errors.UnsupportedError("unsupported cipher in private key: " + strconv.Itoa(int(pk.cipher)))
+ }
+ pk.iv = make([]byte, ivSize)
+ _, err = readFull(r, pk.iv)
+ if err != nil {
+ return
+ }
+ if v5 && pk.s2kType == S2KAEAD {
+ pk.iv = pk.iv[:pk.aead.IvLength()]
+ }
+ }
+
+ var privateKeyData []byte
+ if v5 {
+ var n [4]byte /* secret material four octet count */
+ _, err = readFull(r, n[:])
+ if err != nil {
+ return
+ }
+ count := uint32(uint32(n[0])<<24 | uint32(n[1])<<16 | uint32(n[2])<<8 | uint32(n[3]))
+ if !pk.Encrypted {
+ count = count + 2 /* two octet checksum */
+ }
+ privateKeyData = make([]byte, count)
+ _, err = readFull(r, privateKeyData)
+ if err != nil {
+ return
+ }
+ } else {
+ privateKeyData, err = io.ReadAll(r)
+ if err != nil {
+ return
+ }
+ }
+ if !pk.Encrypted {
+ if len(privateKeyData) < 2 {
+ return errors.StructuralError("truncated private key data")
+ }
+ if pk.Version != 6 {
+ // checksum
+ var sum uint16
+ for i := 0; i < len(privateKeyData)-2; i++ {
+ sum += uint16(privateKeyData[i])
+ }
+ if privateKeyData[len(privateKeyData)-2] != uint8(sum>>8) ||
+ privateKeyData[len(privateKeyData)-1] != uint8(sum) {
+ return errors.StructuralError("private key checksum failure")
+ }
+ privateKeyData = privateKeyData[:len(privateKeyData)-2]
+ return pk.parsePrivateKey(privateKeyData)
+ } else {
+ // No checksum
+ return pk.parsePrivateKey(privateKeyData)
+ }
+ }
+
+ pk.encryptedData = privateKeyData
+ return
+}
+
+// Dummy returns true if the private key is a dummy key. This is a GNU extension.
+func (pk *PrivateKey) Dummy() bool {
+ return pk.s2kParams.Dummy()
+}
+
+func mod64kHash(d []byte) uint16 {
+ var h uint16
+ for _, b := range d {
+ h += uint16(b)
+ }
+ return h
+}
+
+func (pk *PrivateKey) Serialize(w io.Writer) (err error) {
+ contents := bytes.NewBuffer(nil)
+ err = pk.PublicKey.serializeWithoutHeaders(contents)
+ if err != nil {
+ return
+ }
+ if _, err = contents.Write([]byte{uint8(pk.s2kType)}); err != nil {
+ return
+ }
+
+ optional := bytes.NewBuffer(nil)
+ if pk.Encrypted || pk.Dummy() {
+ // [Optional] If string-to-key usage octet was 255, 254, or 253,
+ // a one-octet symmetric encryption algorithm.
+ if _, err = optional.Write([]byte{uint8(pk.cipher)}); err != nil {
+ return
+ }
+ // [Optional] If string-to-key usage octet was 253,
+ // a one-octet AEAD algorithm.
+ if pk.s2kType == S2KAEAD {
+ if _, err = optional.Write([]byte{uint8(pk.aead)}); err != nil {
+ return
+ }
+ }
+
+ s2kBuffer := bytes.NewBuffer(nil)
+ if err := pk.s2kParams.Serialize(s2kBuffer); err != nil {
+ return err
+ }
+ // [Optional] Only for a version 6 packet, and if string-to-key
+ // usage octet was 255, 254, or 253, an one-octet
+ // count of the following field.
+ if pk.Version == 6 {
+ if _, err = optional.Write([]byte{uint8(s2kBuffer.Len())}); err != nil {
+ return
+ }
+ }
+ // [Optional] If string-to-key usage octet was 255, 254, or 253,
+ // a string-to-key (S2K) specifier. The length of the string-to-key specifier
+ // depends on its type
+ if _, err = io.Copy(optional, s2kBuffer); err != nil {
+ return
+ }
+
+ // IV
+ if pk.Encrypted {
+ if _, err = optional.Write(pk.iv); err != nil {
+ return
+ }
+ if pk.Version == 5 && pk.s2kType == S2KAEAD {
+ // Add padding for version 5
+ padding := make([]byte, pk.cipher.blockSize()-len(pk.iv))
+ if _, err = optional.Write(padding); err != nil {
+ return
+ }
+ }
+ }
+ }
+ if pk.Version == 5 || (pk.Version == 6 && pk.s2kType != S2KNON) {
+ contents.Write([]byte{uint8(optional.Len())})
+ }
+
+ if _, err := io.Copy(contents, optional); err != nil {
+ return err
+ }
+
+ if !pk.Dummy() {
+ l := 0
+ var priv []byte
+ if !pk.Encrypted {
+ buf := bytes.NewBuffer(nil)
+ err = pk.serializePrivateKey(buf)
+ if err != nil {
+ return err
+ }
+ l = buf.Len()
+ if pk.Version != 6 {
+ checksum := mod64kHash(buf.Bytes())
+ buf.Write([]byte{byte(checksum >> 8), byte(checksum)})
+ }
+ priv = buf.Bytes()
+ } else {
+ priv, l = pk.encryptedData, len(pk.encryptedData)
+ }
+
+ if pk.Version == 5 {
+ contents.Write([]byte{byte(l >> 24), byte(l >> 16), byte(l >> 8), byte(l)})
+ }
+ contents.Write(priv)
+ }
+
+ ptype := packetTypePrivateKey
+ if pk.IsSubkey {
+ ptype = packetTypePrivateSubkey
+ }
+ err = serializeHeader(w, ptype, contents.Len())
+ if err != nil {
+ return
+ }
+ _, err = io.Copy(w, contents)
+ if err != nil {
+ return
+ }
+ return
+}
+
+func serializeRSAPrivateKey(w io.Writer, priv *rsa.PrivateKey) error {
+ if _, err := w.Write(new(encoding.MPI).SetBig(priv.D).EncodedBytes()); err != nil {
+ return err
+ }
+ if _, err := w.Write(new(encoding.MPI).SetBig(priv.Primes[1]).EncodedBytes()); err != nil {
+ return err
+ }
+ if _, err := w.Write(new(encoding.MPI).SetBig(priv.Primes[0]).EncodedBytes()); err != nil {
+ return err
+ }
+ _, err := w.Write(new(encoding.MPI).SetBig(priv.Precomputed.Qinv).EncodedBytes())
+ return err
+}
+
+func serializeDSAPrivateKey(w io.Writer, priv *dsa.PrivateKey) error {
+ _, err := w.Write(new(encoding.MPI).SetBig(priv.X).EncodedBytes())
+ return err
+}
+
+func serializeElGamalPrivateKey(w io.Writer, priv *elgamal.PrivateKey) error {
+ _, err := w.Write(new(encoding.MPI).SetBig(priv.X).EncodedBytes())
+ return err
+}
+
+func serializeECDSAPrivateKey(w io.Writer, priv *ecdsa.PrivateKey) error {
+ _, err := w.Write(encoding.NewMPI(priv.MarshalIntegerSecret()).EncodedBytes())
+ return err
+}
+
+func serializeEdDSAPrivateKey(w io.Writer, priv *eddsa.PrivateKey) error {
+ _, err := w.Write(encoding.NewMPI(priv.MarshalByteSecret()).EncodedBytes())
+ return err
+}
+
+func serializeECDHPrivateKey(w io.Writer, priv *ecdh.PrivateKey) error {
+ _, err := w.Write(encoding.NewMPI(priv.MarshalByteSecret()).EncodedBytes())
+ return err
+}
+
+func serializeX25519PrivateKey(w io.Writer, priv *x25519.PrivateKey) error {
+ _, err := w.Write(priv.Secret)
+ return err
+}
+
+func serializeX448PrivateKey(w io.Writer, priv *x448.PrivateKey) error {
+ _, err := w.Write(priv.Secret)
+ return err
+}
+
+func serializeEd25519PrivateKey(w io.Writer, priv *ed25519.PrivateKey) error {
+ _, err := w.Write(priv.MarshalByteSecret())
+ return err
+}
+
+func serializeEd448PrivateKey(w io.Writer, priv *ed448.PrivateKey) error {
+ _, err := w.Write(priv.MarshalByteSecret())
+ return err
+}
+
+// decrypt decrypts an encrypted private key using a decryption key.
+func (pk *PrivateKey) decrypt(decryptionKey []byte) error {
+ if pk.Dummy() {
+ return errors.ErrDummyPrivateKey("dummy key found")
+ }
+ if !pk.Encrypted {
+ return nil
+ }
+ block := pk.cipher.new(decryptionKey)
+ var data []byte
+ switch pk.s2kType {
+ case S2KAEAD:
+ aead := pk.aead.new(block)
+ additionalData, err := pk.additionalData()
+ if err != nil {
+ return err
+ }
+ // Decrypt the encrypted key material with aead
+ data, err = aead.Open(nil, pk.iv, pk.encryptedData, additionalData)
+ if err != nil {
+ return err
+ }
+ case S2KSHA1, S2KCHECKSUM:
+ cfb := cipher.NewCFBDecrypter(block, pk.iv)
+ data = make([]byte, len(pk.encryptedData))
+ cfb.XORKeyStream(data, pk.encryptedData)
+ if pk.s2kType == S2KSHA1 {
+ if len(data) < sha1.Size {
+ return errors.StructuralError("truncated private key data")
+ }
+ h := sha1.New()
+ h.Write(data[:len(data)-sha1.Size])
+ sum := h.Sum(nil)
+ if !bytes.Equal(sum, data[len(data)-sha1.Size:]) {
+ return errors.StructuralError("private key checksum failure")
+ }
+ data = data[:len(data)-sha1.Size]
+ } else {
+ if len(data) < 2 {
+ return errors.StructuralError("truncated private key data")
+ }
+ var sum uint16
+ for i := 0; i < len(data)-2; i++ {
+ sum += uint16(data[i])
+ }
+ if data[len(data)-2] != uint8(sum>>8) ||
+ data[len(data)-1] != uint8(sum) {
+ return errors.StructuralError("private key checksum failure")
+ }
+ data = data[:len(data)-2]
+ }
+ default:
+ return errors.InvalidArgumentError("invalid s2k type")
+ }
+
+ err := pk.parsePrivateKey(data)
+ if _, ok := err.(errors.KeyInvalidError); ok {
+ return errors.KeyInvalidError("invalid key parameters")
+ }
+ if err != nil {
+ return err
+ }
+
+ // Mark key as unencrypted
+ pk.s2kType = S2KNON
+ pk.s2k = nil
+ pk.Encrypted = false
+ pk.encryptedData = nil
+ return nil
+}
+
+func (pk *PrivateKey) decryptWithCache(passphrase []byte, keyCache *s2k.Cache) error {
+ if pk.Dummy() {
+ return errors.ErrDummyPrivateKey("dummy key found")
+ }
+ if !pk.Encrypted {
+ return nil
+ }
+
+ key, err := keyCache.GetOrComputeDerivedKey(passphrase, pk.s2kParams, pk.cipher.KeySize())
+ if err != nil {
+ return err
+ }
+ if pk.s2kType == S2KAEAD {
+ key = pk.applyHKDF(key)
+ }
+ return pk.decrypt(key)
+}
+
+// Decrypt decrypts an encrypted private key using a passphrase.
+func (pk *PrivateKey) Decrypt(passphrase []byte) error {
+ if pk.Dummy() {
+ return errors.ErrDummyPrivateKey("dummy key found")
+ }
+ if !pk.Encrypted {
+ return nil
+ }
+
+ key := make([]byte, pk.cipher.KeySize())
+ pk.s2k(key, passphrase)
+ if pk.s2kType == S2KAEAD {
+ key = pk.applyHKDF(key)
+ }
+ return pk.decrypt(key)
+}
+
+// DecryptPrivateKeys decrypts all encrypted keys with the given config and passphrase.
+// Avoids recomputation of similar s2k key derivations.
+func DecryptPrivateKeys(keys []*PrivateKey, passphrase []byte) error {
+ // Create a cache to avoid recomputation of key derviations for the same passphrase.
+ s2kCache := &s2k.Cache{}
+ for _, key := range keys {
+ if key != nil && !key.Dummy() && key.Encrypted {
+ err := key.decryptWithCache(passphrase, s2kCache)
+ if err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+}
+
+// encrypt encrypts an unencrypted private key.
+func (pk *PrivateKey) encrypt(key []byte, params *s2k.Params, s2kType S2KType, cipherFunction CipherFunction, rand io.Reader) error {
+ if pk.Dummy() {
+ return errors.ErrDummyPrivateKey("dummy key found")
+ }
+ if pk.Encrypted {
+ return nil
+ }
+ // check if encryptionKey has the correct size
+ if len(key) != cipherFunction.KeySize() {
+ return errors.InvalidArgumentError("supplied encryption key has the wrong size")
+ }
+
+ if params.Mode() == s2k.Argon2S2K && s2kType != S2KAEAD {
+ return errors.InvalidArgumentError("using Argon2 S2K without AEAD is not allowed")
+ }
+ if params.Mode() != s2k.Argon2S2K && params.Mode() != s2k.IteratedSaltedS2K &&
+ params.Mode() != s2k.SaltedS2K { // only allowed for high-entropy passphrases
+ return errors.InvalidArgumentError("insecure S2K mode")
+ }
+
+ priv := bytes.NewBuffer(nil)
+ err := pk.serializePrivateKey(priv)
+ if err != nil {
+ return err
+ }
+
+ pk.cipher = cipherFunction
+ pk.s2kParams = params
+ pk.s2k, err = pk.s2kParams.Function()
+ if err != nil {
+ return err
+ }
+
+ privateKeyBytes := priv.Bytes()
+ pk.s2kType = s2kType
+ block := pk.cipher.new(key)
+ switch s2kType {
+ case S2KAEAD:
+ if pk.aead == 0 {
+ return errors.StructuralError("aead mode is not set on key")
+ }
+ aead := pk.aead.new(block)
+ additionalData, err := pk.additionalData()
+ if err != nil {
+ return err
+ }
+ pk.iv = make([]byte, aead.NonceSize())
+ _, err = io.ReadFull(rand, pk.iv)
+ if err != nil {
+ return err
+ }
+ // Decrypt the encrypted key material with aead
+ pk.encryptedData = aead.Seal(nil, pk.iv, privateKeyBytes, additionalData)
+ case S2KSHA1, S2KCHECKSUM:
+ pk.iv = make([]byte, pk.cipher.blockSize())
+ _, err = io.ReadFull(rand, pk.iv)
+ if err != nil {
+ return err
+ }
+ cfb := cipher.NewCFBEncrypter(block, pk.iv)
+ if s2kType == S2KSHA1 {
+ h := sha1.New()
+ h.Write(privateKeyBytes)
+ sum := h.Sum(nil)
+ privateKeyBytes = append(privateKeyBytes, sum...)
+ } else {
+ var sum uint16
+ for _, b := range privateKeyBytes {
+ sum += uint16(b)
+ }
+ privateKeyBytes = append(privateKeyBytes, []byte{uint8(sum >> 8), uint8(sum)}...)
+ }
+ pk.encryptedData = make([]byte, len(privateKeyBytes))
+ cfb.XORKeyStream(pk.encryptedData, privateKeyBytes)
+ default:
+ return errors.InvalidArgumentError("invalid s2k type for encryption")
+ }
+
+ pk.Encrypted = true
+ pk.PrivateKey = nil
+ return err
+}
+
+// EncryptWithConfig encrypts an unencrypted private key using the passphrase and the config.
+func (pk *PrivateKey) EncryptWithConfig(passphrase []byte, config *Config) error {
+ params, err := s2k.Generate(config.Random(), config.S2K())
+ if err != nil {
+ return err
+ }
+ // Derive an encryption key with the configured s2k function.
+ key := make([]byte, config.Cipher().KeySize())
+ s2k, err := params.Function()
+ if err != nil {
+ return err
+ }
+ s2k(key, passphrase)
+ s2kType := S2KSHA1
+ if config.AEAD() != nil {
+ s2kType = S2KAEAD
+ pk.aead = config.AEAD().Mode()
+ pk.cipher = config.Cipher()
+ key = pk.applyHKDF(key)
+ }
+ // Encrypt the private key with the derived encryption key.
+ return pk.encrypt(key, params, s2kType, config.Cipher(), config.Random())
+}
+
+// EncryptPrivateKeys encrypts all unencrypted keys with the given config and passphrase.
+// Only derives one key from the passphrase, which is then used to encrypt each key.
+func EncryptPrivateKeys(keys []*PrivateKey, passphrase []byte, config *Config) error {
+ params, err := s2k.Generate(config.Random(), config.S2K())
+ if err != nil {
+ return err
+ }
+ // Derive an encryption key with the configured s2k function.
+ encryptionKey := make([]byte, config.Cipher().KeySize())
+ s2k, err := params.Function()
+ if err != nil {
+ return err
+ }
+ s2k(encryptionKey, passphrase)
+ for _, key := range keys {
+ if key != nil && !key.Dummy() && !key.Encrypted {
+ s2kType := S2KSHA1
+ if config.AEAD() != nil {
+ s2kType = S2KAEAD
+ key.aead = config.AEAD().Mode()
+ key.cipher = config.Cipher()
+ derivedKey := key.applyHKDF(encryptionKey)
+ err = key.encrypt(derivedKey, params, s2kType, config.Cipher(), config.Random())
+ } else {
+ err = key.encrypt(encryptionKey, params, s2kType, config.Cipher(), config.Random())
+ }
+ if err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+}
+
+// Encrypt encrypts an unencrypted private key using a passphrase.
+func (pk *PrivateKey) Encrypt(passphrase []byte) error {
+ // Default config of private key encryption
+ config := &Config{
+ S2KConfig: &s2k.Config{
+ S2KMode: s2k.IteratedSaltedS2K,
+ S2KCount: 65536,
+ Hash: crypto.SHA256,
+ },
+ DefaultCipher: CipherAES256,
+ }
+ return pk.EncryptWithConfig(passphrase, config)
+}
+
+func (pk *PrivateKey) serializePrivateKey(w io.Writer) (err error) {
+ switch priv := pk.PrivateKey.(type) {
+ case *rsa.PrivateKey:
+ err = serializeRSAPrivateKey(w, priv)
+ case *dsa.PrivateKey:
+ err = serializeDSAPrivateKey(w, priv)
+ case *elgamal.PrivateKey:
+ err = serializeElGamalPrivateKey(w, priv)
+ case *ecdsa.PrivateKey:
+ err = serializeECDSAPrivateKey(w, priv)
+ case *eddsa.PrivateKey:
+ err = serializeEdDSAPrivateKey(w, priv)
+ case *ecdh.PrivateKey:
+ err = serializeECDHPrivateKey(w, priv)
+ case *x25519.PrivateKey:
+ err = serializeX25519PrivateKey(w, priv)
+ case *x448.PrivateKey:
+ err = serializeX448PrivateKey(w, priv)
+ case *ed25519.PrivateKey:
+ err = serializeEd25519PrivateKey(w, priv)
+ case *ed448.PrivateKey:
+ err = serializeEd448PrivateKey(w, priv)
+ default:
+ err = errors.InvalidArgumentError("unknown private key type")
+ }
+ return
+}
+
+func (pk *PrivateKey) parsePrivateKey(data []byte) (err error) {
+ switch pk.PublicKey.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoRSAEncryptOnly:
+ return pk.parseRSAPrivateKey(data)
+ case PubKeyAlgoDSA:
+ return pk.parseDSAPrivateKey(data)
+ case PubKeyAlgoElGamal:
+ return pk.parseElGamalPrivateKey(data)
+ case PubKeyAlgoECDSA:
+ return pk.parseECDSAPrivateKey(data)
+ case PubKeyAlgoECDH:
+ return pk.parseECDHPrivateKey(data)
+ case PubKeyAlgoEdDSA:
+ return pk.parseEdDSAPrivateKey(data)
+ case PubKeyAlgoX25519:
+ return pk.parseX25519PrivateKey(data)
+ case PubKeyAlgoX448:
+ return pk.parseX448PrivateKey(data)
+ case PubKeyAlgoEd25519:
+ return pk.parseEd25519PrivateKey(data)
+ case PubKeyAlgoEd448:
+ return pk.parseEd448PrivateKey(data)
+ default:
+ err = errors.StructuralError("unknown private key type")
+ return
+ }
+}
+
+func (pk *PrivateKey) parseRSAPrivateKey(data []byte) (err error) {
+ rsaPub := pk.PublicKey.PublicKey.(*rsa.PublicKey)
+ rsaPriv := new(rsa.PrivateKey)
+ rsaPriv.PublicKey = *rsaPub
+
+ buf := bytes.NewBuffer(data)
+ d := new(encoding.MPI)
+ if _, err := d.ReadFrom(buf); err != nil {
+ return err
+ }
+
+ p := new(encoding.MPI)
+ if _, err := p.ReadFrom(buf); err != nil {
+ return err
+ }
+
+ q := new(encoding.MPI)
+ if _, err := q.ReadFrom(buf); err != nil {
+ return err
+ }
+
+ rsaPriv.D = new(big.Int).SetBytes(d.Bytes())
+ rsaPriv.Primes = make([]*big.Int, 2)
+ rsaPriv.Primes[0] = new(big.Int).SetBytes(p.Bytes())
+ rsaPriv.Primes[1] = new(big.Int).SetBytes(q.Bytes())
+ if err := rsaPriv.Validate(); err != nil {
+ return errors.KeyInvalidError(err.Error())
+ }
+ rsaPriv.Precompute()
+ pk.PrivateKey = rsaPriv
+
+ return nil
+}
+
+func (pk *PrivateKey) parseDSAPrivateKey(data []byte) (err error) {
+ dsaPub := pk.PublicKey.PublicKey.(*dsa.PublicKey)
+ dsaPriv := new(dsa.PrivateKey)
+ dsaPriv.PublicKey = *dsaPub
+
+ buf := bytes.NewBuffer(data)
+ x := new(encoding.MPI)
+ if _, err := x.ReadFrom(buf); err != nil {
+ return err
+ }
+
+ dsaPriv.X = new(big.Int).SetBytes(x.Bytes())
+ if err := validateDSAParameters(dsaPriv); err != nil {
+ return err
+ }
+ pk.PrivateKey = dsaPriv
+
+ return nil
+}
+
+func (pk *PrivateKey) parseElGamalPrivateKey(data []byte) (err error) {
+ pub := pk.PublicKey.PublicKey.(*elgamal.PublicKey)
+ priv := new(elgamal.PrivateKey)
+ priv.PublicKey = *pub
+
+ buf := bytes.NewBuffer(data)
+ x := new(encoding.MPI)
+ if _, err := x.ReadFrom(buf); err != nil {
+ return err
+ }
+
+ priv.X = new(big.Int).SetBytes(x.Bytes())
+ if err := validateElGamalParameters(priv); err != nil {
+ return err
+ }
+ pk.PrivateKey = priv
+
+ return nil
+}
+
+func (pk *PrivateKey) parseECDSAPrivateKey(data []byte) (err error) {
+ ecdsaPub := pk.PublicKey.PublicKey.(*ecdsa.PublicKey)
+ ecdsaPriv := ecdsa.NewPrivateKey(*ecdsaPub)
+
+ buf := bytes.NewBuffer(data)
+ d := new(encoding.MPI)
+ if _, err := d.ReadFrom(buf); err != nil {
+ return err
+ }
+
+ if err := ecdsaPriv.UnmarshalIntegerSecret(d.Bytes()); err != nil {
+ return err
+ }
+ if err := ecdsa.Validate(ecdsaPriv); err != nil {
+ return err
+ }
+ pk.PrivateKey = ecdsaPriv
+
+ return nil
+}
+
+func (pk *PrivateKey) parseECDHPrivateKey(data []byte) (err error) {
+ ecdhPub := pk.PublicKey.PublicKey.(*ecdh.PublicKey)
+ ecdhPriv := ecdh.NewPrivateKey(*ecdhPub)
+
+ buf := bytes.NewBuffer(data)
+ d := new(encoding.MPI)
+ if _, err := d.ReadFrom(buf); err != nil {
+ return err
+ }
+
+ if err := ecdhPriv.UnmarshalByteSecret(d.Bytes()); err != nil {
+ return err
+ }
+
+ if err := ecdh.Validate(ecdhPriv); err != nil {
+ return err
+ }
+
+ pk.PrivateKey = ecdhPriv
+
+ return nil
+}
+
+func (pk *PrivateKey) parseX25519PrivateKey(data []byte) (err error) {
+ publicKey := pk.PublicKey.PublicKey.(*x25519.PublicKey)
+ privateKey := x25519.NewPrivateKey(*publicKey)
+ privateKey.PublicKey = *publicKey
+
+ privateKey.Secret = make([]byte, x25519.KeySize)
+
+ if len(data) != x25519.KeySize {
+ err = errors.StructuralError("wrong x25519 key size")
+ return err
+ }
+ subtle.ConstantTimeCopy(1, privateKey.Secret, data)
+ if err = x25519.Validate(privateKey); err != nil {
+ return err
+ }
+ pk.PrivateKey = privateKey
+ return nil
+}
+
+func (pk *PrivateKey) parseX448PrivateKey(data []byte) (err error) {
+ publicKey := pk.PublicKey.PublicKey.(*x448.PublicKey)
+ privateKey := x448.NewPrivateKey(*publicKey)
+ privateKey.PublicKey = *publicKey
+
+ privateKey.Secret = make([]byte, x448.KeySize)
+
+ if len(data) != x448.KeySize {
+ err = errors.StructuralError("wrong x448 key size")
+ return err
+ }
+ subtle.ConstantTimeCopy(1, privateKey.Secret, data)
+ if err = x448.Validate(privateKey); err != nil {
+ return err
+ }
+ pk.PrivateKey = privateKey
+ return nil
+}
+
+func (pk *PrivateKey) parseEd25519PrivateKey(data []byte) (err error) {
+ publicKey := pk.PublicKey.PublicKey.(*ed25519.PublicKey)
+ privateKey := ed25519.NewPrivateKey(*publicKey)
+ privateKey.PublicKey = *publicKey
+
+ if len(data) != ed25519.SeedSize {
+ err = errors.StructuralError("wrong ed25519 key size")
+ return err
+ }
+ err = privateKey.UnmarshalByteSecret(data)
+ if err != nil {
+ return err
+ }
+ err = ed25519.Validate(privateKey)
+ if err != nil {
+ return err
+ }
+ pk.PrivateKey = privateKey
+ return nil
+}
+
+func (pk *PrivateKey) parseEd448PrivateKey(data []byte) (err error) {
+ publicKey := pk.PublicKey.PublicKey.(*ed448.PublicKey)
+ privateKey := ed448.NewPrivateKey(*publicKey)
+ privateKey.PublicKey = *publicKey
+
+ if len(data) != ed448.SeedSize {
+ err = errors.StructuralError("wrong ed448 key size")
+ return err
+ }
+ err = privateKey.UnmarshalByteSecret(data)
+ if err != nil {
+ return err
+ }
+ err = ed448.Validate(privateKey)
+ if err != nil {
+ return err
+ }
+ pk.PrivateKey = privateKey
+ return nil
+}
+
+func (pk *PrivateKey) parseEdDSAPrivateKey(data []byte) (err error) {
+ eddsaPub := pk.PublicKey.PublicKey.(*eddsa.PublicKey)
+ eddsaPriv := eddsa.NewPrivateKey(*eddsaPub)
+ eddsaPriv.PublicKey = *eddsaPub
+
+ buf := bytes.NewBuffer(data)
+ d := new(encoding.MPI)
+ if _, err := d.ReadFrom(buf); err != nil {
+ return err
+ }
+
+ if err = eddsaPriv.UnmarshalByteSecret(d.Bytes()); err != nil {
+ return err
+ }
+
+ if err := eddsa.Validate(eddsaPriv); err != nil {
+ return err
+ }
+
+ pk.PrivateKey = eddsaPriv
+
+ return nil
+}
+
+func (pk *PrivateKey) additionalData() ([]byte, error) {
+ additionalData := bytes.NewBuffer(nil)
+ // Write additional data prefix based on packet type
+ var packetByte byte
+ if pk.PublicKey.IsSubkey {
+ packetByte = 0xc7
+ } else {
+ packetByte = 0xc5
+ }
+ // Write public key to additional data
+ _, err := additionalData.Write([]byte{packetByte})
+ if err != nil {
+ return nil, err
+ }
+ err = pk.PublicKey.serializeWithoutHeaders(additionalData)
+ if err != nil {
+ return nil, err
+ }
+ return additionalData.Bytes(), nil
+}
+
+func (pk *PrivateKey) applyHKDF(inputKey []byte) []byte {
+ var packetByte byte
+ if pk.PublicKey.IsSubkey {
+ packetByte = 0xc7
+ } else {
+ packetByte = 0xc5
+ }
+ associatedData := []byte{packetByte, byte(pk.Version), byte(pk.cipher), byte(pk.aead)}
+ hkdfReader := hkdf.New(sha256.New, inputKey, []byte{}, associatedData)
+ encryptionKey := make([]byte, pk.cipher.KeySize())
+ _, _ = readFull(hkdfReader, encryptionKey)
+ return encryptionKey
+}
+
+func validateDSAParameters(priv *dsa.PrivateKey) error {
+ p := priv.P // group prime
+ q := priv.Q // subgroup order
+ g := priv.G // g has order q mod p
+ x := priv.X // secret
+ y := priv.Y // y == g**x mod p
+ one := big.NewInt(1)
+ // expect g, y >= 2 and g < p
+ if g.Cmp(one) <= 0 || y.Cmp(one) <= 0 || g.Cmp(p) > 0 {
+ return errors.KeyInvalidError("dsa: invalid group")
+ }
+ // expect p > q
+ if p.Cmp(q) <= 0 {
+ return errors.KeyInvalidError("dsa: invalid group prime")
+ }
+ // q should be large enough and divide p-1
+ pSub1 := new(big.Int).Sub(p, one)
+ if q.BitLen() < 150 || new(big.Int).Mod(pSub1, q).Cmp(big.NewInt(0)) != 0 {
+ return errors.KeyInvalidError("dsa: invalid order")
+ }
+ // confirm that g has order q mod p
+ if !q.ProbablyPrime(32) || new(big.Int).Exp(g, q, p).Cmp(one) != 0 {
+ return errors.KeyInvalidError("dsa: invalid order")
+ }
+ // check y
+ if new(big.Int).Exp(g, x, p).Cmp(y) != 0 {
+ return errors.KeyInvalidError("dsa: mismatching values")
+ }
+
+ return nil
+}
+
+func validateElGamalParameters(priv *elgamal.PrivateKey) error {
+ p := priv.P // group prime
+ g := priv.G // g has order p-1 mod p
+ x := priv.X // secret
+ y := priv.Y // y == g**x mod p
+ one := big.NewInt(1)
+ // Expect g, y >= 2 and g < p
+ if g.Cmp(one) <= 0 || y.Cmp(one) <= 0 || g.Cmp(p) > 0 {
+ return errors.KeyInvalidError("elgamal: invalid group")
+ }
+ if p.BitLen() < 1024 {
+ return errors.KeyInvalidError("elgamal: group order too small")
+ }
+ pSub1 := new(big.Int).Sub(p, one)
+ if new(big.Int).Exp(g, pSub1, p).Cmp(one) != 0 {
+ return errors.KeyInvalidError("elgamal: invalid group")
+ }
+ // Since p-1 is not prime, g might have a smaller order that divides p-1.
+ // We cannot confirm the exact order of g, but we make sure it is not too small.
+ gExpI := new(big.Int).Set(g)
+ i := 1
+ threshold := 2 << 17 // we want order > threshold
+ for i < threshold {
+ i++ // we check every order to make sure key validation is not easily bypassed by guessing y'
+ gExpI.Mod(new(big.Int).Mul(gExpI, g), p)
+ if gExpI.Cmp(one) == 0 {
+ return errors.KeyInvalidError("elgamal: order too small")
+ }
+ }
+ // Check y
+ if new(big.Int).Exp(g, x, p).Cmp(y) != 0 {
+ return errors.KeyInvalidError("elgamal: mismatching values")
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key_test_data.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key_test_data.go
new file mode 100644
index 0000000000..029b8f1aab
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key_test_data.go
@@ -0,0 +1,12 @@
+package packet
+
+// Generated with `gpg --export-secret-keys "Test Key 2"`
+const privKeyRSAHex = "9501fe044cc349a8010400b70ca0010e98c090008d45d1ee8f9113bd5861fd57b88bacb7c68658747663f1e1a3b5a98f32fda6472373c024b97359cd2efc88ff60f77751adfbf6af5e615e6a1408cfad8bf0cea30b0d5f53aa27ad59089ba9b15b7ebc2777a25d7b436144027e3bcd203909f147d0e332b240cf63d3395f5dfe0df0a6c04e8655af7eacdf0011010001fe0303024a252e7d475fd445607de39a265472aa74a9320ba2dac395faa687e9e0336aeb7e9a7397e511b5afd9dc84557c80ac0f3d4d7bfec5ae16f20d41c8c84a04552a33870b930420e230e179564f6d19bb153145e76c33ae993886c388832b0fa042ddda7f133924f3854481533e0ede31d51278c0519b29abc3bf53da673e13e3e1214b52413d179d7f66deee35cac8eacb060f78379d70ef4af8607e68131ff529439668fc39c9ce6dfef8a5ac234d234802cbfb749a26107db26406213ae5c06d4673253a3cbee1fcbae58d6ab77e38d6e2c0e7c6317c48e054edadb5a40d0d48acb44643d998139a8a66bb820be1f3f80185bc777d14b5954b60effe2448a036d565c6bc0b915fcea518acdd20ab07bc1529f561c58cd044f723109b93f6fd99f876ff891d64306b5d08f48bab59f38695e9109c4dec34013ba3153488ce070268381ba923ee1eb77125b36afcb4347ec3478c8f2735b06ef17351d872e577fa95d0c397c88c71b59629a36aec"
+
+// Generated by `gpg --export-secret-keys` followed by a manual extraction of
+// the ElGamal subkey from the packets.
+const privKeyElGamalHex = "9d0157044df9ee1a100400eb8e136a58ec39b582629cdadf830bc64e0a94ed8103ca8bb247b27b11b46d1d25297ef4bcc3071785ba0c0bedfe89eabc5287fcc0edf81ab5896c1c8e4b20d27d79813c7aede75320b33eaeeaa586edc00fd1036c10133e6ba0ff277245d0d59d04b2b3421b7244aca5f4a8d870c6f1c1fbff9e1c26699a860b9504f35ca1d700030503fd1ededd3b840795be6d9ccbe3c51ee42e2f39233c432b831ddd9c4e72b7025a819317e47bf94f9ee316d7273b05d5fcf2999c3a681f519b1234bbfa6d359b4752bd9c3f77d6b6456cde152464763414ca130f4e91d91041432f90620fec0e6d6b5116076c2985d5aeaae13be492b9b329efcaf7ee25120159a0a30cd976b42d7afe030302dae7eb80db744d4960c4df930d57e87fe81412eaace9f900e6c839817a614ddb75ba6603b9417c33ea7b6c93967dfa2bcff3fa3c74a5ce2c962db65b03aece14c96cbd0038fc"
+
+// pkcs1PrivKeyHex is a PKCS#1, RSA private key.
+// Generated by `openssl genrsa 1024 | openssl rsa -outform DER | xxd -p`
+const pkcs1PrivKeyHex = "3082025d02010002818100e98edfa1c3b35884a54d0b36a6a603b0290fa85e49e30fa23fc94fef9c6790bc4849928607aa48d809da326fb42a969d06ad756b98b9c1a90f5d4a2b6d0ac05953c97f4da3120164a21a679793ce181c906dc01d235cc085ddcdf6ea06c389b6ab8885dfd685959e693138856a68a7e5db263337ff82a088d583a897cf2d59e9020301000102818100b6d5c9eb70b02d5369b3ee5b520a14490b5bde8a317d36f7e4c74b7460141311d1e5067735f8f01d6f5908b2b96fbd881f7a1ab9a84d82753e39e19e2d36856be960d05ac9ef8e8782ea1b6d65aee28fdfe1d61451e8cff0adfe84322f12cf455028b581cf60eb9e0e140ba5d21aeba6c2634d7c65318b9a665fc01c3191ca21024100fa5e818da3705b0fa33278bb28d4b6f6050388af2d4b75ec9375dd91ccf2e7d7068086a8b82a8f6282e4fbbdb8a7f2622eb97295249d87acea7f5f816f54d347024100eecf9406d7dc49cdfb95ab1eff4064de84c7a30f64b2798936a0d2018ba9eb52e4b636f82e96c49cc63b80b675e91e40d1b2e4017d4b9adaf33ab3d9cf1c214f024100c173704ace742c082323066226a4655226819a85304c542b9dacbeacbf5d1881ee863485fcf6f59f3a604f9b42289282067447f2b13dfeed3eab7851fc81e0550240741fc41f3fc002b382eed8730e33c5d8de40256e4accee846667f536832f711ab1d4590e7db91a8a116ac5bff3be13d3f9243ff2e976662aa9b395d907f8e9c9024046a5696c9ef882363e06c9fa4e2f5b580906452befba03f4a99d0f873697ef1f851d2226ca7934b30b7c3e80cb634a67172bbbf4781735fe3e09263e2dd723e7"
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key.go
new file mode 100644
index 0000000000..e2813396e3
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key.go
@@ -0,0 +1,1125 @@
+// 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 packet
+
+import (
+ "crypto/dsa"
+ "crypto/rsa"
+ "crypto/sha1"
+ "crypto/sha256"
+ _ "crypto/sha512"
+ "encoding/binary"
+ "fmt"
+ "hash"
+ "io"
+ "math/big"
+ "strconv"
+ "time"
+
+ "github.com/ProtonMail/go-crypto/openpgp/ecdh"
+ "github.com/ProtonMail/go-crypto/openpgp/ecdsa"
+ "github.com/ProtonMail/go-crypto/openpgp/ed25519"
+ "github.com/ProtonMail/go-crypto/openpgp/ed448"
+ "github.com/ProtonMail/go-crypto/openpgp/eddsa"
+ "github.com/ProtonMail/go-crypto/openpgp/elgamal"
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/ecc"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/encoding"
+ "github.com/ProtonMail/go-crypto/openpgp/x25519"
+ "github.com/ProtonMail/go-crypto/openpgp/x448"
+)
+
+// PublicKey represents an OpenPGP public key. See RFC 4880, section 5.5.2.
+type PublicKey struct {
+ Version int
+ CreationTime time.Time
+ PubKeyAlgo PublicKeyAlgorithm
+ PublicKey interface{} // *rsa.PublicKey, *dsa.PublicKey, *ecdsa.PublicKey or *eddsa.PublicKey, *x25519.PublicKey, *x448.PublicKey, *ed25519.PublicKey, *ed448.PublicKey
+ Fingerprint []byte
+ KeyId uint64
+ IsSubkey bool
+
+ // RFC 4880 fields
+ n, e, p, q, g, y encoding.Field
+
+ // RFC 6637 fields
+ // oid contains the OID byte sequence identifying the elliptic curve used
+ oid encoding.Field
+
+ // kdf stores key derivation function parameters
+ // used for ECDH encryption. See RFC 6637, Section 9.
+ kdf encoding.Field
+}
+
+// UpgradeToV5 updates the version of the key to v5, and updates all necessary
+// fields.
+func (pk *PublicKey) UpgradeToV5() {
+ pk.Version = 5
+ pk.setFingerprintAndKeyId()
+}
+
+// UpgradeToV6 updates the version of the key to v6, and updates all necessary
+// fields.
+func (pk *PublicKey) UpgradeToV6() error {
+ pk.Version = 6
+ pk.setFingerprintAndKeyId()
+ return pk.checkV6Compatibility()
+}
+
+// signingKey provides a convenient abstraction over signature verification
+// for v3 and v4 public keys.
+type signingKey interface {
+ SerializeForHash(io.Writer) error
+ SerializeSignaturePrefix(io.Writer) error
+ serializeWithoutHeaders(io.Writer) error
+}
+
+// NewRSAPublicKey returns a PublicKey that wraps the given rsa.PublicKey.
+func NewRSAPublicKey(creationTime time.Time, pub *rsa.PublicKey) *PublicKey {
+ pk := &PublicKey{
+ Version: 4,
+ CreationTime: creationTime,
+ PubKeyAlgo: PubKeyAlgoRSA,
+ PublicKey: pub,
+ n: new(encoding.MPI).SetBig(pub.N),
+ e: new(encoding.MPI).SetBig(big.NewInt(int64(pub.E))),
+ }
+
+ pk.setFingerprintAndKeyId()
+ return pk
+}
+
+// NewDSAPublicKey returns a PublicKey that wraps the given dsa.PublicKey.
+func NewDSAPublicKey(creationTime time.Time, pub *dsa.PublicKey) *PublicKey {
+ pk := &PublicKey{
+ Version: 4,
+ CreationTime: creationTime,
+ PubKeyAlgo: PubKeyAlgoDSA,
+ PublicKey: pub,
+ p: new(encoding.MPI).SetBig(pub.P),
+ q: new(encoding.MPI).SetBig(pub.Q),
+ g: new(encoding.MPI).SetBig(pub.G),
+ y: new(encoding.MPI).SetBig(pub.Y),
+ }
+
+ pk.setFingerprintAndKeyId()
+ return pk
+}
+
+// NewElGamalPublicKey returns a PublicKey that wraps the given elgamal.PublicKey.
+func NewElGamalPublicKey(creationTime time.Time, pub *elgamal.PublicKey) *PublicKey {
+ pk := &PublicKey{
+ Version: 4,
+ CreationTime: creationTime,
+ PubKeyAlgo: PubKeyAlgoElGamal,
+ PublicKey: pub,
+ p: new(encoding.MPI).SetBig(pub.P),
+ g: new(encoding.MPI).SetBig(pub.G),
+ y: new(encoding.MPI).SetBig(pub.Y),
+ }
+
+ pk.setFingerprintAndKeyId()
+ return pk
+}
+
+func NewECDSAPublicKey(creationTime time.Time, pub *ecdsa.PublicKey) *PublicKey {
+ pk := &PublicKey{
+ Version: 4,
+ CreationTime: creationTime,
+ PubKeyAlgo: PubKeyAlgoECDSA,
+ PublicKey: pub,
+ p: encoding.NewMPI(pub.MarshalPoint()),
+ }
+
+ curveInfo := ecc.FindByCurve(pub.GetCurve())
+ if curveInfo == nil {
+ panic("unknown elliptic curve")
+ }
+ pk.oid = curveInfo.Oid
+ pk.setFingerprintAndKeyId()
+ return pk
+}
+
+func NewECDHPublicKey(creationTime time.Time, pub *ecdh.PublicKey) *PublicKey {
+ var pk *PublicKey
+ var kdf = encoding.NewOID([]byte{0x1, pub.Hash.Id(), pub.Cipher.Id()})
+ pk = &PublicKey{
+ Version: 4,
+ CreationTime: creationTime,
+ PubKeyAlgo: PubKeyAlgoECDH,
+ PublicKey: pub,
+ p: encoding.NewMPI(pub.MarshalPoint()),
+ kdf: kdf,
+ }
+
+ curveInfo := ecc.FindByCurve(pub.GetCurve())
+
+ if curveInfo == nil {
+ panic("unknown elliptic curve")
+ }
+
+ pk.oid = curveInfo.Oid
+ pk.setFingerprintAndKeyId()
+ return pk
+}
+
+func NewEdDSAPublicKey(creationTime time.Time, pub *eddsa.PublicKey) *PublicKey {
+ curveInfo := ecc.FindByCurve(pub.GetCurve())
+ pk := &PublicKey{
+ Version: 4,
+ CreationTime: creationTime,
+ PubKeyAlgo: PubKeyAlgoEdDSA,
+ PublicKey: pub,
+ oid: curveInfo.Oid,
+ // Native point format, see draft-koch-eddsa-for-openpgp-04, Appendix B
+ p: encoding.NewMPI(pub.MarshalPoint()),
+ }
+
+ pk.setFingerprintAndKeyId()
+ return pk
+}
+
+func NewX25519PublicKey(creationTime time.Time, pub *x25519.PublicKey) *PublicKey {
+ pk := &PublicKey{
+ Version: 4,
+ CreationTime: creationTime,
+ PubKeyAlgo: PubKeyAlgoX25519,
+ PublicKey: pub,
+ }
+
+ pk.setFingerprintAndKeyId()
+ return pk
+}
+
+func NewX448PublicKey(creationTime time.Time, pub *x448.PublicKey) *PublicKey {
+ pk := &PublicKey{
+ Version: 4,
+ CreationTime: creationTime,
+ PubKeyAlgo: PubKeyAlgoX448,
+ PublicKey: pub,
+ }
+
+ pk.setFingerprintAndKeyId()
+ return pk
+}
+
+func NewEd25519PublicKey(creationTime time.Time, pub *ed25519.PublicKey) *PublicKey {
+ pk := &PublicKey{
+ Version: 4,
+ CreationTime: creationTime,
+ PubKeyAlgo: PubKeyAlgoEd25519,
+ PublicKey: pub,
+ }
+
+ pk.setFingerprintAndKeyId()
+ return pk
+}
+
+func NewEd448PublicKey(creationTime time.Time, pub *ed448.PublicKey) *PublicKey {
+ pk := &PublicKey{
+ Version: 4,
+ CreationTime: creationTime,
+ PubKeyAlgo: PubKeyAlgoEd448,
+ PublicKey: pub,
+ }
+
+ pk.setFingerprintAndKeyId()
+ return pk
+}
+
+func (pk *PublicKey) parse(r io.Reader) (err error) {
+ // RFC 4880, section 5.5.2
+ var buf [6]byte
+ _, err = readFull(r, buf[:])
+ if err != nil {
+ return
+ }
+
+ pk.Version = int(buf[0])
+ if pk.Version != 4 && pk.Version != 5 && pk.Version != 6 {
+ return errors.UnsupportedError("public key version " + strconv.Itoa(int(buf[0])))
+ }
+
+ if V5Disabled && pk.Version == 5 {
+ return errors.UnsupportedError("support for parsing v5 entities is disabled; build with `-tags v5` if needed")
+ }
+
+ if pk.Version >= 5 {
+ // Read the four-octet scalar octet count
+ // The count is not used in this implementation
+ var n [4]byte
+ _, err = readFull(r, n[:])
+ if err != nil {
+ return
+ }
+ }
+ pk.CreationTime = time.Unix(int64(uint32(buf[1])<<24|uint32(buf[2])<<16|uint32(buf[3])<<8|uint32(buf[4])), 0)
+ pk.PubKeyAlgo = PublicKeyAlgorithm(buf[5])
+ // Ignore four-ocet length
+ switch pk.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:
+ err = pk.parseRSA(r)
+ case PubKeyAlgoDSA:
+ err = pk.parseDSA(r)
+ case PubKeyAlgoElGamal:
+ err = pk.parseElGamal(r)
+ case PubKeyAlgoECDSA:
+ err = pk.parseECDSA(r)
+ case PubKeyAlgoECDH:
+ err = pk.parseECDH(r)
+ case PubKeyAlgoEdDSA:
+ err = pk.parseEdDSA(r)
+ case PubKeyAlgoX25519:
+ err = pk.parseX25519(r)
+ case PubKeyAlgoX448:
+ err = pk.parseX448(r)
+ case PubKeyAlgoEd25519:
+ err = pk.parseEd25519(r)
+ case PubKeyAlgoEd448:
+ err = pk.parseEd448(r)
+ default:
+ err = errors.UnsupportedError("public key type: " + strconv.Itoa(int(pk.PubKeyAlgo)))
+ }
+ if err != nil {
+ return
+ }
+
+ pk.setFingerprintAndKeyId()
+ return
+}
+
+func (pk *PublicKey) setFingerprintAndKeyId() {
+ // RFC 4880, section 12.2
+ if pk.Version >= 5 {
+ fingerprint := sha256.New()
+ if err := pk.SerializeForHash(fingerprint); err != nil {
+ // Should not happen for a hash.
+ panic(err)
+ }
+ pk.Fingerprint = make([]byte, 32)
+ copy(pk.Fingerprint, fingerprint.Sum(nil))
+ pk.KeyId = binary.BigEndian.Uint64(pk.Fingerprint[:8])
+ } else {
+ fingerprint := sha1.New()
+ if err := pk.SerializeForHash(fingerprint); err != nil {
+ // Should not happen for a hash.
+ panic(err)
+ }
+ pk.Fingerprint = make([]byte, 20)
+ copy(pk.Fingerprint, fingerprint.Sum(nil))
+ pk.KeyId = binary.BigEndian.Uint64(pk.Fingerprint[12:20])
+ }
+}
+
+func (pk *PublicKey) checkV6Compatibility() error {
+ // Implementations MUST NOT accept or generate version 6 key material using the deprecated OIDs.
+ switch pk.PubKeyAlgo {
+ case PubKeyAlgoECDH:
+ curveInfo := ecc.FindByOid(pk.oid)
+ if curveInfo == nil {
+ return errors.UnsupportedError(fmt.Sprintf("unknown oid: %x", pk.oid))
+ }
+ if curveInfo.GenName == ecc.Curve25519GenName {
+ return errors.StructuralError("cannot generate v6 key with deprecated OID: Curve25519Legacy")
+ }
+ case PubKeyAlgoEdDSA:
+ return errors.StructuralError("cannot generate v6 key with deprecated algorithm: EdDSALegacy")
+ }
+ return nil
+}
+
+// parseRSA parses RSA public key material from the given Reader. See RFC 4880,
+// section 5.5.2.
+func (pk *PublicKey) parseRSA(r io.Reader) (err error) {
+ pk.n = new(encoding.MPI)
+ if _, err = pk.n.ReadFrom(r); err != nil {
+ return
+ }
+ pk.e = new(encoding.MPI)
+ if _, err = pk.e.ReadFrom(r); err != nil {
+ return
+ }
+
+ if len(pk.e.Bytes()) > 3 {
+ err = errors.UnsupportedError("large public exponent")
+ return
+ }
+ rsa := &rsa.PublicKey{
+ N: new(big.Int).SetBytes(pk.n.Bytes()),
+ E: 0,
+ }
+ for i := 0; i < len(pk.e.Bytes()); i++ {
+ rsa.E <<= 8
+ rsa.E |= int(pk.e.Bytes()[i])
+ }
+ pk.PublicKey = rsa
+ return
+}
+
+// parseDSA parses DSA public key material from the given Reader. See RFC 4880,
+// section 5.5.2.
+func (pk *PublicKey) parseDSA(r io.Reader) (err error) {
+ pk.p = new(encoding.MPI)
+ if _, err = pk.p.ReadFrom(r); err != nil {
+ return
+ }
+ pk.q = new(encoding.MPI)
+ if _, err = pk.q.ReadFrom(r); err != nil {
+ return
+ }
+ pk.g = new(encoding.MPI)
+ if _, err = pk.g.ReadFrom(r); err != nil {
+ return
+ }
+ pk.y = new(encoding.MPI)
+ if _, err = pk.y.ReadFrom(r); err != nil {
+ return
+ }
+
+ dsa := new(dsa.PublicKey)
+ dsa.P = new(big.Int).SetBytes(pk.p.Bytes())
+ dsa.Q = new(big.Int).SetBytes(pk.q.Bytes())
+ dsa.G = new(big.Int).SetBytes(pk.g.Bytes())
+ dsa.Y = new(big.Int).SetBytes(pk.y.Bytes())
+ pk.PublicKey = dsa
+ return
+}
+
+// parseElGamal parses ElGamal public key material from the given Reader. See
+// RFC 4880, section 5.5.2.
+func (pk *PublicKey) parseElGamal(r io.Reader) (err error) {
+ pk.p = new(encoding.MPI)
+ if _, err = pk.p.ReadFrom(r); err != nil {
+ return
+ }
+ pk.g = new(encoding.MPI)
+ if _, err = pk.g.ReadFrom(r); err != nil {
+ return
+ }
+ pk.y = new(encoding.MPI)
+ if _, err = pk.y.ReadFrom(r); err != nil {
+ return
+ }
+
+ elgamal := new(elgamal.PublicKey)
+ elgamal.P = new(big.Int).SetBytes(pk.p.Bytes())
+ elgamal.G = new(big.Int).SetBytes(pk.g.Bytes())
+ elgamal.Y = new(big.Int).SetBytes(pk.y.Bytes())
+ pk.PublicKey = elgamal
+ return
+}
+
+// parseECDSA parses ECDSA public key material from the given Reader. See
+// RFC 6637, Section 9.
+func (pk *PublicKey) parseECDSA(r io.Reader) (err error) {
+ pk.oid = new(encoding.OID)
+ if _, err = pk.oid.ReadFrom(r); err != nil {
+ return
+ }
+
+ curveInfo := ecc.FindByOid(pk.oid)
+ if curveInfo == nil {
+ return errors.UnsupportedError(fmt.Sprintf("unknown oid: %x", pk.oid))
+ }
+
+ pk.p = new(encoding.MPI)
+ if _, err = pk.p.ReadFrom(r); err != nil {
+ return
+ }
+
+ c, ok := curveInfo.Curve.(ecc.ECDSACurve)
+ if !ok {
+ return errors.UnsupportedError(fmt.Sprintf("unsupported oid: %x", pk.oid))
+ }
+
+ ecdsaKey := ecdsa.NewPublicKey(c)
+ err = ecdsaKey.UnmarshalPoint(pk.p.Bytes())
+ pk.PublicKey = ecdsaKey
+
+ return
+}
+
+// parseECDH parses ECDH public key material from the given Reader. See
+// RFC 6637, Section 9.
+func (pk *PublicKey) parseECDH(r io.Reader) (err error) {
+ pk.oid = new(encoding.OID)
+ if _, err = pk.oid.ReadFrom(r); err != nil {
+ return
+ }
+
+ curveInfo := ecc.FindByOid(pk.oid)
+ if curveInfo == nil {
+ return errors.UnsupportedError(fmt.Sprintf("unknown oid: %x", pk.oid))
+ }
+
+ if pk.Version == 6 && curveInfo.GenName == ecc.Curve25519GenName {
+ // Implementations MUST NOT accept or generate version 6 key material using the deprecated OIDs.
+ return errors.StructuralError("cannot read v6 key with deprecated OID: Curve25519Legacy")
+ }
+
+ pk.p = new(encoding.MPI)
+ if _, err = pk.p.ReadFrom(r); err != nil {
+ return
+ }
+ pk.kdf = new(encoding.OID)
+ if _, err = pk.kdf.ReadFrom(r); err != nil {
+ return
+ }
+
+ c, ok := curveInfo.Curve.(ecc.ECDHCurve)
+ if !ok {
+ return errors.UnsupportedError(fmt.Sprintf("unsupported oid: %x", pk.oid))
+ }
+
+ if kdfLen := len(pk.kdf.Bytes()); kdfLen < 3 {
+ return errors.UnsupportedError("unsupported ECDH KDF length: " + strconv.Itoa(kdfLen))
+ }
+ if reserved := pk.kdf.Bytes()[0]; reserved != 0x01 {
+ return errors.UnsupportedError("unsupported KDF reserved field: " + strconv.Itoa(int(reserved)))
+ }
+ kdfHash, ok := algorithm.HashById[pk.kdf.Bytes()[1]]
+ if !ok {
+ return errors.UnsupportedError("unsupported ECDH KDF hash: " + strconv.Itoa(int(pk.kdf.Bytes()[1])))
+ }
+ kdfCipher, ok := algorithm.CipherById[pk.kdf.Bytes()[2]]
+ if !ok {
+ return errors.UnsupportedError("unsupported ECDH KDF cipher: " + strconv.Itoa(int(pk.kdf.Bytes()[2])))
+ }
+
+ ecdhKey := ecdh.NewPublicKey(c, kdfHash, kdfCipher)
+ err = ecdhKey.UnmarshalPoint(pk.p.Bytes())
+ pk.PublicKey = ecdhKey
+
+ return
+}
+
+func (pk *PublicKey) parseEdDSA(r io.Reader) (err error) {
+ if pk.Version == 6 {
+ // Implementations MUST NOT accept or generate version 6 key material using the deprecated OIDs.
+ return errors.StructuralError("cannot generate v6 key with deprecated algorithm: EdDSALegacy")
+ }
+
+ pk.oid = new(encoding.OID)
+ if _, err = pk.oid.ReadFrom(r); err != nil {
+ return
+ }
+
+ curveInfo := ecc.FindByOid(pk.oid)
+ if curveInfo == nil {
+ return errors.UnsupportedError(fmt.Sprintf("unknown oid: %x", pk.oid))
+ }
+
+ c, ok := curveInfo.Curve.(ecc.EdDSACurve)
+ if !ok {
+ return errors.UnsupportedError(fmt.Sprintf("unsupported oid: %x", pk.oid))
+ }
+
+ pk.p = new(encoding.MPI)
+ if _, err = pk.p.ReadFrom(r); err != nil {
+ return
+ }
+
+ if len(pk.p.Bytes()) == 0 {
+ return errors.StructuralError("empty EdDSA public key")
+ }
+
+ pub := eddsa.NewPublicKey(c)
+
+ switch flag := pk.p.Bytes()[0]; flag {
+ case 0x04:
+ // TODO: see _grcy_ecc_eddsa_ensure_compact in grcypt
+ return errors.UnsupportedError("unsupported EdDSA compression: " + strconv.Itoa(int(flag)))
+ case 0x40:
+ err = pub.UnmarshalPoint(pk.p.Bytes())
+ default:
+ return errors.UnsupportedError("unsupported EdDSA compression: " + strconv.Itoa(int(flag)))
+ }
+
+ pk.PublicKey = pub
+ return
+}
+
+func (pk *PublicKey) parseX25519(r io.Reader) (err error) {
+ point := make([]byte, x25519.KeySize)
+ _, err = io.ReadFull(r, point)
+ if err != nil {
+ return
+ }
+ pub := &x25519.PublicKey{
+ Point: point,
+ }
+ pk.PublicKey = pub
+ return
+}
+
+func (pk *PublicKey) parseX448(r io.Reader) (err error) {
+ point := make([]byte, x448.KeySize)
+ _, err = io.ReadFull(r, point)
+ if err != nil {
+ return
+ }
+ pub := &x448.PublicKey{
+ Point: point,
+ }
+ pk.PublicKey = pub
+ return
+}
+
+func (pk *PublicKey) parseEd25519(r io.Reader) (err error) {
+ point := make([]byte, ed25519.PublicKeySize)
+ _, err = io.ReadFull(r, point)
+ if err != nil {
+ return
+ }
+ pub := &ed25519.PublicKey{
+ Point: point,
+ }
+ pk.PublicKey = pub
+ return
+}
+
+func (pk *PublicKey) parseEd448(r io.Reader) (err error) {
+ point := make([]byte, ed448.PublicKeySize)
+ _, err = io.ReadFull(r, point)
+ if err != nil {
+ return
+ }
+ pub := &ed448.PublicKey{
+ Point: point,
+ }
+ pk.PublicKey = pub
+ return
+}
+
+// SerializeForHash serializes the PublicKey to w with the special packet
+// header format needed for hashing.
+func (pk *PublicKey) SerializeForHash(w io.Writer) error {
+ if err := pk.SerializeSignaturePrefix(w); err != nil {
+ return err
+ }
+ return pk.serializeWithoutHeaders(w)
+}
+
+// SerializeSignaturePrefix writes the prefix for this public key to the given Writer.
+// The prefix is used when calculating a signature over this public key. See
+// RFC 4880, section 5.2.4.
+func (pk *PublicKey) SerializeSignaturePrefix(w io.Writer) error {
+ var pLength = pk.algorithmSpecificByteCount()
+ // version, timestamp, algorithm
+ pLength += versionSize + timestampSize + algorithmSize
+ if pk.Version >= 5 {
+ // key octet count (4).
+ pLength += 4
+ _, err := w.Write([]byte{
+ // When a v4 signature is made over a key, the hash data starts with the octet 0x99, followed by a two-octet length
+ // of the key, and then the body of the key packet. When a v6 signature is made over a key, the hash data starts
+ // with the salt, then octet 0x9B, followed by a four-octet length of the key, and then the body of the key packet.
+ 0x95 + byte(pk.Version),
+ byte(pLength >> 24),
+ byte(pLength >> 16),
+ byte(pLength >> 8),
+ byte(pLength),
+ })
+ return err
+ }
+ if _, err := w.Write([]byte{0x99, byte(pLength >> 8), byte(pLength)}); err != nil {
+ return err
+ }
+ return nil
+}
+
+func (pk *PublicKey) Serialize(w io.Writer) (err error) {
+ length := uint32(versionSize + timestampSize + algorithmSize) // 6 byte header
+ length += pk.algorithmSpecificByteCount()
+ if pk.Version >= 5 {
+ length += 4 // octet key count
+ }
+ packetType := packetTypePublicKey
+ if pk.IsSubkey {
+ packetType = packetTypePublicSubkey
+ }
+ err = serializeHeader(w, packetType, int(length))
+ if err != nil {
+ return
+ }
+ return pk.serializeWithoutHeaders(w)
+}
+
+func (pk *PublicKey) algorithmSpecificByteCount() uint32 {
+ length := uint32(0)
+ switch pk.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:
+ length += uint32(pk.n.EncodedLength())
+ length += uint32(pk.e.EncodedLength())
+ case PubKeyAlgoDSA:
+ length += uint32(pk.p.EncodedLength())
+ length += uint32(pk.q.EncodedLength())
+ length += uint32(pk.g.EncodedLength())
+ length += uint32(pk.y.EncodedLength())
+ case PubKeyAlgoElGamal:
+ length += uint32(pk.p.EncodedLength())
+ length += uint32(pk.g.EncodedLength())
+ length += uint32(pk.y.EncodedLength())
+ case PubKeyAlgoECDSA:
+ length += uint32(pk.oid.EncodedLength())
+ length += uint32(pk.p.EncodedLength())
+ case PubKeyAlgoECDH:
+ length += uint32(pk.oid.EncodedLength())
+ length += uint32(pk.p.EncodedLength())
+ length += uint32(pk.kdf.EncodedLength())
+ case PubKeyAlgoEdDSA:
+ length += uint32(pk.oid.EncodedLength())
+ length += uint32(pk.p.EncodedLength())
+ case PubKeyAlgoX25519:
+ length += x25519.KeySize
+ case PubKeyAlgoX448:
+ length += x448.KeySize
+ case PubKeyAlgoEd25519:
+ length += ed25519.PublicKeySize
+ case PubKeyAlgoEd448:
+ length += ed448.PublicKeySize
+ default:
+ panic("unknown public key algorithm")
+ }
+ return length
+}
+
+// serializeWithoutHeaders marshals the PublicKey to w in the form of an
+// OpenPGP public key packet, not including the packet header.
+func (pk *PublicKey) serializeWithoutHeaders(w io.Writer) (err error) {
+ t := uint32(pk.CreationTime.Unix())
+ if _, err = w.Write([]byte{
+ byte(pk.Version),
+ byte(t >> 24), byte(t >> 16), byte(t >> 8), byte(t),
+ byte(pk.PubKeyAlgo),
+ }); err != nil {
+ return
+ }
+
+ if pk.Version >= 5 {
+ n := pk.algorithmSpecificByteCount()
+ if _, err = w.Write([]byte{
+ byte(n >> 24), byte(n >> 16), byte(n >> 8), byte(n),
+ }); err != nil {
+ return
+ }
+ }
+
+ switch pk.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:
+ if _, err = w.Write(pk.n.EncodedBytes()); err != nil {
+ return
+ }
+ _, err = w.Write(pk.e.EncodedBytes())
+ return
+ case PubKeyAlgoDSA:
+ if _, err = w.Write(pk.p.EncodedBytes()); err != nil {
+ return
+ }
+ if _, err = w.Write(pk.q.EncodedBytes()); err != nil {
+ return
+ }
+ if _, err = w.Write(pk.g.EncodedBytes()); err != nil {
+ return
+ }
+ _, err = w.Write(pk.y.EncodedBytes())
+ return
+ case PubKeyAlgoElGamal:
+ if _, err = w.Write(pk.p.EncodedBytes()); err != nil {
+ return
+ }
+ if _, err = w.Write(pk.g.EncodedBytes()); err != nil {
+ return
+ }
+ _, err = w.Write(pk.y.EncodedBytes())
+ return
+ case PubKeyAlgoECDSA:
+ if _, err = w.Write(pk.oid.EncodedBytes()); err != nil {
+ return
+ }
+ _, err = w.Write(pk.p.EncodedBytes())
+ return
+ case PubKeyAlgoECDH:
+ if _, err = w.Write(pk.oid.EncodedBytes()); err != nil {
+ return
+ }
+ if _, err = w.Write(pk.p.EncodedBytes()); err != nil {
+ return
+ }
+ _, err = w.Write(pk.kdf.EncodedBytes())
+ return
+ case PubKeyAlgoEdDSA:
+ if _, err = w.Write(pk.oid.EncodedBytes()); err != nil {
+ return
+ }
+ _, err = w.Write(pk.p.EncodedBytes())
+ return
+ case PubKeyAlgoX25519:
+ publicKey := pk.PublicKey.(*x25519.PublicKey)
+ _, err = w.Write(publicKey.Point)
+ return
+ case PubKeyAlgoX448:
+ publicKey := pk.PublicKey.(*x448.PublicKey)
+ _, err = w.Write(publicKey.Point)
+ return
+ case PubKeyAlgoEd25519:
+ publicKey := pk.PublicKey.(*ed25519.PublicKey)
+ _, err = w.Write(publicKey.Point)
+ return
+ case PubKeyAlgoEd448:
+ publicKey := pk.PublicKey.(*ed448.PublicKey)
+ _, err = w.Write(publicKey.Point)
+ return
+ }
+ return errors.InvalidArgumentError("bad public-key algorithm")
+}
+
+// CanSign returns true iff this public key can generate signatures
+func (pk *PublicKey) CanSign() bool {
+ return pk.PubKeyAlgo != PubKeyAlgoRSAEncryptOnly && pk.PubKeyAlgo != PubKeyAlgoElGamal && pk.PubKeyAlgo != PubKeyAlgoECDH
+}
+
+// VerifyHashTag returns nil iff sig appears to be a plausible signature of the data
+// hashed into signed, based solely on its HashTag. signed is mutated by this call.
+func VerifyHashTag(signed hash.Hash, sig *Signature) (err error) {
+ if sig.Version == 5 && (sig.SigType == 0x00 || sig.SigType == 0x01) {
+ sig.AddMetadataToHashSuffix()
+ }
+ signed.Write(sig.HashSuffix)
+ hashBytes := signed.Sum(nil)
+ if hashBytes[0] != sig.HashTag[0] || hashBytes[1] != sig.HashTag[1] {
+ return errors.SignatureError("hash tag doesn't match")
+ }
+ return nil
+}
+
+// VerifySignature returns nil iff sig is a valid signature, made by this
+// public key, of the data hashed into signed. signed is mutated by this call.
+func (pk *PublicKey) VerifySignature(signed hash.Hash, sig *Signature) (err error) {
+ if !pk.CanSign() {
+ return errors.InvalidArgumentError("public key cannot generate signatures")
+ }
+ if sig.Version == 5 && (sig.SigType == 0x00 || sig.SigType == 0x01) {
+ sig.AddMetadataToHashSuffix()
+ }
+ signed.Write(sig.HashSuffix)
+ hashBytes := signed.Sum(nil)
+ // see discussion https://github.com/ProtonMail/go-crypto/issues/107
+ if sig.Version >= 5 && (hashBytes[0] != sig.HashTag[0] || hashBytes[1] != sig.HashTag[1]) {
+ return errors.SignatureError("hash tag doesn't match")
+ }
+
+ if pk.PubKeyAlgo != sig.PubKeyAlgo {
+ return errors.InvalidArgumentError("public key and signature use different algorithms")
+ }
+
+ switch pk.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:
+ rsaPublicKey, _ := pk.PublicKey.(*rsa.PublicKey)
+ err = rsa.VerifyPKCS1v15(rsaPublicKey, sig.Hash, hashBytes, padToKeySize(rsaPublicKey, sig.RSASignature.Bytes()))
+ if err != nil {
+ return errors.SignatureError("RSA verification failure")
+ }
+ return nil
+ case PubKeyAlgoDSA:
+ dsaPublicKey, _ := pk.PublicKey.(*dsa.PublicKey)
+ // Need to truncate hashBytes to match FIPS 186-3 section 4.6.
+ subgroupSize := (dsaPublicKey.Q.BitLen() + 7) / 8
+ if len(hashBytes) > subgroupSize {
+ hashBytes = hashBytes[:subgroupSize]
+ }
+ if !dsa.Verify(dsaPublicKey, hashBytes, new(big.Int).SetBytes(sig.DSASigR.Bytes()), new(big.Int).SetBytes(sig.DSASigS.Bytes())) {
+ return errors.SignatureError("DSA verification failure")
+ }
+ return nil
+ case PubKeyAlgoECDSA:
+ ecdsaPublicKey := pk.PublicKey.(*ecdsa.PublicKey)
+ if !ecdsa.Verify(ecdsaPublicKey, hashBytes, new(big.Int).SetBytes(sig.ECDSASigR.Bytes()), new(big.Int).SetBytes(sig.ECDSASigS.Bytes())) {
+ return errors.SignatureError("ECDSA verification failure")
+ }
+ return nil
+ case PubKeyAlgoEdDSA:
+ eddsaPublicKey := pk.PublicKey.(*eddsa.PublicKey)
+ if !eddsa.Verify(eddsaPublicKey, hashBytes, sig.EdDSASigR.Bytes(), sig.EdDSASigS.Bytes()) {
+ return errors.SignatureError("EdDSA verification failure")
+ }
+ return nil
+ case PubKeyAlgoEd25519:
+ ed25519PublicKey := pk.PublicKey.(*ed25519.PublicKey)
+ if !ed25519.Verify(ed25519PublicKey, hashBytes, sig.EdSig) {
+ return errors.SignatureError("Ed25519 verification failure")
+ }
+ return nil
+ case PubKeyAlgoEd448:
+ ed448PublicKey := pk.PublicKey.(*ed448.PublicKey)
+ if !ed448.Verify(ed448PublicKey, hashBytes, sig.EdSig) {
+ return errors.SignatureError("ed448 verification failure")
+ }
+ return nil
+ default:
+ return errors.SignatureError("Unsupported public key algorithm used in signature")
+ }
+}
+
+// keySignatureHash returns a Hash of the message that needs to be signed for
+// pk to assert a subkey relationship to signed.
+func keySignatureHash(pk, signed signingKey, hashFunc hash.Hash) (h hash.Hash, err error) {
+ h = hashFunc
+
+ // RFC 4880, section 5.2.4
+ err = pk.SerializeForHash(h)
+ if err != nil {
+ return nil, err
+ }
+
+ err = signed.SerializeForHash(h)
+ return
+}
+
+// VerifyKeyHashTag returns nil iff sig appears to be a plausible signature over this
+// primary key and subkey, based solely on its HashTag.
+func (pk *PublicKey) VerifyKeyHashTag(signed *PublicKey, sig *Signature) error {
+ preparedHash, err := sig.PrepareVerify()
+ if err != nil {
+ return err
+ }
+ h, err := keySignatureHash(pk, signed, preparedHash)
+ if err != nil {
+ return err
+ }
+ return VerifyHashTag(h, sig)
+}
+
+// VerifyKeySignature returns nil iff sig is a valid signature, made by this
+// public key, of signed.
+func (pk *PublicKey) VerifyKeySignature(signed *PublicKey, sig *Signature) error {
+ preparedHash, err := sig.PrepareVerify()
+ if err != nil {
+ return err
+ }
+ h, err := keySignatureHash(pk, signed, preparedHash)
+ if err != nil {
+ return err
+ }
+ if err = pk.VerifySignature(h, sig); err != nil {
+ return err
+ }
+
+ if sig.FlagSign {
+ // Signing subkeys must be cross-signed. See
+ // https://www.gnupg.org/faq/subkey-cross-certify.html.
+ if sig.EmbeddedSignature == nil {
+ return errors.StructuralError("signing subkey is missing cross-signature")
+ }
+ preparedHashEmbedded, err := sig.EmbeddedSignature.PrepareVerify()
+ if err != nil {
+ return err
+ }
+ // Verify the cross-signature. This is calculated over the same
+ // data as the main signature, so we cannot just recursively
+ // call signed.VerifyKeySignature(...)
+ if h, err = keySignatureHash(pk, signed, preparedHashEmbedded); err != nil {
+ return errors.StructuralError("error while hashing for cross-signature: " + err.Error())
+ }
+ if err := signed.VerifySignature(h, sig.EmbeddedSignature); err != nil {
+ return errors.StructuralError("error while verifying cross-signature: " + err.Error())
+ }
+ }
+
+ return nil
+}
+
+func keyRevocationHash(pk signingKey, hashFunc hash.Hash) (err error) {
+ return pk.SerializeForHash(hashFunc)
+}
+
+// VerifyRevocationHashTag returns nil iff sig appears to be a plausible signature
+// over this public key, based solely on its HashTag.
+func (pk *PublicKey) VerifyRevocationHashTag(sig *Signature) (err error) {
+ preparedHash, err := sig.PrepareVerify()
+ if err != nil {
+ return err
+ }
+ if err = keyRevocationHash(pk, preparedHash); err != nil {
+ return err
+ }
+ return VerifyHashTag(preparedHash, sig)
+}
+
+// VerifyRevocationSignature returns nil iff sig is a valid signature, made by this
+// public key.
+func (pk *PublicKey) VerifyRevocationSignature(sig *Signature) (err error) {
+ preparedHash, err := sig.PrepareVerify()
+ if err != nil {
+ return err
+ }
+ if err = keyRevocationHash(pk, preparedHash); err != nil {
+ return err
+ }
+ return pk.VerifySignature(preparedHash, sig)
+}
+
+// VerifySubkeyRevocationSignature returns nil iff sig is a valid subkey revocation signature,
+// made by this public key, of signed.
+func (pk *PublicKey) VerifySubkeyRevocationSignature(sig *Signature, signed *PublicKey) (err error) {
+ preparedHash, err := sig.PrepareVerify()
+ if err != nil {
+ return err
+ }
+ h, err := keySignatureHash(pk, signed, preparedHash)
+ if err != nil {
+ return err
+ }
+ return pk.VerifySignature(h, sig)
+}
+
+// userIdSignatureHash returns a Hash of the message that needs to be signed
+// to assert that pk is a valid key for id.
+func userIdSignatureHash(id string, pk *PublicKey, h hash.Hash) (err error) {
+
+ // RFC 4880, section 5.2.4
+ if err := pk.SerializeSignaturePrefix(h); err != nil {
+ return err
+ }
+ if err := pk.serializeWithoutHeaders(h); err != nil {
+ return err
+ }
+
+ var buf [5]byte
+ buf[0] = 0xb4
+ buf[1] = byte(len(id) >> 24)
+ buf[2] = byte(len(id) >> 16)
+ buf[3] = byte(len(id) >> 8)
+ buf[4] = byte(len(id))
+ h.Write(buf[:])
+ h.Write([]byte(id))
+
+ return nil
+}
+
+// directKeySignatureHash returns a Hash of the message that needs to be signed.
+func directKeySignatureHash(pk *PublicKey, h hash.Hash) (err error) {
+ return pk.SerializeForHash(h)
+}
+
+// VerifyUserIdHashTag returns nil iff sig appears to be a plausible signature over this
+// public key and UserId, based solely on its HashTag
+func (pk *PublicKey) VerifyUserIdHashTag(id string, sig *Signature) (err error) {
+ preparedHash, err := sig.PrepareVerify()
+ if err != nil {
+ return err
+ }
+ err = userIdSignatureHash(id, pk, preparedHash)
+ if err != nil {
+ return err
+ }
+ return VerifyHashTag(preparedHash, sig)
+}
+
+// VerifyUserIdSignature returns nil iff sig is a valid signature, made by this
+// public key, that id is the identity of pub.
+func (pk *PublicKey) VerifyUserIdSignature(id string, pub *PublicKey, sig *Signature) (err error) {
+ h, err := sig.PrepareVerify()
+ if err != nil {
+ return err
+ }
+ if err := userIdSignatureHash(id, pub, h); err != nil {
+ return err
+ }
+ return pk.VerifySignature(h, sig)
+}
+
+// VerifyDirectKeySignature returns nil iff sig is a valid signature, made by this
+// public key.
+func (pk *PublicKey) VerifyDirectKeySignature(sig *Signature) (err error) {
+ h, err := sig.PrepareVerify()
+ if err != nil {
+ return err
+ }
+ if err := directKeySignatureHash(pk, h); err != nil {
+ return err
+ }
+ return pk.VerifySignature(h, sig)
+}
+
+// KeyIdString returns the public key's fingerprint in capital hex
+// (e.g. "6C7EE1B8621CC013").
+func (pk *PublicKey) KeyIdString() string {
+ return fmt.Sprintf("%016X", pk.KeyId)
+}
+
+// KeyIdShortString returns the short form of public key's fingerprint
+// in capital hex, as shown by gpg --list-keys (e.g. "621CC013").
+// This function will return the full key id for v5 and v6 keys
+// since the short key id is undefined for them.
+func (pk *PublicKey) KeyIdShortString() string {
+ if pk.Version >= 5 {
+ return pk.KeyIdString()
+ }
+ return fmt.Sprintf("%X", pk.Fingerprint[16:20])
+}
+
+// BitLength returns the bit length for the given public key.
+func (pk *PublicKey) BitLength() (bitLength uint16, err error) {
+ switch pk.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly:
+ bitLength = pk.n.BitLength()
+ case PubKeyAlgoDSA:
+ bitLength = pk.p.BitLength()
+ case PubKeyAlgoElGamal:
+ bitLength = pk.p.BitLength()
+ case PubKeyAlgoECDSA:
+ bitLength = pk.p.BitLength()
+ case PubKeyAlgoECDH:
+ bitLength = pk.p.BitLength()
+ case PubKeyAlgoEdDSA:
+ bitLength = pk.p.BitLength()
+ case PubKeyAlgoX25519:
+ bitLength = x25519.KeySize * 8
+ case PubKeyAlgoX448:
+ bitLength = x448.KeySize * 8
+ case PubKeyAlgoEd25519:
+ bitLength = ed25519.PublicKeySize * 8
+ case PubKeyAlgoEd448:
+ bitLength = ed448.PublicKeySize * 8
+ default:
+ err = errors.InvalidArgumentError("bad public-key algorithm")
+ }
+ return
+}
+
+// Curve returns the used elliptic curve of this public key.
+// Returns an error if no elliptic curve is used.
+func (pk *PublicKey) Curve() (curve Curve, err error) {
+ switch pk.PubKeyAlgo {
+ case PubKeyAlgoECDSA, PubKeyAlgoECDH, PubKeyAlgoEdDSA:
+ curveInfo := ecc.FindByOid(pk.oid)
+ if curveInfo == nil {
+ return "", errors.UnsupportedError(fmt.Sprintf("unknown oid: %x", pk.oid))
+ }
+ curve = Curve(curveInfo.GenName)
+ case PubKeyAlgoEd25519, PubKeyAlgoX25519:
+ curve = Curve25519
+ case PubKeyAlgoEd448, PubKeyAlgoX448:
+ curve = Curve448
+ default:
+ err = errors.InvalidArgumentError("public key does not operate with an elliptic curve")
+ }
+ return
+}
+
+// KeyExpired returns whether sig is a self-signature of a key that has
+// expired or is created in the future.
+func (pk *PublicKey) KeyExpired(sig *Signature, currentTime time.Time) bool {
+ if pk.CreationTime.Unix() > currentTime.Unix() {
+ return true
+ }
+ if sig.KeyLifetimeSecs == nil || *sig.KeyLifetimeSecs == 0 {
+ return false
+ }
+ expiry := pk.CreationTime.Add(time.Duration(*sig.KeyLifetimeSecs) * time.Second)
+ return currentTime.Unix() > expiry.Unix()
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key_test_data.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key_test_data.go
new file mode 100644
index 0000000000..b255f1f6f8
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key_test_data.go
@@ -0,0 +1,24 @@
+package packet
+
+const rsaFingerprintHex = "5fb74b1d03b1e3cb31bc2f8aa34d7e18c20c31bb"
+
+const rsaPkDataHex = "988d044d3c5c10010400b1d13382944bd5aba23a4312968b5095d14f947f600eb478e14a6fcb16b0e0cac764884909c020bc495cfcc39a935387c661507bdb236a0612fb582cac3af9b29cc2c8c70090616c41b662f4da4c1201e195472eb7f4ae1ccbcbf9940fe21d985e379a5563dde5b9a23d35f1cfaa5790da3b79db26f23695107bfaca8e7b5bcd0011010001"
+
+const dsaFingerprintHex = "eece4c094db002103714c63c8e8fbe54062f19ed"
+
+const dsaPkDataHex = "9901a2044d432f89110400cd581334f0d7a1e1bdc8b9d6d8c0baf68793632735d2bb0903224cbaa1dfbf35a60ee7a13b92643421e1eb41aa8d79bea19a115a677f6b8ba3c7818ce53a6c2a24a1608bd8b8d6e55c5090cbde09dd26e356267465ae25e69ec8bdd57c7bbb2623e4d73336f73a0a9098f7f16da2e25252130fd694c0e8070c55a812a423ae7f00a0ebf50e70c2f19c3520a551bd4b08d30f23530d3d03ff7d0bf4a53a64a09dc5e6e6e35854b7d70c882b0c60293401958b1bd9e40abec3ea05ba87cf64899299d4bd6aa7f459c201d3fbbd6c82004bdc5e8a9eb8082d12054cc90fa9d4ec251a843236a588bf49552441817436c4f43326966fe85447d4e6d0acf8fa1ef0f014730770603ad7634c3088dc52501c237328417c31c89ed70400b2f1a98b0bf42f11fefc430704bebbaa41d9f355600c3facee1e490f64208e0e094ea55e3a598a219a58500bf78ac677b670a14f4e47e9cf8eab4f368cc1ddcaa18cc59309d4cc62dd4f680e73e6cc3e1ce87a84d0925efbcb26c575c093fc42eecf45135fabf6403a25c2016e1774c0484e440a18319072c617cc97ac0a3bb0"
+
+const ecdsaFingerprintHex = "9892270b38b8980b05c8d56d43fe956c542ca00b"
+
+const ecdsaPkDataHex = "9893045071c29413052b8104002304230401f4867769cedfa52c325018896245443968e52e51d0c2df8d939949cb5b330f2921711fbee1c9b9dddb95d15cb0255e99badeddda7cc23d9ddcaacbc290969b9f24019375d61c2e4e3b36953a28d8b2bc95f78c3f1d592fb24499be348656a7b17e3963187b4361afe497bc5f9f81213f04069f8e1fb9e6a6290ae295ca1a92b894396cb4"
+
+const ecdhFingerprintHex = "722354df2475a42164d1d49faa8b938f9a201946"
+
+const ecdhPkDataHex = "b90073044d53059212052b810400220303042faa84024a20b6735c4897efa5bfb41bf85b7eefeab5ca0cb9ffc8ea04a46acb25534a577694f9e25340a4ab5223a9dd1eda530c8aa2e6718db10d7e672558c7736fe09369ea5739a2a3554bf16d41faa50562f11c6d39bbd5dffb6b9a9ec91803010909"
+
+const eddsaFingerprintHex = "b2d5e5ec0e6deca6bc8eeeb00907e75e1dd99ad8"
+
+const eddsaPkDataHex = "98330456e2132b16092b06010401da470f01010740bbda39266affa511a8c2d02edf690fb784b0499c4406185811a163539ef11dc1b41d74657374696e67203c74657374696e674074657374696e672e636f6d3e8879041316080021050256e2132b021b03050b09080702061508090a0b020416020301021e01021780000a09100907e75e1dd99ad86d0c00fe39d2008359352782bc9b61ac382584cd8eff3f57a18c2287e3afeeb05d1f04ba00fe2d0bc1ddf3ff8adb9afa3e7d9287244b4ec567f3db4d60b74a9b5465ed528203"
+
+// Source: https://sites.google.com/site/brainhub/pgpecckeys#TOC-ECC-NIST-P-384-key
+const ecc384PubHex = `99006f044d53059213052b81040022030304f6b8c5aced5b84ef9f4a209db2e4a9dfb70d28cb8c10ecd57674a9fa5a67389942b62d5e51367df4c7bfd3f8e500feecf07ed265a621a8ebbbe53e947ec78c677eba143bd1533c2b350e1c29f82313e1e1108eba063be1e64b10e6950e799c2db42465635f6473615f64685f333834203c6f70656e70677040627261696e6875622e6f72673e8900cb04101309005305024d530592301480000000002000077072656665727265642d656d61696c2d656e636f64696e67407067702e636f6d7067706d696d65040b090807021901051b03000000021602051e010000000415090a08000a0910098033880f54719fca2b0180aa37350968bd5f115afd8ce7bc7b103822152dbff06d0afcda835329510905b98cb469ba208faab87c7412b799e7b633017f58364ea480e8a1a3f253a0c5f22c446e8be9a9fce6210136ee30811abbd49139de28b5bdf8dc36d06ae748579e9ff503b90073044d53059212052b810400220303042faa84024a20b6735c4897efa5bfb41bf85b7eefeab5ca0cb9ffc8ea04a46acb25534a577694f9e25340a4ab5223a9dd1eda530c8aa2e6718db10d7e672558c7736fe09369ea5739a2a3554bf16d41faa50562f11c6d39bbd5dffb6b9a9ec9180301090989008404181309000c05024d530592051b0c000000000a0910098033880f54719f80970180eee7a6d8fcee41ee4f9289df17f9bcf9d955dca25c583b94336f3a2b2d4986dc5cf417b8d2dc86f741a9e1a6d236c0e3017d1c76575458a0cfb93ae8a2b274fcc65ceecd7a91eec83656ba13219969f06945b48c56bd04152c3a0553c5f2f4bd1267`
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/reader.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/reader.go
new file mode 100644
index 0000000000..dd84092392
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/reader.go
@@ -0,0 +1,209 @@
+// 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 packet
+
+import (
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+)
+
+type PacketReader interface {
+ Next() (p Packet, err error)
+ Push(reader io.Reader) (err error)
+ Unread(p Packet)
+}
+
+// Reader reads packets from an io.Reader and allows packets to be 'unread' so
+// that they result from the next call to Next.
+type Reader struct {
+ q []Packet
+ readers []io.Reader
+}
+
+// New io.Readers are pushed when a compressed or encrypted packet is processed
+// and recursively treated as a new source of packets. However, a carefully
+// crafted packet can trigger an infinite recursive sequence of packets. See
+// http://mumble.net/~campbell/misc/pgp-quine
+// https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4402
+// This constant limits the number of recursive packets that may be pushed.
+const maxReaders = 32
+
+// Next returns the most recently unread Packet, or reads another packet from
+// the top-most io.Reader. Unknown/unsupported/Marker packet types are skipped.
+func (r *Reader) Next() (p Packet, err error) {
+ for {
+ p, err := r.read()
+ if err == io.EOF {
+ break
+ } else if err != nil {
+ if _, ok := err.(errors.UnknownPacketTypeError); ok {
+ continue
+ }
+ if _, ok := err.(errors.UnsupportedError); ok {
+ switch p.(type) {
+ case *SymmetricallyEncrypted, *AEADEncrypted, *Compressed, *LiteralData:
+ return nil, err
+ }
+ continue
+ }
+ return nil, err
+ } else {
+ //A marker packet MUST be ignored when received
+ switch p.(type) {
+ case *Marker:
+ continue
+ }
+ return p, nil
+ }
+ }
+ return nil, io.EOF
+}
+
+// Next returns the most recently unread Packet, or reads another packet from
+// the top-most io.Reader. Unknown/Marker packet types are skipped while unsupported
+// packets are returned as UnsupportedPacket type.
+func (r *Reader) NextWithUnsupported() (p Packet, err error) {
+ for {
+ p, err = r.read()
+ if err == io.EOF {
+ break
+ } else if err != nil {
+ if _, ok := err.(errors.UnknownPacketTypeError); ok {
+ continue
+ }
+ if casteErr, ok := err.(errors.UnsupportedError); ok {
+ return &UnsupportedPacket{
+ IncompletePacket: p,
+ Error: casteErr,
+ }, nil
+ }
+ return
+ } else {
+ //A marker packet MUST be ignored when received
+ switch p.(type) {
+ case *Marker:
+ continue
+ }
+ return
+ }
+ }
+ return nil, io.EOF
+}
+
+func (r *Reader) read() (p Packet, err error) {
+ if len(r.q) > 0 {
+ p = r.q[len(r.q)-1]
+ r.q = r.q[:len(r.q)-1]
+ return
+ }
+ for len(r.readers) > 0 {
+ p, err = Read(r.readers[len(r.readers)-1])
+ if err == io.EOF {
+ r.readers = r.readers[:len(r.readers)-1]
+ continue
+ }
+ return p, err
+ }
+ return nil, io.EOF
+}
+
+// Push causes the Reader to start reading from a new io.Reader. When an EOF
+// error is seen from the new io.Reader, it is popped and the Reader continues
+// to read from the next most recent io.Reader. Push returns a StructuralError
+// if pushing the reader would exceed the maximum recursion level, otherwise it
+// returns nil.
+func (r *Reader) Push(reader io.Reader) (err error) {
+ if len(r.readers) >= maxReaders {
+ return errors.StructuralError("too many layers of packets")
+ }
+ r.readers = append(r.readers, reader)
+ return nil
+}
+
+// Unread causes the given Packet to be returned from the next call to Next.
+func (r *Reader) Unread(p Packet) {
+ r.q = append(r.q, p)
+}
+
+func NewReader(r io.Reader) *Reader {
+ return &Reader{
+ q: nil,
+ readers: []io.Reader{r},
+ }
+}
+
+// CheckReader is similar to Reader but additionally
+// uses the pushdown automata to verify the read packet sequence.
+type CheckReader struct {
+ Reader
+ verifier *SequenceVerifier
+ fullyRead bool
+}
+
+// Next returns the most recently unread Packet, or reads another packet from
+// the top-most io.Reader. Unknown packet types are skipped.
+// If the read packet sequence does not conform to the packet composition
+// rules in rfc4880, it returns an error.
+func (r *CheckReader) Next() (p Packet, err error) {
+ if r.fullyRead {
+ return nil, io.EOF
+ }
+ if len(r.q) > 0 {
+ p = r.q[len(r.q)-1]
+ r.q = r.q[:len(r.q)-1]
+ return
+ }
+ var errMsg error
+ for len(r.readers) > 0 {
+ p, errMsg, err = ReadWithCheck(r.readers[len(r.readers)-1], r.verifier)
+ if errMsg != nil {
+ err = errMsg
+ return
+ }
+ if err == nil {
+ return
+ }
+ if err == io.EOF {
+ r.readers = r.readers[:len(r.readers)-1]
+ continue
+ }
+ //A marker packet MUST be ignored when received
+ switch p.(type) {
+ case *Marker:
+ continue
+ }
+ if _, ok := err.(errors.UnknownPacketTypeError); ok {
+ continue
+ }
+ if _, ok := err.(errors.UnsupportedError); ok {
+ switch p.(type) {
+ case *SymmetricallyEncrypted, *AEADEncrypted, *Compressed, *LiteralData:
+ return nil, err
+ }
+ continue
+ }
+ return nil, err
+ }
+ if errMsg = r.verifier.Next(EOSSymbol); errMsg != nil {
+ return nil, errMsg
+ }
+ if errMsg = r.verifier.AssertValid(); errMsg != nil {
+ return nil, errMsg
+ }
+ r.fullyRead = true
+ return nil, io.EOF
+}
+
+func NewCheckReader(r io.Reader) *CheckReader {
+ return &CheckReader{
+ Reader: Reader{
+ q: nil,
+ readers: []io.Reader{r},
+ },
+ verifier: NewSequenceVerifier(),
+ fullyRead: false,
+ }
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/recipient.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/recipient.go
new file mode 100644
index 0000000000..fb2e362e4a
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/recipient.go
@@ -0,0 +1,15 @@
+package packet
+
+// Recipient type represents a Intended Recipient Fingerprint subpacket
+// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh#name-intended-recipient-fingerpr
+type Recipient struct {
+ KeyVersion int
+ Fingerprint []byte
+}
+
+func (r *Recipient) Serialize() []byte {
+ packet := make([]byte, len(r.Fingerprint)+1)
+ packet[0] = byte(r.KeyVersion)
+ copy(packet[1:], r.Fingerprint)
+ return packet
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/signature.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/signature.go
new file mode 100644
index 0000000000..4490fdf83e
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/signature.go
@@ -0,0 +1,1511 @@
+// 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 packet
+
+import (
+ "bytes"
+ "crypto"
+ "crypto/dsa"
+ "encoding/asn1"
+ "encoding/binary"
+ "hash"
+ "io"
+ "math/big"
+ "strconv"
+ "time"
+
+ "github.com/ProtonMail/go-crypto/openpgp/ecdsa"
+ "github.com/ProtonMail/go-crypto/openpgp/ed25519"
+ "github.com/ProtonMail/go-crypto/openpgp/ed448"
+ "github.com/ProtonMail/go-crypto/openpgp/eddsa"
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/encoding"
+)
+
+const (
+ // First octet of key flags.
+ // See RFC 9580, section 5.2.3.29 for details.
+ KeyFlagCertify = 1 << iota
+ KeyFlagSign
+ KeyFlagEncryptCommunications
+ KeyFlagEncryptStorage
+ KeyFlagSplitKey
+ KeyFlagAuthenticate
+ _
+ KeyFlagGroupKey
+)
+
+const (
+ // First octet of keyserver preference flags.
+ // See RFC 9580, section 5.2.3.25 for details.
+ _ = 1 << iota
+ _
+ _
+ _
+ _
+ _
+ _
+ KeyserverPrefNoModify
+)
+
+const SaltNotationName = "salt@notations.openpgpjs.org"
+
+// Signature represents a signature. See RFC 9580, section 5.2.
+type Signature struct {
+ Version int
+ SigType SignatureType
+ PubKeyAlgo PublicKeyAlgorithm
+ Hash crypto.Hash
+ // salt contains a random salt value for v6 signatures
+ // See RFC 9580 Section 5.2.4.
+ salt []byte
+
+ // HashSuffix is extra data that is hashed in after the signed data.
+ HashSuffix []byte
+ // HashTag contains the first two bytes of the hash for fast rejection
+ // of bad signed data.
+ HashTag [2]byte
+
+ // Metadata includes format, filename and time, and is protected by v5
+ // signatures of type 0x00 or 0x01. This metadata is included into the hash
+ // computation; if nil, six 0x00 bytes are used instead. See section 5.2.4.
+ Metadata *LiteralData
+
+ CreationTime time.Time
+
+ RSASignature encoding.Field
+ DSASigR, DSASigS encoding.Field
+ ECDSASigR, ECDSASigS encoding.Field
+ EdDSASigR, EdDSASigS encoding.Field
+ EdSig []byte
+
+ // rawSubpackets contains the unparsed subpackets, in order.
+ rawSubpackets []outputSubpacket
+
+ // The following are optional so are nil when not included in the
+ // signature.
+
+ SigLifetimeSecs, KeyLifetimeSecs *uint32
+ PreferredSymmetric, PreferredHash, PreferredCompression []uint8
+ PreferredCipherSuites [][2]uint8
+ IssuerKeyId *uint64
+ IssuerFingerprint []byte
+ SignerUserId *string
+ IsPrimaryId *bool
+ Notations []*Notation
+ IntendedRecipients []*Recipient
+
+ // TrustLevel and TrustAmount can be set by the signer to assert that
+ // the key is not only valid but also trustworthy at the specified
+ // level.
+ // See RFC 9580, section 5.2.3.21 for details.
+ TrustLevel TrustLevel
+ TrustAmount TrustAmount
+
+ // TrustRegularExpression can be used in conjunction with trust Signature
+ // packets to limit the scope of the trust that is extended.
+ // See RFC 9580, section 5.2.3.22 for details.
+ TrustRegularExpression *string
+
+ // KeyserverPrefsValid is set if any keyserver preferences were given. See RFC 9580, section
+ // 5.2.3.25 for details.
+ KeyserverPrefsValid bool
+ KeyserverPrefNoModify bool
+
+ // PreferredKeyserver can be set to a URI where the latest version of the
+ // key that this signature is made over can be found. See RFC 9580, section
+ // 5.2.3.26 for details.
+ PreferredKeyserver string
+
+ // PolicyURI can be set to the URI of a document that describes the
+ // policy under which the signature was issued. See RFC 9580, section
+ // 5.2.3.28 for details.
+ PolicyURI string
+
+ // FlagsValid is set if any flags were given. See RFC 9580, section
+ // 5.2.3.29 for details.
+ FlagsValid bool
+ FlagCertify, FlagSign, FlagEncryptCommunications, FlagEncryptStorage, FlagSplitKey, FlagAuthenticate, FlagGroupKey bool
+
+ // RevocationReason is set if this signature has been revoked.
+ // See RFC 9580, section 5.2.3.31 for details.
+ RevocationReason *ReasonForRevocation
+ RevocationReasonText string
+
+ // In a self-signature, these flags are set there is a features subpacket
+ // indicating that the issuer implementation supports these features
+ // see https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh#features-subpacket
+ SEIPDv1, SEIPDv2 bool
+
+ // EmbeddedSignature, if non-nil, is a signature of the parent key, by
+ // this key. This prevents an attacker from claiming another's signing
+ // subkey as their own.
+ EmbeddedSignature *Signature
+
+ outSubpackets []outputSubpacket
+}
+
+// VerifiableSignature internally keeps state if the
+// the signature has been verified before.
+type VerifiableSignature struct {
+ Valid *bool // nil if it has not been verified yet
+ Packet *Signature
+}
+
+// NewVerifiableSig returns a struct of type VerifiableSignature referencing the input signature.
+func NewVerifiableSig(signature *Signature) *VerifiableSignature {
+ return &VerifiableSignature{
+ Packet: signature,
+ }
+}
+
+// Salt returns the signature salt for v6 signatures.
+func (sig *Signature) Salt() []byte {
+ if sig == nil {
+ return nil
+ }
+ return sig.salt
+}
+
+func (sig *Signature) parse(r io.Reader) (err error) {
+ // RFC 9580, section 5.2.3
+ var buf [7]byte
+ _, err = readFull(r, buf[:1])
+ if err != nil {
+ return
+ }
+ sig.Version = int(buf[0])
+ if sig.Version != 4 && sig.Version != 5 && sig.Version != 6 {
+ err = errors.UnsupportedError("signature packet version " + strconv.Itoa(int(buf[0])))
+ return
+ }
+
+ if V5Disabled && sig.Version == 5 {
+ return errors.UnsupportedError("support for parsing v5 entities is disabled; build with `-tags v5` if needed")
+ }
+
+ if sig.Version == 6 {
+ _, err = readFull(r, buf[:7])
+ } else {
+ _, err = readFull(r, buf[:5])
+ }
+ if err != nil {
+ return
+ }
+ sig.SigType = SignatureType(buf[0])
+ sig.PubKeyAlgo = PublicKeyAlgorithm(buf[1])
+ switch sig.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA, PubKeyAlgoECDSA, PubKeyAlgoEdDSA, PubKeyAlgoEd25519, PubKeyAlgoEd448:
+ default:
+ err = errors.UnsupportedError("public key algorithm " + strconv.Itoa(int(sig.PubKeyAlgo)))
+ return
+ }
+
+ var ok bool
+
+ if sig.Version < 5 {
+ sig.Hash, ok = algorithm.HashIdToHashWithSha1(buf[2])
+ } else {
+ sig.Hash, ok = algorithm.HashIdToHash(buf[2])
+ }
+
+ if !ok {
+ return errors.UnsupportedError("hash function " + strconv.Itoa(int(buf[2])))
+ }
+
+ var hashedSubpacketsLength int
+ if sig.Version == 6 {
+ // For a v6 signature, a four-octet length is used.
+ hashedSubpacketsLength =
+ int(buf[3])<<24 |
+ int(buf[4])<<16 |
+ int(buf[5])<<8 |
+ int(buf[6])
+ } else {
+ hashedSubpacketsLength = int(buf[3])<<8 | int(buf[4])
+ }
+ hashedSubpackets := make([]byte, hashedSubpacketsLength)
+ _, err = readFull(r, hashedSubpackets)
+ if err != nil {
+ return
+ }
+ err = sig.buildHashSuffix(hashedSubpackets)
+ if err != nil {
+ return
+ }
+
+ err = parseSignatureSubpackets(sig, hashedSubpackets, true)
+ if err != nil {
+ return
+ }
+
+ if sig.Version == 6 {
+ _, err = readFull(r, buf[:4])
+ } else {
+ _, err = readFull(r, buf[:2])
+ }
+
+ if err != nil {
+ return
+ }
+ var unhashedSubpacketsLength uint32
+ if sig.Version == 6 {
+ unhashedSubpacketsLength = uint32(buf[0])<<24 | uint32(buf[1])<<16 | uint32(buf[2])<<8 | uint32(buf[3])
+ } else {
+ unhashedSubpacketsLength = uint32(buf[0])<<8 | uint32(buf[1])
+ }
+ unhashedSubpackets := make([]byte, unhashedSubpacketsLength)
+ _, err = readFull(r, unhashedSubpackets)
+ if err != nil {
+ return
+ }
+ err = parseSignatureSubpackets(sig, unhashedSubpackets, false)
+ if err != nil {
+ return
+ }
+
+ _, err = readFull(r, sig.HashTag[:2])
+ if err != nil {
+ return
+ }
+
+ if sig.Version == 6 {
+ // Only for v6 signatures, a variable-length field containing the salt
+ _, err = readFull(r, buf[:1])
+ if err != nil {
+ return
+ }
+ saltLength := int(buf[0])
+ var expectedSaltLength int
+ expectedSaltLength, err = SaltLengthForHash(sig.Hash)
+ if err != nil {
+ return
+ }
+ if saltLength != expectedSaltLength {
+ err = errors.StructuralError("unexpected salt size for the given hash algorithm")
+ return
+ }
+ salt := make([]byte, expectedSaltLength)
+ _, err = readFull(r, salt)
+ if err != nil {
+ return
+ }
+ sig.salt = salt
+ }
+
+ switch sig.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:
+ sig.RSASignature = new(encoding.MPI)
+ _, err = sig.RSASignature.ReadFrom(r)
+ case PubKeyAlgoDSA:
+ sig.DSASigR = new(encoding.MPI)
+ if _, err = sig.DSASigR.ReadFrom(r); err != nil {
+ return
+ }
+
+ sig.DSASigS = new(encoding.MPI)
+ _, err = sig.DSASigS.ReadFrom(r)
+ case PubKeyAlgoECDSA:
+ sig.ECDSASigR = new(encoding.MPI)
+ if _, err = sig.ECDSASigR.ReadFrom(r); err != nil {
+ return
+ }
+
+ sig.ECDSASigS = new(encoding.MPI)
+ _, err = sig.ECDSASigS.ReadFrom(r)
+ case PubKeyAlgoEdDSA:
+ sig.EdDSASigR = new(encoding.MPI)
+ if _, err = sig.EdDSASigR.ReadFrom(r); err != nil {
+ return
+ }
+
+ sig.EdDSASigS = new(encoding.MPI)
+ if _, err = sig.EdDSASigS.ReadFrom(r); err != nil {
+ return
+ }
+ case PubKeyAlgoEd25519:
+ sig.EdSig, err = ed25519.ReadSignature(r)
+ if err != nil {
+ return
+ }
+ case PubKeyAlgoEd448:
+ sig.EdSig, err = ed448.ReadSignature(r)
+ if err != nil {
+ return
+ }
+ default:
+ panic("unreachable")
+ }
+ return
+}
+
+// parseSignatureSubpackets parses subpackets of the main signature packet. See
+// RFC 9580, section 5.2.3.1.
+func parseSignatureSubpackets(sig *Signature, subpackets []byte, isHashed bool) (err error) {
+ for len(subpackets) > 0 {
+ subpackets, err = parseSignatureSubpacket(sig, subpackets, isHashed)
+ if err != nil {
+ return
+ }
+ }
+
+ if sig.CreationTime.IsZero() {
+ err = errors.StructuralError("no creation time in signature")
+ }
+
+ return
+}
+
+type signatureSubpacketType uint8
+
+const (
+ creationTimeSubpacket signatureSubpacketType = 2
+ signatureExpirationSubpacket signatureSubpacketType = 3
+ exportableCertSubpacket signatureSubpacketType = 4
+ trustSubpacket signatureSubpacketType = 5
+ regularExpressionSubpacket signatureSubpacketType = 6
+ keyExpirationSubpacket signatureSubpacketType = 9
+ prefSymmetricAlgosSubpacket signatureSubpacketType = 11
+ issuerSubpacket signatureSubpacketType = 16
+ notationDataSubpacket signatureSubpacketType = 20
+ prefHashAlgosSubpacket signatureSubpacketType = 21
+ prefCompressionSubpacket signatureSubpacketType = 22
+ keyserverPrefsSubpacket signatureSubpacketType = 23
+ prefKeyserverSubpacket signatureSubpacketType = 24
+ primaryUserIdSubpacket signatureSubpacketType = 25
+ policyUriSubpacket signatureSubpacketType = 26
+ keyFlagsSubpacket signatureSubpacketType = 27
+ signerUserIdSubpacket signatureSubpacketType = 28
+ reasonForRevocationSubpacket signatureSubpacketType = 29
+ featuresSubpacket signatureSubpacketType = 30
+ embeddedSignatureSubpacket signatureSubpacketType = 32
+ issuerFingerprintSubpacket signatureSubpacketType = 33
+ intendedRecipientSubpacket signatureSubpacketType = 35
+ prefCipherSuitesSubpacket signatureSubpacketType = 39
+)
+
+// parseSignatureSubpacket parses a single subpacket. len(subpacket) is >= 1.
+func parseSignatureSubpacket(sig *Signature, subpacket []byte, isHashed bool) (rest []byte, err error) {
+ // RFC 9580, section 5.2.3.7
+ var (
+ length uint32
+ packetType signatureSubpacketType
+ isCritical bool
+ )
+ if len(subpacket) == 0 {
+ err = errors.StructuralError("zero length signature subpacket")
+ return
+ }
+ switch {
+ case subpacket[0] < 192:
+ length = uint32(subpacket[0])
+ subpacket = subpacket[1:]
+ case subpacket[0] < 255:
+ if len(subpacket) < 2 {
+ goto Truncated
+ }
+ length = uint32(subpacket[0]-192)<<8 + uint32(subpacket[1]) + 192
+ subpacket = subpacket[2:]
+ default:
+ if len(subpacket) < 5 {
+ goto Truncated
+ }
+ length = uint32(subpacket[1])<<24 |
+ uint32(subpacket[2])<<16 |
+ uint32(subpacket[3])<<8 |
+ uint32(subpacket[4])
+ subpacket = subpacket[5:]
+ }
+ if length > uint32(len(subpacket)) {
+ goto Truncated
+ }
+ rest = subpacket[length:]
+ subpacket = subpacket[:length]
+ if len(subpacket) == 0 {
+ err = errors.StructuralError("zero length signature subpacket")
+ return
+ }
+ packetType = signatureSubpacketType(subpacket[0] & 0x7f)
+ isCritical = subpacket[0]&0x80 == 0x80
+ subpacket = subpacket[1:]
+ sig.rawSubpackets = append(sig.rawSubpackets, outputSubpacket{isHashed, packetType, isCritical, subpacket})
+ if !isHashed &&
+ packetType != issuerSubpacket &&
+ packetType != issuerFingerprintSubpacket &&
+ packetType != embeddedSignatureSubpacket {
+ return
+ }
+ switch packetType {
+ case creationTimeSubpacket:
+ if len(subpacket) != 4 {
+ err = errors.StructuralError("signature creation time not four bytes")
+ return
+ }
+ t := binary.BigEndian.Uint32(subpacket)
+ sig.CreationTime = time.Unix(int64(t), 0)
+ case signatureExpirationSubpacket:
+ // Signature expiration time, section 5.2.3.18
+ if len(subpacket) != 4 {
+ err = errors.StructuralError("expiration subpacket with bad length")
+ return
+ }
+ sig.SigLifetimeSecs = new(uint32)
+ *sig.SigLifetimeSecs = binary.BigEndian.Uint32(subpacket)
+ case exportableCertSubpacket:
+ if subpacket[0] == 0 {
+ err = errors.UnsupportedError("signature with non-exportable certification")
+ return
+ }
+ case trustSubpacket:
+ if len(subpacket) != 2 {
+ err = errors.StructuralError("trust subpacket with bad length")
+ return
+ }
+ // Trust level and amount, section 5.2.3.21
+ sig.TrustLevel = TrustLevel(subpacket[0])
+ sig.TrustAmount = TrustAmount(subpacket[1])
+ case regularExpressionSubpacket:
+ if len(subpacket) == 0 {
+ err = errors.StructuralError("regexp subpacket with bad length")
+ return
+ }
+ // Trust regular expression, section 5.2.3.22
+ // RFC specifies the string should be null-terminated; remove a null byte from the end
+ if subpacket[len(subpacket)-1] != 0x00 {
+ err = errors.StructuralError("expected regular expression to be null-terminated")
+ return
+ }
+ trustRegularExpression := string(subpacket[:len(subpacket)-1])
+ sig.TrustRegularExpression = &trustRegularExpression
+ case keyExpirationSubpacket:
+ // Key expiration time, section 5.2.3.13
+ if len(subpacket) != 4 {
+ err = errors.StructuralError("key expiration subpacket with bad length")
+ return
+ }
+ sig.KeyLifetimeSecs = new(uint32)
+ *sig.KeyLifetimeSecs = binary.BigEndian.Uint32(subpacket)
+ case prefSymmetricAlgosSubpacket:
+ // Preferred symmetric algorithms, section 5.2.3.14
+ sig.PreferredSymmetric = make([]byte, len(subpacket))
+ copy(sig.PreferredSymmetric, subpacket)
+ case issuerSubpacket:
+ // Issuer, section 5.2.3.12
+ if sig.Version > 4 && isHashed {
+ err = errors.StructuralError("issuer subpacket found in v6 key")
+ return
+ }
+ if len(subpacket) != 8 {
+ err = errors.StructuralError("issuer subpacket with bad length")
+ return
+ }
+ if sig.Version <= 4 {
+ sig.IssuerKeyId = new(uint64)
+ *sig.IssuerKeyId = binary.BigEndian.Uint64(subpacket)
+ }
+ case notationDataSubpacket:
+ // Notation data, section 5.2.3.24
+ if len(subpacket) < 8 {
+ err = errors.StructuralError("notation data subpacket with bad length")
+ return
+ }
+
+ nameLength := uint32(subpacket[4])<<8 | uint32(subpacket[5])
+ valueLength := uint32(subpacket[6])<<8 | uint32(subpacket[7])
+ if len(subpacket) != int(nameLength)+int(valueLength)+8 {
+ err = errors.StructuralError("notation data subpacket with bad length")
+ return
+ }
+
+ notation := Notation{
+ IsHumanReadable: (subpacket[0] & 0x80) == 0x80,
+ Name: string(subpacket[8:(nameLength + 8)]),
+ Value: subpacket[(nameLength + 8):(valueLength + nameLength + 8)],
+ IsCritical: isCritical,
+ }
+
+ sig.Notations = append(sig.Notations, ¬ation)
+ case prefHashAlgosSubpacket:
+ // Preferred hash algorithms, section 5.2.3.16
+ sig.PreferredHash = make([]byte, len(subpacket))
+ copy(sig.PreferredHash, subpacket)
+ case prefCompressionSubpacket:
+ // Preferred compression algorithms, section 5.2.3.17
+ sig.PreferredCompression = make([]byte, len(subpacket))
+ copy(sig.PreferredCompression, subpacket)
+ case keyserverPrefsSubpacket:
+ // Keyserver preferences, section 5.2.3.25
+ sig.KeyserverPrefsValid = true
+ if len(subpacket) == 0 {
+ return
+ }
+ if subpacket[0]&KeyserverPrefNoModify != 0 {
+ sig.KeyserverPrefNoModify = true
+ }
+ case prefKeyserverSubpacket:
+ // Preferred keyserver, section 5.2.3.26
+ sig.PreferredKeyserver = string(subpacket)
+ case primaryUserIdSubpacket:
+ // Primary User ID, section 5.2.3.27
+ if len(subpacket) != 1 {
+ err = errors.StructuralError("primary user id subpacket with bad length")
+ return
+ }
+ sig.IsPrimaryId = new(bool)
+ if subpacket[0] > 0 {
+ *sig.IsPrimaryId = true
+ }
+ case keyFlagsSubpacket:
+ // Key flags, section 5.2.3.29
+ sig.FlagsValid = true
+ if len(subpacket) == 0 {
+ return
+ }
+ if subpacket[0]&KeyFlagCertify != 0 {
+ sig.FlagCertify = true
+ }
+ if subpacket[0]&KeyFlagSign != 0 {
+ sig.FlagSign = true
+ }
+ if subpacket[0]&KeyFlagEncryptCommunications != 0 {
+ sig.FlagEncryptCommunications = true
+ }
+ if subpacket[0]&KeyFlagEncryptStorage != 0 {
+ sig.FlagEncryptStorage = true
+ }
+ if subpacket[0]&KeyFlagSplitKey != 0 {
+ sig.FlagSplitKey = true
+ }
+ if subpacket[0]&KeyFlagAuthenticate != 0 {
+ sig.FlagAuthenticate = true
+ }
+ if subpacket[0]&KeyFlagGroupKey != 0 {
+ sig.FlagGroupKey = true
+ }
+ case signerUserIdSubpacket:
+ userId := string(subpacket)
+ sig.SignerUserId = &userId
+ case reasonForRevocationSubpacket:
+ // Reason For Revocation, section 5.2.3.31
+ if len(subpacket) == 0 {
+ err = errors.StructuralError("empty revocation reason subpacket")
+ return
+ }
+ sig.RevocationReason = new(ReasonForRevocation)
+ *sig.RevocationReason = NewReasonForRevocation(subpacket[0])
+ sig.RevocationReasonText = string(subpacket[1:])
+ case featuresSubpacket:
+ // Features subpacket, section 5.2.3.32 specifies a very general
+ // mechanism for OpenPGP implementations to signal support for new
+ // features.
+ if len(subpacket) > 0 {
+ if subpacket[0]&0x01 != 0 {
+ sig.SEIPDv1 = true
+ }
+ // 0x02 and 0x04 are reserved
+ if subpacket[0]&0x08 != 0 {
+ sig.SEIPDv2 = true
+ }
+ }
+ case embeddedSignatureSubpacket:
+ // Only usage is in signatures that cross-certify
+ // signing subkeys. section 5.2.3.34 describes the
+ // format, with its usage described in section 11.1
+ if sig.EmbeddedSignature != nil {
+ err = errors.StructuralError("Cannot have multiple embedded signatures")
+ return
+ }
+ sig.EmbeddedSignature = new(Signature)
+ if err := sig.EmbeddedSignature.parse(bytes.NewBuffer(subpacket)); err != nil {
+ return nil, err
+ }
+ if sigType := sig.EmbeddedSignature.SigType; sigType != SigTypePrimaryKeyBinding {
+ return nil, errors.StructuralError("cross-signature has unexpected type " + strconv.Itoa(int(sigType)))
+ }
+ case policyUriSubpacket:
+ // Policy URI, section 5.2.3.28
+ sig.PolicyURI = string(subpacket)
+ case issuerFingerprintSubpacket:
+ if len(subpacket) == 0 {
+ err = errors.StructuralError("empty issuer fingerprint subpacket")
+ return
+ }
+ v, l := subpacket[0], len(subpacket[1:])
+ if v >= 5 && l != 32 || v < 5 && l != 20 {
+ return nil, errors.StructuralError("bad fingerprint length")
+ }
+ sig.IssuerFingerprint = make([]byte, l)
+ copy(sig.IssuerFingerprint, subpacket[1:])
+ sig.IssuerKeyId = new(uint64)
+ if v >= 5 {
+ *sig.IssuerKeyId = binary.BigEndian.Uint64(subpacket[1:9])
+ } else {
+ *sig.IssuerKeyId = binary.BigEndian.Uint64(subpacket[13:21])
+ }
+ case intendedRecipientSubpacket:
+ // Intended Recipient Fingerprint, section 5.2.3.36
+ if len(subpacket) < 1 {
+ return nil, errors.StructuralError("invalid intended recipient fingerpring length")
+ }
+ version, length := subpacket[0], len(subpacket[1:])
+ if version >= 5 && length != 32 || version < 5 && length != 20 {
+ return nil, errors.StructuralError("invalid fingerprint length")
+ }
+ fingerprint := make([]byte, length)
+ copy(fingerprint, subpacket[1:])
+ sig.IntendedRecipients = append(sig.IntendedRecipients, &Recipient{int(version), fingerprint})
+ case prefCipherSuitesSubpacket:
+ // Preferred AEAD cipher suites, section 5.2.3.15
+ if len(subpacket)%2 != 0 {
+ err = errors.StructuralError("invalid aead cipher suite length")
+ return
+ }
+
+ sig.PreferredCipherSuites = make([][2]byte, len(subpacket)/2)
+
+ for i := 0; i < len(subpacket)/2; i++ {
+ sig.PreferredCipherSuites[i] = [2]uint8{subpacket[2*i], subpacket[2*i+1]}
+ }
+ default:
+ if isCritical {
+ err = errors.UnsupportedError("unknown critical signature subpacket type " + strconv.Itoa(int(packetType)))
+ return
+ }
+ }
+ return
+
+Truncated:
+ err = errors.StructuralError("signature subpacket truncated")
+ return
+}
+
+// subpacketLengthLength returns the length, in bytes, of an encoded length value.
+func subpacketLengthLength(length int) int {
+ if length < 192 {
+ return 1
+ }
+ if length < 16320 {
+ return 2
+ }
+ return 5
+}
+
+func (sig *Signature) CheckKeyIdOrFingerprint(pk *PublicKey) bool {
+ if sig.IssuerFingerprint != nil && len(sig.IssuerFingerprint) >= 20 {
+ return bytes.Equal(sig.IssuerFingerprint, pk.Fingerprint)
+ }
+ return sig.IssuerKeyId != nil && *sig.IssuerKeyId == pk.KeyId
+}
+
+func (sig *Signature) CheckKeyIdOrFingerprintExplicit(fingerprint []byte, keyId uint64) bool {
+ if sig.IssuerFingerprint != nil && len(sig.IssuerFingerprint) >= 20 && fingerprint != nil {
+ return bytes.Equal(sig.IssuerFingerprint, fingerprint)
+ }
+ return sig.IssuerKeyId != nil && *sig.IssuerKeyId == keyId
+}
+
+// serializeSubpacketLength marshals the given length into to.
+func serializeSubpacketLength(to []byte, length int) int {
+ // RFC 9580, Section 4.2.1.
+ if length < 192 {
+ to[0] = byte(length)
+ return 1
+ }
+ if length < 16320 {
+ length -= 192
+ to[0] = byte((length >> 8) + 192)
+ to[1] = byte(length)
+ return 2
+ }
+ to[0] = 255
+ to[1] = byte(length >> 24)
+ to[2] = byte(length >> 16)
+ to[3] = byte(length >> 8)
+ to[4] = byte(length)
+ return 5
+}
+
+// subpacketsLength returns the serialized length, in bytes, of the given
+// subpackets.
+func subpacketsLength(subpackets []outputSubpacket, hashed bool) (length int) {
+ for _, subpacket := range subpackets {
+ if subpacket.hashed == hashed {
+ length += subpacketLengthLength(len(subpacket.contents) + 1)
+ length += 1 // type byte
+ length += len(subpacket.contents)
+ }
+ }
+ return
+}
+
+// serializeSubpackets marshals the given subpackets into to.
+func serializeSubpackets(to []byte, subpackets []outputSubpacket, hashed bool) {
+ for _, subpacket := range subpackets {
+ if subpacket.hashed == hashed {
+ n := serializeSubpacketLength(to, len(subpacket.contents)+1)
+ to[n] = byte(subpacket.subpacketType)
+ if subpacket.isCritical {
+ to[n] |= 0x80
+ }
+ to = to[1+n:]
+ n = copy(to, subpacket.contents)
+ to = to[n:]
+ }
+ }
+}
+
+// SigExpired returns whether sig is a signature that has expired or is created
+// in the future.
+func (sig *Signature) SigExpired(currentTime time.Time) bool {
+ if sig.CreationTime.Unix() > currentTime.Unix() {
+ return true
+ }
+ if sig.SigLifetimeSecs == nil || *sig.SigLifetimeSecs == 0 {
+ return false
+ }
+ expiry := sig.CreationTime.Add(time.Duration(*sig.SigLifetimeSecs) * time.Second)
+ return currentTime.Unix() > expiry.Unix()
+}
+
+// buildHashSuffix constructs the HashSuffix member of sig in preparation for signing.
+func (sig *Signature) buildHashSuffix(hashedSubpackets []byte) (err error) {
+ var hashId byte
+ var ok bool
+
+ if sig.Version < 5 {
+ hashId, ok = algorithm.HashToHashIdWithSha1(sig.Hash)
+ } else {
+ hashId, ok = algorithm.HashToHashId(sig.Hash)
+ }
+
+ if !ok {
+ sig.HashSuffix = nil
+ return errors.InvalidArgumentError("hash cannot be represented in OpenPGP: " + strconv.Itoa(int(sig.Hash)))
+ }
+
+ hashedFields := bytes.NewBuffer([]byte{
+ uint8(sig.Version),
+ uint8(sig.SigType),
+ uint8(sig.PubKeyAlgo),
+ uint8(hashId),
+ })
+ hashedSubpacketsLength := len(hashedSubpackets)
+ if sig.Version == 6 {
+ // v6 signatures store the length in 4 octets
+ hashedFields.Write([]byte{
+ uint8(hashedSubpacketsLength >> 24),
+ uint8(hashedSubpacketsLength >> 16),
+ uint8(hashedSubpacketsLength >> 8),
+ uint8(hashedSubpacketsLength),
+ })
+ } else {
+ hashedFields.Write([]byte{
+ uint8(hashedSubpacketsLength >> 8),
+ uint8(hashedSubpacketsLength),
+ })
+ }
+ lenPrefix := hashedFields.Len()
+ hashedFields.Write(hashedSubpackets)
+
+ var l uint64 = uint64(lenPrefix + len(hashedSubpackets))
+ if sig.Version == 5 {
+ // v5 case
+ hashedFields.Write([]byte{0x05, 0xff})
+ hashedFields.Write([]byte{
+ uint8(l >> 56), uint8(l >> 48), uint8(l >> 40), uint8(l >> 32),
+ uint8(l >> 24), uint8(l >> 16), uint8(l >> 8), uint8(l),
+ })
+ } else {
+ // v4 and v6 case
+ hashedFields.Write([]byte{byte(sig.Version), 0xff})
+ hashedFields.Write([]byte{
+ uint8(l >> 24), uint8(l >> 16), uint8(l >> 8), uint8(l),
+ })
+ }
+ sig.HashSuffix = make([]byte, hashedFields.Len())
+ copy(sig.HashSuffix, hashedFields.Bytes())
+ return
+}
+
+func (sig *Signature) signPrepareHash(h hash.Hash) (digest []byte, err error) {
+ hashedSubpacketsLen := subpacketsLength(sig.outSubpackets, true)
+ hashedSubpackets := make([]byte, hashedSubpacketsLen)
+ serializeSubpackets(hashedSubpackets, sig.outSubpackets, true)
+ err = sig.buildHashSuffix(hashedSubpackets)
+ if err != nil {
+ return
+ }
+ if sig.Version == 5 && (sig.SigType == 0x00 || sig.SigType == 0x01) {
+ sig.AddMetadataToHashSuffix()
+ }
+
+ h.Write(sig.HashSuffix)
+ digest = h.Sum(nil)
+ copy(sig.HashTag[:], digest)
+ return
+}
+
+// PrepareSign must be called to create a hash object before Sign for v6 signatures.
+// The created hash object initially hashes a randomly generated salt
+// as required by v6 signatures. The generated salt is stored in sig. If the signature is not v6,
+// the method returns an empty hash object.
+// See RFC 9580 Section 5.2.4.
+func (sig *Signature) PrepareSign(config *Config) (hash.Hash, error) {
+ if !sig.Hash.Available() {
+ return nil, errors.UnsupportedError("hash function")
+ }
+ hasher := sig.Hash.New()
+ if sig.Version == 6 {
+ if sig.salt == nil {
+ var err error
+ sig.salt, err = SignatureSaltForHash(sig.Hash, config.Random())
+ if err != nil {
+ return nil, err
+ }
+ }
+ hasher.Write(sig.salt)
+ }
+ return hasher, nil
+}
+
+// SetSalt sets the signature salt for v6 signatures.
+// Assumes salt is generated correctly and checks if length matches.
+// If the signature is not v6, the method ignores the salt.
+// Use PrepareSign whenever possible instead of generating and
+// hashing the salt externally.
+// See RFC 9580 Section 5.2.4.
+func (sig *Signature) SetSalt(salt []byte) error {
+ if sig.Version == 6 {
+ expectedSaltLength, err := SaltLengthForHash(sig.Hash)
+ if err != nil {
+ return err
+ }
+ if salt == nil || len(salt) != expectedSaltLength {
+ return errors.InvalidArgumentError("unexpected salt size for the given hash algorithm")
+ }
+ sig.salt = salt
+ }
+ return nil
+}
+
+// PrepareVerify must be called to create a hash object before verifying v6 signatures.
+// The created hash object initially hashes the internally stored salt.
+// If the signature is not v6, the method returns an empty hash object.
+// See RFC 9580 Section 5.2.4.
+func (sig *Signature) PrepareVerify() (hash.Hash, error) {
+ if !sig.Hash.Available() {
+ return nil, errors.UnsupportedError("hash function")
+ }
+ hasher := sig.Hash.New()
+ if sig.Version == 6 {
+ if sig.salt == nil {
+ return nil, errors.StructuralError("v6 requires a salt for the hash to be signed")
+ }
+ hasher.Write(sig.salt)
+ }
+ return hasher, nil
+}
+
+// Sign signs a message with a private key. The hash, h, must contain
+// the hash of the message to be signed and will be mutated by this function.
+// On success, the signature is stored in sig. Call Serialize to write it out.
+// If config is nil, sensible defaults will be used.
+func (sig *Signature) Sign(h hash.Hash, priv *PrivateKey, config *Config) (err error) {
+ if priv.Dummy() {
+ return errors.ErrDummyPrivateKey("dummy key found")
+ }
+ sig.Version = priv.PublicKey.Version
+ sig.IssuerFingerprint = priv.PublicKey.Fingerprint
+ if sig.Version < 6 && config.RandomizeSignaturesViaNotation() {
+ sig.removeNotationsWithName(SaltNotationName)
+ salt, err := SignatureSaltForHash(sig.Hash, config.Random())
+ if err != nil {
+ return err
+ }
+ notation := Notation{
+ Name: SaltNotationName,
+ Value: salt,
+ IsCritical: false,
+ IsHumanReadable: false,
+ }
+ sig.Notations = append(sig.Notations, ¬ation)
+ }
+ sig.outSubpackets, err = sig.buildSubpackets(priv.PublicKey, config)
+ if err != nil {
+ return err
+ }
+ digest, err := sig.signPrepareHash(h)
+ if err != nil {
+ return
+ }
+ switch priv.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:
+ // supports both *rsa.PrivateKey and crypto.Signer
+ sigdata, err := priv.PrivateKey.(crypto.Signer).Sign(config.Random(), digest, sig.Hash)
+ if err == nil {
+ sig.RSASignature = encoding.NewMPI(sigdata)
+ }
+ case PubKeyAlgoDSA:
+ dsaPriv := priv.PrivateKey.(*dsa.PrivateKey)
+
+ // Need to truncate hashBytes to match FIPS 186-3 section 4.6.
+ subgroupSize := (dsaPriv.Q.BitLen() + 7) / 8
+ if len(digest) > subgroupSize {
+ digest = digest[:subgroupSize]
+ }
+ r, s, err := dsa.Sign(config.Random(), dsaPriv, digest)
+ if err == nil {
+ sig.DSASigR = new(encoding.MPI).SetBig(r)
+ sig.DSASigS = new(encoding.MPI).SetBig(s)
+ }
+ case PubKeyAlgoECDSA:
+ var r, s *big.Int
+ if sk, ok := priv.PrivateKey.(*ecdsa.PrivateKey); ok {
+ r, s, err = ecdsa.Sign(config.Random(), sk, digest)
+ } else {
+ var b []byte
+ b, err = priv.PrivateKey.(crypto.Signer).Sign(config.Random(), digest, sig.Hash)
+ if err == nil {
+ r, s, err = unwrapECDSASig(b)
+ }
+ }
+
+ if err == nil {
+ sig.ECDSASigR = new(encoding.MPI).SetBig(r)
+ sig.ECDSASigS = new(encoding.MPI).SetBig(s)
+ }
+ case PubKeyAlgoEdDSA:
+ sk := priv.PrivateKey.(*eddsa.PrivateKey)
+ r, s, err := eddsa.Sign(sk, digest)
+ if err == nil {
+ sig.EdDSASigR = encoding.NewMPI(r)
+ sig.EdDSASigS = encoding.NewMPI(s)
+ }
+ case PubKeyAlgoEd25519:
+ sk := priv.PrivateKey.(*ed25519.PrivateKey)
+ signature, err := ed25519.Sign(sk, digest)
+ if err == nil {
+ sig.EdSig = signature
+ }
+ case PubKeyAlgoEd448:
+ sk := priv.PrivateKey.(*ed448.PrivateKey)
+ signature, err := ed448.Sign(sk, digest)
+ if err == nil {
+ sig.EdSig = signature
+ }
+ default:
+ err = errors.UnsupportedError("public key algorithm: " + strconv.Itoa(int(sig.PubKeyAlgo)))
+ }
+
+ return
+}
+
+// unwrapECDSASig parses the two integer components of an ASN.1-encoded ECDSA signature.
+func unwrapECDSASig(b []byte) (r, s *big.Int, err error) {
+ var ecsdaSig struct {
+ R, S *big.Int
+ }
+ _, err = asn1.Unmarshal(b, &ecsdaSig)
+ if err != nil {
+ return
+ }
+ return ecsdaSig.R, ecsdaSig.S, nil
+}
+
+// SignUserId computes a signature from priv, asserting that pub is a valid
+// key for the identity id. On success, the signature is stored in sig. Call
+// Serialize to write it out.
+// If config is nil, sensible defaults will be used.
+func (sig *Signature) SignUserId(id string, pub *PublicKey, priv *PrivateKey, config *Config) error {
+ if priv.Dummy() {
+ return errors.ErrDummyPrivateKey("dummy key found")
+ }
+ prepareHash, err := sig.PrepareSign(config)
+ if err != nil {
+ return err
+ }
+ if err := userIdSignatureHash(id, pub, prepareHash); err != nil {
+ return err
+ }
+ return sig.Sign(prepareHash, priv, config)
+}
+
+// SignDirectKeyBinding computes a signature from priv
+// On success, the signature is stored in sig.
+// Call Serialize to write it out.
+// If config is nil, sensible defaults will be used.
+func (sig *Signature) SignDirectKeyBinding(pub *PublicKey, priv *PrivateKey, config *Config) error {
+ if priv.Dummy() {
+ return errors.ErrDummyPrivateKey("dummy key found")
+ }
+ prepareHash, err := sig.PrepareSign(config)
+ if err != nil {
+ return err
+ }
+ if err := directKeySignatureHash(pub, prepareHash); err != nil {
+ return err
+ }
+ return sig.Sign(prepareHash, priv, config)
+}
+
+// CrossSignKey computes a signature from signingKey on pub hashed using hashKey. On success,
+// the signature is stored in sig. Call Serialize to write it out.
+// If config is nil, sensible defaults will be used.
+func (sig *Signature) CrossSignKey(pub *PublicKey, hashKey *PublicKey, signingKey *PrivateKey,
+ config *Config) error {
+ prepareHash, err := sig.PrepareSign(config)
+ if err != nil {
+ return err
+ }
+ h, err := keySignatureHash(hashKey, pub, prepareHash)
+ if err != nil {
+ return err
+ }
+ return sig.Sign(h, signingKey, config)
+}
+
+// SignKey computes a signature from priv, asserting that pub is a subkey. On
+// success, the signature is stored in sig. Call Serialize to write it out.
+// If config is nil, sensible defaults will be used.
+func (sig *Signature) SignKey(pub *PublicKey, priv *PrivateKey, config *Config) error {
+ if priv.Dummy() {
+ return errors.ErrDummyPrivateKey("dummy key found")
+ }
+ prepareHash, err := sig.PrepareSign(config)
+ if err != nil {
+ return err
+ }
+ h, err := keySignatureHash(&priv.PublicKey, pub, prepareHash)
+ if err != nil {
+ return err
+ }
+ return sig.Sign(h, priv, config)
+}
+
+// RevokeKey computes a revocation signature of pub using priv. On success, the signature is
+// stored in sig. Call Serialize to write it out.
+// If config is nil, sensible defaults will be used.
+func (sig *Signature) RevokeKey(pub *PublicKey, priv *PrivateKey, config *Config) error {
+ prepareHash, err := sig.PrepareSign(config)
+ if err != nil {
+ return err
+ }
+ if err := keyRevocationHash(pub, prepareHash); err != nil {
+ return err
+ }
+ return sig.Sign(prepareHash, priv, config)
+}
+
+// RevokeSubkey computes a subkey revocation signature of pub using priv.
+// On success, the signature is stored in sig. Call Serialize to write it out.
+// If config is nil, sensible defaults will be used.
+func (sig *Signature) RevokeSubkey(pub *PublicKey, priv *PrivateKey, config *Config) error {
+ // Identical to a subkey binding signature
+ return sig.SignKey(pub, priv, config)
+}
+
+// Serialize marshals sig to w. Sign, SignUserId or SignKey must have been
+// called first.
+func (sig *Signature) Serialize(w io.Writer) (err error) {
+ if len(sig.outSubpackets) == 0 {
+ sig.outSubpackets = sig.rawSubpackets
+ }
+ if sig.RSASignature == nil && sig.DSASigR == nil && sig.ECDSASigR == nil && sig.EdDSASigR == nil && sig.EdSig == nil {
+ return errors.InvalidArgumentError("Signature: need to call Sign, SignUserId or SignKey before Serialize")
+ }
+
+ sigLength := 0
+ switch sig.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:
+ sigLength = int(sig.RSASignature.EncodedLength())
+ case PubKeyAlgoDSA:
+ sigLength = int(sig.DSASigR.EncodedLength())
+ sigLength += int(sig.DSASigS.EncodedLength())
+ case PubKeyAlgoECDSA:
+ sigLength = int(sig.ECDSASigR.EncodedLength())
+ sigLength += int(sig.ECDSASigS.EncodedLength())
+ case PubKeyAlgoEdDSA:
+ sigLength = int(sig.EdDSASigR.EncodedLength())
+ sigLength += int(sig.EdDSASigS.EncodedLength())
+ case PubKeyAlgoEd25519:
+ sigLength = ed25519.SignatureSize
+ case PubKeyAlgoEd448:
+ sigLength = ed448.SignatureSize
+ default:
+ panic("impossible")
+ }
+
+ hashedSubpacketsLen := subpacketsLength(sig.outSubpackets, true)
+ unhashedSubpacketsLen := subpacketsLength(sig.outSubpackets, false)
+ length := 4 + /* length of version|signature type|public-key algorithm|hash algorithm */
+ 2 /* length of hashed subpackets */ + hashedSubpacketsLen +
+ 2 /* length of unhashed subpackets */ + unhashedSubpacketsLen +
+ 2 /* hash tag */ + sigLength
+ if sig.Version == 6 {
+ length += 4 + /* the two length fields are four-octet instead of two */
+ 1 + /* salt length */
+ len(sig.salt) /* length salt */
+ }
+ err = serializeHeader(w, packetTypeSignature, length)
+ if err != nil {
+ return
+ }
+ err = sig.serializeBody(w)
+ if err != nil {
+ return err
+ }
+ return
+}
+
+func (sig *Signature) serializeBody(w io.Writer) (err error) {
+ var fields []byte
+ if sig.Version == 6 {
+ // v6 signatures use 4 octets for length
+ hashedSubpacketsLen :=
+ uint32(uint32(sig.HashSuffix[4])<<24) |
+ uint32(uint32(sig.HashSuffix[5])<<16) |
+ uint32(uint32(sig.HashSuffix[6])<<8) |
+ uint32(sig.HashSuffix[7])
+ fields = sig.HashSuffix[:8+hashedSubpacketsLen]
+ } else {
+ hashedSubpacketsLen := uint16(uint16(sig.HashSuffix[4])<<8) |
+ uint16(sig.HashSuffix[5])
+ fields = sig.HashSuffix[:6+hashedSubpacketsLen]
+
+ }
+ _, err = w.Write(fields)
+ if err != nil {
+ return
+ }
+
+ unhashedSubpacketsLen := subpacketsLength(sig.outSubpackets, false)
+ var unhashedSubpackets []byte
+ if sig.Version == 6 {
+ unhashedSubpackets = make([]byte, 4+unhashedSubpacketsLen)
+ unhashedSubpackets[0] = byte(unhashedSubpacketsLen >> 24)
+ unhashedSubpackets[1] = byte(unhashedSubpacketsLen >> 16)
+ unhashedSubpackets[2] = byte(unhashedSubpacketsLen >> 8)
+ unhashedSubpackets[3] = byte(unhashedSubpacketsLen)
+ serializeSubpackets(unhashedSubpackets[4:], sig.outSubpackets, false)
+ } else {
+ unhashedSubpackets = make([]byte, 2+unhashedSubpacketsLen)
+ unhashedSubpackets[0] = byte(unhashedSubpacketsLen >> 8)
+ unhashedSubpackets[1] = byte(unhashedSubpacketsLen)
+ serializeSubpackets(unhashedSubpackets[2:], sig.outSubpackets, false)
+ }
+
+ _, err = w.Write(unhashedSubpackets)
+ if err != nil {
+ return
+ }
+ _, err = w.Write(sig.HashTag[:])
+ if err != nil {
+ return
+ }
+
+ if sig.Version == 6 {
+ // write salt for v6 signatures
+ _, err = w.Write([]byte{uint8(len(sig.salt))})
+ if err != nil {
+ return
+ }
+ _, err = w.Write(sig.salt)
+ if err != nil {
+ return
+ }
+ }
+
+ switch sig.PubKeyAlgo {
+ case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly:
+ _, err = w.Write(sig.RSASignature.EncodedBytes())
+ case PubKeyAlgoDSA:
+ if _, err = w.Write(sig.DSASigR.EncodedBytes()); err != nil {
+ return
+ }
+ _, err = w.Write(sig.DSASigS.EncodedBytes())
+ case PubKeyAlgoECDSA:
+ if _, err = w.Write(sig.ECDSASigR.EncodedBytes()); err != nil {
+ return
+ }
+ _, err = w.Write(sig.ECDSASigS.EncodedBytes())
+ case PubKeyAlgoEdDSA:
+ if _, err = w.Write(sig.EdDSASigR.EncodedBytes()); err != nil {
+ return
+ }
+ _, err = w.Write(sig.EdDSASigS.EncodedBytes())
+ case PubKeyAlgoEd25519:
+ err = ed25519.WriteSignature(w, sig.EdSig)
+ case PubKeyAlgoEd448:
+ err = ed448.WriteSignature(w, sig.EdSig)
+ default:
+ panic("impossible")
+ }
+ return
+}
+
+// outputSubpacket represents a subpacket to be marshaled.
+type outputSubpacket struct {
+ hashed bool // true if this subpacket is in the hashed area.
+ subpacketType signatureSubpacketType
+ isCritical bool
+ contents []byte
+}
+
+func (sig *Signature) buildSubpackets(issuer PublicKey, config *Config) (subpackets []outputSubpacket, err error) {
+ creationTime := make([]byte, 4)
+ binary.BigEndian.PutUint32(creationTime, uint32(sig.CreationTime.Unix()))
+ // Signature Creation Time
+ subpackets = append(subpackets, outputSubpacket{true, creationTimeSubpacket, !config.GenerateNonCriticalSignatureCreationTime(), creationTime})
+ // Signature Expiration Time
+ if sig.SigLifetimeSecs != nil && *sig.SigLifetimeSecs != 0 {
+ sigLifetime := make([]byte, 4)
+ binary.BigEndian.PutUint32(sigLifetime, *sig.SigLifetimeSecs)
+ subpackets = append(subpackets, outputSubpacket{true, signatureExpirationSubpacket, true, sigLifetime})
+ }
+ // Trust Signature
+ if sig.TrustLevel != 0 {
+ subpackets = append(subpackets, outputSubpacket{true, trustSubpacket, true, []byte{byte(sig.TrustLevel), byte(sig.TrustAmount)}})
+ }
+ // Regular Expression
+ if sig.TrustRegularExpression != nil {
+ // RFC specifies the string should be null-terminated; add a null byte to the end
+ subpackets = append(subpackets, outputSubpacket{true, regularExpressionSubpacket, true, []byte(*sig.TrustRegularExpression + "\000")})
+ }
+ // Key Expiration Time
+ if sig.KeyLifetimeSecs != nil && *sig.KeyLifetimeSecs != 0 {
+ keyLifetime := make([]byte, 4)
+ binary.BigEndian.PutUint32(keyLifetime, *sig.KeyLifetimeSecs)
+ subpackets = append(subpackets, outputSubpacket{true, keyExpirationSubpacket, true, keyLifetime})
+ }
+ // Preferred Symmetric Ciphers for v1 SEIPD
+ if len(sig.PreferredSymmetric) > 0 {
+ subpackets = append(subpackets, outputSubpacket{true, prefSymmetricAlgosSubpacket, false, sig.PreferredSymmetric})
+ }
+ // Issuer Key ID
+ if sig.IssuerKeyId != nil && sig.Version == 4 {
+ keyId := make([]byte, 8)
+ binary.BigEndian.PutUint64(keyId, *sig.IssuerKeyId)
+ // Note: making this critical breaks RPM <=4.16.
+ // See: https://github.com/ProtonMail/go-crypto/issues/263
+ subpackets = append(subpackets, outputSubpacket{true, issuerSubpacket, false, keyId})
+ }
+ // Notation Data
+ for _, notation := range sig.Notations {
+ subpackets = append(
+ subpackets,
+ outputSubpacket{
+ true,
+ notationDataSubpacket,
+ notation.IsCritical,
+ notation.getData(),
+ })
+ }
+ // Preferred Hash Algorithms
+ if len(sig.PreferredHash) > 0 {
+ subpackets = append(subpackets, outputSubpacket{true, prefHashAlgosSubpacket, false, sig.PreferredHash})
+ }
+ // Preferred Compression Algorithms
+ if len(sig.PreferredCompression) > 0 {
+ subpackets = append(subpackets, outputSubpacket{true, prefCompressionSubpacket, false, sig.PreferredCompression})
+ }
+ // Keyserver Preferences
+ // Keyserver preferences may only appear in self-signatures or certification signatures.
+ if sig.KeyserverPrefsValid {
+ var prefs byte
+ if sig.KeyserverPrefNoModify {
+ prefs |= KeyserverPrefNoModify
+ }
+ subpackets = append(subpackets, outputSubpacket{true, keyserverPrefsSubpacket, false, []byte{prefs}})
+ }
+ // Preferred Keyserver
+ if len(sig.PreferredKeyserver) > 0 {
+ subpackets = append(subpackets, outputSubpacket{true, prefKeyserverSubpacket, false, []uint8(sig.PreferredKeyserver)})
+ }
+ // Primary User ID
+ if sig.IsPrimaryId != nil && *sig.IsPrimaryId {
+ subpackets = append(subpackets, outputSubpacket{true, primaryUserIdSubpacket, false, []byte{1}})
+ }
+ // Policy URI
+ if len(sig.PolicyURI) > 0 {
+ subpackets = append(subpackets, outputSubpacket{true, policyUriSubpacket, false, []uint8(sig.PolicyURI)})
+ }
+ // Key Flags
+ // Key flags may only appear in self-signatures or certification signatures.
+ if sig.FlagsValid {
+ var flags byte
+ if sig.FlagCertify {
+ flags |= KeyFlagCertify
+ }
+ if sig.FlagSign {
+ flags |= KeyFlagSign
+ }
+ if sig.FlagEncryptCommunications {
+ flags |= KeyFlagEncryptCommunications
+ }
+ if sig.FlagEncryptStorage {
+ flags |= KeyFlagEncryptStorage
+ }
+ if sig.FlagSplitKey {
+ flags |= KeyFlagSplitKey
+ }
+ if sig.FlagAuthenticate {
+ flags |= KeyFlagAuthenticate
+ }
+ if sig.FlagGroupKey {
+ flags |= KeyFlagGroupKey
+ }
+ subpackets = append(subpackets, outputSubpacket{true, keyFlagsSubpacket, !config.GenerateNonCriticalKeyFlags(), []byte{flags}})
+ }
+ // Signer's User ID
+ if sig.SignerUserId != nil {
+ subpackets = append(subpackets, outputSubpacket{true, signerUserIdSubpacket, false, []byte(*sig.SignerUserId)})
+ }
+ // Reason for Revocation
+ // Revocation reason appears only in revocation signatures and is serialized as per section 5.2.3.31.
+ if sig.RevocationReason != nil {
+ subpackets = append(subpackets, outputSubpacket{true, reasonForRevocationSubpacket, true,
+ append([]uint8{uint8(*sig.RevocationReason)}, []uint8(sig.RevocationReasonText)...)})
+ }
+ // Features
+ var features = byte(0x00)
+ if sig.SEIPDv1 {
+ features |= 0x01
+ }
+ if sig.SEIPDv2 {
+ features |= 0x08
+ }
+ if features != 0x00 {
+ subpackets = append(subpackets, outputSubpacket{true, featuresSubpacket, false, []byte{features}})
+ }
+ // Embedded Signature
+ // EmbeddedSignature appears only in subkeys capable of signing and is serialized as per section 5.2.3.34.
+ if sig.EmbeddedSignature != nil {
+ var buf bytes.Buffer
+ err = sig.EmbeddedSignature.serializeBody(&buf)
+ if err != nil {
+ return
+ }
+ subpackets = append(subpackets, outputSubpacket{true, embeddedSignatureSubpacket, true, buf.Bytes()})
+ }
+ // Issuer Fingerprint
+ if sig.IssuerFingerprint != nil {
+ contents := append([]uint8{uint8(issuer.Version)}, sig.IssuerFingerprint...)
+ subpackets = append(subpackets, outputSubpacket{true, issuerFingerprintSubpacket, sig.Version >= 5, contents})
+ }
+ // Intended Recipient Fingerprint
+ for _, recipient := range sig.IntendedRecipients {
+ subpackets = append(
+ subpackets,
+ outputSubpacket{
+ true,
+ intendedRecipientSubpacket,
+ false,
+ recipient.Serialize(),
+ })
+ }
+ // Preferred AEAD Ciphersuites
+ if len(sig.PreferredCipherSuites) > 0 {
+ serialized := make([]byte, len(sig.PreferredCipherSuites)*2)
+ for i, cipherSuite := range sig.PreferredCipherSuites {
+ serialized[2*i] = cipherSuite[0]
+ serialized[2*i+1] = cipherSuite[1]
+ }
+ subpackets = append(subpackets, outputSubpacket{true, prefCipherSuitesSubpacket, false, serialized})
+ }
+ return
+}
+
+// AddMetadataToHashSuffix modifies the current hash suffix to include metadata
+// (format, filename, and time). Version 5 keys protect this data including it
+// in the hash computation. See section 5.2.4.
+func (sig *Signature) AddMetadataToHashSuffix() {
+ if sig == nil || sig.Version != 5 {
+ return
+ }
+ if sig.SigType != 0x00 && sig.SigType != 0x01 {
+ return
+ }
+ lit := sig.Metadata
+ if lit == nil {
+ // This will translate into six 0x00 bytes.
+ lit = &LiteralData{}
+ }
+
+ // Extract the current byte count
+ n := sig.HashSuffix[len(sig.HashSuffix)-8:]
+ l := uint64(
+ uint64(n[0])<<56 | uint64(n[1])<<48 | uint64(n[2])<<40 | uint64(n[3])<<32 |
+ uint64(n[4])<<24 | uint64(n[5])<<16 | uint64(n[6])<<8 | uint64(n[7]))
+
+ suffix := bytes.NewBuffer(nil)
+ suffix.Write(sig.HashSuffix[:l])
+
+ // Add the metadata
+ var buf [4]byte
+ buf[0] = lit.Format
+ fileName := lit.FileName
+ if len(lit.FileName) > 255 {
+ fileName = fileName[:255]
+ }
+ buf[1] = byte(len(fileName))
+ suffix.Write(buf[:2])
+ suffix.Write([]byte(lit.FileName))
+ binary.BigEndian.PutUint32(buf[:], lit.Time)
+ suffix.Write(buf[:])
+
+ suffix.Write([]byte{0x05, 0xff})
+ suffix.Write([]byte{
+ uint8(l >> 56), uint8(l >> 48), uint8(l >> 40), uint8(l >> 32),
+ uint8(l >> 24), uint8(l >> 16), uint8(l >> 8), uint8(l),
+ })
+ sig.HashSuffix = suffix.Bytes()
+}
+
+// SaltLengthForHash selects the required salt length for the given hash algorithm,
+// as per Table 23 (Hash algorithm registry) of the crypto refresh.
+// See RFC 9580 Section 9.5.
+func SaltLengthForHash(hash crypto.Hash) (int, error) {
+ switch hash {
+ case crypto.SHA256, crypto.SHA224, crypto.SHA3_256:
+ return 16, nil
+ case crypto.SHA384:
+ return 24, nil
+ case crypto.SHA512, crypto.SHA3_512:
+ return 32, nil
+ default:
+ return 0, errors.UnsupportedError("hash function not supported for V6 signatures")
+ }
+}
+
+// SignatureSaltForHash generates a random signature salt
+// with the length for the given hash algorithm.
+// See RFC 9580 Section 9.5.
+func SignatureSaltForHash(hash crypto.Hash, randReader io.Reader) ([]byte, error) {
+ saltLength, err := SaltLengthForHash(hash)
+ if err != nil {
+ return nil, err
+ }
+ salt := make([]byte, saltLength)
+ _, err = io.ReadFull(randReader, salt)
+ if err != nil {
+ return nil, err
+ }
+ return salt, nil
+}
+
+// removeNotationsWithName removes all notations in this signature with the given name.
+func (sig *Signature) removeNotationsWithName(name string) {
+ if sig == nil || sig.Notations == nil {
+ return
+ }
+ updatedNotations := make([]*Notation, 0, len(sig.Notations))
+ for _, notation := range sig.Notations {
+ if notation.Name != name {
+ updatedNotations = append(updatedNotations, notation)
+ }
+ }
+ sig.Notations = updatedNotations
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetric_key_encrypted.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetric_key_encrypted.go
new file mode 100644
index 0000000000..2812a1db88
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetric_key_encrypted.go
@@ -0,0 +1,331 @@
+// 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 packet
+
+import (
+ "bytes"
+ "crypto/cipher"
+ "crypto/sha256"
+ "io"
+ "strconv"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "github.com/ProtonMail/go-crypto/openpgp/s2k"
+ "golang.org/x/crypto/hkdf"
+)
+
+// This is the largest session key that we'll support. Since at most 256-bit cipher
+// is supported in OpenPGP, this is large enough to contain also the auth tag.
+const maxSessionKeySizeInBytes = 64
+
+// SymmetricKeyEncrypted represents a passphrase protected session key. See RFC
+// 4880, section 5.3.
+type SymmetricKeyEncrypted struct {
+ Version int
+ CipherFunc CipherFunction
+ Mode AEADMode
+ s2k func(out, in []byte)
+ iv []byte
+ encryptedKey []byte // Contains also the authentication tag for AEAD
+}
+
+// parse parses an SymmetricKeyEncrypted packet as specified in
+// https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#name-symmetric-key-encrypted-ses
+func (ske *SymmetricKeyEncrypted) parse(r io.Reader) error {
+ var buf [1]byte
+
+ // Version
+ if _, err := readFull(r, buf[:]); err != nil {
+ return err
+ }
+ ske.Version = int(buf[0])
+ if ske.Version != 4 && ske.Version != 5 && ske.Version != 6 {
+ return errors.UnsupportedError("unknown SymmetricKeyEncrypted version")
+ }
+
+ if V5Disabled && ske.Version == 5 {
+ return errors.UnsupportedError("support for parsing v5 entities is disabled; build with `-tags v5` if needed")
+ }
+
+ if ske.Version > 5 {
+ // Scalar octet count
+ if _, err := readFull(r, buf[:]); err != nil {
+ return err
+ }
+ }
+
+ // Cipher function
+ if _, err := readFull(r, buf[:]); err != nil {
+ return err
+ }
+ ske.CipherFunc = CipherFunction(buf[0])
+ if !ske.CipherFunc.IsSupported() {
+ return errors.UnsupportedError("unknown cipher: " + strconv.Itoa(int(buf[0])))
+ }
+
+ if ske.Version >= 5 {
+ // AEAD mode
+ if _, err := readFull(r, buf[:]); err != nil {
+ return errors.StructuralError("cannot read AEAD octet from packet")
+ }
+ ske.Mode = AEADMode(buf[0])
+ }
+
+ if ske.Version > 5 {
+ // Scalar octet count
+ if _, err := readFull(r, buf[:]); err != nil {
+ return err
+ }
+ }
+
+ var err error
+ if ske.s2k, err = s2k.Parse(r); err != nil {
+ if _, ok := err.(errors.ErrDummyPrivateKey); ok {
+ return errors.UnsupportedError("missing key GNU extension in session key")
+ }
+ return err
+ }
+
+ if ske.Version >= 5 {
+ // AEAD IV
+ iv := make([]byte, ske.Mode.IvLength())
+ _, err := readFull(r, iv)
+ if err != nil {
+ return errors.StructuralError("cannot read AEAD IV")
+ }
+
+ ske.iv = iv
+ }
+
+ encryptedKey := make([]byte, maxSessionKeySizeInBytes)
+ // The session key may follow. We just have to try and read to find
+ // out. If it exists then we limit it to maxSessionKeySizeInBytes.
+ n, err := readFull(r, encryptedKey)
+ if err != nil && err != io.ErrUnexpectedEOF {
+ return err
+ }
+
+ if n != 0 {
+ if n == maxSessionKeySizeInBytes {
+ return errors.UnsupportedError("oversized encrypted session key")
+ }
+ ske.encryptedKey = encryptedKey[:n]
+ }
+ return nil
+}
+
+// Decrypt attempts to decrypt an encrypted session key and returns the key and
+// the cipher to use when decrypting a subsequent Symmetrically Encrypted Data
+// packet.
+func (ske *SymmetricKeyEncrypted) Decrypt(passphrase []byte) ([]byte, CipherFunction, error) {
+ key := make([]byte, ske.CipherFunc.KeySize())
+ ske.s2k(key, passphrase)
+ if len(ske.encryptedKey) == 0 {
+ return key, ske.CipherFunc, nil
+ }
+ switch ske.Version {
+ case 4:
+ plaintextKey, cipherFunc, err := ske.decryptV4(key)
+ return plaintextKey, cipherFunc, err
+ case 5, 6:
+ plaintextKey, err := ske.aeadDecrypt(ske.Version, key)
+ return plaintextKey, CipherFunction(0), err
+ }
+ err := errors.UnsupportedError("unknown SymmetricKeyEncrypted version")
+ return nil, CipherFunction(0), err
+}
+
+func (ske *SymmetricKeyEncrypted) decryptV4(key []byte) ([]byte, CipherFunction, error) {
+ // the IV is all zeros
+ iv := make([]byte, ske.CipherFunc.blockSize())
+ c := cipher.NewCFBDecrypter(ske.CipherFunc.new(key), iv)
+ plaintextKey := make([]byte, len(ske.encryptedKey))
+ c.XORKeyStream(plaintextKey, ske.encryptedKey)
+ cipherFunc := CipherFunction(plaintextKey[0])
+ if cipherFunc.blockSize() == 0 {
+ return nil, ske.CipherFunc, errors.UnsupportedError(
+ "unknown cipher: " + strconv.Itoa(int(cipherFunc)))
+ }
+ plaintextKey = plaintextKey[1:]
+ if len(plaintextKey) != cipherFunc.KeySize() {
+ return nil, cipherFunc, errors.StructuralError(
+ "length of decrypted key not equal to cipher keysize")
+ }
+ return plaintextKey, cipherFunc, nil
+}
+
+func (ske *SymmetricKeyEncrypted) aeadDecrypt(version int, key []byte) ([]byte, error) {
+ adata := []byte{0xc3, byte(version), byte(ske.CipherFunc), byte(ske.Mode)}
+ aead := getEncryptedKeyAeadInstance(ske.CipherFunc, ske.Mode, key, adata, version)
+
+ plaintextKey, err := aead.Open(nil, ske.iv, ske.encryptedKey, adata)
+ if err != nil {
+ return nil, err
+ }
+ return plaintextKey, nil
+}
+
+// SerializeSymmetricKeyEncrypted serializes a symmetric key packet to w.
+// The packet contains a random session key, encrypted by a key derived from
+// the given passphrase. The session key is returned and must be passed to
+// SerializeSymmetricallyEncrypted.
+// If config is nil, sensible defaults will be used.
+func SerializeSymmetricKeyEncrypted(w io.Writer, passphrase []byte, config *Config) (key []byte, err error) {
+ cipherFunc := config.Cipher()
+
+ sessionKey := make([]byte, cipherFunc.KeySize())
+ _, err = io.ReadFull(config.Random(), sessionKey)
+ if err != nil {
+ return
+ }
+
+ err = SerializeSymmetricKeyEncryptedReuseKey(w, sessionKey, passphrase, config)
+ if err != nil {
+ return
+ }
+
+ key = sessionKey
+ return
+}
+
+// SerializeSymmetricKeyEncryptedReuseKey serializes a symmetric key packet to w.
+// The packet contains the given session key, encrypted by a key derived from
+// the given passphrase. The returned session key must be passed to
+// SerializeSymmetricallyEncrypted.
+// If config is nil, sensible defaults will be used.
+// Deprecated: Use SerializeSymmetricKeyEncryptedAEADReuseKey instead.
+func SerializeSymmetricKeyEncryptedReuseKey(w io.Writer, sessionKey []byte, passphrase []byte, config *Config) (err error) {
+ return SerializeSymmetricKeyEncryptedAEADReuseKey(w, sessionKey, passphrase, config.AEAD() != nil, config)
+}
+
+// SerializeSymmetricKeyEncryptedAEADReuseKey serializes a symmetric key packet to w.
+// The packet contains the given session key, encrypted by a key derived from
+// the given passphrase. The returned session key must be passed to
+// SerializeSymmetricallyEncrypted.
+// If aeadSupported is set, SKESK v6 is used, otherwise v4.
+// Note: aeadSupported MUST match the value passed to SerializeSymmetricallyEncrypted.
+// If config is nil, sensible defaults will be used.
+func SerializeSymmetricKeyEncryptedAEADReuseKey(w io.Writer, sessionKey []byte, passphrase []byte, aeadSupported bool, config *Config) (err error) {
+ var version int
+ if aeadSupported {
+ version = 6
+ } else {
+ version = 4
+ }
+ cipherFunc := config.Cipher()
+ // cipherFunc must be AES
+ if !cipherFunc.IsSupported() || cipherFunc < CipherAES128 || cipherFunc > CipherAES256 {
+ return errors.UnsupportedError("unsupported cipher: " + strconv.Itoa(int(cipherFunc)))
+ }
+
+ keySize := cipherFunc.KeySize()
+ s2kBuf := new(bytes.Buffer)
+ keyEncryptingKey := make([]byte, keySize)
+ // s2k.Serialize salts and stretches the passphrase, and writes the
+ // resulting key to keyEncryptingKey and the s2k descriptor to s2kBuf.
+ err = s2k.Serialize(s2kBuf, keyEncryptingKey, config.Random(), passphrase, config.S2K())
+ if err != nil {
+ return
+ }
+ s2kBytes := s2kBuf.Bytes()
+
+ var packetLength int
+ switch version {
+ case 4:
+ packetLength = 2 /* header */ + len(s2kBytes) + 1 /* cipher type */ + keySize
+ case 5, 6:
+ ivLen := config.AEAD().Mode().IvLength()
+ tagLen := config.AEAD().Mode().TagLength()
+ packetLength = 3 + len(s2kBytes) + ivLen + keySize + tagLen
+ }
+ if version > 5 {
+ packetLength += 2 // additional octet count fields
+ }
+
+ err = serializeHeader(w, packetTypeSymmetricKeyEncrypted, packetLength)
+ if err != nil {
+ return
+ }
+
+ // Symmetric Key Encrypted Version
+ buf := []byte{byte(version)}
+
+ if version > 5 {
+ // Scalar octet count
+ buf = append(buf, byte(3+len(s2kBytes)+config.AEAD().Mode().IvLength()))
+ }
+
+ // Cipher function
+ buf = append(buf, byte(cipherFunc))
+
+ if version >= 5 {
+ // AEAD mode
+ buf = append(buf, byte(config.AEAD().Mode()))
+ }
+ if version > 5 {
+ // Scalar octet count
+ buf = append(buf, byte(len(s2kBytes)))
+ }
+ _, err = w.Write(buf)
+ if err != nil {
+ return
+ }
+ _, err = w.Write(s2kBytes)
+ if err != nil {
+ return
+ }
+
+ switch version {
+ case 4:
+ iv := make([]byte, cipherFunc.blockSize())
+ c := cipher.NewCFBEncrypter(cipherFunc.new(keyEncryptingKey), iv)
+ encryptedCipherAndKey := make([]byte, keySize+1)
+ c.XORKeyStream(encryptedCipherAndKey, buf[1:])
+ c.XORKeyStream(encryptedCipherAndKey[1:], sessionKey)
+ _, err = w.Write(encryptedCipherAndKey)
+ if err != nil {
+ return
+ }
+ case 5, 6:
+ mode := config.AEAD().Mode()
+ adata := []byte{0xc3, byte(version), byte(cipherFunc), byte(mode)}
+ aead := getEncryptedKeyAeadInstance(cipherFunc, mode, keyEncryptingKey, adata, version)
+
+ // Sample iv using random reader
+ iv := make([]byte, config.AEAD().Mode().IvLength())
+ _, err = io.ReadFull(config.Random(), iv)
+ if err != nil {
+ return
+ }
+ // Seal and write (encryptedData includes auth. tag)
+
+ encryptedData := aead.Seal(nil, iv, sessionKey, adata)
+ _, err = w.Write(iv)
+ if err != nil {
+ return
+ }
+ _, err = w.Write(encryptedData)
+ if err != nil {
+ return
+ }
+ }
+
+ return
+}
+
+func getEncryptedKeyAeadInstance(c CipherFunction, mode AEADMode, inputKey, associatedData []byte, version int) (aead cipher.AEAD) {
+ var blockCipher cipher.Block
+ if version > 5 {
+ hkdfReader := hkdf.New(sha256.New, inputKey, []byte{}, associatedData)
+
+ encryptionKey := make([]byte, c.KeySize())
+ _, _ = readFull(hkdfReader, encryptionKey)
+
+ blockCipher = c.new(encryptionKey)
+ } else {
+ blockCipher = c.new(inputKey)
+ }
+ return mode.new(blockCipher)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted.go
new file mode 100644
index 0000000000..0e898742cf
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted.go
@@ -0,0 +1,94 @@
+// 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 packet
+
+import (
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+)
+
+const aeadSaltSize = 32
+
+// SymmetricallyEncrypted represents a symmetrically encrypted byte string. The
+// encrypted Contents will consist of more OpenPGP packets. See RFC 4880,
+// sections 5.7 and 5.13.
+type SymmetricallyEncrypted struct {
+ Version int
+ Contents io.Reader // contains tag for version 2
+ IntegrityProtected bool // If true it is type 18 (with MDC or AEAD). False is packet type 9
+
+ // Specific to version 1
+ prefix []byte
+
+ // Specific to version 2
+ Cipher CipherFunction
+ Mode AEADMode
+ ChunkSizeByte byte
+ Salt [aeadSaltSize]byte
+}
+
+const (
+ symmetricallyEncryptedVersionMdc = 1
+ symmetricallyEncryptedVersionAead = 2
+)
+
+func (se *SymmetricallyEncrypted) parse(r io.Reader) error {
+ if se.IntegrityProtected {
+ // See RFC 4880, section 5.13.
+ var buf [1]byte
+ _, err := readFull(r, buf[:])
+ if err != nil {
+ return err
+ }
+
+ switch buf[0] {
+ case symmetricallyEncryptedVersionMdc:
+ se.Version = symmetricallyEncryptedVersionMdc
+ case symmetricallyEncryptedVersionAead:
+ se.Version = symmetricallyEncryptedVersionAead
+ if err := se.parseAead(r); err != nil {
+ return err
+ }
+ default:
+ return errors.UnsupportedError("unknown SymmetricallyEncrypted version")
+ }
+ }
+ se.Contents = r
+ return nil
+}
+
+// Decrypt returns a ReadCloser, from which the decrypted Contents of the
+// packet can be read. An incorrect key will only be detected after trying
+// to decrypt the entire data.
+func (se *SymmetricallyEncrypted) Decrypt(c CipherFunction, key []byte) (io.ReadCloser, error) {
+ if se.Version == symmetricallyEncryptedVersionAead {
+ return se.decryptAead(key)
+ }
+
+ return se.decryptMdc(c, key)
+}
+
+// SerializeSymmetricallyEncrypted serializes a symmetrically encrypted packet
+// to w and returns a WriteCloser to which the to-be-encrypted packets can be
+// written.
+// If aeadSupported is set to true, SEIPDv2 is used with the indicated CipherSuite.
+// Otherwise, SEIPDv1 is used with the indicated CipherFunction.
+// Note: aeadSupported MUST match the value passed to SerializeEncryptedKeyAEAD
+// and/or SerializeSymmetricKeyEncryptedAEADReuseKey.
+// If config is nil, sensible defaults will be used.
+func SerializeSymmetricallyEncrypted(w io.Writer, c CipherFunction, aeadSupported bool, cipherSuite CipherSuite, key []byte, config *Config) (Contents io.WriteCloser, err error) {
+ writeCloser := noOpCloser{w}
+ ciphertext, err := serializeStreamHeader(writeCloser, packetTypeSymmetricallyEncryptedIntegrityProtected)
+ if err != nil {
+ return
+ }
+
+ if aeadSupported {
+ return serializeSymmetricallyEncryptedAead(ciphertext, cipherSuite, config.AEADConfig.ChunkSizeByte(), config.Random(), key)
+ }
+
+ return serializeSymmetricallyEncryptedMdc(ciphertext, c, key, config)
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_aead.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_aead.go
new file mode 100644
index 0000000000..3ddc4fe4a9
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_aead.go
@@ -0,0 +1,168 @@
+// Copyright 2023 Proton AG. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package packet
+
+import (
+ "crypto/cipher"
+ "crypto/sha256"
+ "fmt"
+ "io"
+ "strconv"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "golang.org/x/crypto/hkdf"
+)
+
+// parseAead parses a V2 SEIPD packet (AEAD) as specified in
+// https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-5.13.2
+func (se *SymmetricallyEncrypted) parseAead(r io.Reader) error {
+ headerData := make([]byte, 3)
+ if n, err := io.ReadFull(r, headerData); n < 3 {
+ return errors.StructuralError("could not read aead header: " + err.Error())
+ }
+
+ // Cipher
+ se.Cipher = CipherFunction(headerData[0])
+ // cipherFunc must have block size 16 to use AEAD
+ if se.Cipher.blockSize() != 16 {
+ return errors.UnsupportedError("invalid aead cipher: " + strconv.Itoa(int(se.Cipher)))
+ }
+
+ // Mode
+ se.Mode = AEADMode(headerData[1])
+ if se.Mode.TagLength() == 0 {
+ return errors.UnsupportedError("unknown aead mode: " + strconv.Itoa(int(se.Mode)))
+ }
+
+ // Chunk size
+ se.ChunkSizeByte = headerData[2]
+ if se.ChunkSizeByte > 16 {
+ return errors.UnsupportedError("invalid aead chunk size byte: " + strconv.Itoa(int(se.ChunkSizeByte)))
+ }
+
+ // Salt
+ if n, err := io.ReadFull(r, se.Salt[:]); n < aeadSaltSize {
+ return errors.StructuralError("could not read aead salt: " + err.Error())
+ }
+
+ return nil
+}
+
+// associatedData for chunks: tag, version, cipher, mode, chunk size byte
+func (se *SymmetricallyEncrypted) associatedData() []byte {
+ return []byte{
+ 0xD2,
+ symmetricallyEncryptedVersionAead,
+ byte(se.Cipher),
+ byte(se.Mode),
+ se.ChunkSizeByte,
+ }
+}
+
+// decryptAead decrypts a V2 SEIPD packet (AEAD) as specified in
+// https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-5.13.2
+func (se *SymmetricallyEncrypted) decryptAead(inputKey []byte) (io.ReadCloser, error) {
+ if se.Cipher.KeySize() != len(inputKey) {
+ return nil, errors.StructuralError(fmt.Sprintf("invalid session key length for cipher: got %d bytes, but expected %d bytes", len(inputKey), se.Cipher.KeySize()))
+ }
+
+ aead, nonce := getSymmetricallyEncryptedAeadInstance(se.Cipher, se.Mode, inputKey, se.Salt[:], se.associatedData())
+ // Carry the first tagLen bytes
+ chunkSize := decodeAEADChunkSize(se.ChunkSizeByte)
+ tagLen := se.Mode.TagLength()
+ chunkBytes := make([]byte, chunkSize+tagLen*2)
+ peekedBytes := chunkBytes[chunkSize+tagLen:]
+ n, err := io.ReadFull(se.Contents, peekedBytes)
+ if n < tagLen || (err != nil && err != io.EOF) {
+ return nil, errors.StructuralError("not enough data to decrypt:" + err.Error())
+ }
+
+ return &aeadDecrypter{
+ aeadCrypter: aeadCrypter{
+ aead: aead,
+ chunkSize: decodeAEADChunkSize(se.ChunkSizeByte),
+ nonce: nonce,
+ associatedData: se.associatedData(),
+ chunkIndex: nonce[len(nonce)-8:],
+ packetTag: packetTypeSymmetricallyEncryptedIntegrityProtected,
+ },
+ reader: se.Contents,
+ chunkBytes: chunkBytes,
+ peekedBytes: peekedBytes,
+ }, nil
+}
+
+// serializeSymmetricallyEncryptedAead encrypts to a writer a V2 SEIPD packet (AEAD) as specified in
+// https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-5.13.2
+func serializeSymmetricallyEncryptedAead(ciphertext io.WriteCloser, cipherSuite CipherSuite, chunkSizeByte byte, rand io.Reader, inputKey []byte) (Contents io.WriteCloser, err error) {
+ // cipherFunc must have block size 16 to use AEAD
+ if cipherSuite.Cipher.blockSize() != 16 {
+ return nil, errors.InvalidArgumentError("invalid aead cipher function")
+ }
+
+ if cipherSuite.Cipher.KeySize() != len(inputKey) {
+ return nil, errors.InvalidArgumentError("error in aead serialization: bad key length")
+ }
+
+ // Data for en/decryption: tag, version, cipher, aead mode, chunk size
+ prefix := []byte{
+ 0xD2,
+ symmetricallyEncryptedVersionAead,
+ byte(cipherSuite.Cipher),
+ byte(cipherSuite.Mode),
+ chunkSizeByte,
+ }
+
+ // Write header (that correspond to prefix except first byte)
+ n, err := ciphertext.Write(prefix[1:])
+ if err != nil || n < 4 {
+ return nil, err
+ }
+
+ // Random salt
+ salt := make([]byte, aeadSaltSize)
+ if _, err := io.ReadFull(rand, salt); err != nil {
+ return nil, err
+ }
+
+ if _, err := ciphertext.Write(salt); err != nil {
+ return nil, err
+ }
+
+ aead, nonce := getSymmetricallyEncryptedAeadInstance(cipherSuite.Cipher, cipherSuite.Mode, inputKey, salt, prefix)
+
+ chunkSize := decodeAEADChunkSize(chunkSizeByte)
+ tagLen := aead.Overhead()
+ chunkBytes := make([]byte, chunkSize+tagLen)
+ return &aeadEncrypter{
+ aeadCrypter: aeadCrypter{
+ aead: aead,
+ chunkSize: chunkSize,
+ associatedData: prefix,
+ nonce: nonce,
+ chunkIndex: nonce[len(nonce)-8:],
+ packetTag: packetTypeSymmetricallyEncryptedIntegrityProtected,
+ },
+ writer: ciphertext,
+ chunkBytes: chunkBytes,
+ }, nil
+}
+
+func getSymmetricallyEncryptedAeadInstance(c CipherFunction, mode AEADMode, inputKey, salt, associatedData []byte) (aead cipher.AEAD, nonce []byte) {
+ hkdfReader := hkdf.New(sha256.New, inputKey, salt, associatedData)
+
+ encryptionKey := make([]byte, c.KeySize())
+ _, _ = readFull(hkdfReader, encryptionKey)
+
+ nonce = make([]byte, mode.IvLength())
+
+ // Last 64 bits of nonce are the counter
+ _, _ = readFull(hkdfReader, nonce[:len(nonce)-8])
+
+ blockCipher := c.new(encryptionKey)
+ aead = mode.new(blockCipher)
+
+ return
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_mdc.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_mdc.go
new file mode 100644
index 0000000000..8b18623684
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_mdc.go
@@ -0,0 +1,256 @@
+// 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 packet
+
+import (
+ "crypto/cipher"
+ "crypto/sha1"
+ "crypto/subtle"
+ "hash"
+ "io"
+ "strconv"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+)
+
+// seMdcReader wraps an io.Reader with a no-op Close method.
+type seMdcReader struct {
+ in io.Reader
+}
+
+func (ser seMdcReader) Read(buf []byte) (int, error) {
+ return ser.in.Read(buf)
+}
+
+func (ser seMdcReader) Close() error {
+ return nil
+}
+
+func (se *SymmetricallyEncrypted) decryptMdc(c CipherFunction, key []byte) (io.ReadCloser, error) {
+ if !c.IsSupported() {
+ return nil, errors.UnsupportedError("unsupported cipher: " + strconv.Itoa(int(c)))
+ }
+
+ if len(key) != c.KeySize() {
+ return nil, errors.InvalidArgumentError("SymmetricallyEncrypted: incorrect key length")
+ }
+
+ if se.prefix == nil {
+ se.prefix = make([]byte, c.blockSize()+2)
+ _, err := readFull(se.Contents, se.prefix)
+ if err != nil {
+ return nil, err
+ }
+ } else if len(se.prefix) != c.blockSize()+2 {
+ return nil, errors.InvalidArgumentError("can't try ciphers with different block lengths")
+ }
+
+ ocfbResync := OCFBResync
+ if se.IntegrityProtected {
+ // MDC packets use a different form of OCFB mode.
+ ocfbResync = OCFBNoResync
+ }
+
+ s := NewOCFBDecrypter(c.new(key), se.prefix, ocfbResync)
+
+ plaintext := cipher.StreamReader{S: s, R: se.Contents}
+
+ if se.IntegrityProtected {
+ // IntegrityProtected packets have an embedded hash that we need to check.
+ h := sha1.New()
+ h.Write(se.prefix)
+ return &seMDCReader{in: plaintext, h: h}, nil
+ }
+
+ // Otherwise, we just need to wrap plaintext so that it's a valid ReadCloser.
+ return seMdcReader{plaintext}, nil
+}
+
+const mdcTrailerSize = 1 /* tag byte */ + 1 /* length byte */ + sha1.Size
+
+// An seMDCReader wraps an io.Reader, maintains a running hash and keeps hold
+// of the most recent 22 bytes (mdcTrailerSize). Upon EOF, those bytes form an
+// MDC packet containing a hash of the previous Contents which is checked
+// against the running hash. See RFC 4880, section 5.13.
+type seMDCReader struct {
+ in io.Reader
+ h hash.Hash
+ trailer [mdcTrailerSize]byte
+ scratch [mdcTrailerSize]byte
+ trailerUsed int
+ error bool
+ eof bool
+}
+
+func (ser *seMDCReader) Read(buf []byte) (n int, err error) {
+ if ser.error {
+ err = io.ErrUnexpectedEOF
+ return
+ }
+ if ser.eof {
+ err = io.EOF
+ return
+ }
+
+ // If we haven't yet filled the trailer buffer then we must do that
+ // first.
+ for ser.trailerUsed < mdcTrailerSize {
+ n, err = ser.in.Read(ser.trailer[ser.trailerUsed:])
+ ser.trailerUsed += n
+ if err == io.EOF {
+ if ser.trailerUsed != mdcTrailerSize {
+ n = 0
+ err = io.ErrUnexpectedEOF
+ ser.error = true
+ return
+ }
+ ser.eof = true
+ n = 0
+ return
+ }
+
+ if err != nil {
+ n = 0
+ return
+ }
+ }
+
+ // If it's a short read then we read into a temporary buffer and shift
+ // the data into the caller's buffer.
+ if len(buf) <= mdcTrailerSize {
+ n, err = readFull(ser.in, ser.scratch[:len(buf)])
+ copy(buf, ser.trailer[:n])
+ ser.h.Write(buf[:n])
+ copy(ser.trailer[:], ser.trailer[n:])
+ copy(ser.trailer[mdcTrailerSize-n:], ser.scratch[:])
+ if n < len(buf) {
+ ser.eof = true
+ err = io.EOF
+ }
+ return
+ }
+
+ n, err = ser.in.Read(buf[mdcTrailerSize:])
+ copy(buf, ser.trailer[:])
+ ser.h.Write(buf[:n])
+ copy(ser.trailer[:], buf[n:])
+
+ if err == io.EOF {
+ ser.eof = true
+ }
+ return
+}
+
+// This is a new-format packet tag byte for a type 19 (Integrity Protected) packet.
+const mdcPacketTagByte = byte(0x80) | 0x40 | 19
+
+func (ser *seMDCReader) Close() error {
+ if ser.error {
+ return errors.ErrMDCHashMismatch
+ }
+
+ for !ser.eof {
+ // We haven't seen EOF so we need to read to the end
+ var buf [1024]byte
+ _, err := ser.Read(buf[:])
+ if err == io.EOF {
+ break
+ }
+ if err != nil {
+ return errors.ErrMDCHashMismatch
+ }
+ }
+
+ ser.h.Write(ser.trailer[:2])
+
+ final := ser.h.Sum(nil)
+ if subtle.ConstantTimeCompare(final, ser.trailer[2:]) != 1 {
+ return errors.ErrMDCHashMismatch
+ }
+ // The hash already includes the MDC header, but we still check its value
+ // to confirm encryption correctness
+ if ser.trailer[0] != mdcPacketTagByte || ser.trailer[1] != sha1.Size {
+ return errors.ErrMDCHashMismatch
+ }
+ return nil
+}
+
+// An seMDCWriter writes through to an io.WriteCloser while maintains a running
+// hash of the data written. On close, it emits an MDC packet containing the
+// running hash.
+type seMDCWriter struct {
+ w io.WriteCloser
+ h hash.Hash
+}
+
+func (w *seMDCWriter) Write(buf []byte) (n int, err error) {
+ w.h.Write(buf)
+ return w.w.Write(buf)
+}
+
+func (w *seMDCWriter) Close() (err error) {
+ var buf [mdcTrailerSize]byte
+
+ buf[0] = mdcPacketTagByte
+ buf[1] = sha1.Size
+ w.h.Write(buf[:2])
+ digest := w.h.Sum(nil)
+ copy(buf[2:], digest)
+
+ _, err = w.w.Write(buf[:])
+ if err != nil {
+ return
+ }
+ return w.w.Close()
+}
+
+// noOpCloser is like an ioutil.NopCloser, but for an io.Writer.
+type noOpCloser struct {
+ w io.Writer
+}
+
+func (c noOpCloser) Write(data []byte) (n int, err error) {
+ return c.w.Write(data)
+}
+
+func (c noOpCloser) Close() error {
+ return nil
+}
+
+func serializeSymmetricallyEncryptedMdc(ciphertext io.WriteCloser, c CipherFunction, key []byte, config *Config) (Contents io.WriteCloser, err error) {
+ // Disallow old cipher suites
+ if !c.IsSupported() || c < CipherAES128 {
+ return nil, errors.InvalidArgumentError("invalid mdc cipher function")
+ }
+
+ if c.KeySize() != len(key) {
+ return nil, errors.InvalidArgumentError("error in mdc serialization: bad key length")
+ }
+
+ _, err = ciphertext.Write([]byte{symmetricallyEncryptedVersionMdc})
+ if err != nil {
+ return
+ }
+
+ block := c.new(key)
+ blockSize := block.BlockSize()
+ iv := make([]byte, blockSize)
+ _, err = io.ReadFull(config.Random(), iv)
+ if err != nil {
+ return nil, err
+ }
+ s, prefix := NewOCFBEncrypter(block, iv, OCFBNoResync)
+ _, err = ciphertext.Write(prefix)
+ if err != nil {
+ return
+ }
+ plaintext := cipher.StreamWriter{S: s, W: ciphertext}
+
+ h := sha1.New()
+ h.Write(iv)
+ h.Write(iv[blockSize-2:])
+ Contents = &seMDCWriter{w: plaintext, h: h}
+ return
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userattribute.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userattribute.go
new file mode 100644
index 0000000000..63814ed132
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userattribute.go
@@ -0,0 +1,100 @@
+// 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 packet
+
+import (
+ "bytes"
+ "image"
+ "image/jpeg"
+ "io"
+)
+
+const UserAttrImageSubpacket = 1
+
+// UserAttribute is capable of storing other types of data about a user
+// beyond name, email and a text comment. In practice, user attributes are typically used
+// to store a signed thumbnail photo JPEG image of the user.
+// See RFC 4880, section 5.12.
+type UserAttribute struct {
+ Contents []*OpaqueSubpacket
+}
+
+// NewUserAttributePhoto creates a user attribute packet
+// containing the given images.
+func NewUserAttributePhoto(photos ...image.Image) (uat *UserAttribute, err error) {
+ uat = new(UserAttribute)
+ for _, photo := range photos {
+ var buf bytes.Buffer
+ // RFC 4880, Section 5.12.1.
+ data := []byte{
+ 0x10, 0x00, // Little-endian image header length (16 bytes)
+ 0x01, // Image header version 1
+ 0x01, // JPEG
+ 0, 0, 0, 0, // 12 reserved octets, must be all zero.
+ 0, 0, 0, 0,
+ 0, 0, 0, 0}
+ if _, err = buf.Write(data); err != nil {
+ return
+ }
+ if err = jpeg.Encode(&buf, photo, nil); err != nil {
+ return
+ }
+
+ lengthBuf := make([]byte, 5)
+ n := serializeSubpacketLength(lengthBuf, len(buf.Bytes())+1)
+ lengthBuf = lengthBuf[:n]
+
+ uat.Contents = append(uat.Contents, &OpaqueSubpacket{
+ SubType: UserAttrImageSubpacket,
+ EncodedLength: lengthBuf,
+ Contents: buf.Bytes(),
+ })
+ }
+ return
+}
+
+// NewUserAttribute creates a new user attribute packet containing the given subpackets.
+func NewUserAttribute(contents ...*OpaqueSubpacket) *UserAttribute {
+ return &UserAttribute{Contents: contents}
+}
+
+func (uat *UserAttribute) parse(r io.Reader) (err error) {
+ // RFC 4880, section 5.13
+ b, err := io.ReadAll(r)
+ if err != nil {
+ return
+ }
+ uat.Contents, err = OpaqueSubpackets(b)
+ return
+}
+
+// Serialize marshals the user attribute to w in the form of an OpenPGP packet, including
+// header.
+func (uat *UserAttribute) Serialize(w io.Writer) (err error) {
+ var buf bytes.Buffer
+ for _, sp := range uat.Contents {
+ err = sp.Serialize(&buf)
+ if err != nil {
+ return err
+ }
+ }
+ if err = serializeHeader(w, packetTypeUserAttribute, buf.Len()); err != nil {
+ return err
+ }
+ _, err = w.Write(buf.Bytes())
+ return
+}
+
+// ImageData returns zero or more byte slices, each containing
+// JPEG File Interchange Format (JFIF), for each photo in the
+// user attribute packet.
+func (uat *UserAttribute) ImageData() (imageData [][]byte) {
+ for _, sp := range uat.Contents {
+ if sp.SubType == UserAttrImageSubpacket && len(sp.Contents) > 16 {
+ imageData = append(imageData, sp.Contents[16:])
+ }
+ }
+ return
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userid.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userid.go
new file mode 100644
index 0000000000..3c7451a3c3
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userid.go
@@ -0,0 +1,166 @@
+// 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 packet
+
+import (
+ "io"
+ "strings"
+)
+
+// UserId contains text that is intended to represent the name and email
+// address of the key holder. See RFC 4880, section 5.11. By convention, this
+// takes the form "Full Name (Comment) "
+type UserId struct {
+ Id string // By convention, this takes the form "Full Name (Comment) " which is split out in the fields below.
+
+ Name, Comment, Email string
+}
+
+func hasInvalidCharacters(s string) bool {
+ for _, c := range s {
+ switch c {
+ case '(', ')', '<', '>', 0:
+ return true
+ }
+ }
+ return false
+}
+
+// NewUserId returns a UserId or nil if any of the arguments contain invalid
+// characters. The invalid characters are '\x00', '(', ')', '<' and '>'
+func NewUserId(name, comment, email string) *UserId {
+ // RFC 4880 doesn't deal with the structure of userid strings; the
+ // name, comment and email form is just a convention. However, there's
+ // no convention about escaping the metacharacters and GPG just refuses
+ // to create user ids where, say, the name contains a '('. We mirror
+ // this behaviour.
+
+ if hasInvalidCharacters(name) || hasInvalidCharacters(comment) || hasInvalidCharacters(email) {
+ return nil
+ }
+
+ uid := new(UserId)
+ uid.Name, uid.Comment, uid.Email = name, comment, email
+ uid.Id = name
+ if len(comment) > 0 {
+ if len(uid.Id) > 0 {
+ uid.Id += " "
+ }
+ uid.Id += "("
+ uid.Id += comment
+ uid.Id += ")"
+ }
+ if len(email) > 0 {
+ if len(uid.Id) > 0 {
+ uid.Id += " "
+ }
+ uid.Id += "<"
+ uid.Id += email
+ uid.Id += ">"
+ }
+ return uid
+}
+
+func (uid *UserId) parse(r io.Reader) (err error) {
+ // RFC 4880, section 5.11
+ b, err := io.ReadAll(r)
+ if err != nil {
+ return
+ }
+ uid.Id = string(b)
+ uid.Name, uid.Comment, uid.Email = parseUserId(uid.Id)
+ return
+}
+
+// Serialize marshals uid to w in the form of an OpenPGP packet, including
+// header.
+func (uid *UserId) Serialize(w io.Writer) error {
+ err := serializeHeader(w, packetTypeUserId, len(uid.Id))
+ if err != nil {
+ return err
+ }
+ _, err = w.Write([]byte(uid.Id))
+ return err
+}
+
+// parseUserId extracts the name, comment and email from a user id string that
+// is formatted as "Full Name (Comment) ".
+func parseUserId(id string) (name, comment, email string) {
+ var n, c, e struct {
+ start, end int
+ }
+ var state int
+
+ for offset, rune := range id {
+ switch state {
+ case 0:
+ // Entering name
+ n.start = offset
+ state = 1
+ fallthrough
+ case 1:
+ // In name
+ if rune == '(' {
+ state = 2
+ n.end = offset
+ } else if rune == '<' {
+ state = 5
+ n.end = offset
+ }
+ case 2:
+ // Entering comment
+ c.start = offset
+ state = 3
+ fallthrough
+ case 3:
+ // In comment
+ if rune == ')' {
+ state = 4
+ c.end = offset
+ }
+ case 4:
+ // Between comment and email
+ if rune == '<' {
+ state = 5
+ }
+ case 5:
+ // Entering email
+ e.start = offset
+ state = 6
+ fallthrough
+ case 6:
+ // In email
+ if rune == '>' {
+ state = 7
+ e.end = offset
+ }
+ default:
+ // After email
+ }
+ }
+ switch state {
+ case 1:
+ // ended in the name
+ n.end = len(id)
+ case 3:
+ // ended in comment
+ c.end = len(id)
+ case 6:
+ // ended in email
+ e.end = len(id)
+ }
+
+ name = strings.TrimSpace(id[n.start:n.end])
+ comment = strings.TrimSpace(id[c.start:c.end])
+ email = strings.TrimSpace(id[e.start:e.end])
+
+ // RFC 2822 3.4: alternate simple form of a mailbox
+ if email == "" && strings.ContainsRune(name, '@') {
+ email = name
+ name = ""
+ }
+
+ return
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/read.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/read.go
new file mode 100644
index 0000000000..5578797edf
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/read.go
@@ -0,0 +1,619 @@
+// 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 openpgp implements high level operations on OpenPGP messages.
+package openpgp // import "github.com/ProtonMail/go-crypto/openpgp"
+
+import (
+ "crypto"
+ _ "crypto/sha256"
+ _ "crypto/sha512"
+ "hash"
+ "io"
+ "strconv"
+
+ "github.com/ProtonMail/go-crypto/openpgp/armor"
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm"
+ "github.com/ProtonMail/go-crypto/openpgp/packet"
+ _ "golang.org/x/crypto/sha3"
+)
+
+// SignatureType is the armor type for a PGP signature.
+var SignatureType = "PGP SIGNATURE"
+
+// readArmored reads an armored block with the given type.
+func readArmored(r io.Reader, expectedType string) (body io.Reader, err error) {
+ block, err := armor.Decode(r)
+ if err != nil {
+ return
+ }
+
+ if block.Type != expectedType {
+ return nil, errors.InvalidArgumentError("expected '" + expectedType + "', got: " + block.Type)
+ }
+
+ return block.Body, nil
+}
+
+// MessageDetails contains the result of parsing an OpenPGP encrypted and/or
+// signed message.
+type MessageDetails struct {
+ IsEncrypted bool // true if the message was encrypted.
+ EncryptedToKeyIds []uint64 // the list of recipient key ids.
+ IsSymmetricallyEncrypted bool // true if a passphrase could have decrypted the message.
+ DecryptedWith Key // the private key used to decrypt the message, if any.
+ IsSigned bool // true if the message is signed.
+ SignedByKeyId uint64 // the key id of the signer, if any.
+ SignedByFingerprint []byte // the key fingerprint of the signer, if any.
+ SignedBy *Key // the key of the signer, if available.
+ LiteralData *packet.LiteralData // the metadata of the contents
+ UnverifiedBody io.Reader // the contents of the message.
+
+ // If IsSigned is true and SignedBy is non-zero then the signature will
+ // be verified as UnverifiedBody is read. The signature cannot be
+ // checked until the whole of UnverifiedBody is read so UnverifiedBody
+ // must be consumed until EOF before the data can be trusted. Even if a
+ // message isn't signed (or the signer is unknown) the data may contain
+ // an authentication code that is only checked once UnverifiedBody has
+ // been consumed. Once EOF has been seen, the following fields are
+ // valid. (An authentication code failure is reported as a
+ // SignatureError error when reading from UnverifiedBody.)
+ Signature *packet.Signature // the signature packet itself.
+ SignatureError error // nil if the signature is good.
+ UnverifiedSignatures []*packet.Signature // all other unverified signature packets.
+
+ decrypted io.ReadCloser
+}
+
+// A PromptFunction is used as a callback by functions that may need to decrypt
+// a private key, or prompt for a passphrase. It is called with a list of
+// acceptable, encrypted private keys and a boolean that indicates whether a
+// passphrase is usable. It should either decrypt a private key or return a
+// passphrase to try. If the decrypted private key or given passphrase isn't
+// correct, the function will be called again, forever. Any error returned will
+// be passed up.
+type PromptFunction func(keys []Key, symmetric bool) ([]byte, error)
+
+// A keyEnvelopePair is used to store a private key with the envelope that
+// contains a symmetric key, encrypted with that key.
+type keyEnvelopePair struct {
+ key Key
+ encryptedKey *packet.EncryptedKey
+}
+
+// ReadMessage parses an OpenPGP message that may be signed and/or encrypted.
+// The given KeyRing should contain both public keys (for signature
+// verification) and, possibly encrypted, private keys for decrypting.
+// If config is nil, sensible defaults will be used.
+func ReadMessage(r io.Reader, keyring KeyRing, prompt PromptFunction, config *packet.Config) (md *MessageDetails, err error) {
+ var p packet.Packet
+
+ var symKeys []*packet.SymmetricKeyEncrypted
+ var pubKeys []keyEnvelopePair
+ // Integrity protected encrypted packet: SymmetricallyEncrypted or AEADEncrypted
+ var edp packet.EncryptedDataPacket
+
+ packets := packet.NewReader(r)
+ md = new(MessageDetails)
+ md.IsEncrypted = true
+
+ // The message, if encrypted, starts with a number of packets
+ // containing an encrypted decryption key. The decryption key is either
+ // encrypted to a public key, or with a passphrase. This loop
+ // collects these packets.
+ParsePackets:
+ for {
+ p, err = packets.Next()
+ if err != nil {
+ return nil, err
+ }
+ switch p := p.(type) {
+ case *packet.SymmetricKeyEncrypted:
+ // This packet contains the decryption key encrypted with a passphrase.
+ md.IsSymmetricallyEncrypted = true
+ symKeys = append(symKeys, p)
+ case *packet.EncryptedKey:
+ // This packet contains the decryption key encrypted to a public key.
+ md.EncryptedToKeyIds = append(md.EncryptedToKeyIds, p.KeyId)
+ switch p.Algo {
+ case packet.PubKeyAlgoRSA, packet.PubKeyAlgoRSAEncryptOnly, packet.PubKeyAlgoElGamal, packet.PubKeyAlgoECDH, packet.PubKeyAlgoX25519, packet.PubKeyAlgoX448:
+ break
+ default:
+ continue
+ }
+ if keyring != nil {
+ var keys []Key
+ if p.KeyId == 0 {
+ keys = keyring.DecryptionKeys()
+ } else {
+ keys = keyring.KeysById(p.KeyId)
+ }
+ for _, k := range keys {
+ pubKeys = append(pubKeys, keyEnvelopePair{k, p})
+ }
+ }
+ case *packet.SymmetricallyEncrypted:
+ if !p.IntegrityProtected && !config.AllowUnauthenticatedMessages() {
+ return nil, errors.UnsupportedError("message is not integrity protected")
+ }
+ edp = p
+ break ParsePackets
+ case *packet.AEADEncrypted:
+ edp = p
+ break ParsePackets
+ case *packet.Compressed, *packet.LiteralData, *packet.OnePassSignature:
+ // This message isn't encrypted.
+ if len(symKeys) != 0 || len(pubKeys) != 0 {
+ return nil, errors.StructuralError("key material not followed by encrypted message")
+ }
+ packets.Unread(p)
+ return readSignedMessage(packets, nil, keyring, config)
+ }
+ }
+
+ var candidates []Key
+ var decrypted io.ReadCloser
+
+ // Now that we have the list of encrypted keys we need to decrypt at
+ // least one of them or, if we cannot, we need to call the prompt
+ // function so that it can decrypt a key or give us a passphrase.
+FindKey:
+ for {
+ // See if any of the keys already have a private key available
+ candidates = candidates[:0]
+ candidateFingerprints := make(map[string]bool)
+
+ for _, pk := range pubKeys {
+ if pk.key.PrivateKey == nil {
+ continue
+ }
+ if !pk.key.PrivateKey.Encrypted {
+ if len(pk.encryptedKey.Key) == 0 {
+ errDec := pk.encryptedKey.Decrypt(pk.key.PrivateKey, config)
+ if errDec != nil {
+ continue
+ }
+ }
+ // Try to decrypt symmetrically encrypted
+ decrypted, err = edp.Decrypt(pk.encryptedKey.CipherFunc, pk.encryptedKey.Key)
+ if err != nil && err != errors.ErrKeyIncorrect {
+ return nil, err
+ }
+ if decrypted != nil {
+ md.DecryptedWith = pk.key
+ break FindKey
+ }
+ } else {
+ fpr := string(pk.key.PublicKey.Fingerprint[:])
+ if v := candidateFingerprints[fpr]; v {
+ continue
+ }
+ candidates = append(candidates, pk.key)
+ candidateFingerprints[fpr] = true
+ }
+ }
+
+ if len(candidates) == 0 && len(symKeys) == 0 {
+ return nil, errors.ErrKeyIncorrect
+ }
+
+ if prompt == nil {
+ return nil, errors.ErrKeyIncorrect
+ }
+
+ passphrase, err := prompt(candidates, len(symKeys) != 0)
+ if err != nil {
+ return nil, err
+ }
+
+ // Try the symmetric passphrase first
+ if len(symKeys) != 0 && passphrase != nil {
+ for _, s := range symKeys {
+ key, cipherFunc, err := s.Decrypt(passphrase)
+ // In v4, on wrong passphrase, session key decryption is very likely to result in an invalid cipherFunc:
+ // only for < 5% of cases we will proceed to decrypt the data
+ if err == nil {
+ decrypted, err = edp.Decrypt(cipherFunc, key)
+ if err != nil {
+ return nil, err
+ }
+ if decrypted != nil {
+ break FindKey
+ }
+ }
+ }
+ }
+ }
+
+ md.decrypted = decrypted
+ if err := packets.Push(decrypted); err != nil {
+ return nil, err
+ }
+ mdFinal, sensitiveParsingErr := readSignedMessage(packets, md, keyring, config)
+ if sensitiveParsingErr != nil {
+ return nil, errors.HandleSensitiveParsingError(sensitiveParsingErr, md.decrypted != nil)
+ }
+ return mdFinal, nil
+}
+
+// readSignedMessage reads a possibly signed message if mdin is non-zero then
+// that structure is updated and returned. Otherwise a fresh MessageDetails is
+// used.
+func readSignedMessage(packets *packet.Reader, mdin *MessageDetails, keyring KeyRing, config *packet.Config) (md *MessageDetails, err error) {
+ if mdin == nil {
+ mdin = new(MessageDetails)
+ }
+ md = mdin
+
+ var p packet.Packet
+ var h hash.Hash
+ var wrappedHash hash.Hash
+ var prevLast bool
+FindLiteralData:
+ for {
+ p, err = packets.Next()
+ if err != nil {
+ return nil, err
+ }
+ switch p := p.(type) {
+ case *packet.Compressed:
+ if err := packets.Push(p.LimitedBodyReader(config.DecompressedMessageSizeLimit())); err != nil {
+ return nil, err
+ }
+ case *packet.OnePassSignature:
+ if prevLast {
+ return nil, errors.UnsupportedError("nested signature packets")
+ }
+
+ if p.IsLast {
+ prevLast = true
+ }
+
+ h, wrappedHash, err = hashForSignature(p.Hash, p.SigType, p.Salt)
+ if err != nil {
+ md.SignatureError = err
+ }
+
+ md.IsSigned = true
+ if p.Version == 6 {
+ md.SignedByFingerprint = p.KeyFingerprint
+ }
+ md.SignedByKeyId = p.KeyId
+
+ if keyring != nil {
+ keys := keyring.KeysByIdUsage(p.KeyId, packet.KeyFlagSign)
+ if len(keys) > 0 {
+ md.SignedBy = &keys[0]
+ }
+ }
+ case *packet.LiteralData:
+ md.LiteralData = p
+ break FindLiteralData
+ }
+ }
+
+ if md.IsSigned && md.SignatureError == nil {
+ md.UnverifiedBody = &signatureCheckReader{packets, h, wrappedHash, md, config}
+ } else if md.decrypted != nil {
+ md.UnverifiedBody = &checkReader{md, false}
+ } else {
+ md.UnverifiedBody = md.LiteralData.Body
+ }
+
+ return md, nil
+}
+
+func wrapHashForSignature(hashFunc hash.Hash, sigType packet.SignatureType) (hash.Hash, error) {
+ switch sigType {
+ case packet.SigTypeBinary:
+ return hashFunc, nil
+ case packet.SigTypeText:
+ return NewCanonicalTextHash(hashFunc), nil
+ }
+ return nil, errors.UnsupportedError("unsupported signature type: " + strconv.Itoa(int(sigType)))
+}
+
+// hashForSignature returns a pair of hashes that can be used to verify a
+// signature. The signature may specify that the contents of the signed message
+// should be preprocessed (i.e. to normalize line endings). Thus this function
+// returns two hashes. The second should be used to hash the message itself and
+// performs any needed preprocessing.
+func hashForSignature(hashFunc crypto.Hash, sigType packet.SignatureType, sigSalt []byte) (hash.Hash, hash.Hash, error) {
+ if _, ok := algorithm.HashToHashIdWithSha1(hashFunc); !ok {
+ return nil, nil, errors.UnsupportedError("unsupported hash function")
+ }
+ if !hashFunc.Available() {
+ return nil, nil, errors.UnsupportedError("hash not available: " + strconv.Itoa(int(hashFunc)))
+ }
+ h := hashFunc.New()
+ if sigSalt != nil {
+ h.Write(sigSalt)
+ }
+ wrappedHash, err := wrapHashForSignature(h, sigType)
+ if err != nil {
+ return nil, nil, err
+ }
+ switch sigType {
+ case packet.SigTypeBinary:
+ return h, wrappedHash, nil
+ case packet.SigTypeText:
+ return h, wrappedHash, nil
+ }
+ return nil, nil, errors.UnsupportedError("unsupported signature type: " + strconv.Itoa(int(sigType)))
+}
+
+// checkReader wraps an io.Reader from a LiteralData packet. When it sees EOF
+// it closes the ReadCloser from any SymmetricallyEncrypted packet to trigger
+// MDC checks.
+type checkReader struct {
+ md *MessageDetails
+ checked bool
+}
+
+func (cr *checkReader) Read(buf []byte) (int, error) {
+ n, sensitiveParsingError := cr.md.LiteralData.Body.Read(buf)
+ if sensitiveParsingError == io.EOF {
+ if cr.checked {
+ // Only check once
+ return n, io.EOF
+ }
+ mdcErr := cr.md.decrypted.Close()
+ if mdcErr != nil {
+ return n, mdcErr
+ }
+ cr.checked = true
+ return n, io.EOF
+ }
+
+ if sensitiveParsingError != nil {
+ return n, errors.HandleSensitiveParsingError(sensitiveParsingError, true)
+ }
+
+ return n, nil
+}
+
+// signatureCheckReader wraps an io.Reader from a LiteralData packet and hashes
+// the data as it is read. When it sees an EOF from the underlying io.Reader
+// it parses and checks a trailing Signature packet and triggers any MDC checks.
+type signatureCheckReader struct {
+ packets *packet.Reader
+ h, wrappedHash hash.Hash
+ md *MessageDetails
+ config *packet.Config
+}
+
+func (scr *signatureCheckReader) Read(buf []byte) (int, error) {
+ n, sensitiveParsingError := scr.md.LiteralData.Body.Read(buf)
+
+ // Hash only if required
+ if scr.md.SignedBy != nil {
+ scr.wrappedHash.Write(buf[:n])
+ }
+
+ readsDecryptedData := scr.md.decrypted != nil
+ if sensitiveParsingError == io.EOF {
+ var p packet.Packet
+ var readError error
+ var sig *packet.Signature
+
+ p, readError = scr.packets.Next()
+ for readError == nil {
+ var ok bool
+ if sig, ok = p.(*packet.Signature); ok {
+ if sig.Version == 5 && (sig.SigType == 0x00 || sig.SigType == 0x01) {
+ sig.Metadata = scr.md.LiteralData
+ }
+
+ // If signature KeyID matches
+ if scr.md.SignedBy != nil && *sig.IssuerKeyId == scr.md.SignedByKeyId {
+ key := scr.md.SignedBy
+ signatureError := key.PublicKey.VerifySignature(scr.h, sig)
+ if signatureError == nil {
+ signatureError = checkMessageSignatureDetails(key, sig, scr.config)
+ }
+ scr.md.Signature = sig
+ scr.md.SignatureError = signatureError
+ } else {
+ scr.md.UnverifiedSignatures = append(scr.md.UnverifiedSignatures, sig)
+ }
+ }
+
+ p, readError = scr.packets.Next()
+ }
+
+ if scr.md.SignedBy != nil && scr.md.Signature == nil {
+ if scr.md.UnverifiedSignatures == nil {
+ scr.md.SignatureError = errors.StructuralError("LiteralData not followed by signature")
+ } else {
+ scr.md.SignatureError = errors.StructuralError("No matching signature found")
+ }
+ }
+
+ // The SymmetricallyEncrypted packet, if any, might have an
+ // unsigned hash of its own. In order to check this we need to
+ // close that Reader.
+ if scr.md.decrypted != nil {
+ if sensitiveParsingError := scr.md.decrypted.Close(); sensitiveParsingError != nil {
+ return n, errors.HandleSensitiveParsingError(sensitiveParsingError, true)
+ }
+ }
+ return n, io.EOF
+ }
+
+ if sensitiveParsingError != nil {
+ return n, errors.HandleSensitiveParsingError(sensitiveParsingError, readsDecryptedData)
+ }
+
+ return n, nil
+}
+
+// VerifyDetachedSignature takes a signed file and a detached signature and
+// returns the signature packet and the entity the signature was signed by,
+// if any, and a possible signature verification error.
+// If the signer isn't known, ErrUnknownIssuer is returned.
+func VerifyDetachedSignature(keyring KeyRing, signed, signature io.Reader, config *packet.Config) (sig *packet.Signature, signer *Entity, err error) {
+ return verifyDetachedSignature(keyring, signed, signature, nil, false, config)
+}
+
+// VerifyDetachedSignatureAndHash performs the same actions as
+// VerifyDetachedSignature and checks that the expected hash functions were used.
+func VerifyDetachedSignatureAndHash(keyring KeyRing, signed, signature io.Reader, expectedHashes []crypto.Hash, config *packet.Config) (sig *packet.Signature, signer *Entity, err error) {
+ return verifyDetachedSignature(keyring, signed, signature, expectedHashes, true, config)
+}
+
+// CheckDetachedSignature takes a signed file and a detached signature and
+// returns the entity the signature was signed by, if any, and a possible
+// signature verification error. If the signer isn't known,
+// ErrUnknownIssuer is returned.
+func CheckDetachedSignature(keyring KeyRing, signed, signature io.Reader, config *packet.Config) (signer *Entity, err error) {
+ _, signer, err = verifyDetachedSignature(keyring, signed, signature, nil, false, config)
+ return
+}
+
+// CheckDetachedSignatureAndHash performs the same actions as
+// CheckDetachedSignature and checks that the expected hash functions were used.
+func CheckDetachedSignatureAndHash(keyring KeyRing, signed, signature io.Reader, expectedHashes []crypto.Hash, config *packet.Config) (signer *Entity, err error) {
+ _, signer, err = verifyDetachedSignature(keyring, signed, signature, expectedHashes, true, config)
+ return
+}
+
+func verifyDetachedSignature(keyring KeyRing, signed, signature io.Reader, expectedHashes []crypto.Hash, checkHashes bool, config *packet.Config) (sig *packet.Signature, signer *Entity, err error) {
+ var issuerKeyId uint64
+ var hashFunc crypto.Hash
+ var sigType packet.SignatureType
+ var keys []Key
+ var p packet.Packet
+
+ packets := packet.NewReader(signature)
+ for {
+ p, err = packets.Next()
+ if err == io.EOF {
+ return nil, nil, errors.ErrUnknownIssuer
+ }
+ if err != nil {
+ return nil, nil, err
+ }
+
+ var ok bool
+ sig, ok = p.(*packet.Signature)
+ if !ok {
+ return nil, nil, errors.StructuralError("non signature packet found")
+ }
+ if sig.IssuerKeyId == nil {
+ return nil, nil, errors.StructuralError("signature doesn't have an issuer")
+ }
+ issuerKeyId = *sig.IssuerKeyId
+ hashFunc = sig.Hash
+ sigType = sig.SigType
+ if checkHashes {
+ matchFound := false
+ // check for hashes
+ for _, expectedHash := range expectedHashes {
+ if hashFunc == expectedHash {
+ matchFound = true
+ break
+ }
+ }
+ if !matchFound {
+ return nil, nil, errors.StructuralError("hash algorithm or salt mismatch with cleartext message headers")
+ }
+ }
+ keys = keyring.KeysByIdUsage(issuerKeyId, packet.KeyFlagSign)
+ if len(keys) > 0 {
+ break
+ }
+ }
+
+ if len(keys) == 0 {
+ panic("unreachable")
+ }
+
+ h, err := sig.PrepareVerify()
+ if err != nil {
+ return nil, nil, err
+ }
+ wrappedHash, err := wrapHashForSignature(h, sigType)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ if _, err := io.Copy(wrappedHash, signed); err != nil && err != io.EOF {
+ return nil, nil, err
+ }
+
+ for _, key := range keys {
+ err = key.PublicKey.VerifySignature(h, sig)
+ if err == nil {
+ return sig, key.Entity, checkMessageSignatureDetails(&key, sig, config)
+ }
+ }
+
+ return nil, nil, err
+}
+
+// CheckArmoredDetachedSignature performs the same actions as
+// CheckDetachedSignature but expects the signature to be armored.
+func CheckArmoredDetachedSignature(keyring KeyRing, signed, signature io.Reader, config *packet.Config) (signer *Entity, err error) {
+ body, err := readArmored(signature, SignatureType)
+ if err != nil {
+ return
+ }
+
+ return CheckDetachedSignature(keyring, signed, body, config)
+}
+
+// checkMessageSignatureDetails returns an error if:
+// - The signature (or one of the binding signatures mentioned below)
+// has a unknown critical notation data subpacket
+// - The primary key of the signing entity is revoked
+// - The primary identity is revoked
+// - The signature is expired
+// - The primary key of the signing entity is expired according to the
+// primary identity binding signature
+//
+// ... or, if the signature was signed by a subkey and:
+// - The signing subkey is revoked
+// - The signing subkey is expired according to the subkey binding signature
+// - The signing subkey binding signature is expired
+// - The signing subkey cross-signature is expired
+//
+// NOTE: The order of these checks is important, as the caller may choose to
+// ignore ErrSignatureExpired or ErrKeyExpired errors, but should never
+// ignore any other errors.
+func checkMessageSignatureDetails(key *Key, signature *packet.Signature, config *packet.Config) error {
+ now := config.Now()
+ primarySelfSignature, primaryIdentity := key.Entity.PrimarySelfSignature()
+ signedBySubKey := key.PublicKey != key.Entity.PrimaryKey
+ sigsToCheck := []*packet.Signature{signature, primarySelfSignature}
+ if signedBySubKey {
+ sigsToCheck = append(sigsToCheck, key.SelfSignature, key.SelfSignature.EmbeddedSignature)
+ }
+ for _, sig := range sigsToCheck {
+ for _, notation := range sig.Notations {
+ if notation.IsCritical && !config.KnownNotation(notation.Name) {
+ return errors.SignatureError("unknown critical notation: " + notation.Name)
+ }
+ }
+ }
+ if key.Entity.Revoked(now) || // primary key is revoked
+ (signedBySubKey && key.Revoked(now)) || // subkey is revoked
+ (primaryIdentity != nil && primaryIdentity.Revoked(now)) { // primary identity is revoked for v4
+ return errors.ErrKeyRevoked
+ }
+ if key.Entity.PrimaryKey.KeyExpired(primarySelfSignature, now) { // primary key is expired
+ return errors.ErrKeyExpired
+ }
+ if signedBySubKey {
+ if key.PublicKey.KeyExpired(key.SelfSignature, now) { // subkey is expired
+ return errors.ErrKeyExpired
+ }
+ }
+ for _, sig := range sigsToCheck {
+ if sig.SigExpired(now) { // any of the relevant signatures are expired
+ return errors.ErrSignatureExpired
+ }
+ }
+ return nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/read_write_test_data.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/read_write_test_data.go
new file mode 100644
index 0000000000..670d60226a
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/read_write_test_data.go
@@ -0,0 +1,457 @@
+package openpgp
+
+const testKey1KeyId uint64 = 0xA34D7E18C20C31BB
+const testKey3KeyId uint64 = 0x338934250CCC0360
+const testKeyP256KeyId uint64 = 0xd44a2c495918513e
+
+const signedInput = "Signed message\nline 2\nline 3\n"
+const signedTextInput = "Signed message\r\nline 2\r\nline 3\r\n"
+
+const recipientUnspecifiedHex = "848c0300000000000000000103ff62d4d578d03cf40c3da998dfe216c074fa6ddec5e31c197c9666ba292830d91d18716a80f699f9d897389a90e6d62d0238f5f07a5248073c0f24920e4bc4a30c2d17ee4e0cae7c3d4aaa4e8dced50e3010a80ee692175fa0385f62ecca4b56ee6e9980aa3ec51b61b077096ac9e800edaf161268593eedb6cc7027ff5cb32745d250010d407a6221ae22ef18469b444f2822478c4d190b24d36371a95cb40087cdd42d9399c3d06a53c0673349bfb607927f20d1e122bde1e2bf3aa6cae6edf489629bcaa0689539ae3b718914d88ededc3b"
+
+const detachedSignatureHex = "889c04000102000605024d449cd1000a0910a34d7e18c20c31bb167603ff57718d09f28a519fdc7b5a68b6a3336da04df85e38c5cd5d5bd2092fa4629848a33d85b1729402a2aab39c3ac19f9d573f773cc62c264dc924c067a79dfd8a863ae06c7c8686120760749f5fd9b1e03a64d20a7df3446ddc8f0aeadeaeba7cbaee5c1e366d65b6a0c6cc749bcb912d2f15013f812795c2e29eb7f7b77f39ce77"
+
+const detachedSignatureTextHex = "889c04010102000605024d449d21000a0910a34d7e18c20c31bbc8c60400a24fbef7342603a41cb1165767bd18985d015fb72fe05db42db36cfb2f1d455967f1e491194fbf6cf88146222b23bf6ffbd50d17598d976a0417d3192ff9cc0034fd00f287b02e90418bbefe609484b09231e4e7a5f3562e199bf39909ab5276c4d37382fe088f6b5c3426fc1052865da8b3ab158672d58b6264b10823dc4b39"
+
+const detachedSignatureDSAHex = "884604001102000605024d6c4eac000a0910338934250ccc0360f18d00a087d743d6405ed7b87755476629600b8b694a39e900a0abff8126f46faf1547c1743c37b21b4ea15b8f83"
+
+const detachedSignatureP256Hex = "885e0400130a0006050256e5bb00000a0910d44a2c495918513edef001009841a4f792beb0befccb35c8838a6a87d9b936beaa86db6745ddc7b045eee0cf00fd1ac1f78306b17e965935dd3f8bae4587a76587e4af231efe19cc4011a8434817"
+
+// The plaintext is https://www.gutenberg.org/cache/epub/1080/pg1080.txt
+const modestProposalSha512 = "lbbrB1+WP3T9AaC9OQqBdOcCjgeEQadlulXsNPgVx0tyqPzDHwUugZ2gE7V0ESKAw6kAVfgkcuvfgxAAGaeHtw=="
+
+const testKeys1And2Hex = "988d044d3c5c10010400b1d13382944bd5aba23a4312968b5095d14f947f600eb478e14a6fcb16b0e0cac764884909c020bc495cfcc39a935387c661507bdb236a0612fb582cac3af9b29cc2c8c70090616c41b662f4da4c1201e195472eb7f4ae1ccbcbf9940fe21d985e379a5563dde5b9a23d35f1cfaa5790da3b79db26f23695107bfaca8e7b5bcd0011010001b41054657374204b6579203120285253412988b804130102002205024d3c5c10021b03060b090807030206150802090a0b0416020301021e01021780000a0910a34d7e18c20c31bbb5b304009cc45fe610b641a2c146331be94dade0a396e73ca725e1b25c21708d9cab46ecca5ccebc23055879df8f99eea39b377962a400f2ebdc36a7c99c333d74aeba346315137c3ff9d0a09b0273299090343048afb8107cf94cbd1400e3026f0ccac7ecebbc4d78588eb3e478fe2754d3ca664bcf3eac96ca4a6b0c8d7df5102f60f6b0020003b88d044d3c5c10010400b201df61d67487301f11879d514f4248ade90c8f68c7af1284c161098de4c28c2850f1ec7b8e30f959793e571542ffc6532189409cb51c3d30dad78c4ad5165eda18b20d9826d8707d0f742e2ab492103a85bbd9ddf4f5720f6de7064feb0d39ee002219765bb07bcfb8b877f47abe270ddeda4f676108cecb6b9bb2ad484a4f0011010001889f04180102000905024d3c5c10021b0c000a0910a34d7e18c20c31bb1a03040085c8d62e16d05dc4e9dad64953c8a2eed8b6c12f92b1575eeaa6dcf7be9473dd5b24b37b6dffbb4e7c99ed1bd3cb11634be19b3e6e207bed7505c7ca111ccf47cb323bf1f8851eb6360e8034cbff8dd149993c959de89f8f77f38e7e98b8e3076323aa719328e2b408db5ec0d03936efd57422ba04f925cdc7b4c1af7590e40ab0020003988d044d3c5c33010400b488c3e5f83f4d561f317817538d9d0397981e9aef1321ca68ebfae1cf8b7d388e19f4b5a24a82e2fbbf1c6c26557a6c5845307a03d815756f564ac7325b02bc83e87d5480a8fae848f07cb891f2d51ce7df83dcafdc12324517c86d472cc0ee10d47a68fd1d9ae49a6c19bbd36d82af597a0d88cc9c49de9df4e696fc1f0b5d0011010001b42754657374204b6579203220285253412c20656e637279707465642070726976617465206b65792988b804130102002205024d3c5c33021b03060b090807030206150802090a0b0416020301021e01021780000a0910d4984f961e35246b98940400908a73b6a6169f700434f076c6c79015a49bee37130eaf23aaa3cfa9ce60bfe4acaa7bc95f1146ada5867e0079babb38804891f4f0b8ebca57a86b249dee786161a755b7a342e68ccf3f78ed6440a93a6626beb9a37aa66afcd4f888790cb4bb46d94a4ae3eb3d7d3e6b00f6bfec940303e89ec5b32a1eaaacce66497d539328b0020003b88d044d3c5c33010400a4e913f9442abcc7f1804ccab27d2f787ffa592077ca935a8bb23165bd8d57576acac647cc596b2c3f814518cc8c82953c7a4478f32e0cf645630a5ba38d9618ef2bc3add69d459ae3dece5cab778938d988239f8c5ae437807075e06c828019959c644ff05ef6a5a1dab72227c98e3a040b0cf219026640698d7a13d8538a570011010001889f04180102000905024d3c5c33021b0c000a0910d4984f961e35246b26c703ff7ee29ef53bc1ae1ead533c408fa136db508434e233d6e62be621e031e5940bbd4c08142aed0f82217e7c3e1ec8de574bc06ccf3c36633be41ad78a9eacd209f861cae7b064100758545cc9dd83db71806dc1cfd5fb9ae5c7474bba0c19c44034ae61bae5eca379383339dece94ff56ff7aa44a582f3e5c38f45763af577c0934b0020003"
+
+const testKeys1And2PrivateHex = "9501d8044d3c5c10010400b1d13382944bd5aba23a4312968b5095d14f947f600eb478e14a6fcb16b0e0cac764884909c020bc495cfcc39a935387c661507bdb236a0612fb582cac3af9b29cc2c8c70090616c41b662f4da4c1201e195472eb7f4ae1ccbcbf9940fe21d985e379a5563dde5b9a23d35f1cfaa5790da3b79db26f23695107bfaca8e7b5bcd00110100010003ff4d91393b9a8e3430b14d6209df42f98dc927425b881f1209f319220841273a802a97c7bdb8b3a7740b3ab5866c4d1d308ad0d3a79bd1e883aacf1ac92dfe720285d10d08752a7efe3c609b1d00f17f2805b217be53999a7da7e493bfc3e9618fd17018991b8128aea70a05dbce30e4fbe626aa45775fa255dd9177aabf4df7cf0200c1ded12566e4bc2bb590455e5becfb2e2c9796482270a943343a7835de41080582c2be3caf5981aa838140e97afa40ad652a0b544f83eb1833b0957dce26e47b0200eacd6046741e9ce2ec5beb6fb5e6335457844fb09477f83b050a96be7da043e17f3a9523567ed40e7a521f818813a8b8a72209f1442844843ccc7eb9805442570200bdafe0438d97ac36e773c7162028d65844c4d463e2420aa2228c6e50dc2743c3d6c72d0d782a5173fe7be2169c8a9f4ef8a7cf3e37165e8c61b89c346cdc6c1799d2b41054657374204b6579203120285253412988b804130102002205024d3c5c10021b03060b090807030206150802090a0b0416020301021e01021780000a0910a34d7e18c20c31bbb5b304009cc45fe610b641a2c146331be94dade0a396e73ca725e1b25c21708d9cab46ecca5ccebc23055879df8f99eea39b377962a400f2ebdc36a7c99c333d74aeba346315137c3ff9d0a09b0273299090343048afb8107cf94cbd1400e3026f0ccac7ecebbc4d78588eb3e478fe2754d3ca664bcf3eac96ca4a6b0c8d7df5102f60f6b00200009d01d8044d3c5c10010400b201df61d67487301f11879d514f4248ade90c8f68c7af1284c161098de4c28c2850f1ec7b8e30f959793e571542ffc6532189409cb51c3d30dad78c4ad5165eda18b20d9826d8707d0f742e2ab492103a85bbd9ddf4f5720f6de7064feb0d39ee002219765bb07bcfb8b877f47abe270ddeda4f676108cecb6b9bb2ad484a4f00110100010003fd17a7490c22a79c59281fb7b20f5e6553ec0c1637ae382e8adaea295f50241037f8997cf42c1ce26417e015091451b15424b2c59eb8d4161b0975630408e394d3b00f88d4b4e18e2cc85e8251d4753a27c639c83f5ad4a571c4f19d7cd460b9b73c25ade730c99df09637bd173d8e3e981ac64432078263bb6dc30d3e974150dd0200d0ee05be3d4604d2146fb0457f31ba17c057560785aa804e8ca5530a7cd81d3440d0f4ba6851efcfd3954b7e68908fc0ba47f7ac37bf559c6c168b70d3a7c8cd0200da1c677c4bce06a068070f2b3733b0a714e88d62aa3f9a26c6f5216d48d5c2b5624144f3807c0df30be66b3268eeeca4df1fbded58faf49fc95dc3c35f134f8b01fd1396b6c0fc1b6c4f0eb8f5e44b8eace1e6073e20d0b8bc5385f86f1cf3f050f66af789f3ef1fc107b7f4421e19e0349c730c68f0a226981f4e889054fdb4dc149e8e889f04180102000905024d3c5c10021b0c000a0910a34d7e18c20c31bb1a03040085c8d62e16d05dc4e9dad64953c8a2eed8b6c12f92b1575eeaa6dcf7be9473dd5b24b37b6dffbb4e7c99ed1bd3cb11634be19b3e6e207bed7505c7ca111ccf47cb323bf1f8851eb6360e8034cbff8dd149993c959de89f8f77f38e7e98b8e3076323aa719328e2b408db5ec0d03936efd57422ba04f925cdc7b4c1af7590e40ab00200009501fe044d3c5c33010400b488c3e5f83f4d561f317817538d9d0397981e9aef1321ca68ebfae1cf8b7d388e19f4b5a24a82e2fbbf1c6c26557a6c5845307a03d815756f564ac7325b02bc83e87d5480a8fae848f07cb891f2d51ce7df83dcafdc12324517c86d472cc0ee10d47a68fd1d9ae49a6c19bbd36d82af597a0d88cc9c49de9df4e696fc1f0b5d0011010001fe030302e9030f3c783e14856063f16938530e148bc57a7aa3f3e4f90df9dceccdc779bc0835e1ad3d006e4a8d7b36d08b8e0de5a0d947254ecfbd22037e6572b426bcfdc517796b224b0036ff90bc574b5509bede85512f2eefb520fb4b02aa523ba739bff424a6fe81c5041f253f8d757e69a503d3563a104d0d49e9e890b9d0c26f96b55b743883b472caa7050c4acfd4a21f875bdf1258d88bd61224d303dc9df77f743137d51e6d5246b88c406780528fd9a3e15bab5452e5b93970d9dcc79f48b38651b9f15bfbcf6da452837e9cc70683d1bdca94507870f743e4ad902005812488dd342f836e72869afd00ce1850eea4cfa53ce10e3608e13d3c149394ee3cbd0e23d018fcbcb6e2ec5a1a22972d1d462ca05355d0d290dd2751e550d5efb38c6c89686344df64852bf4ff86638708f644e8ec6bd4af9b50d8541cb91891a431326ab2e332faa7ae86cfb6e0540aa63160c1e5cdd5a4add518b303fff0a20117c6bc77f7cfbaf36b04c865c6c2b42754657374204b6579203220285253412c20656e637279707465642070726976617465206b65792988b804130102002205024d3c5c33021b03060b090807030206150802090a0b0416020301021e01021780000a0910d4984f961e35246b98940400908a73b6a6169f700434f076c6c79015a49bee37130eaf23aaa3cfa9ce60bfe4acaa7bc95f1146ada5867e0079babb38804891f4f0b8ebca57a86b249dee786161a755b7a342e68ccf3f78ed6440a93a6626beb9a37aa66afcd4f888790cb4bb46d94a4ae3eb3d7d3e6b00f6bfec940303e89ec5b32a1eaaacce66497d539328b00200009d01fe044d3c5c33010400a4e913f9442abcc7f1804ccab27d2f787ffa592077ca935a8bb23165bd8d57576acac647cc596b2c3f814518cc8c82953c7a4478f32e0cf645630a5ba38d9618ef2bc3add69d459ae3dece5cab778938d988239f8c5ae437807075e06c828019959c644ff05ef6a5a1dab72227c98e3a040b0cf219026640698d7a13d8538a570011010001fe030302e9030f3c783e148560f936097339ae381d63116efcf802ff8b1c9360767db5219cc987375702a4123fd8657d3e22700f23f95020d1b261eda5257e9a72f9a918e8ef22dd5b3323ae03bbc1923dd224db988cadc16acc04b120a9f8b7e84da9716c53e0334d7b66586ddb9014df604b41be1e960dcfcbc96f4ed150a1a0dd070b9eb14276b9b6be413a769a75b519a53d3ecc0c220e85cd91ca354d57e7344517e64b43b6e29823cbd87eae26e2b2e78e6dedfbb76e3e9f77bcb844f9a8932eb3db2c3f9e44316e6f5d60e9e2a56e46b72abe6b06dc9a31cc63f10023d1f5e12d2a3ee93b675c96f504af0001220991c88db759e231b3320dcedf814dcf723fd9857e3d72d66a0f2af26950b915abdf56c1596f46a325bf17ad4810d3535fb02a259b247ac3dbd4cc3ecf9c51b6c07cebb009c1506fba0a89321ec8683e3fd009a6e551d50243e2d5092fefb3321083a4bad91320dc624bd6b5dddf93553e3d53924c05bfebec1fb4bd47e89a1a889f04180102000905024d3c5c33021b0c000a0910d4984f961e35246b26c703ff7ee29ef53bc1ae1ead533c408fa136db508434e233d6e62be621e031e5940bbd4c08142aed0f82217e7c3e1ec8de574bc06ccf3c36633be41ad78a9eacd209f861cae7b064100758545cc9dd83db71806dc1cfd5fb9ae5c7474bba0c19c44034ae61bae5eca379383339dece94ff56ff7aa44a582f3e5c38f45763af577c0934b0020000"
+
+const dsaElGamalTestKeysHex = "9501e1044dfcb16a110400aa3e5c1a1f43dd28c2ffae8abf5cfce555ee874134d8ba0a0f7b868ce2214beddc74e5e1e21ded354a95d18acdaf69e5e342371a71fbb9093162e0c5f3427de413a7f2c157d83f5cd2f9d791256dc4f6f0e13f13c3302af27f2384075ab3021dff7a050e14854bbde0a1094174855fc02f0bae8e00a340d94a1f22b32e48485700a0cec672ac21258fb95f61de2ce1af74b2c4fa3e6703ff698edc9be22c02ae4d916e4fa223f819d46582c0516235848a77b577ea49018dcd5e9e15cff9dbb4663a1ae6dd7580fa40946d40c05f72814b0f88481207e6c0832c3bded4853ebba0a7e3bd8e8c66df33d5a537cd4acf946d1080e7a3dcea679cb2b11a72a33a2b6a9dc85f466ad2ddf4c3db6283fa645343286971e3dd700703fc0c4e290d45767f370831a90187e74e9972aae5bff488eeff7d620af0362bfb95c1a6c3413ab5d15a2e4139e5d07a54d72583914661ed6a87cce810be28a0aa8879a2dd39e52fb6fe800f4f181ac7e328f740cde3d09a05cecf9483e4cca4253e60d4429ffd679d9996a520012aad119878c941e3cf151459873bdfc2a9563472fe0303027a728f9feb3b864260a1babe83925ce794710cfd642ee4ae0e5b9d74cee49e9c67b6cd0ea5dfbb582132195a121356a1513e1bca73e5b80c58c7ccb4164453412f456c47616d616c2054657374204b65792031886204131102002205024dfcb16a021b03060b090807030206150802090a0b0416020301021e01021780000a091033af447ccd759b09fadd00a0b8fd6f5a790bad7e9f2dbb7632046dc4493588db009c087c6a9ba9f7f49fab221587a74788c00db4889ab00200009d0157044dfcb16a1004008dec3f9291205255ccff8c532318133a6840739dd68b03ba942676f9038612071447bf07d00d559c5c0875724ea16a4c774f80d8338b55fca691a0522e530e604215b467bbc9ccfd483a1da99d7bc2648b4318fdbd27766fc8bfad3fddb37c62b8ae7ccfe9577e9b8d1e77c1d417ed2c2ef02d52f4da11600d85d3229607943700030503ff506c94c87c8cab778e963b76cf63770f0a79bf48fb49d3b4e52234620fc9f7657f9f8d56c96a2b7c7826ae6b57ebb2221a3fe154b03b6637cea7e6d98e3e45d87cf8dc432f723d3d71f89c5192ac8d7290684d2c25ce55846a80c9a7823f6acd9bb29fa6cd71f20bc90eccfca20451d0c976e460e672b000df49466408d527affe0303027a728f9feb3b864260abd761730327bca2aaa4ea0525c175e92bf240682a0e83b226f97ecb2e935b62c9a133858ce31b271fa8eb41f6a1b3cd72a63025ce1a75ee4180dcc284884904181102000905024dfcb16a021b0c000a091033af447ccd759b09dd0b009e3c3e7296092c81bee5a19929462caaf2fff3ae26009e218c437a2340e7ea628149af1ec98ec091a43992b00200009501e1044dfcb1be1104009f61faa61aa43df75d128cbe53de528c4aec49ce9360c992e70c77072ad5623de0a3a6212771b66b39a30dad6781799e92608316900518ec01184a85d872365b7d2ba4bacfb5882ea3c2473d3750dc6178cc1cf82147fb58caa28b28e9f12f6d1efcb0534abed644156c91cca4ab78834268495160b2400bc422beb37d237c2300a0cac94911b6d493bda1e1fbc6feeca7cb7421d34b03fe22cec6ccb39675bb7b94a335c2b7be888fd3906a1125f33301d8aa6ec6ee6878f46f73961c8d57a3e9544d8ef2a2cbfd4d52da665b1266928cfe4cb347a58c412815f3b2d2369dec04b41ac9a71cc9547426d5ab941cccf3b18575637ccfb42df1a802df3cfe0a999f9e7109331170e3a221991bf868543960f8c816c28097e503fe319db10fb98049f3a57d7c80c420da66d56f3644371631fad3f0ff4040a19a4fedc2d07727a1b27576f75a4d28c47d8246f27071e12d7a8de62aad216ddbae6aa02efd6b8a3e2818cda48526549791ab277e447b3a36c57cefe9b592f5eab73959743fcc8e83cbefec03a329b55018b53eec196765ae40ef9e20521a603c551efe0303020950d53a146bf9c66034d00c23130cce95576a2ff78016ca471276e8227fb30b1ffbd92e61804fb0c3eff9e30b1a826ee8f3e4730b4d86273ca977b4164453412f456c47616d616c2054657374204b65792032886204131102002205024dfcb1be021b03060b090807030206150802090a0b0416020301021e01021780000a0910a86bf526325b21b22bd9009e34511620415c974750a20df5cb56b182f3b48e6600a0a9466cb1a1305a84953445f77d461593f1d42bc1b00200009d0157044dfcb1be1004009565a951da1ee87119d600c077198f1c1bceb0f7aa54552489298e41ff788fa8f0d43a69871f0f6f77ebdfb14a4260cf9fbeb65d5844b4272a1904dd95136d06c3da745dc46327dd44a0f16f60135914368c8039a34033862261806bb2c5ce1152e2840254697872c85441ccb7321431d75a747a4bfb1d2c66362b51ce76311700030503fc0ea76601c196768070b7365a200e6ddb09307f262d5f39eec467b5f5784e22abdf1aa49226f59ab37cb49969d8f5230ea65caf56015abda62604544ed526c5c522bf92bed178a078789f6c807b6d34885688024a5bed9e9f8c58d11d4b82487b44c5f470c5606806a0443b79cadb45e0f897a561a53f724e5349b9267c75ca17fe0303020950d53a146bf9c660bc5f4ce8f072465e2d2466434320c1e712272fafc20e342fe7608101580fa1a1a367e60486a7cd1246b7ef5586cf5e10b32762b710a30144f12dd17dd4884904181102000905024dfcb1be021b0c000a0910a86bf526325b21b2904c00a0b2b66b4b39ccffda1d10f3ea8d58f827e30a8b8e009f4255b2d8112a184e40cde43a34e8655ca7809370b0020000"
+
+const ed25519wX25519Key = "c54b0663877fe31b00000020f94da7bb48d60a61e567706a6587d0331999bb9d891a08242ead84543df895a3001972817b12be707e8d5f586ce61361201d344eb266a2c82fde6835762b65b0b7c2b1061f1b0a00000042058263877fe3030b090705150a0e080c021600029b03021e09222106cb186c4f0609a697e4d52dfa6c722b0c1f1e27c18a56708f6525ec27bad9acc905270902070200000000ad2820103e2d7d227ec0e6d7ce4471db36bfc97083253690271498a7ef0576c07faae14585b3b903b0127ec4fda2f023045a2ec76bcb4f9571a9651e14aee1137a1d668442c88f951e33c4ffd33fb9a17d511eed758fc6d9cc50cb5fd793b2039d5804c74b0663877fe319000000208693248367f9e5015db922f8f48095dda784987f2d5985b12fbad16caf5e4435004d600a4f794d44775c57a26e0feefed558e9afffd6ad0d582d57fb2ba2dcedb8c29b06181b0a0000002c050263877fe322a106cb186c4f0609a697e4d52dfa6c722b0c1f1e27c18a56708f6525ec27bad9acc9021b0c00000000defa20a6e9186d9d5935fc8fe56314cdb527486a5a5120f9b762a235a729f039010a56b89c658568341fbef3b894e9834ad9bc72afae2f4c9c47a43855e65f1cb0a3f77bbc5f61085c1f8249fe4e7ca59af5f0bcee9398e0fa8d76e522e1d8ab42bb0d"
+
+const signedMessageHex = "a3019bc0cbccc0c4b8d8b74ee2108fe16ec6d3ca490cbe362d3f8333d3f352531472538b8b13d353b97232f352158c20943157c71c16064626063656269052062e4e01987e9b6fccff4b7df3a34c534b23e679cbec3bc0f8f6e64dfb4b55fe3f8efa9ce110ddb5cd79faf1d753c51aecfa669f7e7aa043436596cccc3359cb7dd6bbe9ecaa69e5989d9e57209571edc0b2fa7f57b9b79a64ee6e99ce1371395fee92fec2796f7b15a77c386ff668ee27f6d38f0baa6c438b561657377bf6acff3c5947befd7bf4c196252f1d6e5c524d0300"
+
+const signedTextMessageHex = "a3019bc0cbccc8c4b8d8b74ee2108fe16ec6d36a250cbece0c178233d3f352531472538b8b13d35379b97232f352158ca0b4312f57c71c1646462606365626906a062e4e019811591798ff99bf8afee860b0d8a8c2a85c3387e3bcf0bb3b17987f2bbcfab2aa526d930cbfd3d98757184df3995c9f3e7790e36e3e9779f06089d4c64e9e47dd6202cb6e9bc73c5d11bb59fbaf89d22d8dc7cf199ddf17af96e77c5f65f9bbed56f427bd8db7af37f6c9984bf9385efaf5f184f986fb3e6adb0ecfe35bbf92d16a7aa2a344fb0bc52fb7624f0200"
+
+const signedEncryptedMessageHex = "c18c032a67d68660df41c70103ff5a84c9a72f80e74ef0384c2d6a9ebfe2b09e06a8f298394f6d2abf174e40934ab0ec01fb2d0ddf21211c6fe13eb238563663b017a6b44edca552eb4736c4b7dc6ed907dd9e12a21b51b64b46f902f76fb7aaf805c1db8070574d8d0431a23e324a750f77fb72340a17a42300ee4ca8207301e95a731da229a63ab9c6b44541fbd2c11d016d810b3b3b2b38f15b5b40f0a4910332829c2062f1f7cc61f5b03677d73c54cafa1004ced41f315d46444946faae571d6f426e6dbd45d9780eb466df042005298adabf7ce0ef766dfeb94cd449c7ed0046c880339599c4711af073ce649b1e237c40b50a5536283e03bdbb7afad78bd08707715c67fb43295f905b4c479178809d429a8e167a9a8c6dfd8ab20b4edebdc38d6dec879a3202e1b752690d9bb5b0c07c5a227c79cc200e713a99251a4219d62ad5556900cf69bd384b6c8e726c7be267471d0d23af956da165af4af757246c2ebcc302b39e8ef2fccb4971b234fcda22d759ddb20e27269ee7f7fe67898a9de721bfa02ab0becaa046d00ea16cb1afc4e2eab40d0ac17121c565686e5cbd0cbdfbd9d6db5c70278b9c9db5a83176d04f61fbfbc4471d721340ede2746e5c312ded4f26787985af92b64fae3f253dbdde97f6a5e1996fd4d865599e32ff76325d3e9abe93184c02988ee89a4504356a4ef3b9b7a57cbb9637ca90af34a7676b9ef559325c3cca4e29d69fec1887f5440bb101361d744ad292a8547f22b4f22b419a42aa836169b89190f46d9560824cb2ac6e8771de8223216a5e647e132ab9eebcba89569ab339cb1c3d70fe806b31f4f4c600b4103b8d7583ebff16e43dcda551e6530f975122eb8b29"
+
+const verifiedSignatureEncryptedMessageHex = "c2b304000108000605026048f6d600210910a34d7e18c20c31bb1621045fb74b1d03b1e3cb31bc2f8aa34d7e18c20c31bb9a3b0400a32ddac1af259c1b0abab0041327ea04970944401978fb647dd1cf9aba4f164e43f0d8a9389501886474bdd4a6e77f6aea945c07dfbf87743835b44cc2c39a1f9aeecfa83135abc92e18e50396f2e6a06c44e0188b0081effbfb4160d28f118d4ff73dd199a102e47cffd8c7ff2bacd83ae72b5820c021a486766dd587b5da61"
+
+const unverifiedSignatureEncryptedMessageHex = "c2b304000108000605026048f6d600210910a34d7e18c20c31bb1621045fb74b1d03b1e3cb31bc2f8aa34d7e18c20c31bb9a3b0400a32ddac1af259c1b0abab0041327ea04970944401978fb647dd1cf9aba4f164e43f0d8a9389501886474bdd4a6e77f6aea945c07dfbf87743835b44cc2c39a1f9aeecfa83135abc92e18e50396f2e6a06c44e0188b0081effbfb4160d28f118d4ff73dd199a102e47cffd8c7ff2bacd83ae72b5820c021a486766dd587b5da61"
+
+const signedEncryptedMessage2Hex = "85010e03cf6a7abcd43e36731003fb057f5495b79db367e277cdbe4ab90d924ddee0c0381494112ff8c1238fb0184af35d1731573b01bc4c55ecacd2aafbe2003d36310487d1ecc9ac994f3fada7f9f7f5c3a64248ab7782906c82c6ff1303b69a84d9a9529c31ecafbcdb9ba87e05439897d87e8a2a3dec55e14df19bba7f7bd316291c002ae2efd24f83f9e3441203fc081c0c23dc3092a454ca8a082b27f631abf73aca341686982e8fbda7e0e7d863941d68f3de4a755c2964407f4b5e0477b3196b8c93d551dd23c8beef7d0f03fbb1b6066f78907faf4bf1677d8fcec72651124080e0b7feae6b476e72ab207d38d90b958759fdedfc3c6c35717c9dbfc979b3cfbbff0a76d24a5e57056bb88acbd2a901ef64bc6e4db02adc05b6250ff378de81dca18c1910ab257dff1b9771b85bb9bbe0a69f5989e6d1710a35e6dfcceb7d8fb5ccea8db3932b3d9ff3fe0d327597c68b3622aec8e3716c83a6c93f497543b459b58ba504ed6bcaa747d37d2ca746fe49ae0a6ce4a8b694234e941b5159ff8bd34b9023da2814076163b86f40eed7c9472f81b551452d5ab87004a373c0172ec87ea6ce42ccfa7dbdad66b745496c4873d8019e8c28d6b3"
+
+const signatureEncryptedMessage2Hex = "c24604001102000605024dfd0166000a091033af447ccd759b09bae600a096ec5e63ecf0a403085e10f75cc3bab327663282009f51fad9df457ed8d2b70d8a73c76e0443eac0f377"
+
+const symmetricallyEncryptedCompressedHex = "c32e040903085a357c1a7b5614ed00cc0d1d92f428162058b3f558a0fb0980d221ebac6c97d5eda4e0fe32f6e706e94dd263012d6ca1ef8c4bbd324098225e603a10c85ebf09cbf7b5aeeb5ce46381a52edc51038b76a8454483be74e6dcd1e50d5689a8ae7eceaeefed98a0023d49b22eb1f65c2aa1ef1783bb5e1995713b0457102ec3c3075fe871267ffa4b686ad5d52000d857"
+
+const dsaTestKeyHex = "9901a2044d6c49de110400cb5ce438cf9250907ac2ba5bf6547931270b89f7c4b53d9d09f4d0213a5ef2ec1f26806d3d259960f872a4a102ef1581ea3f6d6882d15134f21ef6a84de933cc34c47cc9106efe3bd84c6aec12e78523661e29bc1a61f0aab17fa58a627fd5fd33f5149153fbe8cd70edf3d963bc287ef875270ff14b5bfdd1bca4483793923b00a0fe46d76cb6e4cbdc568435cd5480af3266d610d303fe33ae8273f30a96d4d34f42fa28ce1112d425b2e3bf7ea553d526e2db6b9255e9dc7419045ce817214d1a0056dbc8d5289956a4b1b69f20f1105124096e6a438f41f2e2495923b0f34b70642607d45559595c7fe94d7fa85fc41bf7d68c1fd509ebeaa5f315f6059a446b9369c277597e4f474a9591535354c7e7f4fd98a08aa60400b130c24ff20bdfbf683313f5daebf1c9b34b3bdadfc77f2ddd72ee1fb17e56c473664bc21d66467655dd74b9005e3a2bacce446f1920cd7017231ae447b67036c9b431b8179deacd5120262d894c26bc015bffe3d827ba7087ad9b700d2ca1f6d16cc1786581e5dd065f293c31209300f9b0afcc3f7c08dd26d0a22d87580b4db41054657374204b65792033202844534129886204131102002205024d6c49de021b03060b090807030206150802090a0b0416020301021e01021780000a0910338934250ccc03607e0400a0bdb9193e8a6b96fc2dfc108ae848914b504481f100a09c4dc148cb693293a67af24dd40d2b13a9e36794"
+
+const dsaTestKeyPrivateHex = "9501bb044d6c49de110400cb5ce438cf9250907ac2ba5bf6547931270b89f7c4b53d9d09f4d0213a5ef2ec1f26806d3d259960f872a4a102ef1581ea3f6d6882d15134f21ef6a84de933cc34c47cc9106efe3bd84c6aec12e78523661e29bc1a61f0aab17fa58a627fd5fd33f5149153fbe8cd70edf3d963bc287ef875270ff14b5bfdd1bca4483793923b00a0fe46d76cb6e4cbdc568435cd5480af3266d610d303fe33ae8273f30a96d4d34f42fa28ce1112d425b2e3bf7ea553d526e2db6b9255e9dc7419045ce817214d1a0056dbc8d5289956a4b1b69f20f1105124096e6a438f41f2e2495923b0f34b70642607d45559595c7fe94d7fa85fc41bf7d68c1fd509ebeaa5f315f6059a446b9369c277597e4f474a9591535354c7e7f4fd98a08aa60400b130c24ff20bdfbf683313f5daebf1c9b34b3bdadfc77f2ddd72ee1fb17e56c473664bc21d66467655dd74b9005e3a2bacce446f1920cd7017231ae447b67036c9b431b8179deacd5120262d894c26bc015bffe3d827ba7087ad9b700d2ca1f6d16cc1786581e5dd065f293c31209300f9b0afcc3f7c08dd26d0a22d87580b4d00009f592e0619d823953577d4503061706843317e4fee083db41054657374204b65792033202844534129886204131102002205024d6c49de021b03060b090807030206150802090a0b0416020301021e01021780000a0910338934250ccc03607e0400a0bdb9193e8a6b96fc2dfc108ae848914b504481f100a09c4dc148cb693293a67af24dd40d2b13a9e36794"
+
+const p256TestKeyHex = "98520456e5b83813082a8648ce3d030107020304a2072cd6d21321266c758cc5b83fab0510f751cb8d91897cddb7047d8d6f185546e2107111b0a95cb8ef063c33245502af7a65f004d5919d93ee74eb71a66253b424502d3235362054657374204b6579203c696e76616c6964406578616d706c652e636f6d3e8879041313080021050256e5b838021b03050b09080702061508090a0b020416020301021e01021780000a0910d44a2c495918513e54e50100dfa64f97d9b47766fc1943c6314ba3f2b2a103d71ad286dc5b1efb96a345b0c80100dbc8150b54241f559da6ef4baacea6d31902b4f4b1bdc09b34bf0502334b7754b8560456e5b83812082a8648ce3d030107020304bfe3cea9cee13486f8d518aa487fecab451f25467d2bf08e58f63e5fa525d5482133e6a79299c274b068ef0be448152ad65cf11cf764348588ca4f6a0bcf22b6030108078861041813080009050256e5b838021b0c000a0910d44a2c495918513e4a4800ff49d589fa64024ad30be363a032e3a0e0e6f5db56ba4c73db850518bf0121b8f20100fd78e065f4c70ea5be9df319ea67e493b936fc78da834a71828043d3154af56e"
+
+const p256TestKeyPrivateHex = "94a50456e5b83813082a8648ce3d030107020304a2072cd6d21321266c758cc5b83fab0510f751cb8d91897cddb7047d8d6f185546e2107111b0a95cb8ef063c33245502af7a65f004d5919d93ee74eb71a66253fe070302f0c2bfb0b6c30f87ee1599472b8636477eab23ced13b271886a4b50ed34c9d8436af5af5b8f88921f0efba6ef8c37c459bbb88bc1c6a13bbd25c4ce9b1e97679569ee77645d469bf4b43de637f5561b424502d3235362054657374204b6579203c696e76616c6964406578616d706c652e636f6d3e8879041313080021050256e5b838021b03050b09080702061508090a0b020416020301021e01021780000a0910d44a2c495918513e54e50100dfa64f97d9b47766fc1943c6314ba3f2b2a103d71ad286dc5b1efb96a345b0c80100dbc8150b54241f559da6ef4baacea6d31902b4f4b1bdc09b34bf0502334b77549ca90456e5b83812082a8648ce3d030107020304bfe3cea9cee13486f8d518aa487fecab451f25467d2bf08e58f63e5fa525d5482133e6a79299c274b068ef0be448152ad65cf11cf764348588ca4f6a0bcf22b603010807fe0703027510012471a603cfee2968dce19f732721ddf03e966fd133b4e3c7a685b788705cbc46fb026dc94724b830c9edbaecd2fb2c662f23169516cacd1fe423f0475c364ecc10abcabcfd4bbbda1a36a1bd8861041813080009050256e5b838021b0c000a0910d44a2c495918513e4a4800ff49d589fa64024ad30be363a032e3a0e0e6f5db56ba4c73db850518bf0121b8f20100fd78e065f4c70ea5be9df319ea67e493b936fc78da834a71828043d3154af56e"
+
+const armoredPrivateKeyBlock = `-----BEGIN PGP PRIVATE KEY BLOCK-----
+Version: GnuPG v1.4.10 (GNU/Linux)
+
+lQHYBE2rFNoBBADFwqWQIW/DSqcB4yCQqnAFTJ27qS5AnB46ccAdw3u4Greeu3Bp
+idpoHdjULy7zSKlwR1EA873dO/k/e11Ml3dlAFUinWeejWaK2ugFP6JjiieSsrKn
+vWNicdCS4HTWn0X4sjl0ZiAygw6GNhqEQ3cpLeL0g8E9hnYzJKQ0LWJa0QARAQAB
+AAP/TB81EIo2VYNmTq0pK1ZXwUpxCrvAAIG3hwKjEzHcbQznsjNvPUihZ+NZQ6+X
+0HCfPAdPkGDCLCb6NavcSW+iNnLTrdDnSI6+3BbIONqWWdRDYJhqZCkqmG6zqSfL
+IdkJgCw94taUg5BWP/AAeQrhzjChvpMQTVKQL5mnuZbUCeMCAN5qrYMP2S9iKdnk
+VANIFj7656ARKt/nf4CBzxcpHTyB8+d2CtPDKCmlJP6vL8t58Jmih+kHJMvC0dzn
+gr5f5+sCAOOe5gt9e0am7AvQWhdbHVfJU0TQJx+m2OiCJAqGTB1nvtBLHdJnfdC9
+TnXXQ6ZXibqLyBies/xeY2sCKL5qtTMCAKnX9+9d/5yQxRyrQUHt1NYhaXZnJbHx
+q4ytu0eWz+5i68IYUSK69jJ1NWPM0T6SkqpB3KCAIv68VFm9PxqG1KmhSrQIVGVz
+dCBLZXmIuAQTAQIAIgUCTasU2gIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AA
+CgkQO9o98PRieSoLhgQAkLEZex02Qt7vGhZzMwuN0R22w3VwyYyjBx+fM3JFETy1
+ut4xcLJoJfIaF5ZS38UplgakHG0FQ+b49i8dMij0aZmDqGxrew1m4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xtHXDUdmuvzchyg6005qIBJ4
+sfaSxX7QgH9RV2ONUhC+WiayCNADq+UMzuR/vunSr4aQffXvuGnR383/AAAAFDxk
+Z2lsQHlhaG9vLWluYy5jb20+wv8AAACGBBATCAA4/wAAAAWCVGvAG/8AAAACiwn/
+AAAACZC2VkQCOjdvYf8AAAAFlQgJCgv/AAAAA5YBAv8AAAACngEAAE1BAP0X8veD
+24IjmI5/C6ZAfVNXxgZZFhTAACFX75jUA3oD6AEAzoSwKf1aqH6oq62qhCN/pekX
++WAsVMBhNwzLpqtCRjLO/wAAAFYEAAAAABIIKoZIzj0DAQcCAwT50ain7vXiIRv8
+B1DO3x3cE/aattZ5sHNixJzRCXi2vQIA5QmOxZ6b5jjUekNbdHG3SZi1a2Ak5mfX
+fRxC/5VGAwEIB8L/AAAAZQQYEwgAGP8AAAAFglRrwBz/AAAACZC2VkQCOjdvYQAA
+FJAA9isX3xtGyMLYwp2F3nXm7QEdY5bq5VUcD/RJlj792VwA/1wH0pCzVLl4Q9F9
+ex7En5r7rHR5xwX82Msc+Rq9dSyO
+=7MrZ
+-----END PGP PUBLIC KEY BLOCK-----`
+
+const dsaKeyWithSHA512 = `9901a2044f04b07f110400db244efecc7316553ee08d179972aab87bb1214de7692593fcf5b6feb1c80fba268722dd464748539b85b81d574cd2d7ad0ca2444de4d849b8756bad7768c486c83a824f9bba4af773d11742bdfb4ac3b89ef8cc9452d4aad31a37e4b630d33927bff68e879284a1672659b8b298222fc68f370f3e24dccacc4a862442b9438b00a0ea444a24088dc23e26df7daf8f43cba3bffc4fe703fe3d6cd7fdca199d54ed8ae501c30e3ec7871ea9cdd4cf63cfe6fc82281d70a5b8bb493f922cd99fba5f088935596af087c8d818d5ec4d0b9afa7f070b3d7c1dd32a84fca08d8280b4890c8da1dde334de8e3cad8450eed2a4a4fcc2db7b8e5528b869a74a7f0189e11ef097ef1253582348de072bb07a9fa8ab838e993cef0ee203ff49298723e2d1f549b00559f886cd417a41692ce58d0ac1307dc71d85a8af21b0cf6eaa14baf2922d3a70389bedf17cc514ba0febbd107675a372fe84b90162a9e88b14d4b1c6be855b96b33fb198c46f058568817780435b6936167ebb3724b680f32bf27382ada2e37a879b3d9de2abe0c3f399350afd1ad438883f4791e2e3b4184453412068617368207472756e636174696f6e207465737488620413110a002205024f04b07f021b03060b090807030206150802090a0b0416020301021e01021780000a0910ef20e0cefca131581318009e2bf3bf047a44d75a9bacd00161ee04d435522397009a03a60d51bd8a568c6c021c8d7cf1be8d990d6417b0020003`
+
+const unknownHashFunctionHex = `8a00000040040001990006050253863c24000a09103b4fe6acc0b21f32ffff0101010101010101010101010101010101010101010101010101010101010101010101010101`
+
+const rsaSignatureBadMPIlength = `8a00000040040001030006050253863c24000a09103b4fe6acc0b21f32ffff0101010101010101010101010101010101010101010101010101010101010101010101010101`
+
+const missingHashFunctionHex = `8a00000040040001030006050253863c24000a09103b4fe6acc0b21f32ffff0101010101010101010101010101010101010101010101010101010101010101010101010101`
+
+const campbellQuine = `a0b001000300fcffa0b001000d00f2ff000300fcffa0b001000d00f2ff8270a01c00000500faff8270a01c00000500faff000500faff001400ebff8270a01c00000500faff000500faff001400ebff428821c400001400ebff428821c400001400ebff428821c400001400ebff428821c400001400ebff428821c400000000ffff000000ffff000b00f4ff428821c400000000ffff000000ffff000b00f4ff0233214c40000100feff000233214c40000100feff0000`
+
+const keyV4forVerifyingSignedMessageV3 = `-----BEGIN PGP PUBLIC KEY BLOCK-----
+Comment: GPGTools - https://gpgtools.org
+
+mI0EVfxoFQEEAMBIqmbDfYygcvP6Phr1wr1XI41IF7Qixqybs/foBF8qqblD9gIY
+BKpXjnBOtbkcVOJ0nljd3/sQIfH4E0vQwK5/4YRQSI59eKOqd6Fx+fWQOLG+uu6z
+tewpeCj9LLHvibx/Sc7VWRnrznia6ftrXxJ/wHMezSab3tnGC0YPVdGNABEBAAG0
+JEdvY3J5cHRvIFRlc3QgS2V5IDx0aGVtYXhAZ21haWwuY29tPoi5BBMBCgAjBQJV
+/GgVAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQeXnQmhdGW9PFVAP+
+K7TU0qX5ArvIONIxh/WAweyOk884c5cE8f+3NOPOOCRGyVy0FId5A7MmD5GOQh4H
+JseOZVEVCqlmngEvtHZb3U1VYtVGE5WZ+6rQhGsMcWP5qaT4soYwMBlSYxgYwQcx
+YhN9qOr292f9j2Y//TTIJmZT4Oa+lMxhWdqTfX+qMgG4jQRV/GgVAQQArhFSiij1
+b+hT3dnapbEU+23Z1yTu1DfF6zsxQ4XQWEV3eR8v+8mEDDNcz8oyyF56k6UQ3rXi
+UMTIwRDg4V6SbZmaFbZYCOwp/EmXJ3rfhm7z7yzXj2OFN22luuqbyVhuL7LRdB0M
+pxgmjXb4tTvfgKd26x34S+QqUJ7W6uprY4sAEQEAAYifBBgBCgAJBQJV/GgVAhsM
+AAoJEHl50JoXRlvT7y8D/02ckx4OMkKBZo7viyrBw0MLG92i+DC2bs35PooHR6zz
+786mitjOp5z2QWNLBvxC70S0qVfCIz8jKupO1J6rq6Z8CcbLF3qjm6h1omUBf8Nd
+EfXKD2/2HV6zMKVknnKzIEzauh+eCKS2CeJUSSSryap/QLVAjRnckaES/OsEWhNB
+=RZia
+-----END PGP PUBLIC KEY BLOCK-----
+`
+
+const signedMessageV3 = `-----BEGIN PGP MESSAGE-----
+Comment: GPGTools - https://gpgtools.org
+
+owGbwMvMwMVYWXlhlrhb9GXG03JJDKF/MtxDMjKLFYAoUaEktbhEITe1uDgxPVWP
+q5NhKjMrWAVcC9evD8z/bF/uWNjqtk/X3y5/38XGRQHm/57rrDRYuGnTw597Xqka
+uM3137/hH3Os+Jf2dc0fXOITKwJvXJvecPVs0ta+Vg7ZO1MLn8w58Xx+6L58mbka
+DGHyU9yTueZE8D+QF/Tz28Y78dqtF56R1VPn9Xw4uJqrWYdd7b3vIZ1V6R4Nh05d
+iT57d/OhWwA=
+=hG7R
+-----END PGP MESSAGE-----
+`
+
+// https://mailarchive.ietf.org/arch/msg/openpgp/9SheW_LENE0Kxf7haNllovPyAdY/
+const v5PrivKey = `-----BEGIN PGP PRIVATE KEY BLOCK-----
+
+lGEFXJH05BYAAAAtCSsGAQQB2kcPAQEHQFhZlVcVVtwf+21xNQPX+ecMJJBL0MPd
+fj75iux+my8QAAAAAAAiAQCHZ1SnSUmWqxEsoI6facIVZQu6mph3cBFzzTvcm5lA
+Ng5ctBhlbW1hLmdvbGRtYW5AZXhhbXBsZS5uZXSIlgUTFggASCIhBRk0e8mHJGQC
+X5nfPsLgAA7ZiEiS4fez6kyUAJFZVptUBQJckfTkAhsDBQsJCAcCAyICAQYVCgkI
+CwIEFgIDAQIeBwIXgAAA9cAA/jiR3yMsZMeEQ40u6uzEoXa6UXeV/S3wwJAXRJy9
+M8s0AP9vuL/7AyTfFXwwzSjDnYmzS0qAhbLDQ643N+MXGBJ2BZxmBVyR9OQSAAAA
+MgorBgEEAZdVAQUBAQdA+nysrzml2UCweAqtpDuncSPlvrcBWKU0yfU0YvYWWAoD
+AQgHAAAAAAAiAP9OdAPppjU1WwpqjIItkxr+VPQRT8Zm/Riw7U3F6v3OiBFHiHoF
+GBYIACwiIQUZNHvJhyRkAl+Z3z7C4AAO2YhIkuH3s+pMlACRWVabVAUCXJH05AIb
+DAAAOSQBAP4BOOIR/sGLNMOfeb5fPs/02QMieoiSjIBnijhob2U5AQC+RtOHCHx7
+TcIYl5/Uyoi+FOvPLcNw4hOv2nwUzSSVAw==
+=IiS2
+-----END PGP PRIVATE KEY BLOCK-----`
+
+// See OpenPGP crypto refresh Section A.3.
+const v6PrivKey = `-----BEGIN PGP PRIVATE KEY BLOCK-----
+
+xUsGY4d/4xsAAAAg+U2nu0jWCmHlZ3BqZYfQMxmZu52JGggkLq2EVD34laMAGXKB
+exK+cH6NX1hs5hNhIB00TrJmosgv3mg1ditlsLfCsQYfGwoAAABCBYJjh3/jAwsJ
+BwUVCg4IDAIWAAKbAwIeCSIhBssYbE8GCaaX5NUt+mxyKwwfHifBilZwj2Ul7Ce6
+2azJBScJAgcCAAAAAK0oIBA+LX0ifsDm185Ecds2v8lwgyU2kCcUmKfvBXbAf6rh
+RYWzuQOwEn7E/aLwIwRaLsdry0+VcallHhSu4RN6HWaEQsiPlR4zxP/TP7mhfVEe
+7XWPxtnMUMtf15OyA51YBMdLBmOHf+MZAAAAIIaTJINn+eUBXbki+PSAld2nhJh/
+LVmFsS+60WyvXkQ1AE1gCk95TUR3XFeibg/u/tVY6a//1q0NWC1X+yui3O24wpsG
+GBsKAAAALAWCY4d/4wKbDCIhBssYbE8GCaaX5NUt+mxyKwwfHifBilZwj2Ul7Ce6
+2azJAAAAAAQBIKbpGG2dWTX8j+VjFM21J0hqWlEg+bdiojWnKfA5AQpWUWtnNwDE
+M0g12vYxoWM8Y81W+bHBw805I8kWVkXU6vFOi+HWvv/ira7ofJu16NnoUkhclkUr
+k0mXubZvyl4GBg==
+-----END PGP PRIVATE KEY BLOCK-----`
+
+// See OpenPGP crypto refresh merge request:
+// https://gitlab.com/openpgp-wg/rfc4880bis/-/merge_requests/304
+const v6PrivKeyMsg = `-----BEGIN PGP MESSAGE-----
+
+wV0GIQYSyD8ecG9jCP4VGkF3Q6HwM3kOk+mXhIjR2zeNqZMIhRmHzxjV8bU/gXzO
+WgBM85PMiVi93AZfJfhK9QmxfdNnZBjeo1VDeVZheQHgaVf7yopqR6W1FT6NOrfS
+aQIHAgZhZBZTW+CwcW1g4FKlbExAf56zaw76/prQoN+bAzxpohup69LA7JW/Vp0l
+yZnuSj3hcFj0DfqLTGgr4/u717J+sPWbtQBfgMfG9AOIwwrUBqsFE9zW+f1zdlYo
+bhF30A+IitsxxA==
+-----END PGP MESSAGE-----`
+
+// See OpenPGP crypto refresh merge request:
+// https://gitlab.com/openpgp-wg/rfc4880bis/-/merge_requests/305
+const v6PrivKeyInlineSignMsg = `-----BEGIN PGP MESSAGE-----
+
+wV0GIQYSyD8ecG9jCP4VGkF3Q6HwM3kOk+mXhIjR2zeNqZMIhRmHzxjV8bU/gXzO
+WgBM85PMiVi93AZfJfhK9QmxfdNnZBjeo1VDeVZheQHgaVf7yopqR6W1FT6NOrfS
+aQIHAgZhZBZTW+CwcW1g4FKlbExAf56zaw76/prQoN+bAzxpohup69LA7JW/Vp0l
+yZnuSj3hcFj0DfqLTGgr4/u717J+sPWbtQBfgMfG9AOIwwrUBqsFE9zW+f1zdlYo
+bhF30A+IitsxxA==
+-----END PGP MESSAGE-----`
+
+// See https://gitlab.com/openpgp-wg/rfc4880bis/-/merge_requests/274
+// decryption password: "correct horse battery staple"
+const v6ArgonSealedPrivKey = `-----BEGIN PGP PRIVATE KEY BLOCK-----
+
+xYIGY4d/4xsAAAAg+U2nu0jWCmHlZ3BqZYfQMxmZu52JGggkLq2EVD34laP9JgkC
+FARdb9ccngltHraRe25uHuyuAQQVtKipJ0+r5jL4dacGWSAheCWPpITYiyfyIOPS
+3gIDyg8f7strd1OB4+LZsUhcIjOMpVHgmiY/IutJkulneoBYwrEGHxsKAAAAQgWC
+Y4d/4wMLCQcFFQoOCAwCFgACmwMCHgkiIQbLGGxPBgmml+TVLfpscisMHx4nwYpW
+cI9lJewnutmsyQUnCQIHAgAAAACtKCAQPi19In7A5tfORHHbNr/JcIMlNpAnFJin
+7wV2wH+q4UWFs7kDsBJ+xP2i8CMEWi7Ha8tPlXGpZR4UruETeh1mhELIj5UeM8T/
+0z+5oX1RHu11j8bZzFDLX9eTsgOdWATHggZjh3/jGQAAACCGkySDZ/nlAV25Ivj0
+gJXdp4SYfy1ZhbEvutFsr15ENf0mCQIUBA5hhGgp2oaavg6mFUXcFMwBBBUuE8qf
+9Ock+xwusd+GAglBr5LVyr/lup3xxQvHXFSjjA2haXfoN6xUGRdDEHI6+uevKjVR
+v5oAxgu7eJpaXNjCmwYYGwoAAAAsBYJjh3/jApsMIiEGyxhsTwYJppfk1S36bHIr
+DB8eJ8GKVnCPZSXsJ7rZrMkAAAAABAEgpukYbZ1ZNfyP5WMUzbUnSGpaUSD5t2Ki
+Nacp8DkBClZRa2c3AMQzSDXa9jGhYzxjzVb5scHDzTkjyRZWRdTq8U6L4da+/+Kt
+ruh8m7Xo2ehSSFyWRSuTSZe5tm/KXgYG
+-----END PGP PRIVATE KEY BLOCK-----`
+
+const v4Key25519 = `-----BEGIN PGP PRIVATE KEY BLOCK-----
+
+xUkEZB3qzRto01j2k2pwN5ux9w70stPinAdXULLr20CRW7U7h2GSeACch0M+
+qzQg8yjFQ8VBvu3uwgKH9senoHmj72lLSCLTmhFKzQR0ZXN0wogEEBsIAD4F
+gmQd6s0ECwkHCAmQIf45+TuC+xMDFQgKBBYAAgECGQECmwMCHgEWIQSWEzMi
+jJUHvyIbVKIh/jn5O4L7EwAAUhaHNlgudvxARdPPETUzVgjuWi+YIz8w1xIb
+lHQMvIrbe2sGCQIethpWofd0x7DHuv/ciHg+EoxJ/Td6h4pWtIoKx0kEZB3q
+zRm4CyA7quliq7yx08AoOqHTuuCgvpkSdEhpp3pEyejQOgBo0p6ywIiLPllY
+0t+jpNspHpAGfXID6oqjpYuJw3AfVRBlwnQEGBsIACoFgmQd6s0JkCH+Ofk7
+gvsTApsMFiEElhMzIoyVB78iG1SiIf45+TuC+xMAAGgQuN9G73446ykvJ/mL
+sCZ7zGFId2gBd1EnG0FTC4npfOKpck0X8dngByrCxU8LDSfvjsEp/xDAiKsQ
+aU71tdtNBQ==
+=e7jT
+-----END PGP PRIVATE KEY BLOCK-----`
+
+const keyWithExpiredCrossSig = `-----BEGIN PGP PUBLIC KEY BLOCK-----
+
+xsDNBF2lnPIBDAC5cL9PQoQLTMuhjbYvb4Ncuuo0bfmgPRFywX53jPhoFf4Zg6mv
+/seOXpgecTdOcVttfzC8ycIKrt3aQTiwOG/ctaR4Bk/t6ayNFfdUNxHWk4WCKzdz
+/56fW2O0F23qIRd8UUJp5IIlN4RDdRCtdhVQIAuzvp2oVy/LaS2kxQoKvph/5pQ/
+5whqsyroEWDJoSV0yOb25B/iwk/pLUFoyhDG9bj0kIzDxrEqW+7Ba8noc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+AGiIaPEGszBBWlOpHTPhNm0LB0nMWqqaT87oNYwP8CQuuxDb6rKJ2lffCmZH27Lb
+UbQZcH8J+0UhpeaiadPZxH5ATJAcenmVtVVMLVOFnm+eIlxzov9ntpgGYt8hLdXB
+ITEG9mMgp3TGS9ZzSifMZ8UGtHdp9QdBg8NEVPFzDOMGxpc/Bftav7RRRuPiAER+
+7A5CBid5
+=aQkm
+-----END PGP SIGNATURE-----
+`
+
+const signedMessageWithCriticalNotation = `-----BEGIN PGP MESSAGE-----
+
+owGbwMvMwMH4oOW7S46CznTG09xJDDE3Wl1KUotLuDousDAwcjBYiSmyXL+48d6x
+U1PSGUxcj8IUszKBVMpMaWAAAgEGZpAeh9SKxNyCnFS95PzcytRiBi5OAZjyXXzM
+f8WYLqv7TXP61Sa4rqT12CI3xaN73YS2pt089f96odCKaEPnWJ3iSGmzJaW/ug10
+2Zo8Wj2k4s7t8wt4H3HtTu+y5UZfV3VOO+l//sdE/o+Lsub8FZH7/eOq7OnbNp4n
+vwjE8mqJXetNMfj8r2SCyvkEnlVRYR+/mnge+ib56FdJ8uKtqSxyvgA=
+=fRXs
+-----END PGP MESSAGE-----`
+
+const criticalNotationSigner = `-----BEGIN PGP PUBLIC KEY BLOCK-----
+
+mI0EUmEvTgEEANyWtQQMOybQ9JltDqmaX0WnNPJeLILIM36sw6zL0nfTQ5zXSS3+
+fIF6P29lJFxpblWk02PSID5zX/DYU9/zjM2xPO8Oa4xo0cVTOTLj++Ri5mtr//f5
+GLsIXxFrBJhD/ghFsL3Op0GXOeLJ9A5bsOn8th7x6JucNKuaRB6bQbSPABEBAAG0
+JFRlc3QgTWNUZXN0aW5ndG9uIDx0ZXN0QGV4YW1wbGUuY29tPoi5BBMBAgAjBQJS
+YS9OAhsvBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQSmNhOk1uQJQwDAP6
+AgrTyqkRlJVqz2pb46TfbDM2TDF7o9CBnBzIGoxBhlRwpqALz7z2kxBDmwpQa+ki
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
+pn2DMIWLrGamMLWRmlwslolKr1sMV5x8w+5Ias6C33iBMl9phkg42an0gYmc
+byVJHvLO/XErtC+GNIJeMg==
+=liRq
+-----END PGP MESSAGE-----
+`
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k.go
new file mode 100644
index 0000000000..6871b84fc9
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k.go
@@ -0,0 +1,436 @@
+// 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 s2k implements the various OpenPGP string-to-key transforms as
+// specified in RFC 4800 section 3.7.1, and Argon2 specified in
+// draft-ietf-openpgp-crypto-refresh-08 section 3.7.1.4.
+package s2k // import "github.com/ProtonMail/go-crypto/openpgp/s2k"
+
+import (
+ "crypto"
+ "hash"
+ "io"
+ "strconv"
+
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm"
+ "golang.org/x/crypto/argon2"
+)
+
+type Mode uint8
+
+// Defines the default S2KMode constants
+//
+// 0 (simple), 1(salted), 3(iterated), 4(argon2)
+const (
+ SimpleS2K Mode = 0
+ SaltedS2K Mode = 1
+ IteratedSaltedS2K Mode = 3
+ Argon2S2K Mode = 4
+ GnuS2K Mode = 101
+)
+
+const Argon2SaltSize int = 16
+
+// Params contains all the parameters of the s2k packet
+type Params struct {
+ // mode is the mode of s2k function.
+ // It can be 0 (simple), 1(salted), 3(iterated)
+ // 2(reserved) 100-110(private/experimental).
+ mode Mode
+ // hashId is the ID of the hash function used in any of the modes
+ hashId byte
+ // salt is a byte array to use as a salt in hashing process or argon2
+ saltBytes [Argon2SaltSize]byte
+ // countByte is used to determine how many rounds of hashing are to
+ // be performed in s2k mode 3. See RFC 4880 Section 3.7.1.3.
+ countByte byte
+ // passes is a parameter in Argon2 to determine the number of iterations
+ // See RFC the crypto refresh Section 3.7.1.4.
+ passes byte
+ // parallelism is a parameter in Argon2 to determine the degree of paralellism
+ // See RFC the crypto refresh Section 3.7.1.4.
+ parallelism byte
+ // memoryExp is a parameter in Argon2 to determine the memory usage
+ // i.e., 2 ** memoryExp kibibytes
+ // See RFC the crypto refresh Section 3.7.1.4.
+ memoryExp byte
+}
+
+// encodeCount converts an iterative "count" in the range 1024 to
+// 65011712, inclusive, to an encoded count. The return value is the
+// octet that is actually stored in the GPG file. encodeCount panics
+// if i is not in the above range (encodedCount above takes care to
+// pass i in the correct range). See RFC 4880 Section 3.7.7.1.
+func encodeCount(i int) uint8 {
+ if i < 65536 || i > 65011712 {
+ panic("count arg i outside the required range")
+ }
+
+ for encoded := 96; encoded < 256; encoded++ {
+ count := decodeCount(uint8(encoded))
+ if count >= i {
+ return uint8(encoded)
+ }
+ }
+
+ return 255
+}
+
+// decodeCount returns the s2k mode 3 iterative "count" corresponding to
+// the encoded octet c.
+func decodeCount(c uint8) int {
+ return (16 + int(c&15)) << (uint32(c>>4) + 6)
+}
+
+// encodeMemory converts the Argon2 "memory" in the range parallelism*8 to
+// 2**31, inclusive, to an encoded memory. The return value is the
+// octet that is actually stored in the GPG file. encodeMemory panics
+// if is not in the above range
+// See OpenPGP crypto refresh Section 3.7.1.4.
+func encodeMemory(memory uint32, parallelism uint8) uint8 {
+ if memory < (8*uint32(parallelism)) || memory > uint32(2147483648) {
+ panic("Memory argument memory is outside the required range")
+ }
+
+ for exp := 3; exp < 31; exp++ {
+ compare := decodeMemory(uint8(exp))
+ if compare >= memory {
+ return uint8(exp)
+ }
+ }
+
+ return 31
+}
+
+// decodeMemory computes the decoded memory in kibibytes as 2**memoryExponent
+func decodeMemory(memoryExponent uint8) uint32 {
+ return uint32(1) << memoryExponent
+}
+
+// Simple writes to out the result of computing the Simple S2K function (RFC
+// 4880, section 3.7.1.1) using the given hash and input passphrase.
+func Simple(out []byte, h hash.Hash, in []byte) {
+ Salted(out, h, in, nil)
+}
+
+var zero [1]byte
+
+// Salted writes to out the result of computing the Salted S2K function (RFC
+// 4880, section 3.7.1.2) using the given hash, input passphrase and salt.
+func Salted(out []byte, h hash.Hash, in []byte, salt []byte) {
+ done := 0
+ var digest []byte
+
+ for i := 0; done < len(out); i++ {
+ h.Reset()
+ for j := 0; j < i; j++ {
+ h.Write(zero[:])
+ }
+ h.Write(salt)
+ h.Write(in)
+ digest = h.Sum(digest[:0])
+ n := copy(out[done:], digest)
+ done += n
+ }
+}
+
+// Iterated writes to out the result of computing the Iterated and Salted S2K
+// function (RFC 4880, section 3.7.1.3) using the given hash, input passphrase,
+// salt and iteration count.
+func Iterated(out []byte, h hash.Hash, in []byte, salt []byte, count int) {
+ combined := make([]byte, len(in)+len(salt))
+ copy(combined, salt)
+ copy(combined[len(salt):], in)
+
+ if count < len(combined) {
+ count = len(combined)
+ }
+
+ done := 0
+ var digest []byte
+ for i := 0; done < len(out); i++ {
+ h.Reset()
+ for j := 0; j < i; j++ {
+ h.Write(zero[:])
+ }
+ written := 0
+ for written < count {
+ if written+len(combined) > count {
+ todo := count - written
+ h.Write(combined[:todo])
+ written = count
+ } else {
+ h.Write(combined)
+ written += len(combined)
+ }
+ }
+ digest = h.Sum(digest[:0])
+ n := copy(out[done:], digest)
+ done += n
+ }
+}
+
+// Argon2 writes to out the key derived from the password (in) with the Argon2
+// function (the crypto refresh, section 3.7.1.4)
+func Argon2(out []byte, in []byte, salt []byte, passes uint8, paralellism uint8, memoryExp uint8) {
+ key := argon2.IDKey(in, salt, uint32(passes), decodeMemory(memoryExp), paralellism, uint32(len(out)))
+ copy(out[:], key)
+}
+
+// Generate generates valid parameters from given configuration.
+// It will enforce the Iterated and Salted or Argon2 S2K method.
+func Generate(rand io.Reader, c *Config) (*Params, error) {
+ var params *Params
+ if c != nil && c.Mode() == Argon2S2K {
+ // handle Argon2 case
+ argonConfig := c.Argon2()
+ params = &Params{
+ mode: Argon2S2K,
+ passes: argonConfig.Passes(),
+ parallelism: argonConfig.Parallelism(),
+ memoryExp: argonConfig.EncodedMemory(),
+ }
+ } else if c != nil && c.PassphraseIsHighEntropy && c.Mode() == SaltedS2K { // Allow SaltedS2K if PassphraseIsHighEntropy
+ hashId, ok := algorithm.HashToHashId(c.hash())
+ if !ok {
+ return nil, errors.UnsupportedError("no such hash")
+ }
+
+ params = &Params{
+ mode: SaltedS2K,
+ hashId: hashId,
+ }
+ } else { // Enforce IteratedSaltedS2K method otherwise
+ hashId, ok := algorithm.HashToHashId(c.hash())
+ if !ok {
+ return nil, errors.UnsupportedError("no such hash")
+ }
+ if c != nil {
+ c.S2KMode = IteratedSaltedS2K
+ }
+ params = &Params{
+ mode: IteratedSaltedS2K,
+ hashId: hashId,
+ countByte: c.EncodedCount(),
+ }
+ }
+ if _, err := io.ReadFull(rand, params.salt()); err != nil {
+ return nil, err
+ }
+ return params, nil
+}
+
+// Parse reads a binary specification for a string-to-key transformation from r
+// and returns a function which performs that transform. If the S2K is a special
+// GNU extension that indicates that the private key is missing, then the error
+// returned is errors.ErrDummyPrivateKey.
+func Parse(r io.Reader) (f func(out, in []byte), err error) {
+ params, err := ParseIntoParams(r)
+ if err != nil {
+ return nil, err
+ }
+
+ return params.Function()
+}
+
+// ParseIntoParams reads a binary specification for a string-to-key
+// transformation from r and returns a struct describing the s2k parameters.
+func ParseIntoParams(r io.Reader) (params *Params, err error) {
+ var buf [Argon2SaltSize + 3]byte
+
+ _, err = io.ReadFull(r, buf[:1])
+ if err != nil {
+ return
+ }
+
+ params = &Params{
+ mode: Mode(buf[0]),
+ }
+
+ switch params.mode {
+ case SimpleS2K:
+ _, err = io.ReadFull(r, buf[:1])
+ if err != nil {
+ return nil, err
+ }
+ params.hashId = buf[0]
+ return params, nil
+ case SaltedS2K:
+ _, err = io.ReadFull(r, buf[:9])
+ if err != nil {
+ return nil, err
+ }
+ params.hashId = buf[0]
+ copy(params.salt(), buf[1:9])
+ return params, nil
+ case IteratedSaltedS2K:
+ _, err = io.ReadFull(r, buf[:10])
+ if err != nil {
+ return nil, err
+ }
+ params.hashId = buf[0]
+ copy(params.salt(), buf[1:9])
+ params.countByte = buf[9]
+ return params, nil
+ case Argon2S2K:
+ _, err = io.ReadFull(r, buf[:Argon2SaltSize+3])
+ if err != nil {
+ return nil, err
+ }
+ copy(params.salt(), buf[:Argon2SaltSize])
+ params.passes = buf[Argon2SaltSize]
+ params.parallelism = buf[Argon2SaltSize+1]
+ params.memoryExp = buf[Argon2SaltSize+2]
+ if err := validateArgon2Params(params); err != nil {
+ return nil, err
+ }
+ return params, nil
+ case GnuS2K:
+ // This is a GNU extension. See
+ // https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=doc/DETAILS;h=fe55ae16ab4e26d8356dc574c9e8bc935e71aef1;hb=23191d7851eae2217ecdac6484349849a24fd94a#l1109
+ if _, err = io.ReadFull(r, buf[:5]); err != nil {
+ return nil, err
+ }
+ params.hashId = buf[0]
+ if buf[1] == 'G' && buf[2] == 'N' && buf[3] == 'U' && buf[4] == 1 {
+ return params, nil
+ }
+ return nil, errors.UnsupportedError("GNU S2K extension")
+ }
+
+ return nil, errors.UnsupportedError("S2K function")
+}
+
+func (params *Params) Mode() Mode {
+ return params.mode
+}
+
+func (params *Params) Dummy() bool {
+ return params != nil && params.mode == GnuS2K
+}
+
+func (params *Params) salt() []byte {
+ switch params.mode {
+ case SaltedS2K, IteratedSaltedS2K:
+ return params.saltBytes[:8]
+ case Argon2S2K:
+ return params.saltBytes[:Argon2SaltSize]
+ default:
+ return nil
+ }
+}
+
+func (params *Params) Function() (f func(out, in []byte), err error) {
+ if params.Dummy() {
+ return nil, errors.ErrDummyPrivateKey("dummy key found")
+ }
+ var hashObj crypto.Hash
+ if params.mode != Argon2S2K {
+ var ok bool
+ hashObj, ok = algorithm.HashIdToHashWithSha1(params.hashId)
+ if !ok {
+ return nil, errors.UnsupportedError("hash for S2K function: " + strconv.Itoa(int(params.hashId)))
+ }
+ if !hashObj.Available() {
+ return nil, errors.UnsupportedError("hash not available: " + strconv.Itoa(int(hashObj)))
+ }
+ }
+
+ switch params.mode {
+ case SimpleS2K:
+ f := func(out, in []byte) {
+ Simple(out, hashObj.New(), in)
+ }
+
+ return f, nil
+ case SaltedS2K:
+ f := func(out, in []byte) {
+ Salted(out, hashObj.New(), in, params.salt())
+ }
+
+ return f, nil
+ case IteratedSaltedS2K:
+ f := func(out, in []byte) {
+ Iterated(out, hashObj.New(), in, params.salt(), decodeCount(params.countByte))
+ }
+
+ return f, nil
+ case Argon2S2K:
+ f := func(out, in []byte) {
+ Argon2(out, in, params.salt(), params.passes, params.parallelism, params.memoryExp)
+ }
+ return f, nil
+ }
+
+ return nil, errors.UnsupportedError("S2K function")
+}
+
+func (params *Params) Serialize(w io.Writer) (err error) {
+ if _, err = w.Write([]byte{uint8(params.mode)}); err != nil {
+ return
+ }
+ if params.mode != Argon2S2K {
+ if _, err = w.Write([]byte{params.hashId}); err != nil {
+ return
+ }
+ }
+ if params.Dummy() {
+ _, err = w.Write(append([]byte("GNU"), 1))
+ return
+ }
+ if params.mode > 0 {
+ if _, err = w.Write(params.salt()); err != nil {
+ return
+ }
+ if params.mode == IteratedSaltedS2K {
+ _, err = w.Write([]byte{params.countByte})
+ }
+ if params.mode == Argon2S2K {
+ _, err = w.Write([]byte{params.passes, params.parallelism, params.memoryExp})
+ }
+ }
+ return
+}
+
+// Serialize salts and stretches the given passphrase and writes the
+// resulting key into key. It also serializes an S2K descriptor to
+// w. The key stretching can be configured with c, which may be
+// nil. In that case, sensible defaults will be used.
+func Serialize(w io.Writer, key []byte, rand io.Reader, passphrase []byte, c *Config) error {
+ params, err := Generate(rand, c)
+ if err != nil {
+ return err
+ }
+ err = params.Serialize(w)
+ if err != nil {
+ return err
+ }
+
+ f, err := params.Function()
+ if err != nil {
+ return err
+ }
+ f(key, passphrase)
+ return nil
+}
+
+// validateArgon2Params checks that the argon2 parameters are valid according to RFC9580.
+func validateArgon2Params(params *Params) error {
+ // The number of passes t and the degree of parallelism p MUST be non-zero.
+ if params.parallelism == 0 {
+ return errors.StructuralError("invalid argon2 params: parallelism is 0")
+ }
+ if params.passes == 0 {
+ return errors.StructuralError("invalid argon2 params: iterations is 0")
+ }
+
+ // The encoded memory size MUST be a value from 3+ceil(log2(p)) to 31,
+ // such that the decoded memory size m is a value from 8*p to 2^31.
+ if params.memoryExp > 31 || decodeMemory(params.memoryExp) < 8*uint32(params.parallelism) {
+ return errors.StructuralError("invalid argon2 params: memory is out of bounds")
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_cache.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_cache.go
new file mode 100644
index 0000000000..616e0d12c6
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_cache.go
@@ -0,0 +1,26 @@
+package s2k
+
+// Cache stores keys derived with s2k functions from one passphrase
+// to avoid recomputation if multiple items are encrypted with
+// the same parameters.
+type Cache map[Params][]byte
+
+// GetOrComputeDerivedKey tries to retrieve the key
+// for the given s2k parameters from the cache.
+// If there is no hit, it derives the key with the s2k function from the passphrase,
+// updates the cache, and returns the key.
+func (c *Cache) GetOrComputeDerivedKey(passphrase []byte, params *Params, expectedKeySize int) ([]byte, error) {
+ key, found := (*c)[*params]
+ if !found || len(key) != expectedKeySize {
+ var err error
+ derivedKey := make([]byte, expectedKeySize)
+ s2k, err := params.Function()
+ if err != nil {
+ return nil, err
+ }
+ s2k(derivedKey, passphrase)
+ (*c)[*params] = key
+ return derivedKey, nil
+ }
+ return key, nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_config.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_config.go
new file mode 100644
index 0000000000..b93db1ab85
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_config.go
@@ -0,0 +1,129 @@
+package s2k
+
+import "crypto"
+
+// Config collects configuration parameters for s2k key-stretching
+// transformations. A nil *Config is valid and results in all default
+// values.
+type Config struct {
+ // S2K (String to Key) mode, used for key derivation in the context of secret key encryption
+ // and passphrase-encrypted data. Either s2k.Argon2S2K or s2k.IteratedSaltedS2K may be used.
+ // If the passphrase is a high-entropy key, indicated by setting PassphraseIsHighEntropy to true,
+ // s2k.SaltedS2K can also be used.
+ // Note: Argon2 is the strongest option but not all OpenPGP implementations are compatible with it
+ //(pending standardisation).
+ // 0 (simple), 1(salted), 3(iterated), 4(argon2)
+ // 2(reserved) 100-110(private/experimental).
+ S2KMode Mode
+ // Only relevant if S2KMode is not set to s2k.Argon2S2K.
+ // Hash is the default hash function to be used. If
+ // nil, SHA256 is used.
+ Hash crypto.Hash
+ // Argon2 parameters for S2K (String to Key).
+ // Only relevant if S2KMode is set to s2k.Argon2S2K.
+ // If nil, default parameters are used.
+ // For more details on the choice of parameters, see https://tools.ietf.org/html/rfc9106#section-4.
+ Argon2Config *Argon2Config
+ // Only relevant if S2KMode is set to s2k.IteratedSaltedS2K.
+ // Iteration count for Iterated S2K (String to Key). It
+ // determines the strength of the passphrase stretching when
+ // the said passphrase is hashed to produce a key. S2KCount
+ // should be between 65536 and 65011712, inclusive. If Config
+ // is nil or S2KCount is 0, the value 16777216 used. Not all
+ // values in the above range can be represented. S2KCount will
+ // be rounded up to the next representable value if it cannot
+ // be encoded exactly. When set, it is strongly encrouraged to
+ // use a value that is at least 65536. See RFC 4880 Section
+ // 3.7.1.3.
+ S2KCount int
+ // Indicates whether the passphrase passed by the application is a
+ // high-entropy key (e.g. it's randomly generated or derived from
+ // another passphrase using a strong key derivation function).
+ // When true, allows the S2KMode to be s2k.SaltedS2K.
+ // When the passphrase is not a high-entropy key, using SaltedS2K is
+ // insecure, and not allowed by draft-ietf-openpgp-crypto-refresh-08.
+ PassphraseIsHighEntropy bool
+}
+
+// Argon2Config stores the Argon2 parameters
+// A nil *Argon2Config is valid and results in all default
+type Argon2Config struct {
+ NumberOfPasses uint8
+ DegreeOfParallelism uint8
+ // Memory specifies the desired Argon2 memory usage in kibibytes.
+ // For example memory=64*1024 sets the memory cost to ~64 MB.
+ Memory uint32
+}
+
+func (c *Config) Mode() Mode {
+ if c == nil {
+ return IteratedSaltedS2K
+ }
+ return c.S2KMode
+}
+
+func (c *Config) hash() crypto.Hash {
+ if c == nil || uint(c.Hash) == 0 {
+ return crypto.SHA256
+ }
+
+ return c.Hash
+}
+
+func (c *Config) Argon2() *Argon2Config {
+ if c == nil || c.Argon2Config == nil {
+ return nil
+ }
+ return c.Argon2Config
+}
+
+// EncodedCount get encoded count
+func (c *Config) EncodedCount() uint8 {
+ if c == nil || c.S2KCount == 0 {
+ return 224 // The common case. Corresponding to 16777216
+ }
+
+ i := c.S2KCount
+
+ switch {
+ case i < 65536:
+ i = 65536
+ case i > 65011712:
+ i = 65011712
+ }
+
+ return encodeCount(i)
+}
+
+func (c *Argon2Config) Passes() uint8 {
+ if c == nil || c.NumberOfPasses == 0 {
+ return 3
+ }
+ return c.NumberOfPasses
+}
+
+func (c *Argon2Config) Parallelism() uint8 {
+ if c == nil || c.DegreeOfParallelism == 0 {
+ return 4
+ }
+ return c.DegreeOfParallelism
+}
+
+func (c *Argon2Config) EncodedMemory() uint8 {
+ if c == nil || c.Memory == 0 {
+ return 16 // 64 MiB of RAM
+ }
+
+ memory := c.Memory
+ lowerBound := uint32(c.Parallelism()) * 8
+ upperBound := uint32(2147483648)
+
+ switch {
+ case memory < lowerBound:
+ memory = lowerBound
+ case memory > upperBound:
+ memory = upperBound
+ }
+
+ return encodeMemory(memory, c.Parallelism())
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/write.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/write.go
new file mode 100644
index 0000000000..84bc27d83e
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/write.go
@@ -0,0 +1,690 @@
+// 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 openpgp
+
+import (
+ "crypto"
+ "hash"
+ "io"
+ "strconv"
+ "time"
+
+ "github.com/ProtonMail/go-crypto/openpgp/armor"
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm"
+ "github.com/ProtonMail/go-crypto/openpgp/packet"
+)
+
+// DetachSign signs message with the private key from signer (which must
+// already have been decrypted) and writes the signature to w.
+// If config is nil, sensible defaults will be used.
+func DetachSign(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error {
+ return detachSign(w, signer, message, packet.SigTypeBinary, config)
+}
+
+// ArmoredDetachSign signs message with the private key from signer (which
+// must already have been decrypted) and writes an armored signature to w.
+// If config is nil, sensible defaults will be used.
+func ArmoredDetachSign(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) (err error) {
+ return armoredDetachSign(w, signer, message, packet.SigTypeBinary, config)
+}
+
+// DetachSignText signs message (after canonicalising the line endings) with
+// the private key from signer (which must already have been decrypted) and
+// writes the signature to w.
+// If config is nil, sensible defaults will be used.
+func DetachSignText(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error {
+ return detachSign(w, signer, message, packet.SigTypeText, config)
+}
+
+// ArmoredDetachSignText signs message (after canonicalising the line endings)
+// with the private key from signer (which must already have been decrypted)
+// and writes an armored signature to w.
+// If config is nil, sensible defaults will be used.
+func ArmoredDetachSignText(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error {
+ return armoredDetachSign(w, signer, message, packet.SigTypeText, config)
+}
+
+func armoredDetachSign(w io.Writer, signer *Entity, message io.Reader, sigType packet.SignatureType, config *packet.Config) (err error) {
+ out, err := armor.Encode(w, SignatureType, nil)
+ if err != nil {
+ return
+ }
+ err = detachSign(out, signer, message, sigType, config)
+ if err != nil {
+ return
+ }
+ return out.Close()
+}
+
+func detachSign(w io.Writer, signer *Entity, message io.Reader, sigType packet.SignatureType, config *packet.Config) (err error) {
+ signingKey, ok := signer.SigningKeyById(config.Now(), config.SigningKey())
+ if !ok {
+ return errors.InvalidArgumentError("no valid signing keys")
+ }
+ if signingKey.PrivateKey == nil {
+ return errors.InvalidArgumentError("signing key doesn't have a private key")
+ }
+ if signingKey.PrivateKey.Encrypted {
+ return errors.InvalidArgumentError("signing key is encrypted")
+ }
+ if _, ok := algorithm.HashToHashId(config.Hash()); !ok {
+ return errors.InvalidArgumentError("invalid hash function")
+ }
+
+ sig := createSignaturePacket(signingKey.PublicKey, sigType, config)
+
+ h, err := sig.PrepareSign(config)
+ if err != nil {
+ return
+ }
+ wrappedHash, err := wrapHashForSignature(h, sig.SigType)
+ if err != nil {
+ return
+ }
+ if _, err = io.Copy(wrappedHash, message); err != nil {
+ return err
+ }
+
+ err = sig.Sign(h, signingKey.PrivateKey, config)
+ if err != nil {
+ return
+ }
+
+ return sig.Serialize(w)
+}
+
+// FileHints contains metadata about encrypted files. This metadata is, itself,
+// encrypted.
+type FileHints struct {
+ // IsBinary can be set to hint that the contents are binary data.
+ IsBinary bool
+ // FileName hints at the name of the file that should be written. It's
+ // truncated to 255 bytes if longer. It may be empty to suggest that the
+ // file should not be written to disk. It may be equal to "_CONSOLE" to
+ // suggest the data should not be written to disk.
+ FileName string
+ // ModTime contains the modification time of the file, or the zero time if not applicable.
+ ModTime time.Time
+}
+
+// SymmetricallyEncrypt acts like gpg -c: it encrypts a file with a passphrase.
+// The resulting WriteCloser must be closed after the contents of the file have
+// been written.
+// If config is nil, sensible defaults will be used.
+func SymmetricallyEncrypt(ciphertext io.Writer, passphrase []byte, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) {
+ if hints == nil {
+ hints = &FileHints{}
+ }
+
+ key, err := packet.SerializeSymmetricKeyEncrypted(ciphertext, passphrase, config)
+ if err != nil {
+ return
+ }
+
+ var w io.WriteCloser
+ cipherSuite := packet.CipherSuite{
+ Cipher: config.Cipher(),
+ Mode: config.AEAD().Mode(),
+ }
+ w, err = packet.SerializeSymmetricallyEncrypted(ciphertext, config.Cipher(), config.AEAD() != nil, cipherSuite, key, config)
+ if err != nil {
+ return
+ }
+
+ literalData := w
+ if algo := config.Compression(); algo != packet.CompressionNone {
+ var compConfig *packet.CompressionConfig
+ if config != nil {
+ compConfig = config.CompressionConfig
+ }
+ literalData, err = packet.SerializeCompressed(w, algo, compConfig)
+ if err != nil {
+ return
+ }
+ }
+
+ var epochSeconds uint32
+ if !hints.ModTime.IsZero() {
+ epochSeconds = uint32(hints.ModTime.Unix())
+ }
+ return packet.SerializeLiteral(literalData, hints.IsBinary, hints.FileName, epochSeconds)
+}
+
+// intersectPreferences mutates and returns a prefix of a that contains only
+// the values in the intersection of a and b. The order of a is preserved.
+func intersectPreferences(a []uint8, b []uint8) (intersection []uint8) {
+ var j int
+ for _, v := range a {
+ for _, v2 := range b {
+ if v == v2 {
+ a[j] = v
+ j++
+ break
+ }
+ }
+ }
+
+ return a[:j]
+}
+
+// intersectPreferences mutates and returns a prefix of a that contains only
+// the values in the intersection of a and b. The order of a is preserved.
+func intersectCipherSuites(a [][2]uint8, b [][2]uint8) (intersection [][2]uint8) {
+ var j int
+ for _, v := range a {
+ for _, v2 := range b {
+ if v[0] == v2[0] && v[1] == v2[1] {
+ a[j] = v
+ j++
+ break
+ }
+ }
+ }
+
+ return a[:j]
+}
+
+func hashToHashId(h crypto.Hash) uint8 {
+ v, ok := algorithm.HashToHashId(h)
+ if !ok {
+ panic("tried to convert unknown hash")
+ }
+ return v
+}
+
+// EncryptText encrypts a message to a number of recipients and, optionally,
+// signs it. Optional information is contained in 'hints', also encrypted, that
+// aids the recipients in processing the message. The resulting WriteCloser
+// must be closed after the contents of the file have been written. If config
+// is nil, sensible defaults will be used. The signing is done in text mode.
+func EncryptText(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) {
+ return encrypt(ciphertext, ciphertext, to, signed, hints, packet.SigTypeText, config)
+}
+
+// Encrypt encrypts a message to a number of recipients and, optionally, signs
+// it. hints contains optional information, that is also encrypted, that aids
+// the recipients in processing the message. The resulting WriteCloser must
+// be closed after the contents of the file have been written.
+// If config is nil, sensible defaults will be used.
+func Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) {
+ return encrypt(ciphertext, ciphertext, to, signed, hints, packet.SigTypeBinary, config)
+}
+
+// EncryptSplit encrypts a message to a number of recipients and, optionally, signs
+// it. hints contains optional information, that is also encrypted, that aids
+// the recipients in processing the message. The resulting WriteCloser must
+// be closed after the contents of the file have been written.
+// If config is nil, sensible defaults will be used.
+func EncryptSplit(keyWriter io.Writer, dataWriter io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) {
+ return encrypt(keyWriter, dataWriter, to, signed, hints, packet.SigTypeBinary, config)
+}
+
+// EncryptTextSplit encrypts a message to a number of recipients and, optionally, signs
+// it. hints contains optional information, that is also encrypted, that aids
+// the recipients in processing the message. The resulting WriteCloser must
+// be closed after the contents of the file have been written.
+// If config is nil, sensible defaults will be used.
+func EncryptTextSplit(keyWriter io.Writer, dataWriter io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) {
+ return encrypt(keyWriter, dataWriter, to, signed, hints, packet.SigTypeText, config)
+}
+
+// writeAndSign writes the data as a payload package and, optionally, signs
+// it. hints contains optional information, that is also encrypted,
+// that aids the recipients in processing the message. The resulting
+// WriteCloser must be closed after the contents of the file have been
+// written. If config is nil, sensible defaults will be used.
+func writeAndSign(payload io.WriteCloser, candidateHashes []uint8, signed *Entity, hints *FileHints, sigType packet.SignatureType, config *packet.Config) (plaintext io.WriteCloser, err error) {
+ var signer *packet.PrivateKey
+ if signed != nil {
+ signKey, ok := signed.SigningKeyById(config.Now(), config.SigningKey())
+ if !ok {
+ return nil, errors.InvalidArgumentError("no valid signing keys")
+ }
+ signer = signKey.PrivateKey
+ if signer == nil {
+ return nil, errors.InvalidArgumentError("no private key in signing key")
+ }
+ if signer.Encrypted {
+ return nil, errors.InvalidArgumentError("signing key must be decrypted")
+ }
+ }
+
+ var hash crypto.Hash
+ var salt []byte
+ if signer != nil {
+ if hash, err = selectHash(candidateHashes, config.Hash(), signer); err != nil {
+ return nil, err
+ }
+
+ var opsVersion = 3
+ if signer.Version == 6 {
+ opsVersion = signer.Version
+ }
+ ops := &packet.OnePassSignature{
+ Version: opsVersion,
+ SigType: sigType,
+ Hash: hash,
+ PubKeyAlgo: signer.PubKeyAlgo,
+ KeyId: signer.KeyId,
+ IsLast: true,
+ }
+ if opsVersion == 6 {
+ ops.KeyFingerprint = signer.Fingerprint
+ salt, err = packet.SignatureSaltForHash(hash, config.Random())
+ if err != nil {
+ return nil, err
+ }
+ ops.Salt = salt
+ }
+ if err := ops.Serialize(payload); err != nil {
+ return nil, err
+ }
+ }
+
+ if hints == nil {
+ hints = &FileHints{}
+ }
+
+ w := payload
+ if signer != nil {
+ // If we need to write a signature packet after the literal
+ // data then we need to stop literalData from closing
+ // encryptedData.
+ w = noOpCloser{w}
+
+ }
+ var epochSeconds uint32
+ if !hints.ModTime.IsZero() {
+ epochSeconds = uint32(hints.ModTime.Unix())
+ }
+ literalData, err := packet.SerializeLiteral(w, hints.IsBinary, hints.FileName, epochSeconds)
+ if err != nil {
+ return nil, err
+ }
+
+ if signer != nil {
+ h, wrappedHash, err := hashForSignature(hash, sigType, salt)
+ if err != nil {
+ return nil, err
+ }
+ metadata := &packet.LiteralData{
+ Format: 'u',
+ FileName: hints.FileName,
+ Time: epochSeconds,
+ }
+ if hints.IsBinary {
+ metadata.Format = 'b'
+ }
+ return signatureWriter{payload, literalData, hash, wrappedHash, h, salt, signer, sigType, config, metadata}, nil
+ }
+ return literalData, nil
+}
+
+// encrypt encrypts a message to a number of recipients and, optionally, signs
+// it. hints contains optional information, that is also encrypted, that aids
+// the recipients in processing the message. The resulting WriteCloser must
+// be closed after the contents of the file have been written.
+// If config is nil, sensible defaults will be used.
+func encrypt(keyWriter io.Writer, dataWriter io.Writer, to []*Entity, signed *Entity, hints *FileHints, sigType packet.SignatureType, config *packet.Config) (plaintext io.WriteCloser, err error) {
+ if len(to) == 0 {
+ return nil, errors.InvalidArgumentError("no encryption recipient provided")
+ }
+
+ // These are the possible ciphers that we'll use for the message.
+ candidateCiphers := []uint8{
+ uint8(packet.CipherAES256),
+ uint8(packet.CipherAES128),
+ }
+
+ // These are the possible hash functions that we'll use for the signature.
+ candidateHashes := []uint8{
+ hashToHashId(crypto.SHA256),
+ hashToHashId(crypto.SHA384),
+ hashToHashId(crypto.SHA512),
+ hashToHashId(crypto.SHA3_256),
+ hashToHashId(crypto.SHA3_512),
+ }
+
+ // Prefer GCM if everyone supports it
+ candidateCipherSuites := [][2]uint8{
+ {uint8(packet.CipherAES256), uint8(packet.AEADModeGCM)},
+ {uint8(packet.CipherAES256), uint8(packet.AEADModeEAX)},
+ {uint8(packet.CipherAES256), uint8(packet.AEADModeOCB)},
+ {uint8(packet.CipherAES128), uint8(packet.AEADModeGCM)},
+ {uint8(packet.CipherAES128), uint8(packet.AEADModeEAX)},
+ {uint8(packet.CipherAES128), uint8(packet.AEADModeOCB)},
+ }
+
+ candidateCompression := []uint8{
+ uint8(packet.CompressionNone),
+ uint8(packet.CompressionZIP),
+ uint8(packet.CompressionZLIB),
+ }
+
+ encryptKeys := make([]Key, len(to))
+
+ // AEAD is used only if config enables it and every key supports it
+ aeadSupported := config.AEAD() != nil
+
+ for i := range to {
+ var ok bool
+ encryptKeys[i], ok = to[i].EncryptionKey(config.Now())
+ if !ok {
+ return nil, errors.InvalidArgumentError("cannot encrypt a message to key id " + strconv.FormatUint(to[i].PrimaryKey.KeyId, 16) + " because it has no valid encryption keys")
+ }
+
+ primarySelfSignature, _ := to[i].PrimarySelfSignature()
+ if primarySelfSignature == nil {
+ return nil, errors.InvalidArgumentError("entity without a self-signature")
+ }
+
+ if !primarySelfSignature.SEIPDv2 {
+ aeadSupported = false
+ }
+
+ candidateCiphers = intersectPreferences(candidateCiphers, primarySelfSignature.PreferredSymmetric)
+ candidateHashes = intersectPreferences(candidateHashes, primarySelfSignature.PreferredHash)
+ candidateCipherSuites = intersectCipherSuites(candidateCipherSuites, primarySelfSignature.PreferredCipherSuites)
+ candidateCompression = intersectPreferences(candidateCompression, primarySelfSignature.PreferredCompression)
+ }
+
+ // In the event that the intersection of supported algorithms is empty we use the ones
+ // labelled as MUST that every implementation supports.
+ if len(candidateCiphers) == 0 {
+ // https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-9.3
+ candidateCiphers = []uint8{uint8(packet.CipherAES128)}
+ }
+ if len(candidateHashes) == 0 {
+ // https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#hash-algos
+ candidateHashes = []uint8{hashToHashId(crypto.SHA256)}
+ }
+ if len(candidateCipherSuites) == 0 {
+ // https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-9.6
+ candidateCipherSuites = [][2]uint8{{uint8(packet.CipherAES128), uint8(packet.AEADModeOCB)}}
+ }
+
+ cipher := packet.CipherFunction(candidateCiphers[0])
+ aeadCipherSuite := packet.CipherSuite{
+ Cipher: packet.CipherFunction(candidateCipherSuites[0][0]),
+ Mode: packet.AEADMode(candidateCipherSuites[0][1]),
+ }
+
+ // If the cipher specified by config is a candidate, we'll use that.
+ configuredCipher := config.Cipher()
+ for _, c := range candidateCiphers {
+ cipherFunc := packet.CipherFunction(c)
+ if cipherFunc == configuredCipher {
+ cipher = cipherFunc
+ break
+ }
+ }
+
+ var symKey []byte
+ if aeadSupported {
+ symKey = make([]byte, aeadCipherSuite.Cipher.KeySize())
+ } else {
+ symKey = make([]byte, cipher.KeySize())
+ }
+
+ if _, err := io.ReadFull(config.Random(), symKey); err != nil {
+ return nil, err
+ }
+
+ for _, key := range encryptKeys {
+ if err := packet.SerializeEncryptedKeyAEAD(keyWriter, key.PublicKey, cipher, aeadSupported, symKey, config); err != nil {
+ return nil, err
+ }
+ }
+
+ var payload io.WriteCloser
+ payload, err = packet.SerializeSymmetricallyEncrypted(dataWriter, cipher, aeadSupported, aeadCipherSuite, symKey, config)
+ if err != nil {
+ return
+ }
+
+ payload, err = handleCompression(payload, candidateCompression, config)
+ if err != nil {
+ return nil, err
+ }
+
+ return writeAndSign(payload, candidateHashes, signed, hints, sigType, config)
+}
+
+// Sign signs a message. The resulting WriteCloser must be closed after the
+// contents of the file have been written. hints contains optional information
+// that aids the recipients in processing the message.
+// If config is nil, sensible defaults will be used.
+func Sign(output io.Writer, signed *Entity, hints *FileHints, config *packet.Config) (input io.WriteCloser, err error) {
+ if signed == nil {
+ return nil, errors.InvalidArgumentError("no signer provided")
+ }
+
+ // These are the possible hash functions that we'll use for the signature.
+ candidateHashes := []uint8{
+ hashToHashId(crypto.SHA256),
+ hashToHashId(crypto.SHA384),
+ hashToHashId(crypto.SHA512),
+ hashToHashId(crypto.SHA3_256),
+ hashToHashId(crypto.SHA3_512),
+ }
+ defaultHashes := candidateHashes[0:1]
+ primarySelfSignature, _ := signed.PrimarySelfSignature()
+ if primarySelfSignature == nil {
+ return nil, errors.StructuralError("signed entity has no self-signature")
+ }
+ preferredHashes := primarySelfSignature.PreferredHash
+ if len(preferredHashes) == 0 {
+ preferredHashes = defaultHashes
+ }
+ candidateHashes = intersectPreferences(candidateHashes, preferredHashes)
+ if len(candidateHashes) == 0 {
+ return nil, errors.StructuralError("cannot sign because signing key shares no common algorithms with candidate hashes")
+ }
+
+ return writeAndSign(noOpCloser{output}, candidateHashes, signed, hints, packet.SigTypeBinary, config)
+}
+
+// signatureWriter hashes the contents of a message while passing it along to
+// literalData. When closed, it closes literalData, writes a signature packet
+// to encryptedData and then also closes encryptedData.
+type signatureWriter struct {
+ encryptedData io.WriteCloser
+ literalData io.WriteCloser
+ hashType crypto.Hash
+ wrappedHash hash.Hash
+ h hash.Hash
+ salt []byte // v6 only
+ signer *packet.PrivateKey
+ sigType packet.SignatureType
+ config *packet.Config
+ metadata *packet.LiteralData // V5 signatures protect document metadata
+}
+
+func (s signatureWriter) Write(data []byte) (int, error) {
+ s.wrappedHash.Write(data)
+ switch s.sigType {
+ case packet.SigTypeBinary:
+ return s.literalData.Write(data)
+ case packet.SigTypeText:
+ flag := 0
+ return writeCanonical(s.literalData, data, &flag)
+ }
+ return 0, errors.UnsupportedError("unsupported signature type: " + strconv.Itoa(int(s.sigType)))
+}
+
+func (s signatureWriter) Close() error {
+ sig := createSignaturePacket(&s.signer.PublicKey, s.sigType, s.config)
+ sig.Hash = s.hashType
+ sig.Metadata = s.metadata
+
+ if err := sig.SetSalt(s.salt); err != nil {
+ return err
+ }
+
+ if err := sig.Sign(s.h, s.signer, s.config); err != nil {
+ return err
+ }
+ if err := s.literalData.Close(); err != nil {
+ return err
+ }
+ if err := sig.Serialize(s.encryptedData); err != nil {
+ return err
+ }
+ return s.encryptedData.Close()
+}
+
+func selectHashForSigningKey(config *packet.Config, signer *packet.PublicKey) crypto.Hash {
+ acceptableHashes := acceptableHashesToWrite(signer)
+ hash, ok := algorithm.HashToHashId(config.Hash())
+ if !ok {
+ return config.Hash()
+ }
+ for _, acceptableHashes := range acceptableHashes {
+ if acceptableHashes == hash {
+ return config.Hash()
+ }
+ }
+ if len(acceptableHashes) > 0 {
+ defaultAcceptedHash, ok := algorithm.HashIdToHash(acceptableHashes[0])
+ if ok {
+ return defaultAcceptedHash
+ }
+ }
+ return config.Hash()
+}
+
+func createSignaturePacket(signer *packet.PublicKey, sigType packet.SignatureType, config *packet.Config) *packet.Signature {
+ sigLifetimeSecs := config.SigLifetime()
+ hash := selectHashForSigningKey(config, signer)
+ return &packet.Signature{
+ Version: signer.Version,
+ SigType: sigType,
+ PubKeyAlgo: signer.PubKeyAlgo,
+ Hash: hash,
+ CreationTime: config.Now(),
+ IssuerKeyId: &signer.KeyId,
+ IssuerFingerprint: signer.Fingerprint,
+ Notations: config.Notations(),
+ SigLifetimeSecs: &sigLifetimeSecs,
+ }
+}
+
+// noOpCloser is like an ioutil.NopCloser, but for an io.Writer.
+// TODO: we have two of these in OpenPGP packages alone. This probably needs
+// to be promoted somewhere more common.
+type noOpCloser struct {
+ w io.Writer
+}
+
+func (c noOpCloser) Write(data []byte) (n int, err error) {
+ return c.w.Write(data)
+}
+
+func (c noOpCloser) Close() error {
+ return nil
+}
+
+func handleCompression(compressed io.WriteCloser, candidateCompression []uint8, config *packet.Config) (data io.WriteCloser, err error) {
+ data = compressed
+ confAlgo := config.Compression()
+ if confAlgo == packet.CompressionNone {
+ return
+ }
+
+ // Set algorithm labelled as MUST as fallback
+ // https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-9.4
+ finalAlgo := packet.CompressionNone
+ // if compression specified by config available we will use it
+ for _, c := range candidateCompression {
+ if uint8(confAlgo) == c {
+ finalAlgo = confAlgo
+ break
+ }
+ }
+
+ if finalAlgo != packet.CompressionNone {
+ var compConfig *packet.CompressionConfig
+ if config != nil {
+ compConfig = config.CompressionConfig
+ }
+ data, err = packet.SerializeCompressed(compressed, finalAlgo, compConfig)
+ if err != nil {
+ return
+ }
+ }
+ return data, nil
+}
+
+// selectHash selects the preferred hash given the candidateHashes and the configuredHash
+func selectHash(candidateHashes []byte, configuredHash crypto.Hash, signer *packet.PrivateKey) (hash crypto.Hash, err error) {
+ acceptableHashes := acceptableHashesToWrite(&signer.PublicKey)
+ candidateHashes = intersectPreferences(acceptableHashes, candidateHashes)
+
+ for _, hashId := range candidateHashes {
+ if h, ok := algorithm.HashIdToHash(hashId); ok && h.Available() {
+ hash = h
+ break
+ }
+ }
+
+ // If the hash specified by config is a candidate, we'll use that.
+ if configuredHash.Available() {
+ for _, hashId := range candidateHashes {
+ if h, ok := algorithm.HashIdToHash(hashId); ok && h == configuredHash {
+ hash = h
+ break
+ }
+ }
+ }
+
+ if hash == 0 {
+ if len(acceptableHashes) > 0 {
+ if h, ok := algorithm.HashIdToHash(acceptableHashes[0]); ok {
+ hash = h
+ } else {
+ return 0, errors.UnsupportedError("no candidate hash functions are compiled in.")
+ }
+ } else {
+ return 0, errors.UnsupportedError("no candidate hash functions are compiled in.")
+ }
+ }
+ return
+}
+
+func acceptableHashesToWrite(singingKey *packet.PublicKey) []uint8 {
+ switch singingKey.PubKeyAlgo {
+ case packet.PubKeyAlgoEd448:
+ return []uint8{
+ hashToHashId(crypto.SHA512),
+ hashToHashId(crypto.SHA3_512),
+ }
+ case packet.PubKeyAlgoECDSA, packet.PubKeyAlgoEdDSA:
+ if curve, err := singingKey.Curve(); err == nil {
+ if curve == packet.Curve448 ||
+ curve == packet.CurveNistP521 ||
+ curve == packet.CurveBrainpoolP512 {
+ return []uint8{
+ hashToHashId(crypto.SHA512),
+ hashToHashId(crypto.SHA3_512),
+ }
+ } else if curve == packet.CurveBrainpoolP384 ||
+ curve == packet.CurveNistP384 {
+ return []uint8{
+ hashToHashId(crypto.SHA384),
+ hashToHashId(crypto.SHA512),
+ hashToHashId(crypto.SHA3_512),
+ }
+ }
+ }
+ }
+ return []uint8{
+ hashToHashId(crypto.SHA256),
+ hashToHashId(crypto.SHA384),
+ hashToHashId(crypto.SHA512),
+ hashToHashId(crypto.SHA3_256),
+ hashToHashId(crypto.SHA3_512),
+ }
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/x25519/x25519.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/x25519/x25519.go
new file mode 100644
index 0000000000..38afcc74fa
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/x25519/x25519.go
@@ -0,0 +1,221 @@
+package x25519
+
+import (
+ "crypto/sha256"
+ "crypto/subtle"
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/aes/keywrap"
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ x25519lib "github.com/cloudflare/circl/dh/x25519"
+ "golang.org/x/crypto/hkdf"
+)
+
+const (
+ hkdfInfo = "OpenPGP X25519"
+ aes128KeySize = 16
+ // The size of a public or private key in bytes.
+ KeySize = x25519lib.Size
+)
+
+type PublicKey struct {
+ // Point represents the encoded elliptic curve point of the public key.
+ Point []byte
+}
+
+type PrivateKey struct {
+ PublicKey
+ // Secret represents the secret of the private key.
+ Secret []byte
+}
+
+// NewPrivateKey creates a new empty private key including the public key.
+func NewPrivateKey(key PublicKey) *PrivateKey {
+ return &PrivateKey{
+ PublicKey: key,
+ }
+}
+
+// Validate validates that the provided public key matches the private key.
+func Validate(pk *PrivateKey) (err error) {
+ var expectedPublicKey, privateKey x25519lib.Key
+ subtle.ConstantTimeCopy(1, privateKey[:], pk.Secret)
+ x25519lib.KeyGen(&expectedPublicKey, &privateKey)
+ if subtle.ConstantTimeCompare(expectedPublicKey[:], pk.PublicKey.Point) == 0 {
+ return errors.KeyInvalidError("x25519: invalid key")
+ }
+ return nil
+}
+
+// GenerateKey generates a new x25519 key pair.
+func GenerateKey(rand io.Reader) (*PrivateKey, error) {
+ var privateKey, publicKey x25519lib.Key
+ privateKeyOut := new(PrivateKey)
+ err := generateKey(rand, &privateKey, &publicKey)
+ if err != nil {
+ return nil, err
+ }
+ privateKeyOut.PublicKey.Point = publicKey[:]
+ privateKeyOut.Secret = privateKey[:]
+ return privateKeyOut, nil
+}
+
+func generateKey(rand io.Reader, privateKey *x25519lib.Key, publicKey *x25519lib.Key) error {
+ maxRounds := 10
+ isZero := true
+ for round := 0; isZero; round++ {
+ if round == maxRounds {
+ return errors.InvalidArgumentError("x25519: zero keys only, randomness source might be corrupt")
+ }
+ _, err := io.ReadFull(rand, privateKey[:])
+ if err != nil {
+ return err
+ }
+ isZero = constantTimeIsZero(privateKey[:])
+ }
+ x25519lib.KeyGen(publicKey, privateKey)
+ return nil
+}
+
+// Encrypt encrypts a sessionKey with x25519 according to
+// the OpenPGP crypto refresh specification section 5.1.6. The function assumes that the
+// sessionKey has the correct format and padding according to the specification.
+func Encrypt(rand io.Reader, publicKey *PublicKey, sessionKey []byte) (ephemeralPublicKey *PublicKey, encryptedSessionKey []byte, err error) {
+ var ephemeralPrivate, ephemeralPublic, staticPublic, shared x25519lib.Key
+ // Check that the input static public key has 32 bytes
+ if len(publicKey.Point) != KeySize {
+ err = errors.KeyInvalidError("x25519: the public key has the wrong size")
+ return
+ }
+ copy(staticPublic[:], publicKey.Point)
+ // Generate ephemeral keyPair
+ err = generateKey(rand, &ephemeralPrivate, &ephemeralPublic)
+ if err != nil {
+ return
+ }
+ // Compute shared key
+ ok := x25519lib.Shared(&shared, &ephemeralPrivate, &staticPublic)
+ if !ok {
+ err = errors.KeyInvalidError("x25519: the public key is a low order point")
+ return
+ }
+ // Derive the encryption key from the shared secret
+ encryptionKey := applyHKDF(ephemeralPublic[:], publicKey.Point[:], shared[:])
+ ephemeralPublicKey = &PublicKey{
+ Point: ephemeralPublic[:],
+ }
+ // Encrypt the sessionKey with aes key wrapping
+ encryptedSessionKey, err = keywrap.Wrap(encryptionKey, sessionKey)
+ return
+}
+
+// Decrypt decrypts a session key stored in ciphertext with the provided x25519
+// private key and ephemeral public key.
+func Decrypt(privateKey *PrivateKey, ephemeralPublicKey *PublicKey, ciphertext []byte) (encodedSessionKey []byte, err error) {
+ var ephemeralPublic, staticPrivate, shared x25519lib.Key
+ // Check that the input ephemeral public key has 32 bytes
+ if len(ephemeralPublicKey.Point) != KeySize {
+ err = errors.KeyInvalidError("x25519: the public key has the wrong size")
+ return
+ }
+ copy(ephemeralPublic[:], ephemeralPublicKey.Point)
+ subtle.ConstantTimeCopy(1, staticPrivate[:], privateKey.Secret)
+ // Compute shared key
+ ok := x25519lib.Shared(&shared, &staticPrivate, &ephemeralPublic)
+ if !ok {
+ err = errors.KeyInvalidError("x25519: the ephemeral public key is a low order point")
+ return
+ }
+ // Derive the encryption key from the shared secret
+ encryptionKey := applyHKDF(ephemeralPublicKey.Point[:], privateKey.PublicKey.Point[:], shared[:])
+ // Decrypt the session key with aes key wrapping
+ encodedSessionKey, err = keywrap.Unwrap(encryptionKey, ciphertext)
+ return
+}
+
+func applyHKDF(ephemeralPublicKey []byte, publicKey []byte, sharedSecret []byte) []byte {
+ inputKey := make([]byte, 3*KeySize)
+ // ephemeral public key | recipient public key | shared secret
+ subtle.ConstantTimeCopy(1, inputKey[:KeySize], ephemeralPublicKey)
+ subtle.ConstantTimeCopy(1, inputKey[KeySize:2*KeySize], publicKey)
+ subtle.ConstantTimeCopy(1, inputKey[2*KeySize:], sharedSecret)
+ hkdfReader := hkdf.New(sha256.New, inputKey, []byte{}, []byte(hkdfInfo))
+ encryptionKey := make([]byte, aes128KeySize)
+ _, _ = io.ReadFull(hkdfReader, encryptionKey)
+ return encryptionKey
+}
+
+func constantTimeIsZero(bytes []byte) bool {
+ isZero := byte(0)
+ for _, b := range bytes {
+ isZero |= b
+ }
+ return isZero == 0
+}
+
+// ENCODING/DECODING ciphertexts:
+
+// EncodeFieldsLength returns the length of the ciphertext encoding
+// given the encrypted session key.
+func EncodedFieldsLength(encryptedSessionKey []byte, v6 bool) int {
+ lenCipherFunction := 0
+ if !v6 {
+ lenCipherFunction = 1
+ }
+ return KeySize + 1 + len(encryptedSessionKey) + lenCipherFunction
+}
+
+// EncodeField encodes x25519 session key encryption fields as
+// ephemeral x25519 public key | follow byte length | cipherFunction (v3 only) | encryptedSessionKey
+// and writes it to writer.
+func EncodeFields(writer io.Writer, ephemeralPublicKey *PublicKey, encryptedSessionKey []byte, cipherFunction byte, v6 bool) (err error) {
+ lenAlgorithm := 0
+ if !v6 {
+ lenAlgorithm = 1
+ }
+ if _, err = writer.Write(ephemeralPublicKey.Point); err != nil {
+ return err
+ }
+ if _, err = writer.Write([]byte{byte(len(encryptedSessionKey) + lenAlgorithm)}); err != nil {
+ return err
+ }
+ if !v6 {
+ if _, err = writer.Write([]byte{cipherFunction}); err != nil {
+ return err
+ }
+ }
+ _, err = writer.Write(encryptedSessionKey)
+ return err
+}
+
+// DecodeField decodes a x25519 session key encryption as
+// ephemeral x25519 public key | follow byte length | cipherFunction (v3 only) | encryptedSessionKey.
+func DecodeFields(reader io.Reader, v6 bool) (ephemeralPublicKey *PublicKey, encryptedSessionKey []byte, cipherFunction byte, err error) {
+ var buf [1]byte
+ ephemeralPublicKey = &PublicKey{
+ Point: make([]byte, KeySize),
+ }
+ // 32 octets representing an ephemeral x25519 public key.
+ if _, err = io.ReadFull(reader, ephemeralPublicKey.Point); err != nil {
+ return nil, nil, 0, err
+ }
+ // A one-octet size of the following fields.
+ if _, err = io.ReadFull(reader, buf[:]); err != nil {
+ return nil, nil, 0, err
+ }
+ followingLen := buf[0]
+ // The one-octet algorithm identifier, if it was passed (in the case of a v3 PKESK packet).
+ if !v6 {
+ if _, err = io.ReadFull(reader, buf[:]); err != nil {
+ return nil, nil, 0, err
+ }
+ cipherFunction = buf[0]
+ followingLen -= 1
+ }
+ // The encrypted session key.
+ encryptedSessionKey = make([]byte, followingLen)
+ if _, err = io.ReadFull(reader, encryptedSessionKey); err != nil {
+ return nil, nil, 0, err
+ }
+ return ephemeralPublicKey, encryptedSessionKey, cipherFunction, nil
+}
diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/x448/x448.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/x448/x448.go
new file mode 100644
index 0000000000..65a082dabd
--- /dev/null
+++ b/vendor/github.com/ProtonMail/go-crypto/openpgp/x448/x448.go
@@ -0,0 +1,229 @@
+package x448
+
+import (
+ "crypto/sha512"
+ "crypto/subtle"
+ "io"
+
+ "github.com/ProtonMail/go-crypto/openpgp/aes/keywrap"
+ "github.com/ProtonMail/go-crypto/openpgp/errors"
+ x448lib "github.com/cloudflare/circl/dh/x448"
+ "golang.org/x/crypto/hkdf"
+)
+
+const (
+ hkdfInfo = "OpenPGP X448"
+ aes256KeySize = 32
+ // The size of a public or private key in bytes.
+ KeySize = x448lib.Size
+)
+
+type PublicKey struct {
+ // Point represents the encoded elliptic curve point of the public key.
+ Point []byte
+}
+
+type PrivateKey struct {
+ PublicKey
+ // Secret represents the secret of the private key.
+ Secret []byte
+}
+
+// NewPrivateKey creates a new empty private key including the public key.
+func NewPrivateKey(key PublicKey) *PrivateKey {
+ return &PrivateKey{
+ PublicKey: key,
+ }
+}
+
+// Validate validates that the provided public key matches
+// the private key.
+func Validate(pk *PrivateKey) (err error) {
+ var expectedPublicKey, privateKey x448lib.Key
+ subtle.ConstantTimeCopy(1, privateKey[:], pk.Secret)
+ x448lib.KeyGen(&expectedPublicKey, &privateKey)
+ if subtle.ConstantTimeCompare(expectedPublicKey[:], pk.PublicKey.Point) == 0 {
+ return errors.KeyInvalidError("x448: invalid key")
+ }
+ return nil
+}
+
+// GenerateKey generates a new x448 key pair.
+func GenerateKey(rand io.Reader) (*PrivateKey, error) {
+ var privateKey, publicKey x448lib.Key
+ privateKeyOut := new(PrivateKey)
+ err := generateKey(rand, &privateKey, &publicKey)
+ if err != nil {
+ return nil, err
+ }
+ privateKeyOut.PublicKey.Point = publicKey[:]
+ privateKeyOut.Secret = privateKey[:]
+ return privateKeyOut, nil
+}
+
+func generateKey(rand io.Reader, privateKey *x448lib.Key, publicKey *x448lib.Key) error {
+ maxRounds := 10
+ isZero := true
+ for round := 0; isZero; round++ {
+ if round == maxRounds {
+ return errors.InvalidArgumentError("x448: zero keys only, randomness source might be corrupt")
+ }
+ _, err := io.ReadFull(rand, privateKey[:])
+ if err != nil {
+ return err
+ }
+ isZero = constantTimeIsZero(privateKey[:])
+ }
+ x448lib.KeyGen(publicKey, privateKey)
+ return nil
+}
+
+// Encrypt encrypts a sessionKey with x448 according to
+// the OpenPGP crypto refresh specification section 5.1.7. The function assumes that the
+// sessionKey has the correct format and padding according to the specification.
+func Encrypt(rand io.Reader, publicKey *PublicKey, sessionKey []byte) (ephemeralPublicKey *PublicKey, encryptedSessionKey []byte, err error) {
+ var ephemeralPrivate, ephemeralPublic, staticPublic, shared x448lib.Key
+ // Check that the input static public key has 56 bytes.
+ if len(publicKey.Point) != KeySize {
+ err = errors.KeyInvalidError("x448: the public key has the wrong size")
+ return nil, nil, err
+ }
+ copy(staticPublic[:], publicKey.Point)
+ // Generate ephemeral keyPair.
+ if err = generateKey(rand, &ephemeralPrivate, &ephemeralPublic); err != nil {
+ return nil, nil, err
+ }
+ // Compute shared key.
+ ok := x448lib.Shared(&shared, &ephemeralPrivate, &staticPublic)
+ if !ok {
+ err = errors.KeyInvalidError("x448: the public key is a low order point")
+ return nil, nil, err
+ }
+ // Derive the encryption key from the shared secret.
+ encryptionKey := applyHKDF(ephemeralPublic[:], publicKey.Point[:], shared[:])
+ ephemeralPublicKey = &PublicKey{
+ Point: ephemeralPublic[:],
+ }
+ // Encrypt the sessionKey with aes key wrapping.
+ encryptedSessionKey, err = keywrap.Wrap(encryptionKey, sessionKey)
+ if err != nil {
+ return nil, nil, err
+ }
+ return ephemeralPublicKey, encryptedSessionKey, nil
+}
+
+// Decrypt decrypts a session key stored in ciphertext with the provided x448
+// private key and ephemeral public key.
+func Decrypt(privateKey *PrivateKey, ephemeralPublicKey *PublicKey, ciphertext []byte) (encodedSessionKey []byte, err error) {
+ var ephemeralPublic, staticPrivate, shared x448lib.Key
+ // Check that the input ephemeral public key has 56 bytes.
+ if len(ephemeralPublicKey.Point) != KeySize {
+ err = errors.KeyInvalidError("x448: the public key has the wrong size")
+ return nil, err
+ }
+ copy(ephemeralPublic[:], ephemeralPublicKey.Point)
+ subtle.ConstantTimeCopy(1, staticPrivate[:], privateKey.Secret)
+ // Compute shared key.
+ ok := x448lib.Shared(&shared, &staticPrivate, &ephemeralPublic)
+ if !ok {
+ err = errors.KeyInvalidError("x448: the ephemeral public key is a low order point")
+ return nil, err
+ }
+ // Derive the encryption key from the shared secret.
+ encryptionKey := applyHKDF(ephemeralPublicKey.Point[:], privateKey.PublicKey.Point[:], shared[:])
+ // Decrypt the session key with aes key wrapping.
+ encodedSessionKey, err = keywrap.Unwrap(encryptionKey, ciphertext)
+ if err != nil {
+ return nil, err
+ }
+ return encodedSessionKey, nil
+}
+
+func applyHKDF(ephemeralPublicKey []byte, publicKey []byte, sharedSecret []byte) []byte {
+ inputKey := make([]byte, 3*KeySize)
+ // ephemeral public key | recipient public key | shared secret.
+ subtle.ConstantTimeCopy(1, inputKey[:KeySize], ephemeralPublicKey)
+ subtle.ConstantTimeCopy(1, inputKey[KeySize:2*KeySize], publicKey)
+ subtle.ConstantTimeCopy(1, inputKey[2*KeySize:], sharedSecret)
+ hkdfReader := hkdf.New(sha512.New, inputKey, []byte{}, []byte(hkdfInfo))
+ encryptionKey := make([]byte, aes256KeySize)
+ _, _ = io.ReadFull(hkdfReader, encryptionKey)
+ return encryptionKey
+}
+
+func constantTimeIsZero(bytes []byte) bool {
+ isZero := byte(0)
+ for _, b := range bytes {
+ isZero |= b
+ }
+ return isZero == 0
+}
+
+// ENCODING/DECODING ciphertexts:
+
+// EncodeFieldsLength returns the length of the ciphertext encoding
+// given the encrypted session key.
+func EncodedFieldsLength(encryptedSessionKey []byte, v6 bool) int {
+ lenCipherFunction := 0
+ if !v6 {
+ lenCipherFunction = 1
+ }
+ return KeySize + 1 + len(encryptedSessionKey) + lenCipherFunction
+}
+
+// EncodeField encodes x448 session key encryption fields as
+// ephemeral x448 public key | follow byte length | cipherFunction (v3 only) | encryptedSessionKey
+// and writes it to writer.
+func EncodeFields(writer io.Writer, ephemeralPublicKey *PublicKey, encryptedSessionKey []byte, cipherFunction byte, v6 bool) (err error) {
+ lenAlgorithm := 0
+ if !v6 {
+ lenAlgorithm = 1
+ }
+ if _, err = writer.Write(ephemeralPublicKey.Point); err != nil {
+ return err
+ }
+ if _, err = writer.Write([]byte{byte(len(encryptedSessionKey) + lenAlgorithm)}); err != nil {
+ return err
+ }
+ if !v6 {
+ if _, err = writer.Write([]byte{cipherFunction}); err != nil {
+ return err
+ }
+ }
+ if _, err = writer.Write(encryptedSessionKey); err != nil {
+ return err
+ }
+ return nil
+}
+
+// DecodeField decodes a x448 session key encryption as
+// ephemeral x448 public key | follow byte length | cipherFunction (v3 only) | encryptedSessionKey.
+func DecodeFields(reader io.Reader, v6 bool) (ephemeralPublicKey *PublicKey, encryptedSessionKey []byte, cipherFunction byte, err error) {
+ var buf [1]byte
+ ephemeralPublicKey = &PublicKey{
+ Point: make([]byte, KeySize),
+ }
+ // 56 octets representing an ephemeral x448 public key.
+ if _, err = io.ReadFull(reader, ephemeralPublicKey.Point); err != nil {
+ return nil, nil, 0, err
+ }
+ // A one-octet size of the following fields.
+ if _, err = io.ReadFull(reader, buf[:]); err != nil {
+ return nil, nil, 0, err
+ }
+ followingLen := buf[0]
+ // The one-octet algorithm identifier, if it was passed (in the case of a v3 PKESK packet).
+ if !v6 {
+ if _, err = io.ReadFull(reader, buf[:]); err != nil {
+ return nil, nil, 0, err
+ }
+ cipherFunction = buf[0]
+ followingLen -= 1
+ }
+ // The encrypted session key.
+ encryptedSessionKey = make([]byte, followingLen)
+ if _, err = io.ReadFull(reader, encryptedSessionKey); err != nil {
+ return nil, nil, 0, err
+ }
+ return ephemeralPublicKey, encryptedSessionKey, cipherFunction, nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue/CHANGELOG.md
index e7e56265c3..93d2f2f768 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue/CHANGELOG.md
@@ -1,3 +1,42 @@
+# v1.20.35 (2026-03-13)
+
+* **Bug Fix**: Fix documentation typo.
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.20.34 (2026-03-03)
+
+* **Dependency Update**: Bump minimum Go version to 1.24
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.20.33 (2026-02-23)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.20.32 (2026-02-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.20.31 (2026-01-22)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.20.30 (2026-01-09)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.20.29 (2025-12-09)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.20.28 (2025-12-08)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.20.27 (2025-12-02)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change.
+
# v1.20.26 (2025-11-25)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue/encode.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue/encode.go
index 441a6fdfdf..fa57dbb3df 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue/encode.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue/encode.go
@@ -88,7 +88,7 @@ type Marshaler interface {
// type. This value can be used in API operations to simplify marshaling
// your Go value types into AttributeValues.
//
-// Marshal will recursively transverse the passed in value marshaling its
+// Marshal will recursively traverse the passed in value marshaling its
// contents into a AttributeValue. Marshal supports basic scalars
// (int,uint,float,bool,string), maps, slices, and structs. Anonymous
// nested types are flattened based on Go anonymous type visibility.
@@ -191,7 +191,7 @@ func Marshal(in interface{}) (types.AttributeValue, error) {
//
// Use the `optsFns` functional options to override the default configuration.
//
-// MarshalWithOptions will recursively transverse the passed in value marshaling its
+// MarshalWithOptions will recursively traverse the passed in value marshaling its
// contents into a AttributeValue. Marshal supports basic scalars
// (int,uint,float,bool,string), maps, slices, and structs. Anonymous
// nested types are flattened based on Go anonymous type visibility.
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue/go_module_metadata.go
index 1ba04a923c..0ecc690770 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue/go_module_metadata.go
@@ -3,4 +3,4 @@
package attributevalue
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.20.26"
+const goModuleVersion = "1.20.35"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/CHANGELOG.md
index a7965ded25..d721c81b92 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/CHANGELOG.md
@@ -1,3 +1,42 @@
+# v1.8.35 (2026-03-13)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.8.34 (2026-03-03)
+
+* **Bug Fix**: Modernize non codegen files with go fix
+* **Dependency Update**: Bump minimum Go version to 1.24
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.8.33 (2026-02-23)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.8.32 (2026-02-03)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.8.31 (2026-01-22)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.8.30 (2026-01-09)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.8.29 (2025-12-09)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.8.28 (2025-12-08)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.8.27 (2025-12-02)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change.
+
# v1.8.26 (2025-11-25)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/condition.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/condition.go
index 09e494dd7a..d8d7e8b90a 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/condition.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/condition.go
@@ -1360,7 +1360,7 @@ func (nb NameBuilder) BeginsWith(prefix string) ConditionBuilder {
// expression.Contains(expression.Name("InviteList"), "Ben")
// // Let :ben be an ExpressionAttributeValue representing the value "Ben"
// "contains (InviteList, :ben)"
-func Contains(nameBuilder NameBuilder, val interface{}) ConditionBuilder {
+func Contains(nameBuilder NameBuilder, val any) ConditionBuilder {
v := ValueBuilder{
value: val,
}
@@ -1395,7 +1395,7 @@ func Contains(nameBuilder NameBuilder, val interface{}) ConditionBuilder {
// expression.Name("InviteList").Contains("Ben")
// // Let :ben be an ExpressionAttributeValue representing the value "Ben"
// "contains (InviteList, :ben)"
-func (nb NameBuilder) Contains(val interface{}) ConditionBuilder {
+func (nb NameBuilder) Contains(val any) ConditionBuilder {
return Contains(nb, val)
}
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/go_module_metadata.go
index 8f6894eb1e..e04cf7dd58 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/go_module_metadata.go
@@ -3,4 +3,4 @@
package expression
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.8.26"
+const goModuleVersion = "1.8.35"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/operand.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/operand.go
index c2cacf6b03..c8c4e659eb 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/operand.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression/operand.go
@@ -18,7 +18,7 @@ import (
// // Create a ValueBuilder representing the string "aValue"
// valueBuilder := expression.Value("aValue")
type ValueBuilder struct {
- value interface{}
+ value any
options ValueBuilderOptions
}
@@ -237,7 +237,7 @@ func NameNoDotSplit(name string) NameBuilder {
// condition := expression.Name("foo").Equal(expression.Value(10))
// // Use Value() to set the value of a set expression.
// update := Set(expression.Name("greets"), expression.Value(&types.AttributeValueMemberS{Value: "hello"}))
-func Value(value interface{}) ValueBuilder {
+func Value(value any) ValueBuilder {
return ValueBuilder{
value: value,
}
@@ -262,7 +262,7 @@ func Value(value interface{}) ValueBuilder {
// condition := expression.Name("foo").Equal(expression.Value(10))
// // Use Value() to set the value of a set expression.
// update := Set(expression.Name("greets"), expression.Value(&types.AttributeValueMemberS{Value: "hello"}))
-func ValueWithOptions(value interface{}, optFns ...func(*ValueBuilderOptions)) ValueBuilder {
+func ValueWithOptions(value any, optFns ...func(*ValueBuilderOptions)) ValueBuilder {
var options ValueBuilderOptions
for _, fn := range optFns {
fn(&options)
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/CHANGELOG.md
index 913a4e926e..1771acab88 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/CHANGELOG.md
@@ -1,3 +1,43 @@
+# v1.56.2 (2026-03-13)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.56.1 (2026-03-03)
+
+* **Bug Fix**: Modernize non codegen files with go fix
+* **Dependency Update**: Bump minimum Go version to 1.24
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.56.0 (2026-02-23)
+
+* **Feature**: This change supports the creation of multi-account global tables. It adds one new arguments to UpdateTable, GlobalTableSettingsReplicationMode.
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.55.0 (2026-02-03)
+
+* **Feature**: This change supports the creation of multi-account global tables. It adds two new arguments to CreateTable, GlobalTableSourceArn and GlobalTableSettingsReplicationMode. DescribeTable is also updated to include information about GlobalTableSettingsReplicationMode.
+
+# v1.54.0 (2026-01-22)
+
+* **Feature**: Adds additional waiters to Amazon DynamoDB.
+
+# v1.53.6 (2026-01-09)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.53.5 (2025-12-09)
+
+* No change notes available for this release.
+
+# v1.53.4 (2025-12-08)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.53.3 (2025-12-02)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change.
+
# v1.53.2 (2025-11-25)
* **Bug Fix**: Add error check for endpoint param binding during auth scheme resolution to fix panic reported in #3234
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateTable.go
index 1d8a0254b7..9334fe4101 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateTable.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateTable.go
@@ -46,55 +46,15 @@ func (c *Client) CreateTable(ctx context.Context, params *CreateTableInput, optF
// Represents the input of a CreateTable operation.
type CreateTableInput struct {
- // An array of attributes that describe the key schema for the table and indexes.
- //
- // This member is required.
- AttributeDefinitions []types.AttributeDefinition
-
- // Specifies the attributes that make up the primary key for a table or an index.
- // The attributes in KeySchema must also be defined in the AttributeDefinitions
- // array. For more information, see [Data Model]in the Amazon DynamoDB Developer Guide.
- //
- // Each KeySchemaElement in the array is composed of:
- //
- // - AttributeName - The name of this key attribute.
- //
- // - KeyType - The role that the key attribute will assume:
- //
- // - HASH - partition key
- //
- // - RANGE - sort key
- //
- // The partition key of an item is also known as its hash attribute. The term
- // "hash attribute" derives from the DynamoDB usage of an internal hash function to
- // evenly distribute data items across partitions, based on their partition key
- // values.
- //
- // The sort key of an item is also known as its range attribute. The term "range
- // attribute" derives from the way DynamoDB stores items with the same partition
- // key physically close together, in sorted order by the sort key value.
- //
- // For a simple primary key (partition key), you must provide exactly one element
- // with a KeyType of HASH .
- //
- // For a composite primary key (partition key and sort key), you must provide
- // exactly two elements, in this order: The first element must have a KeyType of
- // HASH , and the second element must have a KeyType of RANGE .
- //
- // For more information, see [Working with Tables] in the Amazon DynamoDB Developer Guide.
- //
- // [Data Model]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html
- // [Working with Tables]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key
- //
- // This member is required.
- KeySchema []types.KeySchemaElement
-
// The name of the table to create. You can also provide the Amazon Resource Name
// (ARN) of the table in this parameter.
//
// This member is required.
TableName *string
+ // An array of attributes that describe the key schema for the table and indexes.
+ AttributeDefinitions []types.AttributeDefinition
+
// Controls how you are charged for read and write throughput and how you manage
// capacity. This setting can be changed later.
//
@@ -119,7 +79,8 @@ type CreateTableInput struct {
// - IndexName - The name of the global secondary index. Must be unique only for
// this table.
//
- // - KeySchema - Specifies the key schema for the global secondary index.
+ // - KeySchema - Specifies the key schema for the global secondary index. Each
+ // global secondary index supports up to 4 partition keys and up to 4 sort keys.
//
// - Projection - Specifies attributes that are copied (projected) from the table
// into the index. These are in addition to the primary key attributes and index
@@ -148,6 +109,52 @@ type CreateTableInput struct {
// secondary index, consisting of read and write capacity units.
GlobalSecondaryIndexes []types.GlobalSecondaryIndex
+ // Controls the settings synchronization mode for the global table. For
+ // multi-account global tables, this parameter is required and the only supported
+ // value is ENABLED. For same-account global tables, this parameter is set to
+ // ENABLED_WITH_OVERRIDES.
+ GlobalTableSettingsReplicationMode types.GlobalTableSettingsReplicationMode
+
+ // The Amazon Resource Name (ARN) of the source table used for the creation of a
+ // multi-account global table.
+ GlobalTableSourceArn *string
+
+ // Specifies the attributes that make up the primary key for a table or an index.
+ // The attributes in KeySchema must also be defined in the AttributeDefinitions
+ // array. For more information, see [Data Model]in the Amazon DynamoDB Developer Guide.
+ //
+ // Each KeySchemaElement in the array is composed of:
+ //
+ // - AttributeName - The name of this key attribute.
+ //
+ // - KeyType - The role that the key attribute will assume:
+ //
+ // - HASH - partition key
+ //
+ // - RANGE - sort key
+ //
+ // The partition key of an item is also known as its hash attribute. The term
+ // "hash attribute" derives from the DynamoDB usage of an internal hash function to
+ // evenly distribute data items across partitions, based on their partition key
+ // values.
+ //
+ // The sort key of an item is also known as its range attribute. The term "range
+ // attribute" derives from the way DynamoDB stores items with the same partition
+ // key physically close together, in sorted order by the sort key value.
+ //
+ // For a simple primary key (partition key), you must provide exactly one element
+ // with a KeyType of HASH .
+ //
+ // For a composite primary key (partition key and sort key), you must provide
+ // exactly two elements, in this order: The first element must have a KeyType of
+ // HASH , and the second element must have a KeyType of RANGE .
+ //
+ // For more information, see [Working with Tables] in the Amazon DynamoDB Developer Guide.
+ //
+ // [Data Model]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html
+ // [Working with Tables]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key
+ KeySchema []types.KeySchemaElement
+
// One or more local secondary indexes (the maximum is 5) to be created on the
// table. Each index is scoped to a given partition key value. There is a 10 GB
// size limit per partition key value; otherwise, the size of a local secondary
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeContributorInsights.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeContributorInsights.go
index dc54c3dbdf..8f4571f2f8 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeContributorInsights.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeContributorInsights.go
@@ -8,7 +8,9 @@ import (
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
"github.com/aws/smithy-go/middleware"
+ smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
+ smithywaiter "github.com/aws/smithy-go/waiter"
"time"
)
@@ -204,6 +206,203 @@ func (c *Client) addOperationDescribeContributorInsightsMiddlewares(stack *middl
return nil
}
+// ContributorInsightsEnabledWaiterOptions are waiter options for
+// ContributorInsightsEnabledWaiter
+type ContributorInsightsEnabledWaiterOptions struct {
+
+ // Set of options to modify how an operation is invoked. These apply to all
+ // operations invoked for this client. Use functional options on operation call to
+ // modify this list for per operation behavior.
+ //
+ // Passing options here is functionally equivalent to passing values to this
+ // config's ClientOptions field that extend the inner client's APIOptions directly.
+ APIOptions []func(*middleware.Stack) error
+
+ // Functional options to be passed to all operations invoked by this client.
+ //
+ // Function values that modify the inner APIOptions are applied after the waiter
+ // config's own APIOptions modifiers.
+ ClientOptions []func(*Options)
+
+ // MinDelay is the minimum amount of time to delay between retries. If unset,
+ // ContributorInsightsEnabledWaiter will use default minimum delay of 20 seconds.
+ // Note that MinDelay must resolve to a value lesser than or equal to the MaxDelay.
+ MinDelay time.Duration
+
+ // MaxDelay is the maximum amount of time to delay between retries. If unset or
+ // set to zero, ContributorInsightsEnabledWaiter will use default max delay of 120
+ // seconds. Note that MaxDelay must resolve to value greater than or equal to the
+ // MinDelay.
+ MaxDelay time.Duration
+
+ // LogWaitAttempts is used to enable logging for waiter retry attempts
+ LogWaitAttempts bool
+
+ // Retryable is function that can be used to override the service defined
+ // waiter-behavior based on operation output, or returned error. This function is
+ // used by the waiter to decide if a state is retryable or a terminal state.
+ //
+ // By default service-modeled logic will populate this option. This option can
+ // thus be used to define a custom waiter state with fall-back to service-modeled
+ // waiter state mutators.The function returns an error in case of a failure state.
+ // In case of retry state, this function returns a bool value of true and nil
+ // error, while in case of success it returns a bool value of false and nil error.
+ Retryable func(context.Context, *DescribeContributorInsightsInput, *DescribeContributorInsightsOutput, error) (bool, error)
+}
+
+// ContributorInsightsEnabledWaiter defines the waiters for
+// ContributorInsightsEnabled
+type ContributorInsightsEnabledWaiter struct {
+ client DescribeContributorInsightsAPIClient
+
+ options ContributorInsightsEnabledWaiterOptions
+}
+
+// NewContributorInsightsEnabledWaiter constructs a
+// ContributorInsightsEnabledWaiter.
+func NewContributorInsightsEnabledWaiter(client DescribeContributorInsightsAPIClient, optFns ...func(*ContributorInsightsEnabledWaiterOptions)) *ContributorInsightsEnabledWaiter {
+ options := ContributorInsightsEnabledWaiterOptions{}
+ options.MinDelay = 20 * time.Second
+ options.MaxDelay = 120 * time.Second
+ options.Retryable = contributorInsightsEnabledStateRetryable
+
+ for _, fn := range optFns {
+ fn(&options)
+ }
+ return &ContributorInsightsEnabledWaiter{
+ client: client,
+ options: options,
+ }
+}
+
+// Wait calls the waiter function for ContributorInsightsEnabled waiter. The
+// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is
+// required and must be greater than zero.
+func (w *ContributorInsightsEnabledWaiter) Wait(ctx context.Context, params *DescribeContributorInsightsInput, maxWaitDur time.Duration, optFns ...func(*ContributorInsightsEnabledWaiterOptions)) error {
+ _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
+ return err
+}
+
+// WaitForOutput calls the waiter function for ContributorInsightsEnabled waiter
+// and returns the output of the successful operation. The maxWaitDur is the
+// maximum wait duration the waiter will wait. The maxWaitDur is required and must
+// be greater than zero.
+func (w *ContributorInsightsEnabledWaiter) WaitForOutput(ctx context.Context, params *DescribeContributorInsightsInput, maxWaitDur time.Duration, optFns ...func(*ContributorInsightsEnabledWaiterOptions)) (*DescribeContributorInsightsOutput, error) {
+ if maxWaitDur <= 0 {
+ return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
+ }
+
+ options := w.options
+ for _, fn := range optFns {
+ fn(&options)
+ }
+
+ if options.MaxDelay <= 0 {
+ options.MaxDelay = 120 * time.Second
+ }
+
+ if options.MinDelay > options.MaxDelay {
+ return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
+ }
+
+ ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
+ defer cancelFn()
+
+ logger := smithywaiter.Logger{}
+ remainingTime := maxWaitDur
+
+ var attempt int64
+ for {
+
+ attempt++
+ apiOptions := options.APIOptions
+ start := time.Now()
+
+ if options.LogWaitAttempts {
+ logger.Attempt = attempt
+ apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
+ apiOptions = append(apiOptions, logger.AddLogger)
+ }
+
+ out, err := w.client.DescribeContributorInsights(ctx, params, func(o *Options) {
+ baseOpts := []func(*Options){
+ addIsWaiterUserAgent,
+ }
+ o.APIOptions = append(o.APIOptions, apiOptions...)
+ for _, opt := range baseOpts {
+ opt(o)
+ }
+ for _, opt := range options.ClientOptions {
+ opt(o)
+ }
+ })
+
+ retryable, err := options.Retryable(ctx, params, out, err)
+ if err != nil {
+ return nil, err
+ }
+ if !retryable {
+ return out, nil
+ }
+
+ remainingTime -= time.Since(start)
+ if remainingTime < options.MinDelay || remainingTime <= 0 {
+ break
+ }
+
+ // compute exponential backoff between waiter retries
+ delay, err := smithywaiter.ComputeDelay(
+ attempt, options.MinDelay, options.MaxDelay, remainingTime,
+ )
+ if err != nil {
+ return nil, fmt.Errorf("error computing waiter delay, %w", err)
+ }
+
+ remainingTime -= delay
+ // sleep for the delay amount before invoking a request
+ if err := smithytime.SleepWithContext(ctx, delay); err != nil {
+ return nil, fmt.Errorf("request cancelled while waiting, %w", err)
+ }
+ }
+ return nil, fmt.Errorf("exceeded max wait time for ContributorInsightsEnabled waiter")
+}
+
+func contributorInsightsEnabledStateRetryable(ctx context.Context, input *DescribeContributorInsightsInput, output *DescribeContributorInsightsOutput, err error) (bool, error) {
+
+ if err == nil {
+ v1 := output.ContributorInsightsStatus
+ expectedValue := "ENABLED"
+ var pathValue string
+ pathValue = string(v1)
+ if pathValue == expectedValue {
+ return false, nil
+ }
+ }
+
+ if err == nil {
+ v1 := output.ContributorInsightsStatus
+ expectedValue := "FAILED"
+ var pathValue string
+ pathValue = string(v1)
+ if pathValue == expectedValue {
+ return false, fmt.Errorf("waiter state transitioned to Failure")
+ }
+ }
+
+ if err != nil {
+ return false, err
+ }
+ return true, nil
+}
+
+// DescribeContributorInsightsAPIClient is a client that implements the
+// DescribeContributorInsights operation.
+type DescribeContributorInsightsAPIClient interface {
+ DescribeContributorInsights(context.Context, *DescribeContributorInsightsInput, ...func(*Options)) (*DescribeContributorInsightsOutput, error)
+}
+
+var _ DescribeContributorInsightsAPIClient = (*Client)(nil)
+
func newServiceMetadataMiddleware_opDescribeContributorInsights(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeExport.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeExport.go
index 57fd40aaea..6c35bc510a 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeExport.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeExport.go
@@ -8,7 +8,10 @@ import (
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
"github.com/aws/smithy-go/middleware"
+ smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
+ smithywaiter "github.com/aws/smithy-go/waiter"
+ "time"
)
// Describes an existing table export.
@@ -163,6 +166,209 @@ func (c *Client) addOperationDescribeExportMiddlewares(stack *middleware.Stack,
return nil
}
+// ExportCompletedWaiterOptions are waiter options for ExportCompletedWaiter
+type ExportCompletedWaiterOptions struct {
+
+ // Set of options to modify how an operation is invoked. These apply to all
+ // operations invoked for this client. Use functional options on operation call to
+ // modify this list for per operation behavior.
+ //
+ // Passing options here is functionally equivalent to passing values to this
+ // config's ClientOptions field that extend the inner client's APIOptions directly.
+ APIOptions []func(*middleware.Stack) error
+
+ // Functional options to be passed to all operations invoked by this client.
+ //
+ // Function values that modify the inner APIOptions are applied after the waiter
+ // config's own APIOptions modifiers.
+ ClientOptions []func(*Options)
+
+ // MinDelay is the minimum amount of time to delay between retries. If unset,
+ // ExportCompletedWaiter will use default minimum delay of 20 seconds. Note that
+ // MinDelay must resolve to a value lesser than or equal to the MaxDelay.
+ MinDelay time.Duration
+
+ // MaxDelay is the maximum amount of time to delay between retries. If unset or
+ // set to zero, ExportCompletedWaiter will use default max delay of 120 seconds.
+ // Note that MaxDelay must resolve to value greater than or equal to the MinDelay.
+ MaxDelay time.Duration
+
+ // LogWaitAttempts is used to enable logging for waiter retry attempts
+ LogWaitAttempts bool
+
+ // Retryable is function that can be used to override the service defined
+ // waiter-behavior based on operation output, or returned error. This function is
+ // used by the waiter to decide if a state is retryable or a terminal state.
+ //
+ // By default service-modeled logic will populate this option. This option can
+ // thus be used to define a custom waiter state with fall-back to service-modeled
+ // waiter state mutators.The function returns an error in case of a failure state.
+ // In case of retry state, this function returns a bool value of true and nil
+ // error, while in case of success it returns a bool value of false and nil error.
+ Retryable func(context.Context, *DescribeExportInput, *DescribeExportOutput, error) (bool, error)
+}
+
+// ExportCompletedWaiter defines the waiters for ExportCompleted
+type ExportCompletedWaiter struct {
+ client DescribeExportAPIClient
+
+ options ExportCompletedWaiterOptions
+}
+
+// NewExportCompletedWaiter constructs a ExportCompletedWaiter.
+func NewExportCompletedWaiter(client DescribeExportAPIClient, optFns ...func(*ExportCompletedWaiterOptions)) *ExportCompletedWaiter {
+ options := ExportCompletedWaiterOptions{}
+ options.MinDelay = 20 * time.Second
+ options.MaxDelay = 120 * time.Second
+ options.Retryable = exportCompletedStateRetryable
+
+ for _, fn := range optFns {
+ fn(&options)
+ }
+ return &ExportCompletedWaiter{
+ client: client,
+ options: options,
+ }
+}
+
+// Wait calls the waiter function for ExportCompleted waiter. The maxWaitDur is
+// the maximum wait duration the waiter will wait. The maxWaitDur is required and
+// must be greater than zero.
+func (w *ExportCompletedWaiter) Wait(ctx context.Context, params *DescribeExportInput, maxWaitDur time.Duration, optFns ...func(*ExportCompletedWaiterOptions)) error {
+ _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
+ return err
+}
+
+// WaitForOutput calls the waiter function for ExportCompleted waiter and returns
+// the output of the successful operation. The maxWaitDur is the maximum wait
+// duration the waiter will wait. The maxWaitDur is required and must be greater
+// than zero.
+func (w *ExportCompletedWaiter) WaitForOutput(ctx context.Context, params *DescribeExportInput, maxWaitDur time.Duration, optFns ...func(*ExportCompletedWaiterOptions)) (*DescribeExportOutput, error) {
+ if maxWaitDur <= 0 {
+ return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
+ }
+
+ options := w.options
+ for _, fn := range optFns {
+ fn(&options)
+ }
+
+ if options.MaxDelay <= 0 {
+ options.MaxDelay = 120 * time.Second
+ }
+
+ if options.MinDelay > options.MaxDelay {
+ return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
+ }
+
+ ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
+ defer cancelFn()
+
+ logger := smithywaiter.Logger{}
+ remainingTime := maxWaitDur
+
+ var attempt int64
+ for {
+
+ attempt++
+ apiOptions := options.APIOptions
+ start := time.Now()
+
+ if options.LogWaitAttempts {
+ logger.Attempt = attempt
+ apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
+ apiOptions = append(apiOptions, logger.AddLogger)
+ }
+
+ out, err := w.client.DescribeExport(ctx, params, func(o *Options) {
+ baseOpts := []func(*Options){
+ addIsWaiterUserAgent,
+ }
+ o.APIOptions = append(o.APIOptions, apiOptions...)
+ for _, opt := range baseOpts {
+ opt(o)
+ }
+ for _, opt := range options.ClientOptions {
+ opt(o)
+ }
+ })
+
+ retryable, err := options.Retryable(ctx, params, out, err)
+ if err != nil {
+ return nil, err
+ }
+ if !retryable {
+ return out, nil
+ }
+
+ remainingTime -= time.Since(start)
+ if remainingTime < options.MinDelay || remainingTime <= 0 {
+ break
+ }
+
+ // compute exponential backoff between waiter retries
+ delay, err := smithywaiter.ComputeDelay(
+ attempt, options.MinDelay, options.MaxDelay, remainingTime,
+ )
+ if err != nil {
+ return nil, fmt.Errorf("error computing waiter delay, %w", err)
+ }
+
+ remainingTime -= delay
+ // sleep for the delay amount before invoking a request
+ if err := smithytime.SleepWithContext(ctx, delay); err != nil {
+ return nil, fmt.Errorf("request cancelled while waiting, %w", err)
+ }
+ }
+ return nil, fmt.Errorf("exceeded max wait time for ExportCompleted waiter")
+}
+
+func exportCompletedStateRetryable(ctx context.Context, input *DescribeExportInput, output *DescribeExportOutput, err error) (bool, error) {
+
+ if err == nil {
+ v1 := output.ExportDescription
+ var v2 types.ExportStatus
+ if v1 != nil {
+ v3 := v1.ExportStatus
+ v2 = v3
+ }
+ expectedValue := "COMPLETED"
+ var pathValue string
+ pathValue = string(v2)
+ if pathValue == expectedValue {
+ return false, nil
+ }
+ }
+
+ if err == nil {
+ v1 := output.ExportDescription
+ var v2 types.ExportStatus
+ if v1 != nil {
+ v3 := v1.ExportStatus
+ v2 = v3
+ }
+ expectedValue := "FAILED"
+ var pathValue string
+ pathValue = string(v2)
+ if pathValue == expectedValue {
+ return false, fmt.Errorf("waiter state transitioned to Failure")
+ }
+ }
+
+ if err != nil {
+ return false, err
+ }
+ return true, nil
+}
+
+// DescribeExportAPIClient is a client that implements the DescribeExport
+// operation.
+type DescribeExportAPIClient interface {
+ DescribeExport(context.Context, *DescribeExportInput, ...func(*Options)) (*DescribeExportOutput, error)
+}
+
+var _ DescribeExportAPIClient = (*Client)(nil)
+
func newServiceMetadataMiddleware_opDescribeExport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeImport.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeImport.go
index def30e72d9..606f9756a7 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeImport.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeImport.go
@@ -8,7 +8,10 @@ import (
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
"github.com/aws/smithy-go/middleware"
+ smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
+ smithywaiter "github.com/aws/smithy-go/waiter"
+ "time"
)
// Represents the properties of the import.
@@ -167,6 +170,224 @@ func (c *Client) addOperationDescribeImportMiddlewares(stack *middleware.Stack,
return nil
}
+// ImportCompletedWaiterOptions are waiter options for ImportCompletedWaiter
+type ImportCompletedWaiterOptions struct {
+
+ // Set of options to modify how an operation is invoked. These apply to all
+ // operations invoked for this client. Use functional options on operation call to
+ // modify this list for per operation behavior.
+ //
+ // Passing options here is functionally equivalent to passing values to this
+ // config's ClientOptions field that extend the inner client's APIOptions directly.
+ APIOptions []func(*middleware.Stack) error
+
+ // Functional options to be passed to all operations invoked by this client.
+ //
+ // Function values that modify the inner APIOptions are applied after the waiter
+ // config's own APIOptions modifiers.
+ ClientOptions []func(*Options)
+
+ // MinDelay is the minimum amount of time to delay between retries. If unset,
+ // ImportCompletedWaiter will use default minimum delay of 20 seconds. Note that
+ // MinDelay must resolve to a value lesser than or equal to the MaxDelay.
+ MinDelay time.Duration
+
+ // MaxDelay is the maximum amount of time to delay between retries. If unset or
+ // set to zero, ImportCompletedWaiter will use default max delay of 120 seconds.
+ // Note that MaxDelay must resolve to value greater than or equal to the MinDelay.
+ MaxDelay time.Duration
+
+ // LogWaitAttempts is used to enable logging for waiter retry attempts
+ LogWaitAttempts bool
+
+ // Retryable is function that can be used to override the service defined
+ // waiter-behavior based on operation output, or returned error. This function is
+ // used by the waiter to decide if a state is retryable or a terminal state.
+ //
+ // By default service-modeled logic will populate this option. This option can
+ // thus be used to define a custom waiter state with fall-back to service-modeled
+ // waiter state mutators.The function returns an error in case of a failure state.
+ // In case of retry state, this function returns a bool value of true and nil
+ // error, while in case of success it returns a bool value of false and nil error.
+ Retryable func(context.Context, *DescribeImportInput, *DescribeImportOutput, error) (bool, error)
+}
+
+// ImportCompletedWaiter defines the waiters for ImportCompleted
+type ImportCompletedWaiter struct {
+ client DescribeImportAPIClient
+
+ options ImportCompletedWaiterOptions
+}
+
+// NewImportCompletedWaiter constructs a ImportCompletedWaiter.
+func NewImportCompletedWaiter(client DescribeImportAPIClient, optFns ...func(*ImportCompletedWaiterOptions)) *ImportCompletedWaiter {
+ options := ImportCompletedWaiterOptions{}
+ options.MinDelay = 20 * time.Second
+ options.MaxDelay = 120 * time.Second
+ options.Retryable = importCompletedStateRetryable
+
+ for _, fn := range optFns {
+ fn(&options)
+ }
+ return &ImportCompletedWaiter{
+ client: client,
+ options: options,
+ }
+}
+
+// Wait calls the waiter function for ImportCompleted waiter. The maxWaitDur is
+// the maximum wait duration the waiter will wait. The maxWaitDur is required and
+// must be greater than zero.
+func (w *ImportCompletedWaiter) Wait(ctx context.Context, params *DescribeImportInput, maxWaitDur time.Duration, optFns ...func(*ImportCompletedWaiterOptions)) error {
+ _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
+ return err
+}
+
+// WaitForOutput calls the waiter function for ImportCompleted waiter and returns
+// the output of the successful operation. The maxWaitDur is the maximum wait
+// duration the waiter will wait. The maxWaitDur is required and must be greater
+// than zero.
+func (w *ImportCompletedWaiter) WaitForOutput(ctx context.Context, params *DescribeImportInput, maxWaitDur time.Duration, optFns ...func(*ImportCompletedWaiterOptions)) (*DescribeImportOutput, error) {
+ if maxWaitDur <= 0 {
+ return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
+ }
+
+ options := w.options
+ for _, fn := range optFns {
+ fn(&options)
+ }
+
+ if options.MaxDelay <= 0 {
+ options.MaxDelay = 120 * time.Second
+ }
+
+ if options.MinDelay > options.MaxDelay {
+ return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
+ }
+
+ ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
+ defer cancelFn()
+
+ logger := smithywaiter.Logger{}
+ remainingTime := maxWaitDur
+
+ var attempt int64
+ for {
+
+ attempt++
+ apiOptions := options.APIOptions
+ start := time.Now()
+
+ if options.LogWaitAttempts {
+ logger.Attempt = attempt
+ apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
+ apiOptions = append(apiOptions, logger.AddLogger)
+ }
+
+ out, err := w.client.DescribeImport(ctx, params, func(o *Options) {
+ baseOpts := []func(*Options){
+ addIsWaiterUserAgent,
+ }
+ o.APIOptions = append(o.APIOptions, apiOptions...)
+ for _, opt := range baseOpts {
+ opt(o)
+ }
+ for _, opt := range options.ClientOptions {
+ opt(o)
+ }
+ })
+
+ retryable, err := options.Retryable(ctx, params, out, err)
+ if err != nil {
+ return nil, err
+ }
+ if !retryable {
+ return out, nil
+ }
+
+ remainingTime -= time.Since(start)
+ if remainingTime < options.MinDelay || remainingTime <= 0 {
+ break
+ }
+
+ // compute exponential backoff between waiter retries
+ delay, err := smithywaiter.ComputeDelay(
+ attempt, options.MinDelay, options.MaxDelay, remainingTime,
+ )
+ if err != nil {
+ return nil, fmt.Errorf("error computing waiter delay, %w", err)
+ }
+
+ remainingTime -= delay
+ // sleep for the delay amount before invoking a request
+ if err := smithytime.SleepWithContext(ctx, delay); err != nil {
+ return nil, fmt.Errorf("request cancelled while waiting, %w", err)
+ }
+ }
+ return nil, fmt.Errorf("exceeded max wait time for ImportCompleted waiter")
+}
+
+func importCompletedStateRetryable(ctx context.Context, input *DescribeImportInput, output *DescribeImportOutput, err error) (bool, error) {
+
+ if err == nil {
+ v1 := output.ImportTableDescription
+ var v2 types.ImportStatus
+ if v1 != nil {
+ v3 := v1.ImportStatus
+ v2 = v3
+ }
+ expectedValue := "COMPLETED"
+ var pathValue string
+ pathValue = string(v2)
+ if pathValue == expectedValue {
+ return false, nil
+ }
+ }
+
+ if err == nil {
+ v1 := output.ImportTableDescription
+ var v2 types.ImportStatus
+ if v1 != nil {
+ v3 := v1.ImportStatus
+ v2 = v3
+ }
+ expectedValue := "FAILED"
+ var pathValue string
+ pathValue = string(v2)
+ if pathValue == expectedValue {
+ return false, fmt.Errorf("waiter state transitioned to Failure")
+ }
+ }
+
+ if err == nil {
+ v1 := output.ImportTableDescription
+ var v2 types.ImportStatus
+ if v1 != nil {
+ v3 := v1.ImportStatus
+ v2 = v3
+ }
+ expectedValue := "CANCELLED"
+ var pathValue string
+ pathValue = string(v2)
+ if pathValue == expectedValue {
+ return false, fmt.Errorf("waiter state transitioned to Failure")
+ }
+ }
+
+ if err != nil {
+ return false, err
+ }
+ return true, nil
+}
+
+// DescribeImportAPIClient is a client that implements the DescribeImport
+// operation.
+type DescribeImportAPIClient interface {
+ DescribeImport(context.Context, *DescribeImportInput, ...func(*Options)) (*DescribeImportOutput, error)
+}
+
+var _ DescribeImportAPIClient = (*Client)(nil)
+
func newServiceMetadataMiddleware_opDescribeImport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeKinesisStreamingDestination.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeKinesisStreamingDestination.go
index c68f3529fb..ca6a2bf299 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeKinesisStreamingDestination.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeKinesisStreamingDestination.go
@@ -9,7 +9,11 @@ import (
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery"
"github.com/aws/smithy-go/middleware"
+ smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
+ smithywaiter "github.com/aws/smithy-go/waiter"
+ "strconv"
+ "time"
)
// Returns information about the status of Kinesis streaming.
@@ -171,6 +175,231 @@ func (c *Client) addOperationDescribeKinesisStreamingDestinationMiddlewares(stac
return nil
}
+// KinesisStreamingDestinationActiveWaiterOptions are waiter options for
+// KinesisStreamingDestinationActiveWaiter
+type KinesisStreamingDestinationActiveWaiterOptions struct {
+
+ // Set of options to modify how an operation is invoked. These apply to all
+ // operations invoked for this client. Use functional options on operation call to
+ // modify this list for per operation behavior.
+ //
+ // Passing options here is functionally equivalent to passing values to this
+ // config's ClientOptions field that extend the inner client's APIOptions directly.
+ APIOptions []func(*middleware.Stack) error
+
+ // Functional options to be passed to all operations invoked by this client.
+ //
+ // Function values that modify the inner APIOptions are applied after the waiter
+ // config's own APIOptions modifiers.
+ ClientOptions []func(*Options)
+
+ // MinDelay is the minimum amount of time to delay between retries. If unset,
+ // KinesisStreamingDestinationActiveWaiter will use default minimum delay of 20
+ // seconds. Note that MinDelay must resolve to a value lesser than or equal to the
+ // MaxDelay.
+ MinDelay time.Duration
+
+ // MaxDelay is the maximum amount of time to delay between retries. If unset or
+ // set to zero, KinesisStreamingDestinationActiveWaiter will use default max delay
+ // of 120 seconds. Note that MaxDelay must resolve to value greater than or equal
+ // to the MinDelay.
+ MaxDelay time.Duration
+
+ // LogWaitAttempts is used to enable logging for waiter retry attempts
+ LogWaitAttempts bool
+
+ // Retryable is function that can be used to override the service defined
+ // waiter-behavior based on operation output, or returned error. This function is
+ // used by the waiter to decide if a state is retryable or a terminal state.
+ //
+ // By default service-modeled logic will populate this option. This option can
+ // thus be used to define a custom waiter state with fall-back to service-modeled
+ // waiter state mutators.The function returns an error in case of a failure state.
+ // In case of retry state, this function returns a bool value of true and nil
+ // error, while in case of success it returns a bool value of false and nil error.
+ Retryable func(context.Context, *DescribeKinesisStreamingDestinationInput, *DescribeKinesisStreamingDestinationOutput, error) (bool, error)
+}
+
+// KinesisStreamingDestinationActiveWaiter defines the waiters for
+// KinesisStreamingDestinationActive
+type KinesisStreamingDestinationActiveWaiter struct {
+ client DescribeKinesisStreamingDestinationAPIClient
+
+ options KinesisStreamingDestinationActiveWaiterOptions
+}
+
+// NewKinesisStreamingDestinationActiveWaiter constructs a
+// KinesisStreamingDestinationActiveWaiter.
+func NewKinesisStreamingDestinationActiveWaiter(client DescribeKinesisStreamingDestinationAPIClient, optFns ...func(*KinesisStreamingDestinationActiveWaiterOptions)) *KinesisStreamingDestinationActiveWaiter {
+ options := KinesisStreamingDestinationActiveWaiterOptions{}
+ options.MinDelay = 20 * time.Second
+ options.MaxDelay = 120 * time.Second
+ options.Retryable = kinesisStreamingDestinationActiveStateRetryable
+
+ for _, fn := range optFns {
+ fn(&options)
+ }
+ return &KinesisStreamingDestinationActiveWaiter{
+ client: client,
+ options: options,
+ }
+}
+
+// Wait calls the waiter function for KinesisStreamingDestinationActive waiter.
+// The maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur
+// is required and must be greater than zero.
+func (w *KinesisStreamingDestinationActiveWaiter) Wait(ctx context.Context, params *DescribeKinesisStreamingDestinationInput, maxWaitDur time.Duration, optFns ...func(*KinesisStreamingDestinationActiveWaiterOptions)) error {
+ _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
+ return err
+}
+
+// WaitForOutput calls the waiter function for KinesisStreamingDestinationActive
+// waiter and returns the output of the successful operation. The maxWaitDur is the
+// maximum wait duration the waiter will wait. The maxWaitDur is required and must
+// be greater than zero.
+func (w *KinesisStreamingDestinationActiveWaiter) WaitForOutput(ctx context.Context, params *DescribeKinesisStreamingDestinationInput, maxWaitDur time.Duration, optFns ...func(*KinesisStreamingDestinationActiveWaiterOptions)) (*DescribeKinesisStreamingDestinationOutput, error) {
+ if maxWaitDur <= 0 {
+ return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
+ }
+
+ options := w.options
+ for _, fn := range optFns {
+ fn(&options)
+ }
+
+ if options.MaxDelay <= 0 {
+ options.MaxDelay = 120 * time.Second
+ }
+
+ if options.MinDelay > options.MaxDelay {
+ return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
+ }
+
+ ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
+ defer cancelFn()
+
+ logger := smithywaiter.Logger{}
+ remainingTime := maxWaitDur
+
+ var attempt int64
+ for {
+
+ attempt++
+ apiOptions := options.APIOptions
+ start := time.Now()
+
+ if options.LogWaitAttempts {
+ logger.Attempt = attempt
+ apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
+ apiOptions = append(apiOptions, logger.AddLogger)
+ }
+
+ out, err := w.client.DescribeKinesisStreamingDestination(ctx, params, func(o *Options) {
+ baseOpts := []func(*Options){
+ addIsWaiterUserAgent,
+ }
+ o.APIOptions = append(o.APIOptions, apiOptions...)
+ for _, opt := range baseOpts {
+ opt(o)
+ }
+ for _, opt := range options.ClientOptions {
+ opt(o)
+ }
+ })
+
+ retryable, err := options.Retryable(ctx, params, out, err)
+ if err != nil {
+ return nil, err
+ }
+ if !retryable {
+ return out, nil
+ }
+
+ remainingTime -= time.Since(start)
+ if remainingTime < options.MinDelay || remainingTime <= 0 {
+ break
+ }
+
+ // compute exponential backoff between waiter retries
+ delay, err := smithywaiter.ComputeDelay(
+ attempt, options.MinDelay, options.MaxDelay, remainingTime,
+ )
+ if err != nil {
+ return nil, fmt.Errorf("error computing waiter delay, %w", err)
+ }
+
+ remainingTime -= delay
+ // sleep for the delay amount before invoking a request
+ if err := smithytime.SleepWithContext(ctx, delay); err != nil {
+ return nil, fmt.Errorf("request cancelled while waiting, %w", err)
+ }
+ }
+ return nil, fmt.Errorf("exceeded max wait time for KinesisStreamingDestinationActive waiter")
+}
+
+func kinesisStreamingDestinationActiveStateRetryable(ctx context.Context, input *DescribeKinesisStreamingDestinationInput, output *DescribeKinesisStreamingDestinationOutput, err error) (bool, error) {
+
+ if err == nil {
+ v1 := output.KinesisDataStreamDestinations
+ var v2 []types.DestinationStatus
+ for _, v := range v1 {
+ v3 := v.DestinationStatus
+ v2 = append(v2, v3)
+ }
+ expectedValue := "ACTIVE"
+ var match bool
+ for _, v := range v2 {
+ if string(v) == expectedValue {
+ match = true
+ break
+ }
+ }
+
+ if match {
+ return false, nil
+ }
+ }
+
+ if err == nil {
+ v1 := output.KinesisDataStreamDestinations
+ v2 := len(v1)
+ v3 := 0
+ v4 := int64(v2) > int64(v3)
+ v5 := output.KinesisDataStreamDestinations
+ var v6 []types.KinesisDataStreamDestination
+ for _, v := range v5 {
+ v7 := v.DestinationStatus
+ v8 := "DISABLED"
+ v9 := string(v7) == string(v8)
+ v10 := v.DestinationStatus
+ v11 := "ENABLE_FAILED"
+ v12 := string(v10) == string(v11)
+ v13 := v9 || v12
+ if v13 {
+ v6 = append(v6, v)
+ }
+ }
+ v14 := len(v6)
+ v15 := output.KinesisDataStreamDestinations
+ v16 := len(v15)
+ v17 := int64(v14) == int64(v16)
+ v18 := v4 && v17
+ expectedValue := "true"
+ bv, err := strconv.ParseBool(expectedValue)
+ if err != nil {
+ return false, fmt.Errorf("error parsing boolean from string %w", err)
+ }
+ if v18 == bv {
+ return false, fmt.Errorf("waiter state transitioned to Failure")
+ }
+ }
+
+ if err != nil {
+ return false, err
+ }
+ return true, nil
+}
+
func addOpDescribeKinesisStreamingDestinationDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error {
return stack.Finalize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{
Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){
@@ -214,6 +443,14 @@ func (c *Client) fetchOpDescribeKinesisStreamingDestinationDiscoverEndpoint(ctx
return internalEndpointDiscovery.WeightedAddress{}, nil
}
+// DescribeKinesisStreamingDestinationAPIClient is a client that implements the
+// DescribeKinesisStreamingDestination operation.
+type DescribeKinesisStreamingDestinationAPIClient interface {
+ DescribeKinesisStreamingDestination(context.Context, *DescribeKinesisStreamingDestinationInput, ...func(*Options)) (*DescribeKinesisStreamingDestinationOutput, error)
+}
+
+var _ DescribeKinesisStreamingDestinationAPIClient = (*Client)(nil)
+
func newServiceMetadataMiddleware_opDescribeKinesisStreamingDestination(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExportTableToPointInTime.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExportTableToPointInTime.go
index 65f7de7f0f..20e17a1e34 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExportTableToPointInTime.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExportTableToPointInTime.go
@@ -53,7 +53,7 @@ type ExportTableToPointInTimeInput struct {
//
// If you submit a request with the same client token but a change in other
// parameters within the 8-hour idempotency window, DynamoDB returns an
- // ImportConflictException .
+ // ExportConflictException .
ClientToken *string
// The format for the exported data. Valid values for ExportFormat are
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListExports.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListExports.go
index 8bd9e56a03..fbcaf16397 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListExports.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListExports.go
@@ -11,7 +11,8 @@ import (
smithyhttp "github.com/aws/smithy-go/transport/http"
)
-// Lists completed exports within the past 90 days.
+// Lists completed exports within the past 90 days, in reverse alphanumeric order
+// of ExportArn .
func (c *Client) ListExports(ctx context.Context, params *ListExportsInput, optFns ...func(*Options)) (*ListExportsOutput, error) {
if params == nil {
params = &ListExportsInput{}
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_PutItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_PutItem.go
index 2927b3e8f7..7a523c5f7e 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_PutItem.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_PutItem.go
@@ -36,6 +36,10 @@ import (
// contain that attribute, the attribute_not_exists function will only succeed if
// no matching item exists.
//
+// To determine whether PutItem overwrote an existing item, use ReturnValues set
+// to ALL_OLD . If the response includes the Attributes element, an existing item
+// was overwritten.
+//
// For more information about PutItem , see [Working with Items] in the Amazon DynamoDB Developer
// Guide.
//
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateItem.go
index 36c44dbc11..44d40c3813 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateItem.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateItem.go
@@ -261,8 +261,7 @@ type UpdateItemInput struct {
// Both sets must have the same primitive data type. For example, if the existing
// data type is a set of strings, the Value must also be a set of strings.
//
- // The ADD action only supports Number and set data types. In addition, ADD can
- // only be used on top-level attributes, not nested attributes.
+ // The ADD action only supports Number and set data types.
//
// - DELETE - Deletes an element from a set.
//
@@ -271,8 +270,7 @@ type UpdateItemInput struct {
// action specifies [a,c] , then the final attribute value is [b] . Specifying an
// empty set is an error.
//
- // The DELETE action only supports set data types. In addition, DELETE can only be
- // used on top-level attributes, not nested attributes.
+ // The DELETE action only supports set data types.
//
// You can have many actions in a single expression, such as the following: SET
// a=:value1, b=:value2 DELETE :value3, :value4, :value5
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTable.go
index 16bec163fc..185e5b6432 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTable.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTable.go
@@ -96,6 +96,18 @@ type UpdateTableInput struct {
// [Managing Global Secondary Indexes]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html
GlobalSecondaryIndexUpdates []types.GlobalSecondaryIndexUpdate
+ // Controls the settings replication mode for a global table replica. This
+ // attribute can be defined using UpdateTable operation only on a regional table
+ // with values:
+ //
+ // - ENABLED : Defines settings replication on a regional table to be used as a
+ // source table for creating Multi-Account Global Table.
+ //
+ // - DISABLED : Remove settings replication on a regional table. Settings
+ // replication needs to be defined to ENABLED again in order to create a
+ // Multi-Account Global Table using this table.
+ GlobalTableSettingsReplicationMode types.GlobalTableSettingsReplicationMode
+
// A list of witness updates for a MRSC global table. A witness provides a
// cost-effective alternative to a full replica in a MRSC global table by
// maintaining replicated change data written to global table replicas. You cannot
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/deserializers.go
index fdf566c4c5..301daeaf0d 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/deserializers.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/deserializers.go
@@ -14387,6 +14387,15 @@ func awsAwsjson10_deserializeDocumentReplicaDescription(v **types.ReplicaDescrip
return err
}
+ case "GlobalTableSettingsReplicationMode":
+ if value != nil {
+ jtv, ok := value.(string)
+ if !ok {
+ return fmt.Errorf("expected GlobalTableSettingsReplicationMode to be of type string, got %T instead", value)
+ }
+ sv.GlobalTableSettingsReplicationMode = types.GlobalTableSettingsReplicationMode(jtv)
+ }
+
case "KMSMasterKeyId":
if value != nil {
jtv, ok := value.(string)
@@ -16045,6 +16054,15 @@ func awsAwsjson10_deserializeDocumentTableDescription(v **types.TableDescription
return err
}
+ case "GlobalTableSettingsReplicationMode":
+ if value != nil {
+ jtv, ok := value.(string)
+ if !ok {
+ return fmt.Errorf("expected GlobalTableSettingsReplicationMode to be of type string, got %T instead", value)
+ }
+ sv.GlobalTableSettingsReplicationMode = types.GlobalTableSettingsReplicationMode(jtv)
+ }
+
case "GlobalTableVersion":
if value != nil {
jtv, ok := value.(string)
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/endpoints.go
index a504652be1..afaaca494f 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/endpoints.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/endpoints.go
@@ -454,10 +454,10 @@ func (r *resolver) ResolveEndpoint(
SchemeID: "aws.auth#sigv4",
SignerProperties: func() smithy.Properties {
var sp smithy.Properties
+ smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
+
smithyhttp.SetSigV4SigningName(&sp, "dynamodb")
smithyhttp.SetSigV4ASigningName(&sp, "dynamodb")
-
- smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
return sp
}(),
},
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/generated.json
index 5c4f744ee3..f306b0cb12 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/generated.json
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/generated.json
@@ -77,7 +77,6 @@
"internal/endpoints/endpoints.go",
"internal/endpoints/endpoints_test.go",
"options.go",
- "protocol_test.go",
"serializers.go",
"snapshot_test.go",
"sra_operation_order_test.go",
@@ -87,7 +86,7 @@
"types/types_exported_test.go",
"validators.go"
],
- "go": "1.23",
+ "go": "1.24",
"module": "github.com/aws/aws-sdk-go-v2/service/dynamodb",
"unstable": false
}
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/go_module_metadata.go
index c655932d7c..cffb37c0b4 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/go_module_metadata.go
@@ -3,4 +3,4 @@
package dynamodb
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.53.2"
+const goModuleVersion = "1.56.2"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/endpoints/endpoints.go
index 6857bd4621..07d61e8026 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/endpoints/endpoints.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/endpoints/endpoints.go
@@ -421,6 +421,11 @@ var defaultPartitions = endpoints.Partitions{
},
RegionRegex: partitionRegexp.AwsEusc,
IsRegionalized: true,
+ Endpoints: endpoints.Endpoints{
+ endpoints.EndpointKey{
+ Region: "eusc-de-east-1",
+ }: endpoints.Endpoint{},
+ },
},
{
ID: "aws-iso",
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/options.go
index 743c048fb0..5db1ed2b91 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/options.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/options.go
@@ -72,8 +72,7 @@ type Options struct {
// the client option BaseEndpoint instead.
EndpointResolver EndpointResolver
- // Resolves the endpoint used for a particular service operation. This should be
- // used over the deprecated EndpointResolver.
+ // Resolves the endpoint used for a particular service operation.
EndpointResolverV2 EndpointResolverV2
// Signature Version 4 (SigV4) Signer
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/serializers.go
index 366d529669..5316f9f4ab 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/serializers.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/serializers.go
@@ -5805,6 +5805,16 @@ func awsAwsjson10_serializeOpDocumentCreateTableInput(v *CreateTableInput, value
}
}
+ if len(v.GlobalTableSettingsReplicationMode) > 0 {
+ ok := object.Key("GlobalTableSettingsReplicationMode")
+ ok.String(string(v.GlobalTableSettingsReplicationMode))
+ }
+
+ if v.GlobalTableSourceArn != nil {
+ ok := object.Key("GlobalTableSourceArn")
+ ok.String(*v.GlobalTableSourceArn)
+ }
+
if v.KeySchema != nil {
ok := object.Key("KeySchema")
if err := awsAwsjson10_serializeDocumentKeySchema(v.KeySchema, ok); err != nil {
@@ -7338,6 +7348,11 @@ func awsAwsjson10_serializeOpDocumentUpdateTableInput(v *UpdateTableInput, value
}
}
+ if len(v.GlobalTableSettingsReplicationMode) > 0 {
+ ok := object.Key("GlobalTableSettingsReplicationMode")
+ ok.String(string(v.GlobalTableSettingsReplicationMode))
+ }
+
if v.GlobalTableWitnessUpdates != nil {
ok := object.Key("GlobalTableWitnessUpdates")
if err := awsAwsjson10_serializeDocumentGlobalTableWitnessGroupUpdateList(v.GlobalTableWitnessUpdates, ok); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/enums.go
index 47d43d57e5..c9beca8696 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/enums.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/enums.go
@@ -411,6 +411,28 @@ func (ExportViewType) Values() []ExportViewType {
}
}
+type GlobalTableSettingsReplicationMode string
+
+// Enum values for GlobalTableSettingsReplicationMode
+const (
+ GlobalTableSettingsReplicationModeEnabled GlobalTableSettingsReplicationMode = "ENABLED"
+ GlobalTableSettingsReplicationModeDisabled GlobalTableSettingsReplicationMode = "DISABLED"
+ GlobalTableSettingsReplicationModeEnabledWithOverrides GlobalTableSettingsReplicationMode = "ENABLED_WITH_OVERRIDES"
+)
+
+// Values returns all known values for GlobalTableSettingsReplicationMode. Note
+// that this can be expanded in the future, and so it is only as up to date as the
+// client.
+//
+// The ordering of this slice is not guaranteed to be stable across updates.
+func (GlobalTableSettingsReplicationMode) Values() []GlobalTableSettingsReplicationMode {
+ return []GlobalTableSettingsReplicationMode{
+ "ENABLED",
+ "DISABLED",
+ "ENABLED_WITH_OVERRIDES",
+ }
+}
+
type GlobalTableStatus string
// Enum values for GlobalTableStatus
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/errors.go
index 45bf62b57d..3774a406e5 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/errors.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/errors.go
@@ -959,8 +959,7 @@ func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.Fau
//
// - There is a user error, such as an invalid data format.
//
-// If using Java, DynamoDB lists the cancellation reasons on the
-// CancellationReasons property. This property is not set for other languages.
+// DynamoDB lists the cancellation reasons on the CancellationReasons property.
// Transaction cancellation reasons are ordered in the order of requested items, if
// an item has no error it will have None code and Null message.
//
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/types.go
index ce3801ef9c..dde699b085 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/types.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/types/types.go
@@ -947,7 +947,8 @@ type CreateGlobalSecondaryIndexAction struct {
// This member is required.
IndexName *string
- // The key schema for the global secondary index.
+ // The key schema for the global secondary index. Global secondary index supports
+ // up to 4 partition and up to 4 sort keys.
//
// This member is required.
KeySchema []KeySchemaElement
@@ -2622,6 +2623,19 @@ type ReplicaDescription struct {
// Replica-specific global secondary index settings.
GlobalSecondaryIndexes []ReplicaGlobalSecondaryIndexDescription
+ // Indicates one of the settings synchronization modes for the global table
+ // replica:
+ //
+ // - ENABLED : Indicates that the settings synchronization mode for the global
+ // table replica is enabled.
+ //
+ // - DISABLED : Indicates that the settings synchronization mode for the global
+ // table replica is disabled.
+ //
+ // - ENABLED_WITH_OVERRIDES : This mode is set by default for a same account
+ // global table. Indicates that certain global table settings can be overridden.
+ GlobalTableSettingsReplicationMode GlobalTableSettingsReplicationMode
+
// The KMS key of the replica that will be used for KMS encryption.
KMSMasterKeyId *string
@@ -3337,6 +3351,18 @@ type TableDescription struct {
// returned.
GlobalSecondaryIndexes []GlobalSecondaryIndexDescription
+ // Indicates one of the settings synchronization modes for the global table:
+ //
+ // - ENABLED : Indicates that the settings synchronization mode for the global
+ // table is enabled.
+ //
+ // - DISABLED : Indicates that the settings synchronization mode for the global
+ // table is disabled.
+ //
+ // - ENABLED_WITH_OVERRIDES : This mode is set by default for a same account
+ // global table. Indicates that certain global table settings can be overridden.
+ GlobalTableSettingsReplicationMode GlobalTableSettingsReplicationMode
+
// Represents the version of [global tables] in use, if the table is replicated across Amazon Web
// Services Regions.
//
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/validators.go
index 781ef41cf3..cd5187a307 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/validators.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/validators.go
@@ -2668,9 +2668,7 @@ func validateOpCreateTableInput(v *CreateTableInput) error {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateTableInput"}
- if v.AttributeDefinitions == nil {
- invalidParams.Add(smithy.NewErrParamRequired("AttributeDefinitions"))
- } else if v.AttributeDefinitions != nil {
+ if v.AttributeDefinitions != nil {
if err := validateAttributeDefinitions(v.AttributeDefinitions); err != nil {
invalidParams.AddNested("AttributeDefinitions", err.(smithy.InvalidParamsError))
}
@@ -2678,9 +2676,7 @@ func validateOpCreateTableInput(v *CreateTableInput) error {
if v.TableName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TableName"))
}
- if v.KeySchema == nil {
- invalidParams.Add(smithy.NewErrParamRequired("KeySchema"))
- } else if v.KeySchema != nil {
+ if v.KeySchema != nil {
if err := validateKeySchema(v.KeySchema); err != nil {
invalidParams.AddNested("KeySchema", err.(smithy.InvalidParamsError))
}
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/CHANGELOG.md
index b9ae6f37bb..c44af7b7d0 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/CHANGELOG.md
@@ -1,3 +1,30 @@
+# v1.11.20 (2026-03-13)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.11.19 (2026-03-03)
+
+* **Bug Fix**: Modernize non codegen files with go fix
+* **Dependency Update**: Bump minimum Go version to 1.24
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.11.18 (2026-02-23)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.11.17 (2026-01-09)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.11.16 (2025-12-08)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.11.15 (2025-12-02)
+
+* **Dependency Update**: Updated to the latest SDK module versions
+* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change.
+
# v1.11.14 (2025-11-19.2)
* **Dependency Update**: Updated to the latest SDK module versions
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/cache.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/cache.go
index 6abd3029c0..3d5be48038 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/cache.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/cache.go
@@ -87,7 +87,7 @@ func (c *EndpointCache) deleteRandomKey() bool {
atomic.AddInt64(&c.size, -1)
found := false
- c.endpoints.Range(func(key, value interface{}) bool {
+ c.endpoints.Range(func(key, value any) bool {
found = true
c.endpoints.Delete(key)
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/go_module_metadata.go
index d1c63c4c00..36aad2b0e8 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/go_module_metadata.go
@@ -3,4 +3,4 @@
package endpointdiscovery
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.11.14"
+const goModuleVersion = "1.11.20"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/middleware.go
index c6b073d21f..7e11470915 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/middleware.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/middleware.go
@@ -17,7 +17,7 @@ type DiscoverEndpointOptions struct {
// EndpointResolverUsedForDiscovery is the endpoint resolver used to
// resolve an endpoint for discovery api call.
- EndpointResolverUsedForDiscovery interface{}
+ EndpointResolverUsedForDiscovery any
// DisableHTTPS will disable tls for endpoint discovery call and
// subsequent discovered endpoint if service did not return an
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/CHANGELOG.md
index 9be3bb13ff..567df5ba93 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/CHANGELOG.md
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/CHANGELOG.md
@@ -1,3 +1,12 @@
+# v1.55.0 (2026-07-21)
+
+* **Feature**: Add an option to clients to disable clock skew
+* **Dependency Update**: Updated to the latest SDK module versions
+
+# v1.54.1 (2026-07-13)
+
+* No change notes available for this release.
+
# v1.54.0 (2026-07-06)
* **Feature**: Add request serialization snapshot tests.
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_client.go
index c17eb770ca..fe287b64e7 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_client.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_client.go
@@ -484,16 +484,17 @@ func setResolvedDefaultsMode(o *Options) {
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
- Region: cfg.Region,
- DefaultsMode: cfg.DefaultsMode,
- RuntimeEnvironment: cfg.RuntimeEnvironment,
- HTTPClient: cfg.HTTPClient,
- Credentials: cfg.Credentials,
- APIOptions: cfg.APIOptions,
- Logger: cfg.Logger,
- ClientLogMode: cfg.ClientLogMode,
- AppID: cfg.AppID,
- AuthSchemePreference: cfg.AuthSchemePreference,
+ Region: cfg.Region,
+ DefaultsMode: cfg.DefaultsMode,
+ RuntimeEnvironment: cfg.RuntimeEnvironment,
+ HTTPClient: cfg.HTTPClient,
+ Credentials: cfg.Credentials,
+ APIOptions: cfg.APIOptions,
+ Logger: cfg.Logger,
+ ClientLogMode: cfg.ClientLogMode,
+ AppID: cfg.AppID,
+ DisableClockSkewCorrection: cfg.DisableClockSkewCorrection,
+ AuthSchemePreference: cfg.AuthSchemePreference,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
@@ -690,8 +691,10 @@ func addRawResponseToMetadata(stack *middleware.Stack) error {
return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before)
}
-func addRecordResponseTiming(stack *middleware.Stack) error {
- return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After)
+func addRecordResponseTiming(stack *middleware.Stack, options Options) error {
+ return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{
+ DisableClockSkewCorrection: options.DisableClockSkewCorrection,
+ }, middleware.After)
}
func addSpanRetryLoop(stack *middleware.Stack, options Options) error {
@@ -762,6 +765,7 @@ func addRetry(stack *middleware.Stack, o Options, c *Client) error {
m.LogAttempts = o.ClientLogMode.IsRetries()
m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/kms")
m.ClientSkew = c.timeOffset
+ m.DisableClockSkewCorrection = o.DisableClockSkewCorrection
})
if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil {
return err
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CancelKeyDeletion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CancelKeyDeletion.go
index 7fa13b61da..2f5a62809f 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CancelKeyDeletion.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CancelKeyDeletion.go
@@ -102,7 +102,7 @@ func (c *Client) addOperationCancelKeyDeletionMiddlewares(stack *middleware.Stac
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ConnectCustomKeyStore.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ConnectCustomKeyStore.go
index f67d12635e..807eb28c15 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ConnectCustomKeyStore.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ConnectCustomKeyStore.go
@@ -155,7 +155,7 @@ func (c *Client) addOperationConnectCustomKeyStoreMiddlewares(stack *middleware.
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateAlias.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateAlias.go
index 987bd3e80e..915984b8b2 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateAlias.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateAlias.go
@@ -155,7 +155,7 @@ func (c *Client) addOperationCreateAliasMiddlewares(stack *middleware.Stack, opt
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateCustomKeyStore.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateCustomKeyStore.go
index b55752e49c..51b6e9664c 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateCustomKeyStore.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateCustomKeyStore.go
@@ -306,7 +306,7 @@ func (c *Client) addOperationCreateCustomKeyStoreMiddlewares(stack *middleware.S
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateGrant.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateGrant.go
index e77e8fa730..8628b8cd82 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateGrant.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateGrant.go
@@ -305,7 +305,7 @@ func (c *Client) addOperationCreateGrantMiddlewares(stack *middleware.Stack, opt
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateKey.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateKey.go
index b65f1f5b6a..e9015fe683 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateKey.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_CreateKey.go
@@ -540,7 +540,7 @@ func (c *Client) addOperationCreateKeyMiddlewares(stack *middleware.Stack, optio
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Decrypt.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Decrypt.go
index 8813e48516..9c107f109d 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Decrypt.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Decrypt.go
@@ -301,7 +301,7 @@ func (c *Client) addOperationDecryptMiddlewares(stack *middleware.Stack, options
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteAlias.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteAlias.go
index a330716535..0db9946484 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteAlias.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteAlias.go
@@ -105,7 +105,7 @@ func (c *Client) addOperationDeleteAliasMiddlewares(stack *middleware.Stack, opt
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteCustomKeyStore.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteCustomKeyStore.go
index 96a7b289a2..0b7906721a 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteCustomKeyStore.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteCustomKeyStore.go
@@ -121,7 +121,7 @@ func (c *Client) addOperationDeleteCustomKeyStoreMiddlewares(stack *middleware.S
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteImportedKeyMaterial.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteImportedKeyMaterial.go
index 8a3051a045..36c66b91d1 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteImportedKeyMaterial.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeleteImportedKeyMaterial.go
@@ -132,7 +132,7 @@ func (c *Client) addOperationDeleteImportedKeyMaterialMiddlewares(stack *middlew
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeriveSharedSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeriveSharedSecret.go
index 4d5d2b7343..f70c812f85 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeriveSharedSecret.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DeriveSharedSecret.go
@@ -280,7 +280,7 @@ func (c *Client) addOperationDeriveSharedSecretMiddlewares(stack *middleware.Sta
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeCustomKeyStores.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeCustomKeyStores.go
index 9522becd17..1e53df8ef7 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeCustomKeyStores.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeCustomKeyStores.go
@@ -156,7 +156,7 @@ func (c *Client) addOperationDescribeCustomKeyStoresMiddlewares(stack *middlewar
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeKey.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeKey.go
index 687edfd473..e94423c58b 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeKey.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DescribeKey.go
@@ -168,7 +168,7 @@ func (c *Client) addOperationDescribeKeyMiddlewares(stack *middleware.Stack, opt
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKey.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKey.go
index 8b9f9aadbc..96383943c6 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKey.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKey.go
@@ -94,7 +94,7 @@ func (c *Client) addOperationDisableKeyMiddlewares(stack *middleware.Stack, opti
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKeyRotation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKeyRotation.go
index 9a39bb04e7..e8b4ebc319 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKeyRotation.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisableKeyRotation.go
@@ -126,7 +126,7 @@ func (c *Client) addOperationDisableKeyRotationMiddlewares(stack *middleware.Sta
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisconnectCustomKeyStore.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisconnectCustomKeyStore.go
index 0c2b2479f2..dcae2c878b 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisconnectCustomKeyStore.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_DisconnectCustomKeyStore.go
@@ -110,7 +110,7 @@ func (c *Client) addOperationDisconnectCustomKeyStoreMiddlewares(stack *middlewa
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKey.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKey.go
index 055826f44f..e084acac2f 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKey.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKey.go
@@ -93,7 +93,7 @@ func (c *Client) addOperationEnableKeyMiddlewares(stack *middleware.Stack, optio
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKeyRotation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKeyRotation.go
index 0fa8222d4c..673588533e 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKeyRotation.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_EnableKeyRotation.go
@@ -165,7 +165,7 @@ func (c *Client) addOperationEnableKeyRotationMiddlewares(stack *middleware.Stac
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Encrypt.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Encrypt.go
index e24243f7e4..6797b33382 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Encrypt.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Encrypt.go
@@ -233,7 +233,7 @@ func (c *Client) addOperationEncryptMiddlewares(stack *middleware.Stack, options
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKey.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKey.go
index 0fc87ff3f9..0705543bf0 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKey.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKey.go
@@ -294,7 +294,7 @@ func (c *Client) addOperationGenerateDataKeyMiddlewares(stack *middleware.Stack,
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPair.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPair.go
index d04292a7cc..b7641d89a5 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPair.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPair.go
@@ -294,7 +294,7 @@ func (c *Client) addOperationGenerateDataKeyPairMiddlewares(stack *middleware.St
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPairWithoutPlaintext.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPairWithoutPlaintext.go
index 540a50220a..fc0d1bdcbf 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPairWithoutPlaintext.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyPairWithoutPlaintext.go
@@ -217,7 +217,7 @@ func (c *Client) addOperationGenerateDataKeyPairWithoutPlaintextMiddlewares(stac
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyWithoutPlaintext.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyWithoutPlaintext.go
index fadff19604..51a7425e1e 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyWithoutPlaintext.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateDataKeyWithoutPlaintext.go
@@ -216,7 +216,7 @@ func (c *Client) addOperationGenerateDataKeyWithoutPlaintextMiddlewares(stack *m
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateMac.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateMac.go
index b09cd6d0cc..8365512b91 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateMac.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateMac.go
@@ -158,7 +158,7 @@ func (c *Client) addOperationGenerateMacMiddlewares(stack *middleware.Stack, opt
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateRandom.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateRandom.go
index 4e21d391d2..fd5d922a17 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateRandom.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GenerateRandom.go
@@ -149,7 +149,7 @@ func (c *Client) addOperationGenerateRandomMiddlewares(stack *middleware.Stack,
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyLastUsage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyLastUsage.go
index f8819e7fee..68f5f03f1a 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyLastUsage.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyLastUsage.go
@@ -148,7 +148,7 @@ func (c *Client) addOperationGetKeyLastUsageMiddlewares(stack *middleware.Stack,
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyPolicy.go
index dbb01db2f7..a81ba45a31 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyPolicy.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyPolicy.go
@@ -100,7 +100,7 @@ func (c *Client) addOperationGetKeyPolicyMiddlewares(stack *middleware.Stack, op
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyRotationStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyRotationStatus.go
index 5c4d80f8e7..656012950b 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyRotationStatus.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetKeyRotationStatus.go
@@ -168,7 +168,7 @@ func (c *Client) addOperationGetKeyRotationStatusMiddlewares(stack *middleware.S
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetParametersForImport.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetParametersForImport.go
index 24f0fcb982..6c101e0de3 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetParametersForImport.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetParametersForImport.go
@@ -218,7 +218,7 @@ func (c *Client) addOperationGetParametersForImportMiddlewares(stack *middleware
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetPublicKey.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetPublicKey.go
index 5e60228bd6..2cd6c90669 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetPublicKey.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_GetPublicKey.go
@@ -209,7 +209,7 @@ func (c *Client) addOperationGetPublicKeyMiddlewares(stack *middleware.Stack, op
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ImportKeyMaterial.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ImportKeyMaterial.go
index fd13b50fec..d54aa8ddfd 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ImportKeyMaterial.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ImportKeyMaterial.go
@@ -303,7 +303,7 @@ func (c *Client) addOperationImportKeyMaterialMiddlewares(stack *middleware.Stac
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListAliases.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListAliases.go
index 76b20d35ca..cc6485f693 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListAliases.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListAliases.go
@@ -144,7 +144,7 @@ func (c *Client) addOperationListAliasesMiddlewares(stack *middleware.Stack, opt
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListGrants.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListGrants.go
index 839a4f809b..5c5a9567c9 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListGrants.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListGrants.go
@@ -166,7 +166,7 @@ func (c *Client) addOperationListGrantsMiddlewares(stack *middleware.Stack, opti
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyPolicies.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyPolicies.go
index 98f820df2e..e24d0645ea 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyPolicies.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyPolicies.go
@@ -124,7 +124,7 @@ func (c *Client) addOperationListKeyPoliciesMiddlewares(stack *middleware.Stack,
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyRotations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyRotations.go
index 330f90f1fb..e0f20f3fac 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyRotations.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeyRotations.go
@@ -148,7 +148,7 @@ func (c *Client) addOperationListKeyRotationsMiddlewares(stack *middleware.Stack
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeys.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeys.go
index 93ce7febd5..f4492c0c3b 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeys.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListKeys.go
@@ -109,7 +109,7 @@ func (c *Client) addOperationListKeysMiddlewares(stack *middleware.Stack, option
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListResourceTags.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListResourceTags.go
index f50754c1fd..b67ca90f96 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListResourceTags.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListResourceTags.go
@@ -140,7 +140,7 @@ func (c *Client) addOperationListResourceTagsMiddlewares(stack *middleware.Stack
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListRetirableGrants.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListRetirableGrants.go
index 01c6549b20..ec03fe682c 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListRetirableGrants.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ListRetirableGrants.go
@@ -157,7 +157,7 @@ func (c *Client) addOperationListRetirableGrantsMiddlewares(stack *middleware.St
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_PutKeyPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_PutKeyPolicy.go
index c9e53eb2a0..111e5964af 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_PutKeyPolicy.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_PutKeyPolicy.go
@@ -168,7 +168,7 @@ func (c *Client) addOperationPutKeyPolicyMiddlewares(stack *middleware.Stack, op
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReEncrypt.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReEncrypt.go
index f1890b5553..f3ac90907e 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReEncrypt.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReEncrypt.go
@@ -345,7 +345,7 @@ func (c *Client) addOperationReEncryptMiddlewares(stack *middleware.Stack, optio
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReplicateKey.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReplicateKey.go
index 26305e14ef..07e47449a9 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReplicateKey.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ReplicateKey.go
@@ -298,7 +298,7 @@ func (c *Client) addOperationReplicateKeyMiddlewares(stack *middleware.Stack, op
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RetireGrant.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RetireGrant.go
index 4ae1a0c1e8..b319eae26d 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RetireGrant.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RetireGrant.go
@@ -126,7 +126,7 @@ func (c *Client) addOperationRetireGrantMiddlewares(stack *middleware.Stack, opt
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RevokeGrant.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RevokeGrant.go
index 0a7b56cea6..0d8ec33c6d 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RevokeGrant.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RevokeGrant.go
@@ -126,7 +126,7 @@ func (c *Client) addOperationRevokeGrantMiddlewares(stack *middleware.Stack, opt
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RotateKeyOnDemand.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RotateKeyOnDemand.go
index 09ab3fa3b6..3e744a7753 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RotateKeyOnDemand.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_RotateKeyOnDemand.go
@@ -156,7 +156,7 @@ func (c *Client) addOperationRotateKeyOnDemandMiddlewares(stack *middleware.Stac
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ScheduleKeyDeletion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ScheduleKeyDeletion.go
index 12c0a8fdbb..2c1b82a664 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ScheduleKeyDeletion.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_ScheduleKeyDeletion.go
@@ -180,7 +180,7 @@ func (c *Client) addOperationScheduleKeyDeletionMiddlewares(stack *middleware.St
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Sign.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Sign.go
index 36b799643a..e70c8f0b39 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Sign.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Sign.go
@@ -257,7 +257,7 @@ func (c *Client) addOperationSignMiddlewares(stack *middleware.Stack, options Op
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_TagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_TagResource.go
index b14174f397..162ca4a1fd 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_TagResource.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_TagResource.go
@@ -137,7 +137,7 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UntagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UntagResource.go
index 01cf83921e..6121b4b763 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UntagResource.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UntagResource.go
@@ -120,7 +120,7 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateAlias.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateAlias.go
index 3a65a6f70d..6b7c4b1326 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateAlias.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateAlias.go
@@ -151,7 +151,7 @@ func (c *Client) addOperationUpdateAliasMiddlewares(stack *middleware.Stack, opt
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateCustomKeyStore.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateCustomKeyStore.go
index ef5a8d16a0..301b2d35c1 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateCustomKeyStore.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateCustomKeyStore.go
@@ -269,7 +269,7 @@ func (c *Client) addOperationUpdateCustomKeyStoreMiddlewares(stack *middleware.S
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateKeyDescription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateKeyDescription.go
index fe391e77e0..f38124250c 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateKeyDescription.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdateKeyDescription.go
@@ -104,7 +104,7 @@ func (c *Client) addOperationUpdateKeyDescriptionMiddlewares(stack *middleware.S
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdatePrimaryRegion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdatePrimaryRegion.go
index dcb55f13ab..0943769b2e 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdatePrimaryRegion.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_UpdatePrimaryRegion.go
@@ -159,7 +159,7 @@ func (c *Client) addOperationUpdatePrimaryRegionMiddlewares(stack *middleware.St
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Verify.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Verify.go
index 2e98a47597..ed39ac34af 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Verify.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_Verify.go
@@ -243,7 +243,7 @@ func (c *Client) addOperationVerifyMiddlewares(stack *middleware.Stack, options
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_VerifyMac.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_VerifyMac.go
index d2c5ea458c..10dd84f442 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_VerifyMac.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/api_op_VerifyMac.go
@@ -157,7 +157,7 @@ func (c *Client) addOperationVerifyMacMiddlewares(stack *middleware.Stack, optio
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
- if err = addRecordResponseTiming(stack); err != nil {
+ if err = addRecordResponseTiming(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/generated.json
index 1bce0a76eb..d4077fec1a 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/generated.json
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/generated.json
@@ -72,7 +72,8 @@
"internal/endpoints/endpoints.go",
"internal/endpoints/endpoints_test.go",
"options.go",
- "serde_snapshot_test.go",
+ "request_snapshot_test.go",
+ "response_snapshot_test.go",
"serializers.go",
"snapshot_test.go",
"sra_operation_order_test.go",
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/go_module_metadata.go
index 5e3a6aeb21..8b88235851 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/go_module_metadata.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/go_module_metadata.go
@@ -3,4 +3,4 @@
package kms
// goModuleVersion is the tagged release for this module
-const goModuleVersion = "1.54.0"
+const goModuleVersion = "1.55.0"
diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/options.go
index 8c74c5fabb..05df7bb042 100644
--- a/vendor/github.com/aws/aws-sdk-go-v2/service/kms/options.go
+++ b/vendor/github.com/aws/aws-sdk-go-v2/service/kms/options.go
@@ -44,6 +44,11 @@ type Options struct {
// clients initial default settings.
DefaultsMode aws.DefaultsMode
+ // Disables SDK clock skew correction. When set, the SDK will not adjust request
+ // signing timestamps to compensate for clock drift between the client and the
+ // service.
+ DisableClockSkewCorrection bool
+
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
diff --git a/vendor/github.com/blang/semver/.travis.yml b/vendor/github.com/blang/semver/.travis.yml
deleted file mode 100644
index 102fb9a691..0000000000
--- a/vendor/github.com/blang/semver/.travis.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-language: go
-matrix:
- include:
- - go: 1.4.3
- - go: 1.5.4
- - go: 1.6.3
- - go: 1.7
- - go: tip
- allow_failures:
- - go: tip
-install:
-- go get golang.org/x/tools/cmd/cover
-- go get github.com/mattn/goveralls
-script:
-- echo "Test and track coverage" ; $HOME/gopath/bin/goveralls -package "." -service=travis-ci
- -repotoken $COVERALLS_TOKEN
-- echo "Build examples" ; cd examples && go build
-- echo "Check if gofmt'd" ; diff -u <(echo -n) <(gofmt -d -s .)
-env:
- global:
- secure: HroGEAUQpVq9zX1b1VIkraLiywhGbzvNnTZq2TMxgK7JHP8xqNplAeF1izrR2i4QLL9nsY+9WtYss4QuPvEtZcVHUobw6XnL6radF7jS1LgfYZ9Y7oF+zogZ2I5QUMRLGA7rcxQ05s7mKq3XZQfeqaNts4bms/eZRefWuaFZbkw=
diff --git a/vendor/github.com/blang/semver/LICENSE b/vendor/github.com/blang/semver/LICENSE
deleted file mode 100644
index 5ba5c86fcb..0000000000
--- a/vendor/github.com/blang/semver/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-The MIT License
-
-Copyright (c) 2014 Benedikt Lang
-
-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/blang/semver/README.md b/vendor/github.com/blang/semver/README.md
deleted file mode 100644
index 08b2e4a3d7..0000000000
--- a/vendor/github.com/blang/semver/README.md
+++ /dev/null
@@ -1,194 +0,0 @@
-semver for golang [](https://travis-ci.org/blang/semver) [](https://godoc.org/github.com/blang/semver) [](https://coveralls.io/r/blang/semver?branch=master)
-======
-
-semver is a [Semantic Versioning](http://semver.org/) library written in golang. It fully covers spec version `2.0.0`.
-
-Usage
------
-```bash
-$ go get github.com/blang/semver
-```
-Note: Always vendor your dependencies or fix on a specific version tag.
-
-```go
-import github.com/blang/semver
-v1, err := semver.Make("1.0.0-beta")
-v2, err := semver.Make("2.0.0-beta")
-v1.Compare(v2)
-```
-
-Also check the [GoDocs](http://godoc.org/github.com/blang/semver).
-
-Why should I use this lib?
------
-
-- Fully spec compatible
-- No reflection
-- No regex
-- Fully tested (Coverage >99%)
-- Readable parsing/validation errors
-- Fast (See [Benchmarks](#benchmarks))
-- Only Stdlib
-- Uses values instead of pointers
-- Many features, see below
-
-
-Features
------
-
-- Parsing and validation at all levels
-- Comparator-like comparisons
-- Compare Helper Methods
-- InPlace manipulation
-- Ranges `>=1.0.0 <2.0.0 || >=3.0.0 !3.0.1-beta.1`
-- Wildcards `>=1.x`, `<=2.5.x`
-- Sortable (implements sort.Interface)
-- database/sql compatible (sql.Scanner/Valuer)
-- encoding/json compatible (json.Marshaler/Unmarshaler)
-
-Ranges
-------
-
-A `Range` is a set of conditions which specify which versions satisfy the range.
-
-A condition is composed of an operator and a version. The supported operators are:
-
-- `<1.0.0` Less than `1.0.0`
-- `<=1.0.0` Less than or equal to `1.0.0`
-- `>1.0.0` Greater than `1.0.0`
-- `>=1.0.0` Greater than or equal to `1.0.0`
-- `1.0.0`, `=1.0.0`, `==1.0.0` Equal to `1.0.0`
-- `!1.0.0`, `!=1.0.0` Not equal to `1.0.0`. Excludes version `1.0.0`.
-
-Note that spaces between the operator and the version will be gracefully tolerated.
-
-A `Range` can link multiple `Ranges` separated by space:
-
-Ranges can be linked by logical AND:
-
- - `>1.0.0 <2.0.0` would match between both ranges, so `1.1.1` and `1.8.7` but not `1.0.0` or `2.0.0`
- - `>1.0.0 <3.0.0 !2.0.3-beta.2` would match every version between `1.0.0` and `3.0.0` except `2.0.3-beta.2`
-
-Ranges can also be linked by logical OR:
-
- - `<2.0.0 || >=3.0.0` would match `1.x.x` and `3.x.x` but not `2.x.x`
-
-AND has a higher precedence than OR. It's not possible to use brackets.
-
-Ranges can be combined by both AND and OR
-
- - `>1.0.0 <2.0.0 || >3.0.0 !4.2.1` would match `1.2.3`, `1.9.9`, `3.1.1`, but not `4.2.1`, `2.1.1`
-
-Range usage:
-
-```
-v, err := semver.Parse("1.2.3")
-range, err := semver.ParseRange(">1.0.0 <2.0.0 || >=3.0.0")
-if range(v) {
- //valid
-}
-
-```
-
-Example
------
-
-Have a look at full examples in [examples/main.go](examples/main.go)
-
-```go
-import github.com/blang/semver
-
-v, err := semver.Make("0.0.1-alpha.preview+123.github")
-fmt.Printf("Major: %d\n", v.Major)
-fmt.Printf("Minor: %d\n", v.Minor)
-fmt.Printf("Patch: %d\n", v.Patch)
-fmt.Printf("Pre: %s\n", v.Pre)
-fmt.Printf("Build: %s\n", v.Build)
-
-// Prerelease versions array
-if len(v.Pre) > 0 {
- fmt.Println("Prerelease versions:")
- for i, pre := range v.Pre {
- fmt.Printf("%d: %q\n", i, pre)
- }
-}
-
-// Build meta data array
-if len(v.Build) > 0 {
- fmt.Println("Build meta data:")
- for i, build := range v.Build {
- fmt.Printf("%d: %q\n", i, build)
- }
-}
-
-v001, err := semver.Make("0.0.1")
-// Compare using helpers: v.GT(v2), v.LT, v.GTE, v.LTE
-v001.GT(v) == true
-v.LT(v001) == true
-v.GTE(v) == true
-v.LTE(v) == true
-
-// Or use v.Compare(v2) for comparisons (-1, 0, 1):
-v001.Compare(v) == 1
-v.Compare(v001) == -1
-v.Compare(v) == 0
-
-// Manipulate Version in place:
-v.Pre[0], err = semver.NewPRVersion("beta")
-if err != nil {
- fmt.Printf("Error parsing pre release version: %q", err)
-}
-
-fmt.Println("\nValidate versions:")
-v.Build[0] = "?"
-
-err = v.Validate()
-if err != nil {
- fmt.Printf("Validation failed: %s\n", err)
-}
-```
-
-
-Benchmarks
------
-
- BenchmarkParseSimple-4 5000000 390 ns/op 48 B/op 1 allocs/op
- BenchmarkParseComplex-4 1000000 1813 ns/op 256 B/op 7 allocs/op
- BenchmarkParseAverage-4 1000000 1171 ns/op 163 B/op 4 allocs/op
- BenchmarkStringSimple-4 20000000 119 ns/op 16 B/op 1 allocs/op
- BenchmarkStringLarger-4 10000000 206 ns/op 32 B/op 2 allocs/op
- BenchmarkStringComplex-4 5000000 324 ns/op 80 B/op 3 allocs/op
- BenchmarkStringAverage-4 5000000 273 ns/op 53 B/op 2 allocs/op
- BenchmarkValidateSimple-4 200000000 9.33 ns/op 0 B/op 0 allocs/op
- BenchmarkValidateComplex-4 3000000 469 ns/op 0 B/op 0 allocs/op
- BenchmarkValidateAverage-4 5000000 256 ns/op 0 B/op 0 allocs/op
- BenchmarkCompareSimple-4 100000000 11.8 ns/op 0 B/op 0 allocs/op
- BenchmarkCompareComplex-4 50000000 30.8 ns/op 0 B/op 0 allocs/op
- BenchmarkCompareAverage-4 30000000 41.5 ns/op 0 B/op 0 allocs/op
- BenchmarkSort-4 3000000 419 ns/op 256 B/op 2 allocs/op
- BenchmarkRangeParseSimple-4 2000000 850 ns/op 192 B/op 5 allocs/op
- BenchmarkRangeParseAverage-4 1000000 1677 ns/op 400 B/op 10 allocs/op
- BenchmarkRangeParseComplex-4 300000 5214 ns/op 1440 B/op 30 allocs/op
- BenchmarkRangeMatchSimple-4 50000000 25.6 ns/op 0 B/op 0 allocs/op
- BenchmarkRangeMatchAverage-4 30000000 56.4 ns/op 0 B/op 0 allocs/op
- BenchmarkRangeMatchComplex-4 10000000 153 ns/op 0 B/op 0 allocs/op
-
-See benchmark cases at [semver_test.go](semver_test.go)
-
-
-Motivation
------
-
-I simply couldn't find any lib supporting the full spec. Others were just wrong or used reflection and regex which i don't like.
-
-
-Contribution
------
-
-Feel free to make a pull request. For bigger changes create a issue first to discuss about it.
-
-
-License
------
-
-See [LICENSE](LICENSE) file.
diff --git a/vendor/github.com/blang/semver/json.go b/vendor/github.com/blang/semver/json.go
deleted file mode 100644
index a74bf7c449..0000000000
--- a/vendor/github.com/blang/semver/json.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package semver
-
-import (
- "encoding/json"
-)
-
-// MarshalJSON implements the encoding/json.Marshaler interface.
-func (v Version) MarshalJSON() ([]byte, error) {
- return json.Marshal(v.String())
-}
-
-// UnmarshalJSON implements the encoding/json.Unmarshaler interface.
-func (v *Version) UnmarshalJSON(data []byte) (err error) {
- var versionString string
-
- if err = json.Unmarshal(data, &versionString); err != nil {
- return
- }
-
- *v, err = Parse(versionString)
-
- return
-}
diff --git a/vendor/github.com/blang/semver/package.json b/vendor/github.com/blang/semver/package.json
deleted file mode 100644
index 1cf8ebdd9c..0000000000
--- a/vendor/github.com/blang/semver/package.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "author": "blang",
- "bugs": {
- "URL": "https://github.com/blang/semver/issues",
- "url": "https://github.com/blang/semver/issues"
- },
- "gx": {
- "dvcsimport": "github.com/blang/semver"
- },
- "gxVersion": "0.10.0",
- "language": "go",
- "license": "MIT",
- "name": "semver",
- "releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
- "version": "3.5.1"
-}
-
diff --git a/vendor/github.com/blang/semver/range.go b/vendor/github.com/blang/semver/range.go
deleted file mode 100644
index fca406d479..0000000000
--- a/vendor/github.com/blang/semver/range.go
+++ /dev/null
@@ -1,416 +0,0 @@
-package semver
-
-import (
- "fmt"
- "strconv"
- "strings"
- "unicode"
-)
-
-type wildcardType int
-
-const (
- noneWildcard wildcardType = iota
- majorWildcard wildcardType = 1
- minorWildcard wildcardType = 2
- patchWildcard wildcardType = 3
-)
-
-func wildcardTypefromInt(i int) wildcardType {
- switch i {
- case 1:
- return majorWildcard
- case 2:
- return minorWildcard
- case 3:
- return patchWildcard
- default:
- return noneWildcard
- }
-}
-
-type comparator func(Version, Version) bool
-
-var (
- compEQ comparator = func(v1 Version, v2 Version) bool {
- return v1.Compare(v2) == 0
- }
- compNE = func(v1 Version, v2 Version) bool {
- return v1.Compare(v2) != 0
- }
- compGT = func(v1 Version, v2 Version) bool {
- return v1.Compare(v2) == 1
- }
- compGE = func(v1 Version, v2 Version) bool {
- return v1.Compare(v2) >= 0
- }
- compLT = func(v1 Version, v2 Version) bool {
- return v1.Compare(v2) == -1
- }
- compLE = func(v1 Version, v2 Version) bool {
- return v1.Compare(v2) <= 0
- }
-)
-
-type versionRange struct {
- v Version
- c comparator
-}
-
-// rangeFunc creates a Range from the given versionRange.
-func (vr *versionRange) rangeFunc() Range {
- return Range(func(v Version) bool {
- return vr.c(v, vr.v)
- })
-}
-
-// Range represents a range of versions.
-// A Range can be used to check if a Version satisfies it:
-//
-// range, err := semver.ParseRange(">1.0.0 <2.0.0")
-// range(semver.MustParse("1.1.1") // returns true
-type Range func(Version) bool
-
-// OR combines the existing Range with another Range using logical OR.
-func (rf Range) OR(f Range) Range {
- return Range(func(v Version) bool {
- return rf(v) || f(v)
- })
-}
-
-// AND combines the existing Range with another Range using logical AND.
-func (rf Range) AND(f Range) Range {
- return Range(func(v Version) bool {
- return rf(v) && f(v)
- })
-}
-
-// ParseRange parses a range and returns a Range.
-// If the range could not be parsed an error is returned.
-//
-// Valid ranges are:
-// - "<1.0.0"
-// - "<=1.0.0"
-// - ">1.0.0"
-// - ">=1.0.0"
-// - "1.0.0", "=1.0.0", "==1.0.0"
-// - "!1.0.0", "!=1.0.0"
-//
-// A Range can consist of multiple ranges separated by space:
-// Ranges can be linked by logical AND:
-// - ">1.0.0 <2.0.0" would match between both ranges, so "1.1.1" and "1.8.7" but not "1.0.0" or "2.0.0"
-// - ">1.0.0 <3.0.0 !2.0.3-beta.2" would match every version between 1.0.0 and 3.0.0 except 2.0.3-beta.2
-//
-// Ranges can also be linked by logical OR:
-// - "<2.0.0 || >=3.0.0" would match "1.x.x" and "3.x.x" but not "2.x.x"
-//
-// AND has a higher precedence than OR. It's not possible to use brackets.
-//
-// Ranges can be combined by both AND and OR
-//
-// - `>1.0.0 <2.0.0 || >3.0.0 !4.2.1` would match `1.2.3`, `1.9.9`, `3.1.1`, but not `4.2.1`, `2.1.1`
-func ParseRange(s string) (Range, error) {
- parts := splitAndTrim(s)
- orParts, err := splitORParts(parts)
- if err != nil {
- return nil, err
- }
- expandedParts, err := expandWildcardVersion(orParts)
- if err != nil {
- return nil, err
- }
- var orFn Range
- for _, p := range expandedParts {
- var andFn Range
- for _, ap := range p {
- opStr, vStr, err := splitComparatorVersion(ap)
- if err != nil {
- return nil, err
- }
- vr, err := buildVersionRange(opStr, vStr)
- if err != nil {
- return nil, fmt.Errorf("Could not parse Range %q: %s", ap, err)
- }
- rf := vr.rangeFunc()
-
- // Set function
- if andFn == nil {
- andFn = rf
- } else { // Combine with existing function
- andFn = andFn.AND(rf)
- }
- }
- if orFn == nil {
- orFn = andFn
- } else {
- orFn = orFn.OR(andFn)
- }
-
- }
- return orFn, nil
-}
-
-// splitORParts splits the already cleaned parts by '||'.
-// Checks for invalid positions of the operator and returns an
-// error if found.
-func splitORParts(parts []string) ([][]string, error) {
- var ORparts [][]string
- last := 0
- for i, p := range parts {
- if p == "||" {
- if i == 0 {
- return nil, fmt.Errorf("First element in range is '||'")
- }
- ORparts = append(ORparts, parts[last:i])
- last = i + 1
- }
- }
- if last == len(parts) {
- return nil, fmt.Errorf("Last element in range is '||'")
- }
- ORparts = append(ORparts, parts[last:])
- return ORparts, nil
-}
-
-// buildVersionRange takes a slice of 2: operator and version
-// and builds a versionRange, otherwise an error.
-func buildVersionRange(opStr, vStr string) (*versionRange, error) {
- c := parseComparator(opStr)
- if c == nil {
- return nil, fmt.Errorf("Could not parse comparator %q in %q", opStr, strings.Join([]string{opStr, vStr}, ""))
- }
- v, err := Parse(vStr)
- if err != nil {
- return nil, fmt.Errorf("Could not parse version %q in %q: %s", vStr, strings.Join([]string{opStr, vStr}, ""), err)
- }
-
- return &versionRange{
- v: v,
- c: c,
- }, nil
-
-}
-
-// inArray checks if a byte is contained in an array of bytes
-func inArray(s byte, list []byte) bool {
- for _, el := range list {
- if el == s {
- return true
- }
- }
- return false
-}
-
-// splitAndTrim splits a range string by spaces and cleans whitespaces
-func splitAndTrim(s string) (result []string) {
- last := 0
- var lastChar byte
- excludeFromSplit := []byte{'>', '<', '='}
- for i := 0; i < len(s); i++ {
- if s[i] == ' ' && !inArray(lastChar, excludeFromSplit) {
- if last < i-1 {
- result = append(result, s[last:i])
- }
- last = i + 1
- } else if s[i] != ' ' {
- lastChar = s[i]
- }
- }
- if last < len(s)-1 {
- result = append(result, s[last:])
- }
-
- for i, v := range result {
- result[i] = strings.Replace(v, " ", "", -1)
- }
-
- // parts := strings.Split(s, " ")
- // for _, x := range parts {
- // if s := strings.TrimSpace(x); len(s) != 0 {
- // result = append(result, s)
- // }
- // }
- return
-}
-
-// splitComparatorVersion splits the comparator from the version.
-// Input must be free of leading or trailing spaces.
-func splitComparatorVersion(s string) (string, string, error) {
- i := strings.IndexFunc(s, unicode.IsDigit)
- if i == -1 {
- return "", "", fmt.Errorf("Could not get version from string: %q", s)
- }
- return strings.TrimSpace(s[0:i]), s[i:], nil
-}
-
-// getWildcardType will return the type of wildcard that the
-// passed version contains
-func getWildcardType(vStr string) wildcardType {
- parts := strings.Split(vStr, ".")
- nparts := len(parts)
- wildcard := parts[nparts-1]
-
- possibleWildcardType := wildcardTypefromInt(nparts)
- if wildcard == "x" {
- return possibleWildcardType
- }
-
- return noneWildcard
-}
-
-// createVersionFromWildcard will convert a wildcard version
-// into a regular version, replacing 'x's with '0's, handling
-// special cases like '1.x.x' and '1.x'
-func createVersionFromWildcard(vStr string) string {
- // handle 1.x.x
- vStr2 := strings.Replace(vStr, ".x.x", ".x", 1)
- vStr2 = strings.Replace(vStr2, ".x", ".0", 1)
- parts := strings.Split(vStr2, ".")
-
- // handle 1.x
- if len(parts) == 2 {
- return vStr2 + ".0"
- }
-
- return vStr2
-}
-
-// incrementMajorVersion will increment the major version
-// of the passed version
-func incrementMajorVersion(vStr string) (string, error) {
- parts := strings.Split(vStr, ".")
- i, err := strconv.Atoi(parts[0])
- if err != nil {
- return "", err
- }
- parts[0] = strconv.Itoa(i + 1)
-
- return strings.Join(parts, "."), nil
-}
-
-// incrementMajorVersion will increment the minor version
-// of the passed version
-func incrementMinorVersion(vStr string) (string, error) {
- parts := strings.Split(vStr, ".")
- i, err := strconv.Atoi(parts[1])
- if err != nil {
- return "", err
- }
- parts[1] = strconv.Itoa(i + 1)
-
- return strings.Join(parts, "."), nil
-}
-
-// expandWildcardVersion will expand wildcards inside versions
-// following these rules:
-//
-// * when dealing with patch wildcards:
-// >= 1.2.x will become >= 1.2.0
-// <= 1.2.x will become < 1.3.0
-// > 1.2.x will become >= 1.3.0
-// < 1.2.x will become < 1.2.0
-// != 1.2.x will become < 1.2.0 >= 1.3.0
-//
-// * when dealing with minor wildcards:
-// >= 1.x will become >= 1.0.0
-// <= 1.x will become < 2.0.0
-// > 1.x will become >= 2.0.0
-// < 1.0 will become < 1.0.0
-// != 1.x will become < 1.0.0 >= 2.0.0
-//
-// * when dealing with wildcards without
-// version operator:
-// 1.2.x will become >= 1.2.0 < 1.3.0
-// 1.x will become >= 1.0.0 < 2.0.0
-func expandWildcardVersion(parts [][]string) ([][]string, error) {
- var expandedParts [][]string
- for _, p := range parts {
- var newParts []string
- for _, ap := range p {
- if strings.Index(ap, "x") != -1 {
- opStr, vStr, err := splitComparatorVersion(ap)
- if err != nil {
- return nil, err
- }
-
- versionWildcardType := getWildcardType(vStr)
- flatVersion := createVersionFromWildcard(vStr)
-
- var resultOperator string
- var shouldIncrementVersion bool
- switch opStr {
- case ">":
- resultOperator = ">="
- shouldIncrementVersion = true
- case ">=":
- resultOperator = ">="
- case "<":
- resultOperator = "<"
- case "<=":
- resultOperator = "<"
- shouldIncrementVersion = true
- case "", "=", "==":
- newParts = append(newParts, ">="+flatVersion)
- resultOperator = "<"
- shouldIncrementVersion = true
- case "!=", "!":
- newParts = append(newParts, "<"+flatVersion)
- resultOperator = ">="
- shouldIncrementVersion = true
- }
-
- var resultVersion string
- if shouldIncrementVersion {
- switch versionWildcardType {
- case patchWildcard:
- resultVersion, _ = incrementMinorVersion(flatVersion)
- case minorWildcard:
- resultVersion, _ = incrementMajorVersion(flatVersion)
- }
- } else {
- resultVersion = flatVersion
- }
-
- ap = resultOperator + resultVersion
- }
- newParts = append(newParts, ap)
- }
- expandedParts = append(expandedParts, newParts)
- }
-
- return expandedParts, nil
-}
-
-func parseComparator(s string) comparator {
- switch s {
- case "==":
- fallthrough
- case "":
- fallthrough
- case "=":
- return compEQ
- case ">":
- return compGT
- case ">=":
- return compGE
- case "<":
- return compLT
- case "<=":
- return compLE
- case "!":
- fallthrough
- case "!=":
- return compNE
- }
-
- return nil
-}
-
-// MustParseRange is like ParseRange but panics if the range cannot be parsed.
-func MustParseRange(s string) Range {
- r, err := ParseRange(s)
- if err != nil {
- panic(`semver: ParseRange(` + s + `): ` + err.Error())
- }
- return r
-}
diff --git a/vendor/github.com/blang/semver/semver.go b/vendor/github.com/blang/semver/semver.go
deleted file mode 100644
index 8ee0842e6a..0000000000
--- a/vendor/github.com/blang/semver/semver.go
+++ /dev/null
@@ -1,418 +0,0 @@
-package semver
-
-import (
- "errors"
- "fmt"
- "strconv"
- "strings"
-)
-
-const (
- numbers string = "0123456789"
- alphas = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"
- alphanum = alphas + numbers
-)
-
-// SpecVersion is the latest fully supported spec version of semver
-var SpecVersion = Version{
- Major: 2,
- Minor: 0,
- Patch: 0,
-}
-
-// Version represents a semver compatible version
-type Version struct {
- Major uint64
- Minor uint64
- Patch uint64
- Pre []PRVersion
- Build []string //No Precendence
-}
-
-// Version to string
-func (v Version) String() string {
- b := make([]byte, 0, 5)
- b = strconv.AppendUint(b, v.Major, 10)
- b = append(b, '.')
- b = strconv.AppendUint(b, v.Minor, 10)
- b = append(b, '.')
- b = strconv.AppendUint(b, v.Patch, 10)
-
- if len(v.Pre) > 0 {
- b = append(b, '-')
- b = append(b, v.Pre[0].String()...)
-
- for _, pre := range v.Pre[1:] {
- b = append(b, '.')
- b = append(b, pre.String()...)
- }
- }
-
- if len(v.Build) > 0 {
- b = append(b, '+')
- b = append(b, v.Build[0]...)
-
- for _, build := range v.Build[1:] {
- b = append(b, '.')
- b = append(b, build...)
- }
- }
-
- return string(b)
-}
-
-// Equals checks if v is equal to o.
-func (v Version) Equals(o Version) bool {
- return (v.Compare(o) == 0)
-}
-
-// EQ checks if v is equal to o.
-func (v Version) EQ(o Version) bool {
- return (v.Compare(o) == 0)
-}
-
-// NE checks if v is not equal to o.
-func (v Version) NE(o Version) bool {
- return (v.Compare(o) != 0)
-}
-
-// GT checks if v is greater than o.
-func (v Version) GT(o Version) bool {
- return (v.Compare(o) == 1)
-}
-
-// GTE checks if v is greater than or equal to o.
-func (v Version) GTE(o Version) bool {
- return (v.Compare(o) >= 0)
-}
-
-// GE checks if v is greater than or equal to o.
-func (v Version) GE(o Version) bool {
- return (v.Compare(o) >= 0)
-}
-
-// LT checks if v is less than o.
-func (v Version) LT(o Version) bool {
- return (v.Compare(o) == -1)
-}
-
-// LTE checks if v is less than or equal to o.
-func (v Version) LTE(o Version) bool {
- return (v.Compare(o) <= 0)
-}
-
-// LE checks if v is less than or equal to o.
-func (v Version) LE(o Version) bool {
- return (v.Compare(o) <= 0)
-}
-
-// Compare compares Versions v to o:
-// -1 == v is less than o
-// 0 == v is equal to o
-// 1 == v is greater than o
-func (v Version) Compare(o Version) int {
- if v.Major != o.Major {
- if v.Major > o.Major {
- return 1
- }
- return -1
- }
- if v.Minor != o.Minor {
- if v.Minor > o.Minor {
- return 1
- }
- return -1
- }
- if v.Patch != o.Patch {
- if v.Patch > o.Patch {
- return 1
- }
- return -1
- }
-
- // Quick comparison if a version has no prerelease versions
- if len(v.Pre) == 0 && len(o.Pre) == 0 {
- return 0
- } else if len(v.Pre) == 0 && len(o.Pre) > 0 {
- return 1
- } else if len(v.Pre) > 0 && len(o.Pre) == 0 {
- return -1
- }
-
- i := 0
- for ; i < len(v.Pre) && i < len(o.Pre); i++ {
- if comp := v.Pre[i].Compare(o.Pre[i]); comp == 0 {
- continue
- } else if comp == 1 {
- return 1
- } else {
- return -1
- }
- }
-
- // If all pr versions are the equal but one has further prversion, this one greater
- if i == len(v.Pre) && i == len(o.Pre) {
- return 0
- } else if i == len(v.Pre) && i < len(o.Pre) {
- return -1
- } else {
- return 1
- }
-
-}
-
-// Validate validates v and returns error in case
-func (v Version) Validate() error {
- // Major, Minor, Patch already validated using uint64
-
- for _, pre := range v.Pre {
- if !pre.IsNum { //Numeric prerelease versions already uint64
- if len(pre.VersionStr) == 0 {
- return fmt.Errorf("Prerelease can not be empty %q", pre.VersionStr)
- }
- if !containsOnly(pre.VersionStr, alphanum) {
- return fmt.Errorf("Invalid character(s) found in prerelease %q", pre.VersionStr)
- }
- }
- }
-
- for _, build := range v.Build {
- if len(build) == 0 {
- return fmt.Errorf("Build meta data can not be empty %q", build)
- }
- if !containsOnly(build, alphanum) {
- return fmt.Errorf("Invalid character(s) found in build meta data %q", build)
- }
- }
-
- return nil
-}
-
-// New is an alias for Parse and returns a pointer, parses version string and returns a validated Version or error
-func New(s string) (vp *Version, err error) {
- v, err := Parse(s)
- vp = &v
- return
-}
-
-// Make is an alias for Parse, parses version string and returns a validated Version or error
-func Make(s string) (Version, error) {
- return Parse(s)
-}
-
-// ParseTolerant allows for certain version specifications that do not strictly adhere to semver
-// specs to be parsed by this library. It does so by normalizing versions before passing them to
-// Parse(). It currently trims spaces, removes a "v" prefix, and adds a 0 patch number to versions
-// with only major and minor components specified
-func ParseTolerant(s string) (Version, error) {
- s = strings.TrimSpace(s)
- s = strings.TrimPrefix(s, "v")
-
- // Split into major.minor.(patch+pr+meta)
- parts := strings.SplitN(s, ".", 3)
- if len(parts) < 3 {
- if strings.ContainsAny(parts[len(parts)-1], "+-") {
- return Version{}, errors.New("Short version cannot contain PreRelease/Build meta data")
- }
- for len(parts) < 3 {
- parts = append(parts, "0")
- }
- s = strings.Join(parts, ".")
- }
-
- return Parse(s)
-}
-
-// Parse parses version string and returns a validated Version or error
-func Parse(s string) (Version, error) {
- if len(s) == 0 {
- return Version{}, errors.New("Version string empty")
- }
-
- // Split into major.minor.(patch+pr+meta)
- parts := strings.SplitN(s, ".", 3)
- if len(parts) != 3 {
- return Version{}, errors.New("No Major.Minor.Patch elements found")
- }
-
- // Major
- if !containsOnly(parts[0], numbers) {
- return Version{}, fmt.Errorf("Invalid character(s) found in major number %q", parts[0])
- }
- if hasLeadingZeroes(parts[0]) {
- return Version{}, fmt.Errorf("Major number must not contain leading zeroes %q", parts[0])
- }
- major, err := strconv.ParseUint(parts[0], 10, 64)
- if err != nil {
- return Version{}, err
- }
-
- // Minor
- if !containsOnly(parts[1], numbers) {
- return Version{}, fmt.Errorf("Invalid character(s) found in minor number %q", parts[1])
- }
- if hasLeadingZeroes(parts[1]) {
- return Version{}, fmt.Errorf("Minor number must not contain leading zeroes %q", parts[1])
- }
- minor, err := strconv.ParseUint(parts[1], 10, 64)
- if err != nil {
- return Version{}, err
- }
-
- v := Version{}
- v.Major = major
- v.Minor = minor
-
- var build, prerelease []string
- patchStr := parts[2]
-
- if buildIndex := strings.IndexRune(patchStr, '+'); buildIndex != -1 {
- build = strings.Split(patchStr[buildIndex+1:], ".")
- patchStr = patchStr[:buildIndex]
- }
-
- if preIndex := strings.IndexRune(patchStr, '-'); preIndex != -1 {
- prerelease = strings.Split(patchStr[preIndex+1:], ".")
- patchStr = patchStr[:preIndex]
- }
-
- if !containsOnly(patchStr, numbers) {
- return Version{}, fmt.Errorf("Invalid character(s) found in patch number %q", patchStr)
- }
- if hasLeadingZeroes(patchStr) {
- return Version{}, fmt.Errorf("Patch number must not contain leading zeroes %q", patchStr)
- }
- patch, err := strconv.ParseUint(patchStr, 10, 64)
- if err != nil {
- return Version{}, err
- }
-
- v.Patch = patch
-
- // Prerelease
- for _, prstr := range prerelease {
- parsedPR, err := NewPRVersion(prstr)
- if err != nil {
- return Version{}, err
- }
- v.Pre = append(v.Pre, parsedPR)
- }
-
- // Build meta data
- for _, str := range build {
- if len(str) == 0 {
- return Version{}, errors.New("Build meta data is empty")
- }
- if !containsOnly(str, alphanum) {
- return Version{}, fmt.Errorf("Invalid character(s) found in build meta data %q", str)
- }
- v.Build = append(v.Build, str)
- }
-
- return v, nil
-}
-
-// MustParse is like Parse but panics if the version cannot be parsed.
-func MustParse(s string) Version {
- v, err := Parse(s)
- if err != nil {
- panic(`semver: Parse(` + s + `): ` + err.Error())
- }
- return v
-}
-
-// PRVersion represents a PreRelease Version
-type PRVersion struct {
- VersionStr string
- VersionNum uint64
- IsNum bool
-}
-
-// NewPRVersion creates a new valid prerelease version
-func NewPRVersion(s string) (PRVersion, error) {
- if len(s) == 0 {
- return PRVersion{}, errors.New("Prerelease is empty")
- }
- v := PRVersion{}
- if containsOnly(s, numbers) {
- if hasLeadingZeroes(s) {
- return PRVersion{}, fmt.Errorf("Numeric PreRelease version must not contain leading zeroes %q", s)
- }
- num, err := strconv.ParseUint(s, 10, 64)
-
- // Might never be hit, but just in case
- if err != nil {
- return PRVersion{}, err
- }
- v.VersionNum = num
- v.IsNum = true
- } else if containsOnly(s, alphanum) {
- v.VersionStr = s
- v.IsNum = false
- } else {
- return PRVersion{}, fmt.Errorf("Invalid character(s) found in prerelease %q", s)
- }
- return v, nil
-}
-
-// IsNumeric checks if prerelease-version is numeric
-func (v PRVersion) IsNumeric() bool {
- return v.IsNum
-}
-
-// Compare compares two PreRelease Versions v and o:
-// -1 == v is less than o
-// 0 == v is equal to o
-// 1 == v is greater than o
-func (v PRVersion) Compare(o PRVersion) int {
- if v.IsNum && !o.IsNum {
- return -1
- } else if !v.IsNum && o.IsNum {
- return 1
- } else if v.IsNum && o.IsNum {
- if v.VersionNum == o.VersionNum {
- return 0
- } else if v.VersionNum > o.VersionNum {
- return 1
- } else {
- return -1
- }
- } else { // both are Alphas
- if v.VersionStr == o.VersionStr {
- return 0
- } else if v.VersionStr > o.VersionStr {
- return 1
- } else {
- return -1
- }
- }
-}
-
-// PreRelease version to string
-func (v PRVersion) String() string {
- if v.IsNum {
- return strconv.FormatUint(v.VersionNum, 10)
- }
- return v.VersionStr
-}
-
-func containsOnly(s string, set string) bool {
- return strings.IndexFunc(s, func(r rune) bool {
- return !strings.ContainsRune(set, r)
- }) == -1
-}
-
-func hasLeadingZeroes(s string) bool {
- return len(s) > 1 && s[0] == '0'
-}
-
-// NewBuildVersion creates a new valid build version
-func NewBuildVersion(s string) (string, error) {
- if len(s) == 0 {
- return "", errors.New("Buildversion is empty")
- }
- if !containsOnly(s, alphanum) {
- return "", fmt.Errorf("Invalid character(s) found in build meta data %q", s)
- }
- return s, nil
-}
diff --git a/vendor/github.com/blang/semver/sort.go b/vendor/github.com/blang/semver/sort.go
deleted file mode 100644
index e18f880826..0000000000
--- a/vendor/github.com/blang/semver/sort.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package semver
-
-import (
- "sort"
-)
-
-// Versions represents multiple versions.
-type Versions []Version
-
-// Len returns length of version collection
-func (s Versions) Len() int {
- return len(s)
-}
-
-// Swap swaps two versions inside the collection by its indices
-func (s Versions) Swap(i, j int) {
- s[i], s[j] = s[j], s[i]
-}
-
-// Less checks if version at index i is less than version at index j
-func (s Versions) Less(i, j int) bool {
- return s[i].LT(s[j])
-}
-
-// Sort sorts a slice of versions
-func Sort(versions []Version) {
- sort.Sort(Versions(versions))
-}
diff --git a/vendor/github.com/blang/semver/sql.go b/vendor/github.com/blang/semver/sql.go
deleted file mode 100644
index eb4d802666..0000000000
--- a/vendor/github.com/blang/semver/sql.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package semver
-
-import (
- "database/sql/driver"
- "fmt"
-)
-
-// Scan implements the database/sql.Scanner interface.
-func (v *Version) Scan(src interface{}) (err error) {
- var str string
- switch src := src.(type) {
- case string:
- str = src
- case []byte:
- str = string(src)
- default:
- return fmt.Errorf("Version.Scan: cannot convert %T to string.", src)
- }
-
- if t, err := Parse(str); err == nil {
- *v = t
- }
-
- return
-}
-
-// Value implements the database/sql/driver.Valuer interface.
-func (v Version) Value() (driver.Value, error) {
- return v.String(), nil
-}
diff --git a/vendor/github.com/cloudflare/circl/LICENSE b/vendor/github.com/cloudflare/circl/LICENSE
new file mode 100644
index 0000000000..67edaa90a0
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/LICENSE
@@ -0,0 +1,57 @@
+Copyright (c) 2019 Cloudflare. 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 Cloudflare 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.
+
+========================================================================
+
+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/github.com/cloudflare/circl/dh/x25519/curve.go b/vendor/github.com/cloudflare/circl/dh/x25519/curve.go
new file mode 100644
index 0000000000..f9057c2b86
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x25519/curve.go
@@ -0,0 +1,96 @@
+package x25519
+
+import (
+ fp "github.com/cloudflare/circl/math/fp25519"
+)
+
+// ladderJoye calculates a fixed-point multiplication with the generator point.
+// The algorithm is the right-to-left Joye's ladder as described
+// in "How to precompute a ladder" in SAC'2017.
+func ladderJoye(k *Key) {
+ w := [5]fp.Elt{} // [mu,x1,z1,x2,z2] order must be preserved.
+ fp.SetOne(&w[1]) // x1 = 1
+ fp.SetOne(&w[2]) // z1 = 1
+ w[3] = fp.Elt{ // x2 = G-S
+ 0xbd, 0xaa, 0x2f, 0xc8, 0xfe, 0xe1, 0x94, 0x7e,
+ 0xf8, 0xed, 0xb2, 0x14, 0xae, 0x95, 0xf0, 0xbb,
+ 0xe2, 0x48, 0x5d, 0x23, 0xb9, 0xa0, 0xc7, 0xad,
+ 0x34, 0xab, 0x7c, 0xe2, 0xee, 0xcd, 0xae, 0x1e,
+ }
+ fp.SetOne(&w[4]) // z2 = 1
+
+ const n = 255
+ const h = 3
+ swap := uint(1)
+ for s := 0; s < n-h; s++ {
+ i := (s + h) / 8
+ j := (s + h) % 8
+ bit := uint((k[i] >> uint(j)) & 1)
+ copy(w[0][:], tableGenerator[s*Size:(s+1)*Size])
+ diffAdd(&w, swap^bit)
+ swap = bit
+ }
+ for s := 0; s < h; s++ {
+ double(&w[1], &w[2])
+ }
+ toAffine((*[fp.Size]byte)(k), &w[1], &w[2])
+}
+
+// ladderMontgomery calculates a generic scalar point multiplication
+// The algorithm implemented is the left-to-right Montgomery's ladder.
+func ladderMontgomery(k, xP *Key) {
+ w := [5]fp.Elt{} // [x1, x2, z2, x3, z3] order must be preserved.
+ w[0] = *(*fp.Elt)(xP) // x1 = xP
+ fp.SetOne(&w[1]) // x2 = 1
+ w[3] = *(*fp.Elt)(xP) // x3 = xP
+ fp.SetOne(&w[4]) // z3 = 1
+
+ move := uint(0)
+ for s := 255 - 1; s >= 0; s-- {
+ i := s / 8
+ j := s % 8
+ bit := uint((k[i] >> uint(j)) & 1)
+ ladderStep(&w, move^bit)
+ move = bit
+ }
+ toAffine((*[fp.Size]byte)(k), &w[1], &w[2])
+}
+
+func toAffine(k *[fp.Size]byte, x, z *fp.Elt) {
+ fp.Inv(z, z)
+ fp.Mul(x, x, z)
+ _ = fp.ToBytes(k[:], x)
+}
+
+var lowOrderPoints = [5]fp.Elt{
+ { /* (0,_,1) point of order 2 on Curve25519 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ },
+ { /* (1,_,1) point of order 4 on Curve25519 */
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ },
+ { /* (x,_,1) first point of order 8 on Curve25519 */
+ 0xe0, 0xeb, 0x7a, 0x7c, 0x3b, 0x41, 0xb8, 0xae,
+ 0x16, 0x56, 0xe3, 0xfa, 0xf1, 0x9f, 0xc4, 0x6a,
+ 0xda, 0x09, 0x8d, 0xeb, 0x9c, 0x32, 0xb1, 0xfd,
+ 0x86, 0x62, 0x05, 0x16, 0x5f, 0x49, 0xb8, 0x00,
+ },
+ { /* (x,_,1) second point of order 8 on Curve25519 */
+ 0x5f, 0x9c, 0x95, 0xbc, 0xa3, 0x50, 0x8c, 0x24,
+ 0xb1, 0xd0, 0xb1, 0x55, 0x9c, 0x83, 0xef, 0x5b,
+ 0x04, 0x44, 0x5c, 0xc4, 0x58, 0x1c, 0x8e, 0x86,
+ 0xd8, 0x22, 0x4e, 0xdd, 0xd0, 0x9f, 0x11, 0x57,
+ },
+ { /* (-1,_,1) a point of order 4 on the twist of Curve25519 */
+ 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ },
+}
diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.go b/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.go
new file mode 100644
index 0000000000..8a3d54c570
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.go
@@ -0,0 +1,30 @@
+//go:build amd64 && !purego
+// +build amd64,!purego
+
+package x25519
+
+import (
+ fp "github.com/cloudflare/circl/math/fp25519"
+ "golang.org/x/sys/cpu"
+)
+
+var hasBmi2Adx = cpu.X86.HasBMI2 && cpu.X86.HasADX
+
+var _ = hasBmi2Adx
+
+func double(x, z *fp.Elt) { doubleAmd64(x, z) }
+func diffAdd(w *[5]fp.Elt, b uint) { diffAddAmd64(w, b) }
+func ladderStep(w *[5]fp.Elt, b uint) { ladderStepAmd64(w, b) }
+func mulA24(z, x *fp.Elt) { mulA24Amd64(z, x) }
+
+//go:noescape
+func ladderStepAmd64(w *[5]fp.Elt, b uint)
+
+//go:noescape
+func diffAddAmd64(w *[5]fp.Elt, b uint)
+
+//go:noescape
+func doubleAmd64(x, z *fp.Elt)
+
+//go:noescape
+func mulA24Amd64(z, x *fp.Elt)
diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.h b/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.h
new file mode 100644
index 0000000000..8c1ae4d0fb
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.h
@@ -0,0 +1,111 @@
+#define ladderStepLeg \
+ addSub(x2,z2) \
+ addSub(x3,z3) \
+ integerMulLeg(b0,x2,z3) \
+ integerMulLeg(b1,x3,z2) \
+ reduceFromDoubleLeg(t0,b0) \
+ reduceFromDoubleLeg(t1,b1) \
+ addSub(t0,t1) \
+ cselect(x2,x3,regMove) \
+ cselect(z2,z3,regMove) \
+ integerSqrLeg(b0,t0) \
+ integerSqrLeg(b1,t1) \
+ reduceFromDoubleLeg(x3,b0) \
+ reduceFromDoubleLeg(z3,b1) \
+ integerMulLeg(b0,x1,z3) \
+ reduceFromDoubleLeg(z3,b0) \
+ integerSqrLeg(b0,x2) \
+ integerSqrLeg(b1,z2) \
+ reduceFromDoubleLeg(x2,b0) \
+ reduceFromDoubleLeg(z2,b1) \
+ subtraction(t0,x2,z2) \
+ multiplyA24Leg(t1,t0) \
+ additionLeg(t1,t1,z2) \
+ integerMulLeg(b0,x2,z2) \
+ integerMulLeg(b1,t0,t1) \
+ reduceFromDoubleLeg(x2,b0) \
+ reduceFromDoubleLeg(z2,b1)
+
+#define ladderStepBmi2Adx \
+ addSub(x2,z2) \
+ addSub(x3,z3) \
+ integerMulAdx(b0,x2,z3) \
+ integerMulAdx(b1,x3,z2) \
+ reduceFromDoubleAdx(t0,b0) \
+ reduceFromDoubleAdx(t1,b1) \
+ addSub(t0,t1) \
+ cselect(x2,x3,regMove) \
+ cselect(z2,z3,regMove) \
+ integerSqrAdx(b0,t0) \
+ integerSqrAdx(b1,t1) \
+ reduceFromDoubleAdx(x3,b0) \
+ reduceFromDoubleAdx(z3,b1) \
+ integerMulAdx(b0,x1,z3) \
+ reduceFromDoubleAdx(z3,b0) \
+ integerSqrAdx(b0,x2) \
+ integerSqrAdx(b1,z2) \
+ reduceFromDoubleAdx(x2,b0) \
+ reduceFromDoubleAdx(z2,b1) \
+ subtraction(t0,x2,z2) \
+ multiplyA24Adx(t1,t0) \
+ additionAdx(t1,t1,z2) \
+ integerMulAdx(b0,x2,z2) \
+ integerMulAdx(b1,t0,t1) \
+ reduceFromDoubleAdx(x2,b0) \
+ reduceFromDoubleAdx(z2,b1)
+
+#define difAddLeg \
+ addSub(x1,z1) \
+ integerMulLeg(b0,z1,ui) \
+ reduceFromDoubleLeg(z1,b0) \
+ addSub(x1,z1) \
+ integerSqrLeg(b0,x1) \
+ integerSqrLeg(b1,z1) \
+ reduceFromDoubleLeg(x1,b0) \
+ reduceFromDoubleLeg(z1,b1) \
+ integerMulLeg(b0,x1,z2) \
+ integerMulLeg(b1,z1,x2) \
+ reduceFromDoubleLeg(x1,b0) \
+ reduceFromDoubleLeg(z1,b1)
+
+#define difAddBmi2Adx \
+ addSub(x1,z1) \
+ integerMulAdx(b0,z1,ui) \
+ reduceFromDoubleAdx(z1,b0) \
+ addSub(x1,z1) \
+ integerSqrAdx(b0,x1) \
+ integerSqrAdx(b1,z1) \
+ reduceFromDoubleAdx(x1,b0) \
+ reduceFromDoubleAdx(z1,b1) \
+ integerMulAdx(b0,x1,z2) \
+ integerMulAdx(b1,z1,x2) \
+ reduceFromDoubleAdx(x1,b0) \
+ reduceFromDoubleAdx(z1,b1)
+
+#define doubleLeg \
+ addSub(x1,z1) \
+ integerSqrLeg(b0,x1) \
+ integerSqrLeg(b1,z1) \
+ reduceFromDoubleLeg(x1,b0) \
+ reduceFromDoubleLeg(z1,b1) \
+ subtraction(t0,x1,z1) \
+ multiplyA24Leg(t1,t0) \
+ additionLeg(t1,t1,z1) \
+ integerMulLeg(b0,x1,z1) \
+ integerMulLeg(b1,t0,t1) \
+ reduceFromDoubleLeg(x1,b0) \
+ reduceFromDoubleLeg(z1,b1)
+
+#define doubleBmi2Adx \
+ addSub(x1,z1) \
+ integerSqrAdx(b0,x1) \
+ integerSqrAdx(b1,z1) \
+ reduceFromDoubleAdx(x1,b0) \
+ reduceFromDoubleAdx(z1,b1) \
+ subtraction(t0,x1,z1) \
+ multiplyA24Adx(t1,t0) \
+ additionAdx(t1,t1,z1) \
+ integerMulAdx(b0,x1,z1) \
+ integerMulAdx(b1,t0,t1) \
+ reduceFromDoubleAdx(x1,b0) \
+ reduceFromDoubleAdx(z1,b1)
diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.s b/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.s
new file mode 100644
index 0000000000..ce9f062894
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.s
@@ -0,0 +1,157 @@
+//go:build amd64 && !purego
+// +build amd64,!purego
+
+#include "textflag.h"
+
+// Depends on circl/math/fp25519 package
+#include "../../math/fp25519/fp_amd64.h"
+#include "curve_amd64.h"
+
+// CTE_A24 is (A+2)/4 from Curve25519
+#define CTE_A24 121666
+
+#define Size 32
+
+// multiplyA24Leg multiplies x times CTE_A24 and stores in z
+// Uses: AX, DX, R8-R13, FLAGS
+// Instr: x86_64, cmov
+#define multiplyA24Leg(z,x) \
+ MOVL $CTE_A24, AX; MULQ 0+x; MOVQ AX, R8; MOVQ DX, R9; \
+ MOVL $CTE_A24, AX; MULQ 8+x; MOVQ AX, R12; MOVQ DX, R10; \
+ MOVL $CTE_A24, AX; MULQ 16+x; MOVQ AX, R13; MOVQ DX, R11; \
+ MOVL $CTE_A24, AX; MULQ 24+x; \
+ ADDQ R12, R9; \
+ ADCQ R13, R10; \
+ ADCQ AX, R11; \
+ ADCQ $0, DX; \
+ MOVL $38, AX; /* 2*C = 38 = 2^256 MOD 2^255-19*/ \
+ IMULQ AX, DX; \
+ ADDQ DX, R8; \
+ ADCQ $0, R9; MOVQ R9, 8+z; \
+ ADCQ $0, R10; MOVQ R10, 16+z; \
+ ADCQ $0, R11; MOVQ R11, 24+z; \
+ MOVQ $0, DX; \
+ CMOVQCS AX, DX; \
+ ADDQ DX, R8; MOVQ R8, 0+z;
+
+// multiplyA24Adx multiplies x times CTE_A24 and stores in z
+// Uses: AX, DX, R8-R12, FLAGS
+// Instr: x86_64, cmov, bmi2
+#define multiplyA24Adx(z,x) \
+ MOVQ $CTE_A24, DX; \
+ MULXQ 0+x, R8, R10; \
+ MULXQ 8+x, R9, R11; ADDQ R10, R9; \
+ MULXQ 16+x, R10, AX; ADCQ R11, R10; \
+ MULXQ 24+x, R11, R12; ADCQ AX, R11; \
+ ;;;;;;;;;;;;;;;;;;;;; ADCQ $0, R12; \
+ MOVL $38, DX; /* 2*C = 38 = 2^256 MOD 2^255-19*/ \
+ IMULQ DX, R12; \
+ ADDQ R12, R8; \
+ ADCQ $0, R9; MOVQ R9, 8+z; \
+ ADCQ $0, R10; MOVQ R10, 16+z; \
+ ADCQ $0, R11; MOVQ R11, 24+z; \
+ MOVQ $0, R12; \
+ CMOVQCS DX, R12; \
+ ADDQ R12, R8; MOVQ R8, 0+z;
+
+#define mulA24Legacy \
+ multiplyA24Leg(0(DI),0(SI))
+#define mulA24Bmi2Adx \
+ multiplyA24Adx(0(DI),0(SI))
+
+// func mulA24Amd64(z, x *fp255.Elt)
+TEXT ·mulA24Amd64(SB),NOSPLIT,$0-16
+ MOVQ z+0(FP), DI
+ MOVQ x+8(FP), SI
+ CHECK_BMI2ADX(LMA24, mulA24Legacy, mulA24Bmi2Adx)
+
+
+// func ladderStepAmd64(w *[5]fp255.Elt, b uint)
+// ladderStepAmd64 calculates a point addition and doubling as follows:
+// (x2,z2) = 2*(x2,z2) and (x3,z3) = (x2,z2)+(x3,z3) using as a difference (x1,-).
+// work = (x1,x2,z2,x3,z3) are five fp255.Elt of 32 bytes.
+// stack = (t0,t1) are two fp.Elt of fp.Size bytes, and
+// (b0,b1) are two-double precision fp.Elt of 2*fp.Size bytes.
+TEXT ·ladderStepAmd64(SB),NOSPLIT,$192-16
+ // Parameters
+ #define regWork DI
+ #define regMove SI
+ #define x1 0*Size(regWork)
+ #define x2 1*Size(regWork)
+ #define z2 2*Size(regWork)
+ #define x3 3*Size(regWork)
+ #define z3 4*Size(regWork)
+ // Local variables
+ #define t0 0*Size(SP)
+ #define t1 1*Size(SP)
+ #define b0 2*Size(SP)
+ #define b1 4*Size(SP)
+ MOVQ w+0(FP), regWork
+ MOVQ b+8(FP), regMove
+ CHECK_BMI2ADX(LLADSTEP, ladderStepLeg, ladderStepBmi2Adx)
+ #undef regWork
+ #undef regMove
+ #undef x1
+ #undef x2
+ #undef z2
+ #undef x3
+ #undef z3
+ #undef t0
+ #undef t1
+ #undef b0
+ #undef b1
+
+// func diffAddAmd64(w *[5]fp255.Elt, b uint)
+// diffAddAmd64 calculates a differential point addition using a precomputed point.
+// (x1,z1) = (x1,z1)+(mu) using a difference point (x2,z2)
+// w = (mu,x1,z1,x2,z2) are five fp.Elt, and
+// stack = (b0,b1) are two-double precision fp.Elt of 2*fp.Size bytes.
+TEXT ·diffAddAmd64(SB),NOSPLIT,$128-16
+ // Parameters
+ #define regWork DI
+ #define regSwap SI
+ #define ui 0*Size(regWork)
+ #define x1 1*Size(regWork)
+ #define z1 2*Size(regWork)
+ #define x2 3*Size(regWork)
+ #define z2 4*Size(regWork)
+ // Local variables
+ #define b0 0*Size(SP)
+ #define b1 2*Size(SP)
+ MOVQ w+0(FP), regWork
+ MOVQ b+8(FP), regSwap
+ cswap(x1,x2,regSwap)
+ cswap(z1,z2,regSwap)
+ CHECK_BMI2ADX(LDIFADD, difAddLeg, difAddBmi2Adx)
+ #undef regWork
+ #undef regSwap
+ #undef ui
+ #undef x1
+ #undef z1
+ #undef x2
+ #undef z2
+ #undef b0
+ #undef b1
+
+// func doubleAmd64(x, z *fp255.Elt)
+// doubleAmd64 calculates a point doubling (x1,z1) = 2*(x1,z1).
+// stack = (t0,t1) are two fp.Elt of fp.Size bytes, and
+// (b0,b1) are two-double precision fp.Elt of 2*fp.Size bytes.
+TEXT ·doubleAmd64(SB),NOSPLIT,$192-16
+ // Parameters
+ #define x1 0(DI)
+ #define z1 0(SI)
+ // Local variables
+ #define t0 0*Size(SP)
+ #define t1 1*Size(SP)
+ #define b0 2*Size(SP)
+ #define b1 4*Size(SP)
+ MOVQ x+0(FP), DI
+ MOVQ z+8(FP), SI
+ CHECK_BMI2ADX(LDOUB,doubleLeg,doubleBmi2Adx)
+ #undef x1
+ #undef z1
+ #undef t0
+ #undef t1
+ #undef b0
+ #undef b1
diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/curve_generic.go b/vendor/github.com/cloudflare/circl/dh/x25519/curve_generic.go
new file mode 100644
index 0000000000..dae67ea37d
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x25519/curve_generic.go
@@ -0,0 +1,85 @@
+package x25519
+
+import (
+ "encoding/binary"
+ "math/bits"
+
+ fp "github.com/cloudflare/circl/math/fp25519"
+)
+
+func doubleGeneric(x, z *fp.Elt) {
+ t0, t1 := &fp.Elt{}, &fp.Elt{}
+ fp.AddSub(x, z)
+ fp.Sqr(x, x)
+ fp.Sqr(z, z)
+ fp.Sub(t0, x, z)
+ mulA24Generic(t1, t0)
+ fp.Add(t1, t1, z)
+ fp.Mul(x, x, z)
+ fp.Mul(z, t0, t1)
+}
+
+func diffAddGeneric(w *[5]fp.Elt, b uint) {
+ mu, x1, z1, x2, z2 := &w[0], &w[1], &w[2], &w[3], &w[4]
+ fp.Cswap(x1, x2, b)
+ fp.Cswap(z1, z2, b)
+ fp.AddSub(x1, z1)
+ fp.Mul(z1, z1, mu)
+ fp.AddSub(x1, z1)
+ fp.Sqr(x1, x1)
+ fp.Sqr(z1, z1)
+ fp.Mul(x1, x1, z2)
+ fp.Mul(z1, z1, x2)
+}
+
+func ladderStepGeneric(w *[5]fp.Elt, b uint) {
+ x1, x2, z2, x3, z3 := &w[0], &w[1], &w[2], &w[3], &w[4]
+ t0 := &fp.Elt{}
+ t1 := &fp.Elt{}
+ fp.AddSub(x2, z2)
+ fp.AddSub(x3, z3)
+ fp.Mul(t0, x2, z3)
+ fp.Mul(t1, x3, z2)
+ fp.AddSub(t0, t1)
+ fp.Cmov(x2, x3, b)
+ fp.Cmov(z2, z3, b)
+ fp.Sqr(x3, t0)
+ fp.Sqr(z3, t1)
+ fp.Mul(z3, x1, z3)
+ fp.Sqr(x2, x2)
+ fp.Sqr(z2, z2)
+ fp.Sub(t0, x2, z2)
+ mulA24Generic(t1, t0)
+ fp.Add(t1, t1, z2)
+ fp.Mul(x2, x2, z2)
+ fp.Mul(z2, t0, t1)
+}
+
+func mulA24Generic(z, x *fp.Elt) {
+ const A24 = 121666
+ const n = 8
+ var xx [4]uint64
+ for i := range xx {
+ xx[i] = binary.LittleEndian.Uint64(x[i*n : (i+1)*n])
+ }
+
+ h0, l0 := bits.Mul64(xx[0], A24)
+ h1, l1 := bits.Mul64(xx[1], A24)
+ h2, l2 := bits.Mul64(xx[2], A24)
+ h3, l3 := bits.Mul64(xx[3], A24)
+
+ var c3 uint64
+ l1, c0 := bits.Add64(h0, l1, 0)
+ l2, c1 := bits.Add64(h1, l2, c0)
+ l3, c2 := bits.Add64(h2, l3, c1)
+ l4, _ := bits.Add64(h3, 0, c2)
+ _, l4 = bits.Mul64(l4, 38)
+ l0, c0 = bits.Add64(l0, l4, 0)
+ xx[1], c1 = bits.Add64(l1, 0, c0)
+ xx[2], c2 = bits.Add64(l2, 0, c1)
+ xx[3], c3 = bits.Add64(l3, 0, c2)
+ xx[0], _ = bits.Add64(l0, (-c3)&38, 0)
+ for i := range xx {
+ binary.LittleEndian.PutUint64(z[i*n:(i+1)*n], xx[i])
+ }
+}
diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/curve_noasm.go b/vendor/github.com/cloudflare/circl/dh/x25519/curve_noasm.go
new file mode 100644
index 0000000000..07fab97d2a
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x25519/curve_noasm.go
@@ -0,0 +1,11 @@
+//go:build !amd64 || purego
+// +build !amd64 purego
+
+package x25519
+
+import fp "github.com/cloudflare/circl/math/fp25519"
+
+func double(x, z *fp.Elt) { doubleGeneric(x, z) }
+func diffAdd(w *[5]fp.Elt, b uint) { diffAddGeneric(w, b) }
+func ladderStep(w *[5]fp.Elt, b uint) { ladderStepGeneric(w, b) }
+func mulA24(z, x *fp.Elt) { mulA24Generic(z, x) }
diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/doc.go b/vendor/github.com/cloudflare/circl/dh/x25519/doc.go
new file mode 100644
index 0000000000..3ce102d145
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x25519/doc.go
@@ -0,0 +1,19 @@
+/*
+Package x25519 provides Diffie-Hellman functions as specified in RFC-7748.
+
+Validation of public keys.
+
+The Diffie-Hellman function, as described in RFC-7748 [1], works for any
+public key. However, if a different protocol requires contributory
+behaviour [2,3], then the public keys must be validated against low-order
+points [3,4]. To do that, the Shared function performs this validation
+internally and returns false when the public key is invalid (i.e., it
+is a low-order point).
+
+References:
+ - [1] RFC7748 by Langley, Hamburg, Turner (https://rfc-editor.org/rfc/rfc7748.txt)
+ - [2] Curve25519 by Bernstein (https://cr.yp.to/ecdh.html)
+ - [3] Bernstein (https://cr.yp.to/ecdh.html#validate)
+ - [4] Cremers&Jackson (https://eprint.iacr.org/2019/526)
+*/
+package x25519
diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/key.go b/vendor/github.com/cloudflare/circl/dh/x25519/key.go
new file mode 100644
index 0000000000..c76f72ac7f
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x25519/key.go
@@ -0,0 +1,47 @@
+package x25519
+
+import (
+ "crypto/subtle"
+
+ fp "github.com/cloudflare/circl/math/fp25519"
+)
+
+// Size is the length in bytes of a X25519 key.
+const Size = 32
+
+// Key represents a X25519 key.
+type Key [Size]byte
+
+func (k *Key) clamp(in *Key) *Key {
+ *k = *in
+ k[0] &= 248
+ k[31] = (k[31] & 127) | 64
+ return k
+}
+
+// isValidPubKey verifies if the public key is not a low-order point.
+func (k *Key) isValidPubKey() bool {
+ fp.Modp((*fp.Elt)(k))
+ var isLowOrder int
+ for _, P := range lowOrderPoints {
+ isLowOrder |= subtle.ConstantTimeCompare(P[:], k[:])
+ }
+ return isLowOrder == 0
+}
+
+// KeyGen obtains a public key given a secret key.
+func KeyGen(public, secret *Key) {
+ ladderJoye(public.clamp(secret))
+}
+
+// Shared calculates Alice's shared key from Alice's secret key and Bob's
+// public key returning true on success. A failure case happens when the public
+// key is a low-order point, thus the shared key is all-zeros and the function
+// returns false.
+func Shared(shared, secret, public *Key) bool {
+ validPk := *public
+ validPk[31] &= (1 << (255 % 8)) - 1
+ ok := validPk.isValidPubKey()
+ ladderMontgomery(shared.clamp(secret), &validPk)
+ return ok
+}
diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/table.go b/vendor/github.com/cloudflare/circl/dh/x25519/table.go
new file mode 100644
index 0000000000..28c8c4ac03
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x25519/table.go
@@ -0,0 +1,268 @@
+package x25519
+
+import "github.com/cloudflare/circl/math/fp25519"
+
+// tableGenerator contains the set of points:
+//
+// t[i] = (xi+1)/(xi-1),
+//
+// where (xi,yi) = 2^iG and G is the generator point
+// Size = (256)*(256/8) = 8192 bytes.
+var tableGenerator = [256 * fp25519.Size]byte{
+ /* (2^ 0)P */ 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5f,
+ /* (2^ 1)P */ 0x96, 0xfe, 0xaa, 0x16, 0xf4, 0x20, 0x82, 0x6b, 0x34, 0x6a, 0x56, 0x4f, 0x2b, 0xeb, 0xeb, 0x82, 0x0f, 0x95, 0xa5, 0x75, 0xb0, 0xa5, 0xa9, 0xd5, 0xf4, 0x88, 0x24, 0x4b, 0xcf, 0xb2, 0x42, 0x51,
+ /* (2^ 2)P */ 0x0c, 0x68, 0x69, 0x00, 0x75, 0xbc, 0xae, 0x6a, 0x41, 0x9c, 0xf9, 0xa0, 0x20, 0x78, 0xcf, 0x89, 0xf4, 0xd0, 0x56, 0x3b, 0x18, 0xd9, 0x58, 0x2a, 0xa4, 0x11, 0x60, 0xe3, 0x80, 0xca, 0x5a, 0x4b,
+ /* (2^ 3)P */ 0x5d, 0x74, 0x29, 0x8c, 0x34, 0x32, 0x91, 0x32, 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 0x53, 0x47,
+ /* (2^126)P */ 0x87, 0xc5, 0x78, 0x42, 0x0a, 0x63, 0xec, 0xe1, 0xf3, 0x83, 0x8e, 0xca, 0x46, 0xd5, 0x07, 0x55, 0x2b, 0x0c, 0xdc, 0x3a, 0xc6, 0x35, 0xe1, 0x85, 0x4e, 0x84, 0x82, 0x56, 0xa8, 0xef, 0xa7, 0x0a,
+ /* (2^127)P */ 0x15, 0xf6, 0xe1, 0xb3, 0xa8, 0x1b, 0x69, 0x72, 0xfa, 0x3f, 0xbe, 0x1f, 0x70, 0xe9, 0xb4, 0x32, 0x68, 0x78, 0xbb, 0x39, 0x2e, 0xd9, 0xb6, 0x97, 0xe8, 0x39, 0x2e, 0xa0, 0xde, 0x53, 0xfe, 0x2c,
+ /* (2^128)P */ 0xb0, 0x52, 0xcd, 0x85, 0xcd, 0x92, 0x73, 0x68, 0x31, 0x98, 0xe2, 0x10, 0xc9, 0x66, 0xff, 0x27, 0x06, 0x2d, 0x83, 0xa9, 0x56, 0x45, 0x13, 0x97, 0xa0, 0xf8, 0x84, 0x0a, 0x36, 0xb0, 0x9b, 0x26,
+ /* (2^129)P */ 0x5c, 0xf8, 0x43, 0x76, 0x45, 0x55, 0x6e, 0x70, 0x1b, 0x7d, 0x59, 0x9b, 0x8c, 0xa4, 0x34, 0x37, 0x72, 0xa4, 0xef, 0xc6, 0xe8, 0x91, 0xee, 0x7a, 0xe0, 0xd9, 0xa9, 0x98, 0xc1, 0xab, 0xd6, 0x5c,
+ /* (2^130)P */ 0x1a, 0xe4, 0x3c, 0xcb, 0x06, 0xde, 0x04, 0x0e, 0x38, 0xe1, 0x02, 0x34, 0x89, 0xeb, 0xc6, 0xd8, 0x72, 0x37, 0x6e, 0x68, 0xbb, 0x59, 0x46, 0x90, 0xc8, 0xa8, 0x6b, 0x74, 0x71, 0xc3, 0x15, 0x72,
+ /* (2^131)P */ 0xd9, 0xa2, 0xe4, 0xea, 0x7e, 0xa9, 0x12, 0xfd, 0xc5, 0xf2, 0x94, 0x63, 0x51, 0xb7, 0x14, 0x95, 0x94, 0xf2, 0x08, 0x92, 0x80, 0xd5, 0x6f, 0x26, 0xb9, 0x26, 0x9a, 0x61, 0x85, 0x70, 0x84, 0x5c,
+ /* (2^132)P */ 0xea, 0x94, 0xd6, 0xfe, 0x10, 0x54, 0x98, 0x52, 0x54, 0xd2, 0x2e, 0x4a, 0x93, 0x5b, 0x90, 0x3c, 0x67, 0xe4, 0x3b, 0x2d, 0x69, 0x47, 0xbb, 0x10, 0xe1, 0xe9, 0xe5, 0x69, 0x2d, 0x3d, 0x3b, 0x06,
+ /* (2^133)P */ 0xeb, 0x7d, 0xa5, 0xdd, 0xee, 0x26, 0x27, 0x47, 0x91, 0x18, 0xf4, 0x10, 0xae, 0xc4, 0xb6, 0xef, 0x14, 0x76, 0x30, 0x7b, 0x91, 0x41, 0x16, 0x2b, 0x7c, 0x5b, 0xf4, 0xc4, 0x4f, 0x55, 0x7c, 0x11,
+ /* (2^134)P */ 0x12, 0x88, 0x9d, 0x8f, 0x11, 0xf3, 0x7c, 0xc0, 0x39, 0x79, 0x01, 0x50, 0x20, 0xd8, 0xdb, 0x01, 0x27, 0x28, 0x1b, 0x17, 0xf4, 0x03, 0xe8, 0xd7, 0xea, 0x25, 0xd2, 0x87, 0x74, 0xe8, 0x15, 0x10,
+ /* (2^135)P */ 0x4d, 0xcc, 0x3a, 0xd2, 0xfe, 0xe3, 0x8d, 0xc5, 0x2d, 0xbe, 0xa7, 0x94, 0xc2, 0x91, 0xdb, 0x50, 0x57, 0xf4, 0x9c, 0x1c, 0x3d, 0xd4, 0x94, 0x0b, 0x4a, 0x52, 0x37, 0x6e, 0xfa, 0x40, 0x16, 0x6b,
+ /* (2^136)P */ 0x09, 0x0d, 0xda, 0x5f, 0x6c, 0x34, 0x2f, 0x69, 0x51, 0x31, 0x4d, 0xfa, 0x59, 0x1c, 0x0b, 0x20, 0x96, 0xa2, 0x77, 0x07, 0x76, 0x6f, 0xc4, 0xb8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^185)P */ 0xdb, 0x20, 0x19, 0xba, 0x88, 0x83, 0xfe, 0x03, 0x08, 0xb0, 0x0d, 0x15, 0x32, 0x7c, 0xd5, 0xf5, 0x29, 0x0c, 0xf6, 0x1a, 0x28, 0xc4, 0xc8, 0x49, 0xee, 0x1a, 0x70, 0xde, 0x18, 0xb5, 0xed, 0x21,
+ /* (2^186)P */ 0x99, 0xdc, 0x06, 0x8f, 0x41, 0x3e, 0xb6, 0x7f, 0xb8, 0xd7, 0x66, 0xc1, 0x99, 0x0d, 0x46, 0xa4, 0x83, 0x0a, 0x52, 0xce, 0x48, 0x52, 0xdd, 0x24, 0x58, 0x83, 0x92, 0x2b, 0x71, 0xad, 0xc3, 0x5e,
+ /* (2^187)P */ 0x0f, 0x93, 0x17, 0xbd, 0x5f, 0x2a, 0x02, 0x15, 0xe3, 0x70, 0x25, 0xd8, 0x77, 0x4a, 0xf6, 0xa4, 0x12, 0x37, 0x78, 0x15, 0x69, 0x8d, 0xbc, 0x12, 0xbb, 0x0a, 0x62, 0xfc, 0xc0, 0x94, 0x81, 0x49,
+ /* (2^188)P */ 0x82, 0x6c, 0x68, 0x55, 0xd2, 0xd9, 0xa2, 0x38, 0xf0, 0x21, 0x3e, 0x19, 0xd9, 0x6b, 0x5c, 0x78, 0x84, 0x54, 0x4a, 0xb2, 0x1a, 0xc8, 0xd5, 0xe4, 0x89, 0x09, 0xe2, 0xb2, 0x60, 0x78, 0x30, 0x56,
+ /* (2^189)P */ 0xc4, 0x74, 0x4d, 0x8b, 0xf7, 0x55, 0x9d, 0x42, 0x31, 0x01, 0x35, 0x43, 0x46, 0x83, 0xf1, 0x22, 0xff, 0x1f, 0xc7, 0x98, 0x45, 0xc2, 0x60, 0x1e, 0xef, 0x83, 0x99, 0x97, 0x14, 0xf0, 0xf2, 0x59,
+ /* (2^190)P */ 0x44, 0x4a, 0x49, 0xeb, 0x56, 0x7d, 0xa4, 0x46, 0x8e, 0xa1, 0x36, 0xd6, 0x54, 0xa8, 0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 0xa0, 0x34, 0xeb, 0xdd, 0x73, 0xb7, 0x64, 0xeb, 0xcc, 0xce, 0x29, 0x51,
+ /* (2^223)P */ 0x20, 0x35, 0x99, 0x94, 0x58, 0x21, 0x43, 0xee, 0x3b, 0x0b, 0x4c, 0xf1, 0x7c, 0x9c, 0x2f, 0x77, 0xd5, 0xda, 0xbe, 0x06, 0xe3, 0xfc, 0xe2, 0xd2, 0x97, 0x6a, 0xf0, 0x46, 0xb5, 0x42, 0x5f, 0x71,
+ /* (2^224)P */ 0x1a, 0x5f, 0x5b, 0xda, 0xce, 0xcd, 0x4e, 0x43, 0xa9, 0x41, 0x97, 0xa4, 0x15, 0x71, 0xa1, 0x0d, 0x2e, 0xad, 0xed, 0x73, 0x7c, 0xd7, 0x0b, 0x68, 0x41, 0x90, 0xdd, 0x4e, 0x35, 0x02, 0x7c, 0x48,
+ /* (2^225)P */ 0xc4, 0xd9, 0x0e, 0xa7, 0xf3, 0xef, 0xef, 0xb8, 0x02, 0xe3, 0x57, 0xe8, 0xa3, 0x2a, 0xa3, 0x56, 0xa0, 0xa5, 0xa2, 0x48, 0xbd, 0x68, 0x3a, 0xdf, 0x44, 0xc4, 0x76, 0x31, 0xb7, 0x50, 0xf6, 0x07,
+ /* (2^226)P */ 0xb1, 0xcc, 0xe0, 0x26, 0x16, 0x9b, 0x8b, 0xe3, 0x36, 0xfb, 0x09, 0x8b, 0xc1, 0x53, 0xe0, 0x79, 0x64, 0x49, 0xf9, 0xc9, 0x19, 0x03, 0xd9, 0x56, 0xc4, 0xf5, 0x9f, 0xac, 0xe7, 0x41, 0xa9, 0x1c,
+ /* (2^227)P */ 0xbb, 0xa0, 0x2f, 0x16, 0x29, 0xdf, 0xc4, 0x49, 0x05, 0x33, 0xb3, 0x82, 0x32, 0xcf, 0x88, 0x84, 0x7d, 0x43, 0xbb, 0xca, 0x14, 0xda, 0xdf, 0x95, 0x86, 0xad, 0xd5, 0x64, 0x82, 0xf7, 0x91, 0x33,
+ /* (2^228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, 0x7b, 0x79, 0x1d, 0x34, 0x68, 0x6f, 0x05,
+ /* (2^239)P */ 0x27, 0x23, 0xfd, 0x7e, 0x75, 0xd6, 0x79, 0x5e, 0x15, 0xfe, 0x3a, 0x55, 0xb6, 0xbc, 0xbd, 0xfa, 0x60, 0x5a, 0xaf, 0x6e, 0x2c, 0x22, 0xe7, 0xd3, 0x3b, 0x74, 0xae, 0x4d, 0x6d, 0xc7, 0x46, 0x70,
+ /* (2^240)P */ 0x55, 0x4a, 0x8d, 0xb1, 0x72, 0xe8, 0x0b, 0x66, 0x96, 0x14, 0x4e, 0x57, 0x18, 0x25, 0x99, 0x19, 0xbb, 0xdc, 0x2b, 0x30, 0x3a, 0x05, 0x03, 0xc1, 0x8e, 0x8e, 0x21, 0x0b, 0x80, 0xe9, 0xd8, 0x3e,
+ /* (2^241)P */ 0x3e, 0xe0, 0x75, 0xfa, 0x39, 0x92, 0x0b, 0x7b, 0x83, 0xc0, 0x33, 0x46, 0x68, 0xfb, 0xe9, 0xef, 0x93, 0x77, 0x1a, 0x39, 0xbe, 0x5f, 0xa3, 0x98, 0x34, 0xfe, 0xd0, 0xe2, 0x0f, 0x51, 0x65, 0x60,
+ /* (2^242)P */ 0x0c, 0xad, 0xab, 0x48, 0x85, 0x66, 0xcb, 0x55, 0x27, 0xe5, 0x87, 0xda, 0x48, 0x45, 0x58, 0xb4, 0xdd, 0xc1, 0x07, 0x01, 0xea, 0xec, 0x43, 0x2c, 0x35, 0xde, 0x72, 0x93, 0x80, 0x28, 0x60, 0x52,
+ /* (2^243)P */ 0x1f, 0x3b, 0x21, 0xf9, 0x6a, 0xc5, 0x15, 0x34, 0xdb, 0x98, 0x7e, 0x01, 0x4d, 0x1a, 0xee, 0x5b, 0x9b, 0x70, 0xcf, 0xb5, 0x05, 0xb1, 0xf6, 0x13, 0xb6, 0x9a, 0xb2, 0x82, 0x34, 0x0e, 0xf2, 0x5f,
+ /* (2^244)P */ 0x90, 0x6c, 0x2e, 0xcc, 0x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 0x35, 0x03, 0xbe, 0x6b,
+ /* (2^255)P */ 0x44, 0x43, 0x98, 0x53, 0xbe, 0xdc, 0x7f, 0x66, 0xa8, 0x49, 0x59, 0x00, 0x1c, 0xbc, 0x72, 0x07, 0x8e, 0xd6, 0xbe, 0x4e, 0x9f, 0xa4, 0x07, 0xba, 0xbf, 0x30, 0xdf, 0xba, 0x85, 0xb0, 0xa7, 0x1f,
+}
diff --git a/vendor/github.com/cloudflare/circl/dh/x448/curve.go b/vendor/github.com/cloudflare/circl/dh/x448/curve.go
new file mode 100644
index 0000000000..d59564e4b4
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x448/curve.go
@@ -0,0 +1,104 @@
+package x448
+
+import (
+ fp "github.com/cloudflare/circl/math/fp448"
+)
+
+// ladderJoye calculates a fixed-point multiplication with the generator point.
+// The algorithm is the right-to-left Joye's ladder as described
+// in "How to precompute a ladder" in SAC'2017.
+func ladderJoye(k *Key) {
+ w := [5]fp.Elt{} // [mu,x1,z1,x2,z2] order must be preserved.
+ w[1] = fp.Elt{ // x1 = S
+ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ }
+ fp.SetOne(&w[2]) // z1 = 1
+ w[3] = fp.Elt{ // x2 = G-S
+ 0x20, 0x27, 0x9d, 0xc9, 0x7d, 0x19, 0xb1, 0xac,
+ 0xf8, 0xba, 0x69, 0x1c, 0xff, 0x33, 0xac, 0x23,
+ 0x51, 0x1b, 0xce, 0x3a, 0x64, 0x65, 0xbd, 0xf1,
+ 0x23, 0xf8, 0xc1, 0x84, 0x9d, 0x45, 0x54, 0x29,
+ 0x67, 0xb9, 0x81, 0x1c, 0x03, 0xd1, 0xcd, 0xda,
+ 0x7b, 0xeb, 0xff, 0x1a, 0x88, 0x03, 0xcf, 0x3a,
+ 0x42, 0x44, 0x32, 0x01, 0x25, 0xb7, 0xfa, 0xf0,
+ }
+ fp.SetOne(&w[4]) // z2 = 1
+
+ const n = 448
+ const h = 2
+ swap := uint(1)
+ for s := 0; s < n-h; s++ {
+ i := (s + h) / 8
+ j := (s + h) % 8
+ bit := uint((k[i] >> uint(j)) & 1)
+ copy(w[0][:], tableGenerator[s*Size:(s+1)*Size])
+ diffAdd(&w, swap^bit)
+ swap = bit
+ }
+ for s := 0; s < h; s++ {
+ double(&w[1], &w[2])
+ }
+ toAffine((*[fp.Size]byte)(k), &w[1], &w[2])
+}
+
+// ladderMontgomery calculates a generic scalar point multiplication
+// The algorithm implemented is the left-to-right Montgomery's ladder.
+func ladderMontgomery(k, xP *Key) {
+ w := [5]fp.Elt{} // [x1, x2, z2, x3, z3] order must be preserved.
+ w[0] = *(*fp.Elt)(xP) // x1 = xP
+ fp.SetOne(&w[1]) // x2 = 1
+ w[3] = *(*fp.Elt)(xP) // x3 = xP
+ fp.SetOne(&w[4]) // z3 = 1
+
+ move := uint(0)
+ for s := 448 - 1; s >= 0; s-- {
+ i := s / 8
+ j := s % 8
+ bit := uint((k[i] >> uint(j)) & 1)
+ ladderStep(&w, move^bit)
+ move = bit
+ }
+ toAffine((*[fp.Size]byte)(k), &w[1], &w[2])
+}
+
+func toAffine(k *[fp.Size]byte, x, z *fp.Elt) {
+ fp.Inv(z, z)
+ fp.Mul(x, x, z)
+ _ = fp.ToBytes(k[:], x)
+}
+
+var lowOrderPoints = [3]fp.Elt{
+ { /* (0,_,1) point of order 2 on Curve448 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ },
+ { /* (1,_,1) a point of order 4 on the twist of Curve448 */
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ },
+ { /* (-1,_,1) point of order 4 on Curve448 */
+ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ },
+}
diff --git a/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.go b/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.go
new file mode 100644
index 0000000000..a062266613
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.go
@@ -0,0 +1,30 @@
+//go:build amd64 && !purego
+// +build amd64,!purego
+
+package x448
+
+import (
+ fp "github.com/cloudflare/circl/math/fp448"
+ "golang.org/x/sys/cpu"
+)
+
+var hasBmi2Adx = cpu.X86.HasBMI2 && cpu.X86.HasADX
+
+var _ = hasBmi2Adx
+
+func double(x, z *fp.Elt) { doubleAmd64(x, z) }
+func diffAdd(w *[5]fp.Elt, b uint) { diffAddAmd64(w, b) }
+func ladderStep(w *[5]fp.Elt, b uint) { ladderStepAmd64(w, b) }
+func mulA24(z, x *fp.Elt) { mulA24Amd64(z, x) }
+
+//go:noescape
+func doubleAmd64(x, z *fp.Elt)
+
+//go:noescape
+func diffAddAmd64(w *[5]fp.Elt, b uint)
+
+//go:noescape
+func ladderStepAmd64(w *[5]fp.Elt, b uint)
+
+//go:noescape
+func mulA24Amd64(z, x *fp.Elt)
diff --git a/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.h b/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.h
new file mode 100644
index 0000000000..8c1ae4d0fb
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.h
@@ -0,0 +1,111 @@
+#define ladderStepLeg \
+ addSub(x2,z2) \
+ addSub(x3,z3) \
+ integerMulLeg(b0,x2,z3) \
+ integerMulLeg(b1,x3,z2) \
+ reduceFromDoubleLeg(t0,b0) \
+ reduceFromDoubleLeg(t1,b1) \
+ addSub(t0,t1) \
+ cselect(x2,x3,regMove) \
+ cselect(z2,z3,regMove) \
+ integerSqrLeg(b0,t0) \
+ integerSqrLeg(b1,t1) \
+ reduceFromDoubleLeg(x3,b0) \
+ reduceFromDoubleLeg(z3,b1) \
+ integerMulLeg(b0,x1,z3) \
+ reduceFromDoubleLeg(z3,b0) \
+ integerSqrLeg(b0,x2) \
+ integerSqrLeg(b1,z2) \
+ reduceFromDoubleLeg(x2,b0) \
+ reduceFromDoubleLeg(z2,b1) \
+ subtraction(t0,x2,z2) \
+ multiplyA24Leg(t1,t0) \
+ additionLeg(t1,t1,z2) \
+ integerMulLeg(b0,x2,z2) \
+ integerMulLeg(b1,t0,t1) \
+ reduceFromDoubleLeg(x2,b0) \
+ reduceFromDoubleLeg(z2,b1)
+
+#define ladderStepBmi2Adx \
+ addSub(x2,z2) \
+ addSub(x3,z3) \
+ integerMulAdx(b0,x2,z3) \
+ integerMulAdx(b1,x3,z2) \
+ reduceFromDoubleAdx(t0,b0) \
+ reduceFromDoubleAdx(t1,b1) \
+ addSub(t0,t1) \
+ cselect(x2,x3,regMove) \
+ cselect(z2,z3,regMove) \
+ integerSqrAdx(b0,t0) \
+ integerSqrAdx(b1,t1) \
+ reduceFromDoubleAdx(x3,b0) \
+ reduceFromDoubleAdx(z3,b1) \
+ integerMulAdx(b0,x1,z3) \
+ reduceFromDoubleAdx(z3,b0) \
+ integerSqrAdx(b0,x2) \
+ integerSqrAdx(b1,z2) \
+ reduceFromDoubleAdx(x2,b0) \
+ reduceFromDoubleAdx(z2,b1) \
+ subtraction(t0,x2,z2) \
+ multiplyA24Adx(t1,t0) \
+ additionAdx(t1,t1,z2) \
+ integerMulAdx(b0,x2,z2) \
+ integerMulAdx(b1,t0,t1) \
+ reduceFromDoubleAdx(x2,b0) \
+ reduceFromDoubleAdx(z2,b1)
+
+#define difAddLeg \
+ addSub(x1,z1) \
+ integerMulLeg(b0,z1,ui) \
+ reduceFromDoubleLeg(z1,b0) \
+ addSub(x1,z1) \
+ integerSqrLeg(b0,x1) \
+ integerSqrLeg(b1,z1) \
+ reduceFromDoubleLeg(x1,b0) \
+ reduceFromDoubleLeg(z1,b1) \
+ integerMulLeg(b0,x1,z2) \
+ integerMulLeg(b1,z1,x2) \
+ reduceFromDoubleLeg(x1,b0) \
+ reduceFromDoubleLeg(z1,b1)
+
+#define difAddBmi2Adx \
+ addSub(x1,z1) \
+ integerMulAdx(b0,z1,ui) \
+ reduceFromDoubleAdx(z1,b0) \
+ addSub(x1,z1) \
+ integerSqrAdx(b0,x1) \
+ integerSqrAdx(b1,z1) \
+ reduceFromDoubleAdx(x1,b0) \
+ reduceFromDoubleAdx(z1,b1) \
+ integerMulAdx(b0,x1,z2) \
+ integerMulAdx(b1,z1,x2) \
+ reduceFromDoubleAdx(x1,b0) \
+ reduceFromDoubleAdx(z1,b1)
+
+#define doubleLeg \
+ addSub(x1,z1) \
+ integerSqrLeg(b0,x1) \
+ integerSqrLeg(b1,z1) \
+ reduceFromDoubleLeg(x1,b0) \
+ reduceFromDoubleLeg(z1,b1) \
+ subtraction(t0,x1,z1) \
+ multiplyA24Leg(t1,t0) \
+ additionLeg(t1,t1,z1) \
+ integerMulLeg(b0,x1,z1) \
+ integerMulLeg(b1,t0,t1) \
+ reduceFromDoubleLeg(x1,b0) \
+ reduceFromDoubleLeg(z1,b1)
+
+#define doubleBmi2Adx \
+ addSub(x1,z1) \
+ integerSqrAdx(b0,x1) \
+ integerSqrAdx(b1,z1) \
+ reduceFromDoubleAdx(x1,b0) \
+ reduceFromDoubleAdx(z1,b1) \
+ subtraction(t0,x1,z1) \
+ multiplyA24Adx(t1,t0) \
+ additionAdx(t1,t1,z1) \
+ integerMulAdx(b0,x1,z1) \
+ integerMulAdx(b1,t0,t1) \
+ reduceFromDoubleAdx(x1,b0) \
+ reduceFromDoubleAdx(z1,b1)
diff --git a/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.s b/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.s
new file mode 100644
index 0000000000..ed33ba3d03
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.s
@@ -0,0 +1,194 @@
+//go:build amd64 && !purego
+// +build amd64,!purego
+
+#include "textflag.h"
+
+// Depends on circl/math/fp448 package
+#include "../../math/fp448/fp_amd64.h"
+#include "curve_amd64.h"
+
+// CTE_A24 is (A+2)/4 from Curve448
+#define CTE_A24 39082
+
+#define Size 56
+
+// multiplyA24Leg multiplies x times CTE_A24 and stores in z
+// Uses: AX, DX, R8-R15, FLAGS
+// Instr: x86_64, cmov, adx
+#define multiplyA24Leg(z,x) \
+ MOVQ $CTE_A24, R15; \
+ MOVQ 0+x, AX; MULQ R15; MOVQ AX, R8; ;;;;;;;;;;;; MOVQ DX, R9; \
+ MOVQ 8+x, AX; MULQ R15; ADDQ AX, R9; ADCQ $0, DX; MOVQ DX, R10; \
+ MOVQ 16+x, AX; MULQ R15; ADDQ AX, R10; ADCQ $0, DX; MOVQ DX, R11; \
+ MOVQ 24+x, AX; MULQ R15; ADDQ AX, R11; ADCQ $0, DX; MOVQ DX, R12; \
+ MOVQ 32+x, AX; MULQ R15; ADDQ AX, R12; ADCQ $0, DX; MOVQ DX, R13; \
+ MOVQ 40+x, AX; MULQ R15; ADDQ AX, R13; ADCQ $0, DX; MOVQ DX, R14; \
+ MOVQ 48+x, AX; MULQ R15; ADDQ AX, R14; ADCQ $0, DX; \
+ MOVQ DX, AX; \
+ SHLQ $32, AX; \
+ ADDQ DX, R8; MOVQ $0, DX; \
+ ADCQ $0, R9; \
+ ADCQ $0, R10; \
+ ADCQ AX, R11; \
+ ADCQ $0, R12; \
+ ADCQ $0, R13; \
+ ADCQ $0, R14; \
+ ADCQ $0, DX; \
+ MOVQ DX, AX; \
+ SHLQ $32, AX; \
+ ADDQ DX, R8; \
+ ADCQ $0, R9; \
+ ADCQ $0, R10; \
+ ADCQ AX, R11; \
+ ADCQ $0, R12; \
+ ADCQ $0, R13; \
+ ADCQ $0, R14; \
+ MOVQ R8, 0+z; \
+ MOVQ R9, 8+z; \
+ MOVQ R10, 16+z; \
+ MOVQ R11, 24+z; \
+ MOVQ R12, 32+z; \
+ MOVQ R13, 40+z; \
+ MOVQ R14, 48+z;
+
+// multiplyA24Adx multiplies x times CTE_A24 and stores in z
+// Uses: AX, DX, R8-R14, FLAGS
+// Instr: x86_64, bmi2
+#define multiplyA24Adx(z,x) \
+ MOVQ $CTE_A24, DX; \
+ MULXQ 0+x, R8, R9; \
+ MULXQ 8+x, AX, R10; ADDQ AX, R9; \
+ MULXQ 16+x, AX, R11; ADCQ AX, R10; \
+ MULXQ 24+x, AX, R12; ADCQ AX, R11; \
+ MULXQ 32+x, AX, R13; ADCQ AX, R12; \
+ MULXQ 40+x, AX, R14; ADCQ AX, R13; \
+ MULXQ 48+x, AX, DX; ADCQ AX, R14; \
+ ;;;;;;;;;;;;;;;;;;;; ADCQ $0, DX; \
+ MOVQ DX, AX; \
+ SHLQ $32, AX; \
+ ADDQ DX, R8; MOVQ $0, DX; \
+ ADCQ $0, R9; \
+ ADCQ $0, R10; \
+ ADCQ AX, R11; \
+ ADCQ $0, R12; \
+ ADCQ $0, R13; \
+ ADCQ $0, R14; \
+ ADCQ $0, DX; \
+ MOVQ DX, AX; \
+ SHLQ $32, AX; \
+ ADDQ DX, R8; \
+ ADCQ $0, R9; \
+ ADCQ $0, R10; \
+ ADCQ AX, R11; \
+ ADCQ $0, R12; \
+ ADCQ $0, R13; \
+ ADCQ $0, R14; \
+ MOVQ R8, 0+z; \
+ MOVQ R9, 8+z; \
+ MOVQ R10, 16+z; \
+ MOVQ R11, 24+z; \
+ MOVQ R12, 32+z; \
+ MOVQ R13, 40+z; \
+ MOVQ R14, 48+z;
+
+#define mulA24Legacy \
+ multiplyA24Leg(0(DI),0(SI))
+#define mulA24Bmi2Adx \
+ multiplyA24Adx(0(DI),0(SI))
+
+// func mulA24Amd64(z, x *fp448.Elt)
+TEXT ·mulA24Amd64(SB),NOSPLIT,$0-16
+ MOVQ z+0(FP), DI
+ MOVQ x+8(FP), SI
+ CHECK_BMI2ADX(LMA24, mulA24Legacy, mulA24Bmi2Adx)
+
+// func ladderStepAmd64(w *[5]fp448.Elt, b uint)
+// ladderStepAmd64 calculates a point addition and doubling as follows:
+// (x2,z2) = 2*(x2,z2) and (x3,z3) = (x2,z2)+(x3,z3) using as a difference (x1,-).
+// w = {x1,x2,z2,x3,z4} are five fp255.Elt of 56 bytes.
+// stack = (t0,t1) are two fp.Elt of fp.Size bytes, and
+// (b0,b1) are two-double precision fp.Elt of 2*fp.Size bytes.
+TEXT ·ladderStepAmd64(SB),NOSPLIT,$336-16
+ // Parameters
+ #define regWork DI
+ #define regMove SI
+ #define x1 0*Size(regWork)
+ #define x2 1*Size(regWork)
+ #define z2 2*Size(regWork)
+ #define x3 3*Size(regWork)
+ #define z3 4*Size(regWork)
+ // Local variables
+ #define t0 0*Size(SP)
+ #define t1 1*Size(SP)
+ #define b0 2*Size(SP)
+ #define b1 4*Size(SP)
+ MOVQ w+0(FP), regWork
+ MOVQ b+8(FP), regMove
+ CHECK_BMI2ADX(LLADSTEP, ladderStepLeg, ladderStepBmi2Adx)
+ #undef regWork
+ #undef regMove
+ #undef x1
+ #undef x2
+ #undef z2
+ #undef x3
+ #undef z3
+ #undef t0
+ #undef t1
+ #undef b0
+ #undef b1
+
+// func diffAddAmd64(work *[5]fp.Elt, swap uint)
+// diffAddAmd64 calculates a differential point addition using a precomputed point.
+// (x1,z1) = (x1,z1)+(mu) using a difference point (x2,z2)
+// work = {mu,x1,z1,x2,z2} are five fp448.Elt of 56 bytes, and
+// stack = (b0,b1) are two-double precision fp.Elt of 2*fp.Size bytes.
+// This is Equation 7 at https://eprint.iacr.org/2017/264.
+TEXT ·diffAddAmd64(SB),NOSPLIT,$224-16
+ // Parameters
+ #define regWork DI
+ #define regSwap SI
+ #define ui 0*Size(regWork)
+ #define x1 1*Size(regWork)
+ #define z1 2*Size(regWork)
+ #define x2 3*Size(regWork)
+ #define z2 4*Size(regWork)
+ // Local variables
+ #define b0 0*Size(SP)
+ #define b1 2*Size(SP)
+ MOVQ w+0(FP), regWork
+ MOVQ b+8(FP), regSwap
+ cswap(x1,x2,regSwap)
+ cswap(z1,z2,regSwap)
+ CHECK_BMI2ADX(LDIFADD, difAddLeg, difAddBmi2Adx)
+ #undef regWork
+ #undef regSwap
+ #undef ui
+ #undef x1
+ #undef z1
+ #undef x2
+ #undef z2
+ #undef b0
+ #undef b1
+
+// func doubleAmd64(x, z *fp448.Elt)
+// doubleAmd64 calculates a point doubling (x1,z1) = 2*(x1,z1).
+// stack = (t0,t1) are two fp.Elt of fp.Size bytes, and
+// (b0,b1) are two-double precision fp.Elt of 2*fp.Size bytes.
+TEXT ·doubleAmd64(SB),NOSPLIT,$336-16
+ // Parameters
+ #define x1 0(DI)
+ #define z1 0(SI)
+ // Local variables
+ #define t0 0*Size(SP)
+ #define t1 1*Size(SP)
+ #define b0 2*Size(SP)
+ #define b1 4*Size(SP)
+ MOVQ x+0(FP), DI
+ MOVQ z+8(FP), SI
+ CHECK_BMI2ADX(LDOUB,doubleLeg,doubleBmi2Adx)
+ #undef x1
+ #undef z1
+ #undef t0
+ #undef t1
+ #undef b0
+ #undef b1
diff --git a/vendor/github.com/cloudflare/circl/dh/x448/curve_generic.go b/vendor/github.com/cloudflare/circl/dh/x448/curve_generic.go
new file mode 100644
index 0000000000..b0b65ccf7e
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x448/curve_generic.go
@@ -0,0 +1,100 @@
+package x448
+
+import (
+ "encoding/binary"
+ "math/bits"
+
+ "github.com/cloudflare/circl/math/fp448"
+)
+
+func doubleGeneric(x, z *fp448.Elt) {
+ t0, t1 := &fp448.Elt{}, &fp448.Elt{}
+ fp448.AddSub(x, z)
+ fp448.Sqr(x, x)
+ fp448.Sqr(z, z)
+ fp448.Sub(t0, x, z)
+ mulA24Generic(t1, t0)
+ fp448.Add(t1, t1, z)
+ fp448.Mul(x, x, z)
+ fp448.Mul(z, t0, t1)
+}
+
+func diffAddGeneric(w *[5]fp448.Elt, b uint) {
+ mu, x1, z1, x2, z2 := &w[0], &w[1], &w[2], &w[3], &w[4]
+ fp448.Cswap(x1, x2, b)
+ fp448.Cswap(z1, z2, b)
+ fp448.AddSub(x1, z1)
+ fp448.Mul(z1, z1, mu)
+ fp448.AddSub(x1, z1)
+ fp448.Sqr(x1, x1)
+ fp448.Sqr(z1, z1)
+ fp448.Mul(x1, x1, z2)
+ fp448.Mul(z1, z1, x2)
+}
+
+func ladderStepGeneric(w *[5]fp448.Elt, b uint) {
+ x1, x2, z2, x3, z3 := &w[0], &w[1], &w[2], &w[3], &w[4]
+ t0 := &fp448.Elt{}
+ t1 := &fp448.Elt{}
+ fp448.AddSub(x2, z2)
+ fp448.AddSub(x3, z3)
+ fp448.Mul(t0, x2, z3)
+ fp448.Mul(t1, x3, z2)
+ fp448.AddSub(t0, t1)
+ fp448.Cmov(x2, x3, b)
+ fp448.Cmov(z2, z3, b)
+ fp448.Sqr(x3, t0)
+ fp448.Sqr(z3, t1)
+ fp448.Mul(z3, x1, z3)
+ fp448.Sqr(x2, x2)
+ fp448.Sqr(z2, z2)
+ fp448.Sub(t0, x2, z2)
+ mulA24Generic(t1, t0)
+ fp448.Add(t1, t1, z2)
+ fp448.Mul(x2, x2, z2)
+ fp448.Mul(z2, t0, t1)
+}
+
+func mulA24Generic(z, x *fp448.Elt) {
+ const A24 = 39082
+ const n = 8
+ var xx [7]uint64
+ for i := range xx {
+ xx[i] = binary.LittleEndian.Uint64(x[i*n : (i+1)*n])
+ }
+ h0, l0 := bits.Mul64(xx[0], A24)
+ h1, l1 := bits.Mul64(xx[1], A24)
+ h2, l2 := bits.Mul64(xx[2], A24)
+ h3, l3 := bits.Mul64(xx[3], A24)
+ h4, l4 := bits.Mul64(xx[4], A24)
+ h5, l5 := bits.Mul64(xx[5], A24)
+ h6, l6 := bits.Mul64(xx[6], A24)
+
+ l1, c0 := bits.Add64(h0, l1, 0)
+ l2, c1 := bits.Add64(h1, l2, c0)
+ l3, c2 := bits.Add64(h2, l3, c1)
+ l4, c3 := bits.Add64(h3, l4, c2)
+ l5, c4 := bits.Add64(h4, l5, c3)
+ l6, c5 := bits.Add64(h5, l6, c4)
+ l7, _ := bits.Add64(h6, 0, c5)
+
+ l0, c0 = bits.Add64(l0, l7, 0)
+ l1, c1 = bits.Add64(l1, 0, c0)
+ l2, c2 = bits.Add64(l2, 0, c1)
+ l3, c3 = bits.Add64(l3, l7<<32, c2)
+ l4, c4 = bits.Add64(l4, 0, c3)
+ l5, c5 = bits.Add64(l5, 0, c4)
+ l6, l7 = bits.Add64(l6, 0, c5)
+
+ xx[0], c0 = bits.Add64(l0, l7, 0)
+ xx[1], c1 = bits.Add64(l1, 0, c0)
+ xx[2], c2 = bits.Add64(l2, 0, c1)
+ xx[3], c3 = bits.Add64(l3, l7<<32, c2)
+ xx[4], c4 = bits.Add64(l4, 0, c3)
+ xx[5], c5 = bits.Add64(l5, 0, c4)
+ xx[6], _ = bits.Add64(l6, 0, c5)
+
+ for i := range xx {
+ binary.LittleEndian.PutUint64(z[i*n:(i+1)*n], xx[i])
+ }
+}
diff --git a/vendor/github.com/cloudflare/circl/dh/x448/curve_noasm.go b/vendor/github.com/cloudflare/circl/dh/x448/curve_noasm.go
new file mode 100644
index 0000000000..3755b7c83b
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x448/curve_noasm.go
@@ -0,0 +1,11 @@
+//go:build !amd64 || purego
+// +build !amd64 purego
+
+package x448
+
+import fp "github.com/cloudflare/circl/math/fp448"
+
+func double(x, z *fp.Elt) { doubleGeneric(x, z) }
+func diffAdd(w *[5]fp.Elt, b uint) { diffAddGeneric(w, b) }
+func ladderStep(w *[5]fp.Elt, b uint) { ladderStepGeneric(w, b) }
+func mulA24(z, x *fp.Elt) { mulA24Generic(z, x) }
diff --git a/vendor/github.com/cloudflare/circl/dh/x448/doc.go b/vendor/github.com/cloudflare/circl/dh/x448/doc.go
new file mode 100644
index 0000000000..c02904feda
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x448/doc.go
@@ -0,0 +1,19 @@
+/*
+Package x448 provides Diffie-Hellman functions as specified in RFC-7748.
+
+Validation of public keys.
+
+The Diffie-Hellman function, as described in RFC-7748 [1], works for any
+public key. However, if a different protocol requires contributory
+behaviour [2,3], then the public keys must be validated against low-order
+points [3,4]. To do that, the Shared function performs this validation
+internally and returns false when the public key is invalid (i.e., it
+is a low-order point).
+
+References:
+ - [1] RFC7748 by Langley, Hamburg, Turner (https://rfc-editor.org/rfc/rfc7748.txt)
+ - [2] Curve25519 by Bernstein (https://cr.yp.to/ecdh.html)
+ - [3] Bernstein (https://cr.yp.to/ecdh.html#validate)
+ - [4] Cremers&Jackson (https://eprint.iacr.org/2019/526)
+*/
+package x448
diff --git a/vendor/github.com/cloudflare/circl/dh/x448/key.go b/vendor/github.com/cloudflare/circl/dh/x448/key.go
new file mode 100644
index 0000000000..2fdde51168
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x448/key.go
@@ -0,0 +1,46 @@
+package x448
+
+import (
+ "crypto/subtle"
+
+ fp "github.com/cloudflare/circl/math/fp448"
+)
+
+// Size is the length in bytes of a X448 key.
+const Size = 56
+
+// Key represents a X448 key.
+type Key [Size]byte
+
+func (k *Key) clamp(in *Key) *Key {
+ *k = *in
+ k[0] &= 252
+ k[55] |= 128
+ return k
+}
+
+// isValidPubKey verifies if the public key is not a low-order point.
+func (k *Key) isValidPubKey() bool {
+ fp.Modp((*fp.Elt)(k))
+ var isLowOrder int
+ for _, P := range lowOrderPoints {
+ isLowOrder |= subtle.ConstantTimeCompare(P[:], k[:])
+ }
+ return isLowOrder == 0
+}
+
+// KeyGen obtains a public key given a secret key.
+func KeyGen(public, secret *Key) {
+ ladderJoye(public.clamp(secret))
+}
+
+// Shared calculates Alice's shared key from Alice's secret key and Bob's
+// public key returning true on success. A failure case happens when the public
+// key is a low-order point, thus the shared key is all-zeros and the function
+// returns false.
+func Shared(shared, secret, public *Key) bool {
+ validPk := *public
+ ok := validPk.isValidPubKey()
+ ladderMontgomery(shared.clamp(secret), &validPk)
+ return ok
+}
diff --git a/vendor/github.com/cloudflare/circl/dh/x448/table.go b/vendor/github.com/cloudflare/circl/dh/x448/table.go
new file mode 100644
index 0000000000..eef53c30f8
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/dh/x448/table.go
@@ -0,0 +1,460 @@
+package x448
+
+import fp "github.com/cloudflare/circl/math/fp448"
+
+// tableGenerator contains the set of points:
+//
+// t[i] = (xi+1)/(xi-1),
+//
+// where (xi,yi) = 2^iG and G is the generator point
+// Size = (448)*(448/8) = 25088 bytes.
+var tableGenerator = [448 * fp.Size]byte{
+ /* (2^ 0)P */ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ /* (2^ 1)P */ 0x37, 0xfa, 0xaa, 0x0d, 0x86, 0xa6, 0x24, 0xe9, 0x6c, 0x95, 0x08, 0x34, 0xba, 0x1a, 0x81, 0x3a, 0xae, 0x01, 0xa5, 0xa7, 0x05, 0x85, 0x96, 0x00, 0x06, 0x5a, 0xd7, 0xff, 0xee, 0x8e, 0x8f, 0x94, 0xd2, 0xdc, 0xd7, 0xfc, 0xe7, 0xe5, 0x99, 0x1d, 0x05, 0x46, 0x43, 0xe8, 0xbc, 0x12, 0xb7, 0xeb, 0x30, 0x5e, 0x7a, 0x85, 0x68, 0xed, 0x9d, 0x28,
+ /* (2^ 2)P */ 0xf1, 0x7d, 0x08, 0x2b, 0x32, 0x4a, 0x62, 0x80, 0x36, 0xe7, 0xa4, 0x76, 0x5a, 0x2a, 0x1e, 0xf7, 0x9e, 0x3c, 0x40, 0x46, 0x9a, 0x1b, 0x61, 0xc1, 0xbf, 0x1a, 0x1b, 0xae, 0x91, 0x80, 0xa3, 0x76, 0x6c, 0xd4, 0x8f, 0xa4, 0xee, 0x26, 0x39, 0x23, 0xa4, 0x80, 0xf4, 0x66, 0x92, 0xe4, 0xe1, 0x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51, 0xb8, 0x81, 0x74, 0xc8, 0x2c,
+ /* (2^ 25)P */ 0xb2, 0xaf, 0x1c, 0xee, 0x07, 0xb0, 0x58, 0xa8, 0x2c, 0x6a, 0xc9, 0x2d, 0x62, 0x28, 0x75, 0x0c, 0x40, 0xb6, 0x11, 0x33, 0x96, 0x80, 0x28, 0x6d, 0xd5, 0x9e, 0x87, 0x90, 0x01, 0x66, 0x1d, 0x1c, 0xf8, 0xb4, 0x92, 0xac, 0x38, 0x18, 0x05, 0xc2, 0x4c, 0x4b, 0x54, 0x7d, 0x80, 0x46, 0x87, 0x2d, 0x99, 0x8e, 0x70, 0x80, 0x69, 0x71, 0x8b, 0xed,
+ /* (2^ 26)P */ 0x37, 0xa7, 0x6b, 0x71, 0x36, 0x75, 0x8e, 0xff, 0x0f, 0x42, 0xda, 0x5a, 0x46, 0xa6, 0x97, 0x79, 0x7e, 0x30, 0xb3, 0x8f, 0xc7, 0x3a, 0xa0, 0xcb, 0x1d, 0x9c, 0x78, 0x77, 0x36, 0xc2, 0xe7, 0xf4, 0x2f, 0x29, 0x07, 0xb1, 0x07, 0xfd, 0xed, 0x1b, 0x39, 0x77, 0x06, 0x38, 0x77, 0x0f, 0x50, 0x31, 0x12, 0xbf, 0x92, 0xbf, 0x72, 0x79, 0x54, 0xa9,
+ /* (2^ 27)P */ 0xbd, 0x4d, 0x46, 0x6b, 0x1a, 0x80, 0x46, 0x2d, 0xed, 0xfd, 0x64, 0x6d, 0x94, 0xbc, 0x4a, 0x6e, 0x0c, 0x12, 0xf6, 0x12, 0xab, 0x54, 0x88, 0xd3, 0x85, 0xac, 0x51, 0xae, 0x6f, 0xca, 0xc4, 0xb7, 0xec, 0x22, 0x54, 0x6d, 0x80, 0xb2, 0x1c, 0x63, 0x33, 0x76, 0x6b, 0x8e, 0x6d, 0x59, 0xcd, 0x73, 0x92, 0x5f, 0xff, 0xad, 0x10, 0x35, 0x70, 0x5f,
+ /* (2^ 28)P */ 0xb3, 0x84, 0xde, 0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91, 0x30, 0x51,
+ /* (2^132)P */ 0x8d, 0x25, 0xe9, 0x0e, 0x7d, 0x50, 0x76, 0xe4, 0x58, 0x7e, 0xb9, 0x33, 0xe6, 0x65, 0x90, 0xc2, 0x50, 0x9d, 0x50, 0x2e, 0x11, 0xad, 0xd5, 0x43, 0x52, 0x32, 0x41, 0x4f, 0x7b, 0xb6, 0xa0, 0xec, 0x81, 0x75, 0x36, 0x7c, 0x77, 0x85, 0x59, 0x70, 0xe4, 0xf9, 0xef, 0x66, 0x8d, 0x35, 0xc8, 0x2a, 0x6e, 0x5b, 0xc6, 0x0d, 0x0b, 0x29, 0x60, 0x68,
+ /* (2^133)P */ 0xf8, 0xce, 0xb0, 0x3a, 0x56, 0x7d, 0x51, 0x9a, 0x25, 0x73, 0xea, 0xdd, 0xe4, 0xe0, 0x0e, 0xf0, 0x07, 0xc0, 0x31, 0x00, 0x73, 0x35, 0xd0, 0x39, 0xc4, 0x9b, 0xb7, 0x95, 0xe0, 0x62, 0x70, 0x36, 0x0b, 0xcb, 0xa0, 0x42, 0xde, 0x51, 0xcf, 0x41, 0xe0, 0xb8, 0xb4, 0xc0, 0xe5, 0x46, 0x99, 0x9f, 0x02, 0x7f, 0x14, 0x8c, 0xc1, 0x4e, 0xef, 0xe8,
+ /* (2^134)P */ 0x10, 0x01, 0x57, 0x0a, 0xbe, 0x8b, 0x18, 0xc8, 0xca, 0x00, 0x28, 0x77, 0x4a, 0x9a, 0xc7, 0x55, 0x2a, 0xcc, 0x0c, 0x7b, 0xb9, 0xe9, 0xc8, 0x97, 0x7c, 0x02, 0xe3, 0x09, 0x2f, 0x62, 0x30, 0xb8, 0x40, 0x09, 0x65, 0xe9, 0x55, 0x63, 0xb5, 0x07, 0xca, 0x9f, 0x00, 0xdf, 0x9d, 0x5c, 0xc7, 0xee, 0x57, 0xa5, 0x90, 0x15, 0x1e, 0x22, 0xa0, 0x12,
+ /* (2^135)P */ 0x71, 0x2d, 0xc9, 0xef, 0x27, 0xb9, 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0xd7, 0xcb, 0x75, 0x11, 0xc3, 0x6b, 0xc0, 0x38, 0xb1, 0xd5, 0x2d, 0x96, 0x84, 0x16, 0xfa, 0x26, 0xb9, 0xcc, 0x3f, 0x16, 0x47, 0x23, 0x74,
+ /* (2^145)P */ 0x9b, 0x61, 0x2a, 0x1c, 0xdd, 0x39, 0xa5, 0xfa, 0x1c, 0x7d, 0x63, 0x50, 0xca, 0xe6, 0x9d, 0xfa, 0xb7, 0xc4, 0x4c, 0x6a, 0x97, 0x5f, 0x36, 0x4e, 0x47, 0xdd, 0x17, 0xf7, 0xf9, 0x19, 0xce, 0x75, 0x17, 0xad, 0xce, 0x2a, 0xf3, 0xfe, 0x27, 0x8f, 0x3e, 0x48, 0xc0, 0x60, 0x87, 0x24, 0x19, 0xae, 0x59, 0xe4, 0x5a, 0x00, 0x2a, 0xba, 0xa2, 0x1f,
+ /* (2^146)P */ 0x26, 0x88, 0x42, 0x60, 0x9f, 0x6e, 0x2c, 0x7c, 0x39, 0x0f, 0x47, 0x6a, 0x0e, 0x02, 0xbb, 0x4b, 0x34, 0x29, 0x55, 0x18, 0x36, 0xcf, 0x3b, 0x47, 0xf1, 0x2e, 0xfc, 0x6e, 0x94, 0xff, 0xe8, 0x6b, 0x06, 0xd2, 0xba, 0x77, 0x5e, 0x60, 0xd7, 0x19, 0xef, 0x02, 0x9d, 0x3a, 0xc2, 0xb7, 0xa9, 0xd8, 0x57, 0xee, 0x7e, 0x2b, 0xf2, 0x6d, 0x28, 0xda,
+ /* (2^147)P */ 0xdf, 0xd9, 0x92, 0x11, 0x98, 0x23, 0xe2, 0x45, 0x2f, 0x74, 0x70, 0xee, 0x0e, 0x55, 0x65, 0x79, 0x86, 0x38, 0x17, 0x92, 0x85, 0x87, 0x99, 0x50, 0xd9, 0x7c, 0xdb, 0xa1, 0x10, 0xec, 0x30, 0xb7, 0x40, 0xa3, 0x23, 0x9b, 0x0e, 0x27, 0x49, 0x29, 0x03, 0x94, 0xff, 0x53, 0xdc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1, 0xf9, 0xbe,
+ /* (2^151)P */ 0xce, 0x2f, 0x85, 0xca, 0x74, 0x6d, 0x49, 0xb8, 0xce, 0x80, 0x44, 0xe0, 0xda, 0x5b, 0xcf, 0x2f, 0x79, 0x74, 0xfe, 0xb4, 0x2c, 0x99, 0x20, 0x6e, 0x09, 0x04, 0xfb, 0x6d, 0x57, 0x5b, 0x95, 0x0c, 0x45, 0xda, 0x4f, 0x7f, 0x63, 0xcc, 0x85, 0x5a, 0x67, 0x50, 0x68, 0x71, 0xb4, 0x67, 0xb1, 0x2e, 0xc1, 0x1c, 0xdc, 0xff, 0x2a, 0x7c, 0x10, 0x5e,
+ /* (2^152)P */ 0xa6, 0xde, 0xf3, 0xd4, 0x22, 0x30, 0x24, 0x9e, 0x0b, 0x30, 0x54, 0x59, 0x7e, 0xa2, 0xeb, 0x89, 0x54, 0x65, 0x3e, 0x40, 0xd1, 0xde, 0xe6, 0xee, 0x4d, 0xbf, 0x5e, 0x40, 0x1d, 0xee, 0x4f, 0x68, 0xd9, 0xa7, 0x2f, 0xb3, 0x64, 0xb3, 0xf5, 0xc8, 0xd3, 0xaa, 0x70, 0x70, 0x3d, 0xef, 0xd3, 0x95, 0x54, 0xdb, 0x3e, 0x94, 0x95, 0x92, 0x1f, 0x45,
+ /* (2^153)P */ 0x22, 0x80, 0x1d, 0x9d, 0x96, 0xa5, 0x78, 0x6f, 0xe0, 0x1e, 0x1b, 0x66, 0x42, 0xc8, 0xae, 0x9e, 0x46, 0x45, 0x08, 0x41, 0xdf, 0x80, 0xae, 0x6f, 0xdb, 0x15, 0x5a, 0x21, 0x31, 0x7a, 0xd0, 0xf2, 0x54, 0x15, 0x88, 0xd3, 0x0f, 0x7f, 0x14, 0x5a, 0x14, 0x97, 0xab, 0xf4, 0x58, 0x6a, 0x9f, 0xea, 0x74, 0xe5, 0x6b, 0x90, 0x59, 0x2b, 0x48, 0xd9,
+ /* (2^154)P */ 0x12, 0x24, 0x04, 0xf5, 0x50, 0xc2, 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2e, 0x12, 0x3b, 0xe6, 0xa6,
+ /* (2^211)P */ 0x24, 0x82, 0x67, 0xe0, 0x14, 0x7b, 0x56, 0x08, 0x38, 0x44, 0xdb, 0xa0, 0x3a, 0x05, 0x47, 0xb2, 0xc0, 0xac, 0xd1, 0xcc, 0x3f, 0x82, 0xb8, 0x8a, 0x88, 0xbc, 0xf5, 0x33, 0xa1, 0x35, 0x0f, 0xf6, 0xe2, 0xef, 0x6c, 0xf7, 0x37, 0x9e, 0xe8, 0x10, 0xca, 0xb0, 0x8e, 0x80, 0x86, 0x00, 0x23, 0xd0, 0x4a, 0x76, 0x9f, 0xf7, 0x2c, 0x52, 0x15, 0x0e,
+ /* (2^212)P */ 0x5e, 0x49, 0xe1, 0x2c, 0x9a, 0x01, 0x76, 0xa6, 0xb3, 0x07, 0x5b, 0xa4, 0x07, 0xef, 0x1d, 0xc3, 0x6a, 0xbb, 0x64, 0xbe, 0x71, 0x15, 0x6e, 0x32, 0x31, 0x46, 0x9a, 0x9e, 0x8f, 0x45, 0x73, 0xce, 0x0b, 0x94, 0x1a, 0x52, 0x07, 0xf4, 0x50, 0x30, 0x49, 0x53, 0x50, 0xfb, 0x71, 0x1f, 0x5a, 0x03, 0xa9, 0x76, 0xf2, 0x8f, 0x42, 0xff, 0xed, 0xed,
+ /* (2^213)P */ 0xed, 0x08, 0xdb, 0x91, 0x1c, 0xee, 0xa2, 0xb4, 0x47, 0xa2, 0xfa, 0xcb, 0x03, 0xd1, 0xff, 0x8c, 0xad, 0x64, 0x50, 0x61, 0xcd, 0xfc, 0x88, 0xa0, 0x31, 0x95, 0x30, 0xb9, 0x58, 0xdd, 0xd7, 0x43, 0xe4, 0x46, 0xc2, 0x16, 0xd9, 0x72, 0x4a, 0x56, 0x51, 0x70, 0x85, 0xf1, 0xa1, 0x80, 0x40, 0xd5, 0xba, 0x67, 0x81, 0xda, 0xcd, 0x03, 0xea, 0x51,
+ /* (2^214)P */ 0x42, 0x50, 0xf0, 0xef, 0x37, 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x97, 0x77, 0xec, 0x6f, 0x22, 0xbe, 0x44, 0xc7, 0x03,
+ /* (2^309)P */ 0xa5, 0x23, 0x90, 0x41, 0xa3, 0xc5, 0x3e, 0xe0, 0xa5, 0x32, 0x49, 0x1f, 0x39, 0x78, 0xb1, 0xd8, 0x24, 0xea, 0xd4, 0x87, 0x53, 0x42, 0x51, 0xf4, 0xd9, 0x46, 0x25, 0x2f, 0x62, 0xa9, 0x90, 0x9a, 0x4a, 0x25, 0x8a, 0xd2, 0x10, 0xe7, 0x3c, 0xbc, 0x58, 0x8d, 0x16, 0x14, 0x96, 0xa4, 0x6f, 0xf8, 0x12, 0x69, 0x91, 0x73, 0xe2, 0xfa, 0xf4, 0x57,
+ /* (2^310)P */ 0x51, 0x45, 0x3f, 0x96, 0xdc, 0x97, 0x38, 0xa6, 0x01, 0x63, 0x09, 0xea, 0xc2, 0x13, 0x30, 0xb0, 0x00, 0xb8, 0x0a, 0xce, 0xd1, 0x8f, 0x3e, 0x69, 0x62, 0x46, 0x33, 0x9c, 0xbf, 0x4b, 0xcb, 0x0c, 0x90, 0x1c, 0x45, 0xcf, 0x37, 0x5b, 0xf7, 0x4b, 0x5e, 0x95, 0xc3, 0x28, 0x9f, 0x08, 0x83, 0x53, 0x74, 0xab, 0x0c, 0xb4, 0xc0, 0xa1, 0xbc, 0x89,
+ /* (2^311)P */ 0x06, 0xb1, 0x51, 0x15, 0x65, 0x60, 0x21, 0x17, 0x7a, 0x20, 0x65, 0xee, 0x12, 0x35, 0x4d, 0x46, 0xf4, 0xf8, 0xd0, 0xb1, 0xca, 0x09, 0x30, 0x08, 0x89, 0x23, 0x3b, 0xe7, 0xab, 0x8b, 0x77, 0xa6, 0xad, 0x25, 0xdd, 0xea, 0x3c, 0x7d, 0xa5, 0x24, 0xb3, 0xe8, 0xfa, 0xfb, 0xc9, 0xf2, 0x71, 0xe9, 0xfa, 0xf2, 0xdc, 0x54, 0xdd, 0x55, 0x2e, 0x2f,
+ /* (2^312)P */ 0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0xd4, 0x89, 0xe3, 0x79, 0xba, 0xb6, 0xc3, 0xda, 0xe6, 0x78, 0x65, 0x7d, 0x6e, 0x22, 0x62, 0xb1, 0x3d, 0xea, 0x90, 0x84, 0x30, 0x5e, 0xd4, 0x39, 0x84, 0x78, 0xd9, 0x75, 0xd6, 0xce, 0x2a, 0x11, 0x29, 0x69, 0xa4, 0x5e, 0xaa, 0x2a, 0x98, 0x5a, 0xe5, 0x91, 0x8f, 0xb2, 0xfb, 0xda, 0x97, 0xe8, 0x83, 0x6f, 0x04, 0xb9, 0x5d, 0xaf, 0xe1, 0x9b,
+ /* (2^332)P */ 0x8b, 0xe4, 0xe1, 0x48, 0x9c, 0xc4, 0x83, 0x89, 0xdf, 0x65, 0xd3, 0x35, 0x55, 0x13, 0xf4, 0x1f, 0x36, 0x92, 0x33, 0x38, 0xcb, 0xed, 0x15, 0xe6, 0x60, 0x2d, 0x25, 0xf5, 0x36, 0x60, 0x3a, 0x37, 0x9b, 0x71, 0x9d, 0x42, 0xb0, 0x14, 0xc8, 0xba, 0x62, 0xa3, 0x49, 0xb0, 0x88, 0xc1, 0x72, 0x73, 0xdd, 0x62, 0x40, 0xa9, 0x62, 0x88, 0x99, 0xca,
+ /* (2^333)P */ 0x47, 0x7b, 0xea, 0xda, 0x46, 0x2f, 0x45, 0xc6, 0xe3, 0xb4, 0x4d, 0x8d, 0xac, 0x0b, 0x54, 0x22, 0x06, 0x31, 0x16, 0x66, 0x3e, 0xe4, 0x38, 0x12, 0xcd, 0xf3, 0xe7, 0x99, 0x37, 0xd9, 0x62, 0x24, 0x4b, 0x05, 0xf2, 0x58, 0xe6, 0x29, 0x4b, 0x0d, 0xf6, 0xc1, 0xba, 0xa0, 0x1e, 0x0f, 0xcb, 0x1f, 0xc6, 0x2b, 0x19, 0xfc, 0x82, 0x01, 0xd0, 0x86,
+ /* (2^334)P */ 0xa2, 0xae, 0x77, 0x20, 0xfb, 0xa8, 0x18, 0xb4, 0x61, 0xef, 0xe8, 0x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1, 0xdc, 0xc6, 0xce, 0x51, 0x29, 0x50, 0xbf, 0x1b, 0xde, 0xff, 0xba, 0x4d, 0x8d, 0x8b, 0x7e, 0xe7, 0xbd, 0x5b, 0x8f, 0xbe, 0xe3, 0x75, 0x71, 0xff, 0x37, 0x05, 0x5a, 0x10, 0xeb, 0x54, 0x7e, 0x44, 0x72, 0x2c, 0xd4, 0xfc,
+ /* (2^338)P */ 0x03, 0x12, 0x1c, 0xb2, 0x08, 0x90, 0xa1, 0x2d, 0x50, 0xa0, 0xad, 0x7f, 0x8d, 0xa6, 0x97, 0xc1, 0xbd, 0xdc, 0xc3, 0xa7, 0xad, 0x31, 0xdf, 0xb8, 0x03, 0x84, 0xc3, 0xb9, 0x29, 0x3d, 0x92, 0x2e, 0xc3, 0x90, 0x07, 0xe8, 0xa7, 0xc7, 0xbc, 0x61, 0xe9, 0x3e, 0xa0, 0x35, 0xda, 0x1d, 0xab, 0x48, 0xfe, 0x50, 0xc9, 0x25, 0x59, 0x23, 0x69, 0x3f,
+ /* (2^339)P */ 0x8e, 0x91, 0xab, 0x6b, 0x91, 0x4f, 0x89, 0x76, 0x67, 0xad, 0xb2, 0x65, 0x9d, 0xad, 0x02, 0x36, 0xdc, 0xac, 0x96, 0x93, 0x97, 0x21, 0x14, 0xd0, 0xe8, 0x11, 0x60, 0x1e, 0xeb, 0x96, 0x06, 0xf2, 0x53, 0xf2, 0x6d, 0xb7, 0x93, 0x6f, 0x26, 0x91, 0x23, 0xe3, 0x34, 0x04, 0x92, 0x91, 0x37, 0x08, 0x50, 0xd6, 0x28, 0x09, 0x27, 0xa1, 0x0c, 0x00,
+ /* (2^340)P */ 0x1f, 0xbb, 0x21, 0x26, 0x33, 0xcb, 0xa4, 0xd1, 0xee, 0x85, 0xf9, 0xd9, 0x3c, 0x90, 0xc3, 0xd1, 0x26, 0xa2, 0x25, 0x93, 0x43, 0x61, 0xed, 0x91, 0x6e, 0x54, 0x03, 0x2e, 0x42, 0x9d, 0xf7, 0x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, 0x23, 0xa7, 0xf7, 0x77, 0x96, 0x5b, 0x4d, 0x91, 0x10, 0x52, 0x85, 0x9e, 0xa5, 0x38, 0x0b, 0xfd, 0x25, 0x01, 0x4b, 0xfa, 0x4d, 0xd3, 0x3f, 0x78, 0x74, 0x42, 0xff, 0x62, 0x2d, 0x27, 0xdc, 0x9d, 0xd1, 0x29, 0x76, 0x2e, 0x78, 0xb3, 0x35, 0xfa, 0x15, 0xd5, 0x38,
+ /* (2^354)P */ 0x8b, 0xc7, 0x43, 0xce, 0xf0, 0x5e, 0xf1, 0x0d, 0x02, 0x38, 0xe8, 0x82, 0xc9, 0x25, 0xad, 0x2d, 0x27, 0xa4, 0x54, 0x18, 0xb2, 0x30, 0x73, 0xa4, 0x41, 0x08, 0xe4, 0x86, 0xe6, 0x8c, 0xe9, 0x2a, 0x34, 0xb3, 0xd6, 0x61, 0x8f, 0x66, 0x26, 0x08, 0xb6, 0x06, 0x33, 0xaa, 0x12, 0xac, 0x72, 0xec, 0x2e, 0x52, 0xa3, 0x25, 0x3e, 0xd7, 0x62, 0xe8,
+ /* (2^355)P */ 0xc4, 0xbb, 0x89, 0xc8, 0x40, 0xcc, 0x84, 0xec, 0x4a, 0xd9, 0xc4, 0x55, 0x78, 0x00, 0xcf, 0xd8, 0xe9, 0x24, 0x59, 0xdc, 0x5e, 0xf0, 0x66, 0xa1, 0x83, 0xae, 0x97, 0x18, 0xc5, 0x54, 0x27, 0xa2, 0x21, 0x52, 0x03, 0x31, 0x5b, 0x11, 0x67, 0xf6, 0x12, 0x00, 0x87, 0x2f, 0xff, 0x59, 0x70, 0x8f, 0x6d, 0x71, 0xab, 0xab, 0x24, 0xb8, 0xba, 0x35,
+ /* (2^356)P */ 0x69, 0x43, 0xa7, 0x14, 0x06, 0x96, 0xe9, 0xc2, 0xe3, 0x2b, 0x45, 0x22, 0xc0, 0xd0, 0x2f, 0x34, 0xd1, 0x01, 0x99, 0xfc, 0x99, 0x38, 0xa1, 0x25, 0x2e, 0x59, 0x6c, 0x27, 0xc9, 0xeb, 0x7b, 0xdc, 0x4e, 0x26, 0x68, 0xba, 0xfa, 0xec, 0x02, 0x05, 0x64, 0x80, 0x30, 0x20, 0x5c, 0x26, 0x7f, 0xaf, 0x95, 0x17, 0x3d, 0x5c, 0x9e, 0x96, 0x96, 0xaf,
+ /* (2^357)P */ 0xa6, 0xba, 0x21, 0x29, 0x32, 0xe2, 0x98, 0xde, 0x9b, 0x6d, 0x0b, 0x44, 0x91, 0xa8, 0x3e, 0xd4, 0xb8, 0x04, 0x6c, 0xf6, 0x04, 0x39, 0xbd, 0x52, 0x05, 0x15, 0x27, 0x78, 0x8e, 0x55, 0xac, 0x79, 0xc5, 0xe6, 0x00, 0x7f, 0x90, 0xa2, 0xdd, 0x07, 0x13, 0xe0, 0x24, 0x70, 0x5c, 0x0f, 0x4d, 0xa9, 0xf9, 0xae, 0xcb, 0x34, 0x10, 0x9d, 0x89, 0x9d,
+ /* (2^358)P */ 0x12, 0xe0, 0xb3, 0x9f, 0xc4, 0x96, 0x1d, 0xcf, 0xed, 0x99, 0x64, 0x28, 0x8d, 0xc7, 0x31, 0x82, 0xee, 0x5e, 0x75, 0x48, 0xff, 0x3a, 0xf2, 0x09, 0x34, 0x03, 0x93, 0x52, 0x19, 0xb2, 0xc5, 0x81, 0x93, 0x45, 0x5e, 0x59, 0x21, 0x2b, 0xec, 0x89, 0xba, 0x36, 0x6e, 0xf9, 0x82, 0x75, 0x7e, 0x82, 0x3f, 0xaa, 0xe2, 0xe3, 0x3b, 0x94, 0xfd, 0x98,
+ /* (2^359)P */ 0x7c, 0xdb, 0x75, 0x31, 0x61, 0xfb, 0x15, 0x28, 0x94, 0xd7, 0xc3, 0x5a, 0xa9, 0xa1, 0x0a, 0x66, 0x0f, 0x2b, 0x13, 0x3e, 0x42, 0xb5, 0x28, 0x3a, 0xca, 0x83, 0xf3, 0x61, 0x22, 0xf4, 0x40, 0xc5, 0xdf, 0xe7, 0x31, 0x9f, 0x7e, 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 0x63, 0x13, 0x86, 0x6a, 0xa6, 0xb4, 0xd2, 0x60, 0x68, 0x9a, 0x99, 0x82, 0x0a, 0x04, 0x5f, 0x89, 0x7a, 0x1a, 0x2a, 0xae, 0x2d, 0x35, 0x0c, 0x1e, 0xad, 0xef, 0x4f, 0x9a, 0xfc, 0xc8, 0xd9, 0xcf, 0x9d, 0x48, 0x71, 0xa5, 0x55, 0x79, 0x73, 0x39, 0x1b, 0xd8, 0x73, 0xec, 0x9b, 0x03, 0x16, 0xd8, 0x82, 0xf7, 0x67,
+ /* (2^430)P */ 0x52, 0x67, 0x42, 0x21, 0xc9, 0x40, 0x78, 0x82, 0x2b, 0x95, 0x2d, 0x20, 0x92, 0xd1, 0xe2, 0x61, 0x25, 0xb0, 0xc6, 0x9c, 0x20, 0x59, 0x8e, 0x28, 0x6f, 0xf3, 0xfd, 0xd3, 0xc1, 0x32, 0x43, 0xc9, 0xa6, 0x08, 0x7a, 0x77, 0x9c, 0x4c, 0x8c, 0x33, 0x71, 0x13, 0x69, 0xe3, 0x52, 0x30, 0xa7, 0xf5, 0x07, 0x67, 0xac, 0xad, 0x46, 0x8a, 0x26, 0x25,
+ /* (2^431)P */ 0xda, 0x86, 0xc4, 0xa2, 0x71, 0x56, 0xdd, 0xd2, 0x48, 0xd3, 0xde, 0x42, 0x63, 0x01, 0xa7, 0x2c, 0x92, 0x83, 0x6f, 0x2e, 0xd8, 0x1e, 0x3f, 0xc1, 0xc5, 0x42, 0x4e, 0x34, 0x19, 0x54, 0x6e, 0x35, 0x2c, 0x51, 0x2e, 0xfd, 0x0f, 0x9a, 0x45, 0x66, 0x5e, 0x4a, 0x83, 0xda, 0x0a, 0x53, 0x68, 0x63, 0xfa, 0xce, 0x47, 0x20, 0xd3, 0x34, 0xba, 0x0d,
+ /* (2^432)P */ 0xd0, 0xe9, 0x64, 0xa4, 0x61, 0x4b, 0x86, 0xe5, 0x93, 0x6f, 0xda, 0x0e, 0x31, 0x7e, 0x6e, 0xe3, 0x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 0x26, 0x53, 0xf7, 0xda, 0xa8, 0x01, 0x14, 0xb1, 0x63, 0xe3, 0xc3, 0x89, 0x88, 0xb0, 0x85, 0x40, 0x2b, 0x26, 0x9a, 0x10, 0x1a, 0x70, 0x33, 0xf4, 0x50, 0x9d, 0x4d, 0xd8, 0x64, 0xc6, 0x0f, 0xe1, 0x17, 0xc8, 0x10, 0x4b, 0xfc, 0xa0, 0xc9, 0xba, 0x2c, 0x98, 0x09, 0xf5, 0x84, 0xb6, 0x7c, 0x4e, 0xa3, 0xe3, 0x81, 0x1b, 0x32, 0x60, 0x02, 0xdd,
+ /* (2^446)P */ 0xa3, 0xe5, 0x86, 0xd4, 0x43, 0xa8, 0xd1, 0x98, 0x9d, 0x9d, 0xdb, 0x04, 0xcf, 0x6e, 0x35, 0x05, 0x30, 0x53, 0x3b, 0xbc, 0x90, 0x00, 0x4a, 0xc5, 0x40, 0x2a, 0x0f, 0xde, 0x1a, 0xd7, 0x36, 0x27, 0x44, 0x62, 0xa6, 0xac, 0x9d, 0xd2, 0x70, 0x69, 0x14, 0x39, 0x9b, 0xd1, 0xc3, 0x0a, 0x3a, 0x82, 0x0e, 0xf1, 0x94, 0xd7, 0x42, 0x94, 0xd5, 0x7d,
+ /* (2^447)P */ 0x04, 0xc0, 0x6e, 0x12, 0x90, 0x70, 0xf9, 0xdf, 0xf7, 0xc9, 0x86, 0xc0, 0xe6, 0x92, 0x8b, 0x0a, 0xa1, 0xc1, 0x3b, 0xcc, 0x33, 0xb7, 0xf0, 0xeb, 0x51, 0x50, 0x80, 0x20, 0x69, 0x1c, 0x4f, 0x89, 0x05, 0x1e, 0xe4, 0x7a, 0x0a, 0xc2, 0xf0, 0xf5, 0x78, 0x91, 0x76, 0x34, 0x45, 0xdc, 0x24, 0x53, 0x24, 0x98, 0xe2, 0x73, 0x6f, 0xe6, 0x46, 0x67,
+}
diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/constants.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/constants.go
new file mode 100644
index 0000000000..b6b236e5d3
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/ecc/goldilocks/constants.go
@@ -0,0 +1,71 @@
+package goldilocks
+
+import fp "github.com/cloudflare/circl/math/fp448"
+
+var (
+ // genX is the x-coordinate of the generator of Goldilocks curve.
+ genX = fp.Elt{
+ 0x5e, 0xc0, 0x0c, 0xc7, 0x2b, 0xa8, 0x26, 0x26,
+ 0x8e, 0x93, 0x00, 0x8b, 0xe1, 0x80, 0x3b, 0x43,
+ 0x11, 0x65, 0xb6, 0x2a, 0xf7, 0x1a, 0xae, 0x12,
+ 0x64, 0xa4, 0xd3, 0xa3, 0x24, 0xe3, 0x6d, 0xea,
+ 0x67, 0x17, 0x0f, 0x47, 0x70, 0x65, 0x14, 0x9e,
+ 0xda, 0x36, 0xbf, 0x22, 0xa6, 0x15, 0x1d, 0x22,
+ 0xed, 0x0d, 0xed, 0x6b, 0xc6, 0x70, 0x19, 0x4f,
+ }
+ // genY is the y-coordinate of the generator of Goldilocks curve.
+ genY = fp.Elt{
+ 0x14, 0xfa, 0x30, 0xf2, 0x5b, 0x79, 0x08, 0x98,
+ 0xad, 0xc8, 0xd7, 0x4e, 0x2c, 0x13, 0xbd, 0xfd,
+ 0xc4, 0x39, 0x7c, 0xe6, 0x1c, 0xff, 0xd3, 0x3a,
+ 0xd7, 0xc2, 0xa0, 0x05, 0x1e, 0x9c, 0x78, 0x87,
+ 0x40, 0x98, 0xa3, 0x6c, 0x73, 0x73, 0xea, 0x4b,
+ 0x62, 0xc7, 0xc9, 0x56, 0x37, 0x20, 0x76, 0x88,
+ 0x24, 0xbc, 0xb6, 0x6e, 0x71, 0x46, 0x3f, 0x69,
+ }
+ // paramD is -39081 in Fp.
+ paramD = fp.Elt{
+ 0x56, 0x67, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ }
+ // order is 2^446-0x8335dc163bb124b65129c96fde933d8d723a70aadc873d6d54a7bb0d,
+ // which is the number of points in the prime subgroup.
+ order = Scalar{
+ 0xf3, 0x44, 0x58, 0xab, 0x92, 0xc2, 0x78, 0x23,
+ 0x55, 0x8f, 0xc5, 0x8d, 0x72, 0xc2, 0x6c, 0x21,
+ 0x90, 0x36, 0xd6, 0xae, 0x49, 0xdb, 0x4e, 0xc4,
+ 0xe9, 0x23, 0xca, 0x7c, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
+ }
+ // residue448 is 2^448 mod order.
+ residue448 = [4]uint64{
+ 0x721cf5b5529eec34, 0x7a4cf635c8e9c2ab, 0xeec492d944a725bf, 0x20cd77058,
+ }
+ // invFour is 1/4 mod order.
+ invFour = Scalar{
+ 0x3d, 0x11, 0xd6, 0xaa, 0xa4, 0x30, 0xde, 0x48,
+ 0xd5, 0x63, 0x71, 0xa3, 0x9c, 0x30, 0x5b, 0x08,
+ 0xa4, 0x8d, 0xb5, 0x6b, 0xd2, 0xb6, 0x13, 0x71,
+ 0xfa, 0x88, 0x32, 0xdf, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
+ }
+ // paramDTwist is -39082 in Fp. The D parameter of the twist curve.
+ paramDTwist = fp.Elt{
+ 0x55, 0x67, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ }
+)
diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/curve.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/curve.go
new file mode 100644
index 0000000000..1f165141a9
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/ecc/goldilocks/curve.go
@@ -0,0 +1,84 @@
+// Package goldilocks provides elliptic curve operations over the goldilocks curve.
+package goldilocks
+
+import fp "github.com/cloudflare/circl/math/fp448"
+
+// Curve is the Goldilocks curve x^2+y^2=z^2-39081x^2y^2.
+type Curve struct{}
+
+// Identity returns the identity point.
+func (Curve) Identity() *Point {
+ return &Point{
+ y: fp.One(),
+ z: fp.One(),
+ }
+}
+
+// IsOnCurve returns true if the point lies on the curve.
+func (Curve) IsOnCurve(P *Point) bool {
+ x2, y2, t, t2, z2 := &fp.Elt{}, &fp.Elt{}, &fp.Elt{}, &fp.Elt{}, &fp.Elt{}
+ rhs, lhs := &fp.Elt{}, &fp.Elt{}
+ // Check z != 0
+ eq0 := !fp.IsZero(&P.z)
+
+ fp.Mul(t, &P.ta, &P.tb) // t = ta*tb
+ fp.Sqr(x2, &P.x) // x^2
+ fp.Sqr(y2, &P.y) // y^2
+ fp.Sqr(z2, &P.z) // z^2
+ fp.Sqr(t2, t) // t^2
+ fp.Add(lhs, x2, y2) // x^2 + y^2
+ fp.Mul(rhs, t2, ¶mD) // dt^2
+ fp.Add(rhs, rhs, z2) // z^2 + dt^2
+ fp.Sub(lhs, lhs, rhs) // x^2 + y^2 - (z^2 + dt^2)
+ eq1 := fp.IsZero(lhs)
+
+ fp.Mul(lhs, &P.x, &P.y) // xy
+ fp.Mul(rhs, t, &P.z) // tz
+ fp.Sub(lhs, lhs, rhs) // xy - tz
+ eq2 := fp.IsZero(lhs)
+
+ return eq0 && eq1 && eq2
+}
+
+// Generator returns the generator point.
+func (Curve) Generator() *Point {
+ return &Point{
+ x: genX,
+ y: genY,
+ z: fp.One(),
+ ta: genX,
+ tb: genY,
+ }
+}
+
+// Order returns the number of points in the prime subgroup.
+func (Curve) Order() Scalar { return order }
+
+// Double returns 2P.
+func (Curve) Double(P *Point) *Point { R := *P; R.Double(); return &R }
+
+// Add returns P+Q.
+func (Curve) Add(P, Q *Point) *Point { R := *P; R.Add(Q); return &R }
+
+// ScalarMult returns kP. This function runs in constant time.
+func (e Curve) ScalarMult(k *Scalar, P *Point) *Point {
+ k4 := &Scalar{}
+ k4.divBy4(k)
+ return e.pull(twistCurve{}.ScalarMult(k4, e.push(P)))
+}
+
+// ScalarBaseMult returns kG where G is the generator point. This function runs in constant time.
+func (e Curve) ScalarBaseMult(k *Scalar) *Point {
+ k4 := &Scalar{}
+ k4.divBy4(k)
+ return e.pull(twistCurve{}.ScalarBaseMult(k4))
+}
+
+// CombinedMult returns mG+nP, where G is the generator point. This function is non-constant time.
+func (e Curve) CombinedMult(m, n *Scalar, P *Point) *Point {
+ m4 := &Scalar{}
+ n4 := &Scalar{}
+ m4.divBy4(m)
+ n4.divBy4(n)
+ return e.pull(twistCurve{}.CombinedMult(m4, n4, twistCurve{}.pull(P)))
+}
diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/isogeny.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/isogeny.go
new file mode 100644
index 0000000000..b1daab851c
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/ecc/goldilocks/isogeny.go
@@ -0,0 +1,52 @@
+package goldilocks
+
+import fp "github.com/cloudflare/circl/math/fp448"
+
+func (Curve) pull(P *twistPoint) *Point { return twistCurve{}.push(P) }
+func (twistCurve) pull(P *Point) *twistPoint { return Curve{}.push(P) }
+
+// push sends a point on the Goldilocks curve to a point on the twist curve.
+func (Curve) push(P *Point) *twistPoint {
+ Q := &twistPoint{}
+ Px, Py, Pz := &P.x, &P.y, &P.z
+ a, b, c, d, e, f, g, h := &Q.x, &Q.y, &Q.z, &fp.Elt{}, &Q.ta, &Q.x, &Q.y, &Q.tb
+ fp.Add(e, Px, Py) // x+y
+ fp.Sqr(a, Px) // A = x^2
+ fp.Sqr(b, Py) // B = y^2
+ fp.Sqr(c, Pz) // z^2
+ fp.Add(c, c, c) // C = 2*z^2
+ *d = *a // D = A
+ fp.Sqr(e, e) // (x+y)^2
+ fp.Sub(e, e, a) // (x+y)^2-A
+ fp.Sub(e, e, b) // E = (x+y)^2-A-B
+ fp.Add(h, b, d) // H = B+D
+ fp.Sub(g, b, d) // G = B-D
+ fp.Sub(f, c, h) // F = C-H
+ fp.Mul(&Q.z, f, g) // Z = F * G
+ fp.Mul(&Q.x, e, f) // X = E * F
+ fp.Mul(&Q.y, g, h) // Y = G * H, // T = E * H
+ return Q
+}
+
+// push sends a point on the twist curve to a point on the Goldilocks curve.
+func (twistCurve) push(P *twistPoint) *Point {
+ Q := &Point{}
+ Px, Py, Pz := &P.x, &P.y, &P.z
+ a, b, c, d, e, f, g, h := &Q.x, &Q.y, &Q.z, &fp.Elt{}, &Q.ta, &Q.x, &Q.y, &Q.tb
+ fp.Add(e, Px, Py) // x+y
+ fp.Sqr(a, Px) // A = x^2
+ fp.Sqr(b, Py) // B = y^2
+ fp.Sqr(c, Pz) // z^2
+ fp.Add(c, c, c) // C = 2*z^2
+ fp.Neg(d, a) // D = -A
+ fp.Sqr(e, e) // (x+y)^2
+ fp.Sub(e, e, a) // (x+y)^2-A
+ fp.Sub(e, e, b) // E = (x+y)^2-A-B
+ fp.Add(h, b, d) // H = B+D
+ fp.Sub(g, b, d) // G = B-D
+ fp.Sub(f, c, h) // F = C-H
+ fp.Mul(&Q.z, f, g) // Z = F * G
+ fp.Mul(&Q.x, e, f) // X = E * F
+ fp.Mul(&Q.y, g, h) // Y = G * H, // T = E * H
+ return Q
+}
diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/point.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/point.go
new file mode 100644
index 0000000000..11f73de054
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/ecc/goldilocks/point.go
@@ -0,0 +1,171 @@
+package goldilocks
+
+import (
+ "errors"
+ "fmt"
+
+ fp "github.com/cloudflare/circl/math/fp448"
+)
+
+// Point is a point on the Goldilocks Curve.
+type Point struct{ x, y, z, ta, tb fp.Elt }
+
+func (P Point) String() string {
+ return fmt.Sprintf("x: %v\ny: %v\nz: %v\nta: %v\ntb: %v", P.x, P.y, P.z, P.ta, P.tb)
+}
+
+// FromAffine creates a point from affine coordinates.
+func FromAffine(x, y *fp.Elt) (*Point, error) {
+ P := &Point{
+ x: *x,
+ y: *y,
+ z: fp.One(),
+ ta: *x,
+ tb: *y,
+ }
+ if !(Curve{}).IsOnCurve(P) {
+ return P, errors.New("point not on curve")
+ }
+ return P, nil
+}
+
+// isLessThan returns true if 0 <= x < y, and assumes that slices are of the
+// same length and are interpreted in little-endian order.
+func isLessThan(x, y []byte) bool {
+ i := len(x) - 1
+ for i > 0 && x[i] == y[i] {
+ i--
+ }
+ return x[i] < y[i]
+}
+
+// FromBytes returns a point from the input buffer.
+func FromBytes(in []byte) (*Point, error) {
+ if len(in) < fp.Size+1 {
+ return nil, errors.New("wrong input length")
+ }
+ err := errors.New("invalid decoding")
+ P := &Point{}
+ signX := in[fp.Size] >> 7
+ copy(P.y[:], in[:fp.Size])
+ p := fp.P()
+ if !isLessThan(P.y[:], p[:]) {
+ return nil, err
+ }
+
+ u, v := &fp.Elt{}, &fp.Elt{}
+ one := fp.One()
+ fp.Sqr(u, &P.y) // u = y^2
+ fp.Mul(v, u, ¶mD) // v = dy^2
+ fp.Sub(u, u, &one) // u = y^2-1
+ fp.Sub(v, v, &one) // v = dy^2-1
+ isQR := fp.InvSqrt(&P.x, u, v) // x = sqrt(u/v)
+ if !isQR {
+ return nil, err
+ }
+ fp.Modp(&P.x) // x = x mod p
+ if fp.IsZero(&P.x) && signX == 1 {
+ return nil, err
+ }
+ if signX != (P.x[0] & 1) {
+ fp.Neg(&P.x, &P.x)
+ }
+ P.ta = P.x
+ P.tb = P.y
+ P.z = fp.One()
+ return P, nil
+}
+
+// IsIdentity returns true is P is the identity Point.
+func (P *Point) IsIdentity() bool {
+ return fp.IsZero(&P.x) && !fp.IsZero(&P.y) && !fp.IsZero(&P.z) && P.y == P.z
+}
+
+// IsEqual returns true if P is equivalent to Q.
+func (P *Point) IsEqual(Q *Point) bool {
+ l, r := &fp.Elt{}, &fp.Elt{}
+ fp.Mul(l, &P.x, &Q.z)
+ fp.Mul(r, &Q.x, &P.z)
+ fp.Sub(l, l, r)
+ b := fp.IsZero(l)
+ fp.Mul(l, &P.y, &Q.z)
+ fp.Mul(r, &Q.y, &P.z)
+ fp.Sub(l, l, r)
+ b = b && fp.IsZero(l)
+ fp.Mul(l, &P.ta, &P.tb)
+ fp.Mul(l, l, &Q.z)
+ fp.Mul(r, &Q.ta, &Q.tb)
+ fp.Mul(r, r, &P.z)
+ fp.Sub(l, l, r)
+ b = b && fp.IsZero(l)
+ return b
+}
+
+// Neg obtains the inverse of the Point.
+func (P *Point) Neg() { fp.Neg(&P.x, &P.x); fp.Neg(&P.ta, &P.ta) }
+
+// ToAffine returns the x,y affine coordinates of P.
+func (P *Point) ToAffine() (x, y fp.Elt) {
+ fp.Inv(&P.z, &P.z) // 1/z
+ fp.Mul(&P.x, &P.x, &P.z) // x/z
+ fp.Mul(&P.y, &P.y, &P.z) // y/z
+ fp.Modp(&P.x)
+ fp.Modp(&P.y)
+ fp.SetOne(&P.z)
+ P.ta = P.x
+ P.tb = P.y
+ return P.x, P.y
+}
+
+// ToBytes stores P into a slice of bytes.
+func (P *Point) ToBytes(out []byte) error {
+ if len(out) < fp.Size+1 {
+ return errors.New("invalid decoding")
+ }
+ x, y := P.ToAffine()
+ out[fp.Size] = (x[0] & 1) << 7
+ return fp.ToBytes(out[:fp.Size], &y)
+}
+
+// MarshalBinary encodes the receiver into a binary form and returns the result.
+func (P *Point) MarshalBinary() (data []byte, err error) {
+ data = make([]byte, fp.Size+1)
+ err = P.ToBytes(data[:fp.Size+1])
+ return data, err
+}
+
+// UnmarshalBinary must be able to decode the form generated by MarshalBinary.
+func (P *Point) UnmarshalBinary(data []byte) error { Q, err := FromBytes(data); *P = *Q; return err }
+
+// Double sets P = 2Q.
+func (P *Point) Double() { P.Add(P) }
+
+// Add sets P =P+Q..
+func (P *Point) Add(Q *Point) {
+ // This is formula (5) from "Twisted Edwards Curves Revisited" by
+ // Hisil H., Wong K.KH., Carter G., Dawson E. (2008)
+ // https://doi.org/10.1007/978-3-540-89255-7_20
+ x1, y1, z1, ta1, tb1 := &P.x, &P.y, &P.z, &P.ta, &P.tb
+ x2, y2, z2, ta2, tb2 := &Q.x, &Q.y, &Q.z, &Q.ta, &Q.tb
+ x3, y3, z3, E, H := &P.x, &P.y, &P.z, &P.ta, &P.tb
+ A, B, C, D := &fp.Elt{}, &fp.Elt{}, &fp.Elt{}, &fp.Elt{}
+ t1, t2, F, G := C, D, &fp.Elt{}, &fp.Elt{}
+ fp.Mul(t1, ta1, tb1) // t1 = ta1*tb1
+ fp.Mul(t2, ta2, tb2) // t2 = ta2*tb2
+ fp.Mul(A, x1, x2) // A = x1*x2
+ fp.Mul(B, y1, y2) // B = y1*y2
+ fp.Mul(C, t1, t2) // t1*t2
+ fp.Mul(C, C, ¶mD) // C = d*t1*t2
+ fp.Mul(D, z1, z2) // D = z1*z2
+ fp.Add(F, x1, y1) // x1+y1
+ fp.Add(E, x2, y2) // x2+y2
+ fp.Mul(E, E, F) // (x1+y1)*(x2+y2)
+ fp.Sub(E, E, A) // (x1+y1)*(x2+y2)-A
+ fp.Sub(E, E, B) // E = (x1+y1)*(x2+y2)-A-B
+ fp.Sub(F, D, C) // F = D-C
+ fp.Add(G, D, C) // G = D+C
+ fp.Sub(H, B, A) // H = B-A
+ fp.Mul(z3, F, G) // Z = F * G
+ fp.Mul(x3, E, F) // X = E * F
+ fp.Mul(y3, G, H) // Y = G * H, T = E * H
+}
diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/scalar.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/scalar.go
new file mode 100644
index 0000000000..f98117b252
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/ecc/goldilocks/scalar.go
@@ -0,0 +1,203 @@
+package goldilocks
+
+import (
+ "encoding/binary"
+ "math/bits"
+)
+
+// ScalarSize is the size (in bytes) of scalars.
+const ScalarSize = 56 // 448 / 8
+
+// _N is the number of 64-bit words to store scalars.
+const _N = 7 // 448 / 64
+
+// Scalar represents a positive integer stored in little-endian order.
+type Scalar [ScalarSize]byte
+
+type scalar64 [_N]uint64
+
+func (z *scalar64) fromScalar(x *Scalar) {
+ z[0] = binary.LittleEndian.Uint64(x[0*8 : 1*8])
+ z[1] = binary.LittleEndian.Uint64(x[1*8 : 2*8])
+ z[2] = binary.LittleEndian.Uint64(x[2*8 : 3*8])
+ z[3] = binary.LittleEndian.Uint64(x[3*8 : 4*8])
+ z[4] = binary.LittleEndian.Uint64(x[4*8 : 5*8])
+ z[5] = binary.LittleEndian.Uint64(x[5*8 : 6*8])
+ z[6] = binary.LittleEndian.Uint64(x[6*8 : 7*8])
+}
+
+func (z *scalar64) toScalar(x *Scalar) {
+ binary.LittleEndian.PutUint64(x[0*8:1*8], z[0])
+ binary.LittleEndian.PutUint64(x[1*8:2*8], z[1])
+ binary.LittleEndian.PutUint64(x[2*8:3*8], z[2])
+ binary.LittleEndian.PutUint64(x[3*8:4*8], z[3])
+ binary.LittleEndian.PutUint64(x[4*8:5*8], z[4])
+ binary.LittleEndian.PutUint64(x[5*8:6*8], z[5])
+ binary.LittleEndian.PutUint64(x[6*8:7*8], z[6])
+}
+
+// add calculates z = x + y. Assumes len(z) > max(len(x),len(y)).
+func add(z, x, y []uint64) uint64 {
+ l, L, zz := len(x), len(y), y
+ if l > L {
+ l, L, zz = L, l, x
+ }
+ c := uint64(0)
+ for i := 0; i < l; i++ {
+ z[i], c = bits.Add64(x[i], y[i], c)
+ }
+ for i := l; i < L; i++ {
+ z[i], c = bits.Add64(zz[i], 0, c)
+ }
+ return c
+}
+
+// sub calculates z = x - y. Assumes len(z) > max(len(x),len(y)).
+func sub(z, x, y []uint64) uint64 {
+ l, L, zz := len(x), len(y), y
+ if l > L {
+ l, L, zz = L, l, x
+ }
+ c := uint64(0)
+ for i := 0; i < l; i++ {
+ z[i], c = bits.Sub64(x[i], y[i], c)
+ }
+ for i := l; i < L; i++ {
+ z[i], c = bits.Sub64(zz[i], 0, c)
+ }
+ return c
+}
+
+// mulWord calculates z = x * y. Assumes len(z) >= len(x)+1.
+func mulWord(z, x []uint64, y uint64) {
+ for i := range z {
+ z[i] = 0
+ }
+ carry := uint64(0)
+ for i := range x {
+ hi, lo := bits.Mul64(x[i], y)
+ lo, cc := bits.Add64(lo, z[i], 0)
+ hi, _ = bits.Add64(hi, 0, cc)
+ z[i], cc = bits.Add64(lo, carry, 0)
+ carry, _ = bits.Add64(hi, 0, cc)
+ }
+ z[len(x)] = carry
+}
+
+// Cmov moves x into z if b=1.
+func (z *scalar64) Cmov(b uint64, x *scalar64) {
+ m := uint64(0) - b
+ for i := range z {
+ z[i] = (z[i] &^ m) | (x[i] & m)
+ }
+}
+
+// leftShift shifts to the left the words of z returning the more significant word.
+func (z *scalar64) leftShift(low uint64) uint64 {
+ high := z[_N-1]
+ for i := _N - 1; i > 0; i-- {
+ z[i] = z[i-1]
+ }
+ z[0] = low
+ return high
+}
+
+// reduceOneWord calculates z = z + 2^448*x such that the result fits in a Scalar.
+func (z *scalar64) reduceOneWord(x uint64) {
+ prod := (&scalar64{})[:]
+ mulWord(prod, residue448[:], x)
+ cc := add(z[:], z[:], prod)
+ mulWord(prod, residue448[:], cc)
+ add(z[:], z[:], prod)
+}
+
+// modOrder reduces z mod order.
+func (z *scalar64) modOrder() {
+ var o64, x scalar64
+ o64.fromScalar(&order)
+ // Performs: while (z >= order) { z = z-order }
+ // At most 8 (eight) iterations reduce 3 bits by subtracting.
+ for i := 0; i < 8; i++ {
+ c := sub(x[:], z[:], o64[:]) // (c || x) = z-order
+ z.Cmov(1-c, &x) // if c != 0 { z = x }
+ }
+}
+
+// FromBytes stores z = x mod order, where x is a number stored in little-endian order.
+func (z *Scalar) FromBytes(x []byte) {
+ n := len(x)
+ nCeil := (n + 7) >> 3
+ for i := range z {
+ z[i] = 0
+ }
+ if nCeil < _N {
+ copy(z[:], x)
+ return
+ }
+ copy(z[:], x[8*(nCeil-_N):])
+ var z64 scalar64
+ z64.fromScalar(z)
+ for i := nCeil - _N - 1; i >= 0; i-- {
+ low := binary.LittleEndian.Uint64(x[8*i:])
+ high := z64.leftShift(low)
+ z64.reduceOneWord(high)
+ }
+ z64.modOrder()
+ z64.toScalar(z)
+}
+
+// divBy4 calculates z = x/4 mod order.
+func (z *Scalar) divBy4(x *Scalar) { z.Mul(x, &invFour) }
+
+// Red reduces z mod order.
+func (z *Scalar) Red() { var t scalar64; t.fromScalar(z); t.modOrder(); t.toScalar(z) }
+
+// Neg calculates z = -z mod order.
+func (z *Scalar) Neg() { z.Sub(&order, z) }
+
+// Add calculates z = x+y mod order.
+func (z *Scalar) Add(x, y *Scalar) {
+ var z64, x64, y64, t scalar64
+ x64.fromScalar(x)
+ y64.fromScalar(y)
+ c := add(z64[:], x64[:], y64[:])
+ add(t[:], z64[:], residue448[:])
+ z64.Cmov(c, &t)
+ z64.modOrder()
+ z64.toScalar(z)
+}
+
+// Sub calculates z = x-y mod order.
+func (z *Scalar) Sub(x, y *Scalar) {
+ var z64, x64, y64, t scalar64
+ x64.fromScalar(x)
+ y64.fromScalar(y)
+ c := sub(z64[:], x64[:], y64[:])
+ sub(t[:], z64[:], residue448[:])
+ z64.Cmov(c, &t)
+ z64.modOrder()
+ z64.toScalar(z)
+}
+
+// Mul calculates z = x*y mod order.
+func (z *Scalar) Mul(x, y *Scalar) {
+ var z64, x64, y64 scalar64
+ prod := (&[_N + 1]uint64{})[:]
+ x64.fromScalar(x)
+ y64.fromScalar(y)
+ mulWord(prod, x64[:], y64[_N-1])
+ copy(z64[:], prod[:_N])
+ z64.reduceOneWord(prod[_N])
+ for i := _N - 2; i >= 0; i-- {
+ h := z64.leftShift(0)
+ z64.reduceOneWord(h)
+ mulWord(prod, x64[:], y64[i])
+ c := add(z64[:], z64[:], prod[:_N])
+ z64.reduceOneWord(prod[_N] + c)
+ }
+ z64.modOrder()
+ z64.toScalar(z)
+}
+
+// IsZero returns true if z=0.
+func (z *Scalar) IsZero() bool { z.Red(); return *z == Scalar{} }
diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/twist.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/twist.go
new file mode 100644
index 0000000000..83d7cdadd3
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/ecc/goldilocks/twist.go
@@ -0,0 +1,138 @@
+package goldilocks
+
+import (
+ "crypto/subtle"
+ "math/bits"
+
+ "github.com/cloudflare/circl/internal/conv"
+ "github.com/cloudflare/circl/math"
+ fp "github.com/cloudflare/circl/math/fp448"
+)
+
+// twistCurve is -x^2+y^2=1-39082x^2y^2 and is 4-isogenous to Goldilocks.
+type twistCurve struct{}
+
+// Identity returns the identity point.
+func (twistCurve) Identity() *twistPoint {
+ return &twistPoint{
+ y: fp.One(),
+ z: fp.One(),
+ }
+}
+
+// subYDiv16 update x = (x - y) / 16.
+func subYDiv16(x *scalar64, y int64) {
+ s := uint64(y >> 63)
+ x0, b0 := bits.Sub64((*x)[0], uint64(y), 0)
+ x1, b1 := bits.Sub64((*x)[1], s, b0)
+ x2, b2 := bits.Sub64((*x)[2], s, b1)
+ x3, b3 := bits.Sub64((*x)[3], s, b2)
+ x4, b4 := bits.Sub64((*x)[4], s, b3)
+ x5, b5 := bits.Sub64((*x)[5], s, b4)
+ x6, _ := bits.Sub64((*x)[6], s, b5)
+ x[0] = (x0 >> 4) | (x1 << 60)
+ x[1] = (x1 >> 4) | (x2 << 60)
+ x[2] = (x2 >> 4) | (x3 << 60)
+ x[3] = (x3 >> 4) | (x4 << 60)
+ x[4] = (x4 >> 4) | (x5 << 60)
+ x[5] = (x5 >> 4) | (x6 << 60)
+ x[6] = (x6 >> 4)
+}
+
+func recodeScalar(d *[113]int8, k *Scalar) {
+ var k64 scalar64
+ k64.fromScalar(k)
+ for i := 0; i < 112; i++ {
+ d[i] = int8((k64[0] & 0x1f) - 16)
+ subYDiv16(&k64, int64(d[i]))
+ }
+ d[112] = int8(k64[0])
+}
+
+// ScalarMult returns kP.
+func (e twistCurve) ScalarMult(k *Scalar, P *twistPoint) *twistPoint {
+ var TabP [8]preTwistPointProy
+ var S preTwistPointProy
+ var d [113]int8
+
+ var isZero int
+ if k.IsZero() {
+ isZero = 1
+ }
+ subtle.ConstantTimeCopy(isZero, k[:], order[:])
+
+ minusK := *k
+ isEven := 1 - int(k[0]&0x1)
+ minusK.Neg()
+ subtle.ConstantTimeCopy(isEven, k[:], minusK[:])
+ recodeScalar(&d, k)
+
+ P.oddMultiples(TabP[:])
+ Q := e.Identity()
+ for i := 112; i >= 0; i-- {
+ Q.Double()
+ Q.Double()
+ Q.Double()
+ Q.Double()
+ mask := d[i] >> 7
+ absDi := (d[i] + mask) ^ mask
+ inx := int32((absDi - 1) >> 1)
+ sig := int((d[i] >> 7) & 0x1)
+ for j := range TabP {
+ S.cmov(&TabP[j], uint(subtle.ConstantTimeEq(inx, int32(j))))
+ }
+ S.cneg(sig)
+ Q.mixAdd(&S)
+ }
+ Q.cneg(uint(isEven))
+ return Q
+}
+
+const (
+ omegaFix = 7
+ omegaVar = 5
+)
+
+// CombinedMult returns mG+nP.
+func (e twistCurve) CombinedMult(m, n *Scalar, P *twistPoint) *twistPoint {
+ nafFix := math.OmegaNAF(conv.BytesLe2BigInt(m[:]), omegaFix)
+ nafVar := math.OmegaNAF(conv.BytesLe2BigInt(n[:]), omegaVar)
+
+ if len(nafFix) > len(nafVar) {
+ nafVar = append(nafVar, make([]int32, len(nafFix)-len(nafVar))...)
+ } else if len(nafFix) < len(nafVar) {
+ nafFix = append(nafFix, make([]int32, len(nafVar)-len(nafFix))...)
+ }
+
+ var TabQ [1 << (omegaVar - 2)]preTwistPointProy
+ P.oddMultiples(TabQ[:])
+ Q := e.Identity()
+ for i := len(nafFix) - 1; i >= 0; i-- {
+ Q.Double()
+ // Generator point
+ if nafFix[i] != 0 {
+ idxM := absolute(nafFix[i]) >> 1
+ R := tabVerif[idxM]
+ if nafFix[i] < 0 {
+ R.neg()
+ }
+ Q.mixAddZ1(&R)
+ }
+ // Variable input point
+ if nafVar[i] != 0 {
+ idxN := absolute(nafVar[i]) >> 1
+ S := TabQ[idxN]
+ if nafVar[i] < 0 {
+ S.neg()
+ }
+ Q.mixAdd(&S)
+ }
+ }
+ return Q
+}
+
+// absolute returns always a positive value.
+func absolute(x int32) int32 {
+ mask := x >> 31
+ return (x + mask) ^ mask
+}
diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/twistPoint.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/twistPoint.go
new file mode 100644
index 0000000000..c55db77b06
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/ecc/goldilocks/twistPoint.go
@@ -0,0 +1,135 @@
+package goldilocks
+
+import (
+ "fmt"
+
+ fp "github.com/cloudflare/circl/math/fp448"
+)
+
+type twistPoint struct{ x, y, z, ta, tb fp.Elt }
+
+type preTwistPointAffine struct{ addYX, subYX, dt2 fp.Elt }
+
+type preTwistPointProy struct {
+ preTwistPointAffine
+ z2 fp.Elt
+}
+
+func (P *twistPoint) String() string {
+ return fmt.Sprintf("x: %v\ny: %v\nz: %v\nta: %v\ntb: %v", P.x, P.y, P.z, P.ta, P.tb)
+}
+
+// cneg conditionally negates the point if b=1.
+func (P *twistPoint) cneg(b uint) {
+ t := &fp.Elt{}
+ fp.Neg(t, &P.x)
+ fp.Cmov(&P.x, t, b)
+ fp.Neg(t, &P.ta)
+ fp.Cmov(&P.ta, t, b)
+}
+
+// Double updates P with 2P.
+func (P *twistPoint) Double() {
+ // This is formula (7) from "Twisted Edwards Curves Revisited" by
+ // Hisil H., Wong K.KH., Carter G., Dawson E. (2008)
+ // https://doi.org/10.1007/978-3-540-89255-7_20
+ Px, Py, Pz, Pta, Ptb := &P.x, &P.y, &P.z, &P.ta, &P.tb
+ a, b, c, e, f, g, h := Px, Py, Pz, Pta, Px, Py, Ptb
+ fp.Add(e, Px, Py) // x+y
+ fp.Sqr(a, Px) // A = x^2
+ fp.Sqr(b, Py) // B = y^2
+ fp.Sqr(c, Pz) // z^2
+ fp.Add(c, c, c) // C = 2*z^2
+ fp.Add(h, a, b) // H = A+B
+ fp.Sqr(e, e) // (x+y)^2
+ fp.Sub(e, e, h) // E = (x+y)^2-A-B
+ fp.Sub(g, b, a) // G = B-A
+ fp.Sub(f, c, g) // F = C-G
+ fp.Mul(Pz, f, g) // Z = F * G
+ fp.Mul(Px, e, f) // X = E * F
+ fp.Mul(Py, g, h) // Y = G * H, T = E * H
+}
+
+// mixAdd calculates P= P+Q, where Q is a precomputed point with Z_Q = 1.
+func (P *twistPoint) mixAddZ1(Q *preTwistPointAffine) {
+ fp.Add(&P.z, &P.z, &P.z) // D = 2*z1 (z2=1)
+ P.coreAddition(Q)
+}
+
+// coreAddition calculates P=P+Q for curves with A=-1.
+func (P *twistPoint) coreAddition(Q *preTwistPointAffine) {
+ // This is the formula following (5) from "Twisted Edwards Curves Revisited" by
+ // Hisil H., Wong K.KH., Carter G., Dawson E. (2008)
+ // https://doi.org/10.1007/978-3-540-89255-7_20
+ Px, Py, Pz, Pta, Ptb := &P.x, &P.y, &P.z, &P.ta, &P.tb
+ addYX2, subYX2, dt2 := &Q.addYX, &Q.subYX, &Q.dt2
+ a, b, c, d, e, f, g, h := Px, Py, &fp.Elt{}, Pz, Pta, Px, Py, Ptb
+ fp.Mul(c, Pta, Ptb) // t1 = ta*tb
+ fp.Sub(h, Py, Px) // y1-x1
+ fp.Add(b, Py, Px) // y1+x1
+ fp.Mul(a, h, subYX2) // A = (y1-x1)*(y2-x2)
+ fp.Mul(b, b, addYX2) // B = (y1+x1)*(y2+x2)
+ fp.Mul(c, c, dt2) // C = 2*D*t1*t2
+ fp.Sub(e, b, a) // E = B-A
+ fp.Add(h, b, a) // H = B+A
+ fp.Sub(f, d, c) // F = D-C
+ fp.Add(g, d, c) // G = D+C
+ fp.Mul(Pz, f, g) // Z = F * G
+ fp.Mul(Px, e, f) // X = E * F
+ fp.Mul(Py, g, h) // Y = G * H, T = E * H
+}
+
+func (P *preTwistPointAffine) neg() {
+ P.addYX, P.subYX = P.subYX, P.addYX
+ fp.Neg(&P.dt2, &P.dt2)
+}
+
+func (P *preTwistPointAffine) cneg(b int) {
+ t := &fp.Elt{}
+ fp.Cswap(&P.addYX, &P.subYX, uint(b))
+ fp.Neg(t, &P.dt2)
+ fp.Cmov(&P.dt2, t, uint(b))
+}
+
+func (P *preTwistPointAffine) cmov(Q *preTwistPointAffine, b uint) {
+ fp.Cmov(&P.addYX, &Q.addYX, b)
+ fp.Cmov(&P.subYX, &Q.subYX, b)
+ fp.Cmov(&P.dt2, &Q.dt2, b)
+}
+
+// mixAdd calculates P= P+Q, where Q is a precomputed point with Z_Q != 1.
+func (P *twistPoint) mixAdd(Q *preTwistPointProy) {
+ fp.Mul(&P.z, &P.z, &Q.z2) // D = 2*z1*z2
+ P.coreAddition(&Q.preTwistPointAffine)
+}
+
+// oddMultiples calculates T[i] = (2*i-1)P for 0 < i < len(T).
+func (P *twistPoint) oddMultiples(T []preTwistPointProy) {
+ if n := len(T); n > 0 {
+ T[0].FromTwistPoint(P)
+ _2P := *P
+ _2P.Double()
+ R := &preTwistPointProy{}
+ R.FromTwistPoint(&_2P)
+ for i := 1; i < n; i++ {
+ P.mixAdd(R)
+ T[i].FromTwistPoint(P)
+ }
+ }
+}
+
+// cmov conditionally moves Q into P if b=1.
+func (P *preTwistPointProy) cmov(Q *preTwistPointProy, b uint) {
+ P.preTwistPointAffine.cmov(&Q.preTwistPointAffine, b)
+ fp.Cmov(&P.z2, &Q.z2, b)
+}
+
+// FromTwistPoint precomputes some coordinates of Q for missed addition.
+func (P *preTwistPointProy) FromTwistPoint(Q *twistPoint) {
+ fp.Add(&P.addYX, &Q.y, &Q.x) // addYX = X + Y
+ fp.Sub(&P.subYX, &Q.y, &Q.x) // subYX = Y - X
+ fp.Mul(&P.dt2, &Q.ta, &Q.tb) // T = ta*tb
+ fp.Mul(&P.dt2, &P.dt2, ¶mDTwist) // D*T
+ fp.Add(&P.dt2, &P.dt2, &P.dt2) // dt2 = 2*D*T
+ fp.Add(&P.z2, &Q.z, &Q.z) // z2 = 2*Z
+}
diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/twistTables.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/twistTables.go
new file mode 100644
index 0000000000..ed432e02c7
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/ecc/goldilocks/twistTables.go
@@ -0,0 +1,216 @@
+package goldilocks
+
+import fp "github.com/cloudflare/circl/math/fp448"
+
+var tabFixMult = [fxV][fx2w1]preTwistPointAffine{
+ {
+ {
+ addYX: fp.Elt{0x65, 0x4a, 0xdd, 0xdf, 0xb4, 0x79, 0x60, 0xc8, 0xa1, 0x70, 0xb4, 0x3a, 0x1e, 0x0c, 0x9b, 0x19, 0xe5, 0x48, 0x3f, 0xd7, 0x44, 0x18, 0x18, 0x14, 0x14, 0x27, 0x45, 0xd0, 0x2b, 0x24, 0xd5, 0x93, 0xc3, 0x74, 0x4c, 0x50, 0x70, 0x43, 0x26, 0x05, 0x08, 0x24, 0xca, 0x78, 0x30, 0xc1, 0x06, 0x8d, 0xd4, 0x86, 0x42, 0xf0, 0x14, 0xde, 0x08, 0x05},
+ subYX: fp.Elt{0x64, 0x4a, 0xdd, 0xdf, 0xb4, 0x79, 0x60, 0xc8, 0xa1, 0x70, 0xb4, 0x3a, 0x1e, 0x0c, 0x9b, 0x19, 0xe5, 0x48, 0x3f, 0xd7, 0x44, 0x18, 0x18, 0x14, 0x14, 0x27, 0x45, 0xd0, 0x2d, 0x24, 0xd5, 0x93, 0xc3, 0x74, 0x4c, 0x50, 0x70, 0x43, 0x26, 0x05, 0x08, 0x24, 0xca, 0x78, 0x30, 0xc1, 0x06, 0x8d, 0xd4, 0x86, 0x42, 0xf0, 0x14, 0xde, 0x08, 0x05},
+ dt2: fp.Elt{0x1a, 0x33, 0xea, 0x64, 0x45, 0x1c, 0xdf, 0x17, 0x1d, 0x16, 0x34, 0x28, 0xd6, 0x61, 0x19, 0x67, 0x79, 0xb4, 0x13, 0xcf, 0x3e, 0x7c, 0x0e, 0x72, 0xda, 0xf1, 0x5f, 0xda, 0xe6, 0xcf, 0x42, 0xd3, 0xb6, 0x17, 0xc2, 0x68, 0x13, 0x2d, 0xd9, 0x60, 0x3e, 0xae, 0xf0, 0x5b, 0x96, 0xf0, 0xcd, 0xaf, 0xea, 0xb7, 0x0d, 0x59, 0x16, 0xa7, 0xff, 0x55},
+ },
+ {
+ addYX: fp.Elt{0xca, 0xd8, 0x7d, 0x86, 0x1a, 0xef, 0xad, 0x11, 0xe3, 0x27, 0x41, 0x7e, 0x7f, 0x3e, 0xa9, 0xd2, 0xb5, 0x4e, 0x50, 0xe0, 0x77, 0x91, 0xc2, 0x13, 0x52, 0x73, 0x41, 0x09, 0xa6, 0x57, 0x9a, 0xc8, 0xa8, 0x90, 0x9d, 0x26, 0x14, 0xbb, 0xa1, 0x2a, 0xf7, 0x45, 0x43, 0x4e, 0xea, 0x35, 0x62, 0xe1, 0x08, 0x85, 0x46,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cd, 0xfe, 0x07, 0xf6, 0x4c, 0xe2, 0x1d, 0x9b, 0xd8, 0x82, 0x09, 0x5b, 0x11, 0x10, 0x62, 0x56, 0x89, 0xbd},
+ dt2: fp.Elt{0xd9, 0x15, 0x73, 0xf2, 0x96, 0x35, 0x53, 0xb0, 0xe7, 0xa8, 0x0b, 0x93, 0x35, 0x0b, 0x3a, 0x00, 0xf5, 0x18, 0xb1, 0xc3, 0x12, 0x3f, 0x91, 0x17, 0xc1, 0x4c, 0x15, 0x5a, 0x86, 0x92, 0x11, 0xbd, 0x44, 0x40, 0x5a, 0x7b, 0x15, 0x89, 0xba, 0xc1, 0xc1, 0xbc, 0x43, 0x45, 0xe6, 0x52, 0x02, 0x73, 0x0a, 0xd0, 0x2a, 0x19, 0xda, 0x47, 0xa8, 0xff},
+ },
+ },
+}
+
+// tabVerif contains the odd multiples of P. The entry T[i] = (2i+1)P, where
+// P = phi(G) and G is the generator of the Goldilocks curve, and phi is a
+// 4-degree isogeny.
+var tabVerif = [1 << (omegaFix - 2)]preTwistPointAffine{
+ { /* 1P*/
+ addYX: fp.Elt{0x65, 0x4a, 0xdd, 0xdf, 0xb4, 0x79, 0x60, 0xc8, 0xa1, 0x70, 0xb4, 0x3a, 0x1e, 0x0c, 0x9b, 0x19, 0xe5, 0x48, 0x3f, 0xd7, 0x44, 0x18, 0x18, 0x14, 0x14, 0x27, 0x45, 0xd0, 0x2b, 0x24, 0xd5, 0x93, 0xc3, 0x74, 0x4c, 0x50, 0x70, 0x43, 0x26, 0x05, 0x08, 0x24, 0xca, 0x78, 0x30, 0xc1, 0x06, 0x8d, 0xd4, 0x86, 0x42, 0xf0, 0x14, 0xde, 0x08, 0x05},
+ subYX: fp.Elt{0x64, 0x4a, 0xdd, 0xdf, 0xb4, 0x79, 0x60, 0xc8, 0xa1, 0x70, 0xb4, 0x3a, 0x1e, 0x0c, 0x9b, 0x19, 0xe5, 0x48, 0x3f, 0xd7, 0x44, 0x18, 0x18, 0x14, 0x14, 0x27, 0x45, 0xd0, 0x2d, 0x24, 0xd5, 0x93, 0xc3, 0x74, 0x4c, 0x50, 0x70, 0x43, 0x26, 0x05, 0x08, 0x24, 0xca, 0x78, 0x30, 0xc1, 0x06, 0x8d, 0xd4, 0x86, 0x42, 0xf0, 0x14, 0xde, 0x08, 0x05},
+ dt2: fp.Elt{0x1a, 0x33, 0xea, 0x64, 0x45, 0x1c, 0xdf, 0x17, 0x1d, 0x16, 0x34, 0x28, 0xd6, 0x61, 0x19, 0x67, 0x79, 0xb4, 0x13, 0xcf, 0x3e, 0x7c, 0x0e, 0x72, 0xda, 0xf1, 0x5f, 0xda, 0xe6, 0xcf, 0x42, 0xd3, 0xb6, 0x17, 0xc2, 0x68, 0x13, 0x2d, 0xd9, 0x60, 0x3e, 0xae, 0xf0, 0x5b, 0x96, 0xf0, 0xcd, 0xaf, 0xea, 0xb7, 0x0d, 0x59, 0x16, 0xa7, 0xff, 0x55},
+ },
+ { /* 3P*/
+ addYX: fp.Elt{0xd1, 0xe9, 0xa8, 0x33, 0x20, 0x76, 0x18, 0x08, 0x45, 0x2a, 0xc9, 0x67, 0x2a, 0xc3, 0x15, 0x24, 0xf9, 0x74, 0x21, 0x30, 0x99, 0x59, 0x8b, 0xb2, 0xf0, 0xa4, 0x07, 0xe2, 0x6a, 0x36, 0x8d, 0xd9, 0xd2, 0x4a, 0x7f, 0x73, 0x50, 0x39, 0x3d, 0xaa, 0xa7, 0x51, 0x73, 0x0d, 0x2b, 0x8b, 0x96, 0x47, 0xac, 0x3c, 0x5d, 0xaa, 0x39, 0x9c, 0xcf, 0xd5},
+ subYX: fp.Elt{0x6b, 0x11, 0x5d, 0x1a, 0xf9, 0x41, 0x9d, 0xc5, 0x30, 0x3e, 0xad, 0x25, 0x2c, 0x04, 0x45, 0xea, 0xcc, 0x67, 0x07, 0x85, 0xe9, 0xda, 0x0e, 0xb5, 0x40, 0xb7, 0x32, 0xb4, 0x49, 0xdd, 0xff, 0xaa, 0xfc, 0xbb,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x50, 0x6f, 0x32, 0x30, 0x88, 0xa6, 0xe5, 0x48, 0x28, 0xa2, 0x1b, 0x9f, 0xcd, 0xe2, 0x43, 0x38},
+ dt2: fp.Elt{0xa9, 0xcc, 0x53, 0x39, 0x86, 0x02, 0x60, 0x75, 0x34, 0x99, 0x57, 0xbd, 0xfc, 0x5a, 0x8e, 0xce, 0x5e, 0x98, 0x22, 0xd0, 0xa5, 0x24, 0xff, 0x90, 0x28, 0x9f, 0x58, 0xf3, 0x39, 0xe9, 0xba, 0x36, 0x23, 0xfb, 0x7f, 0x41, 0xcc, 0x2b, 0x5a, 0x25, 0x3f, 0x4c, 0x2a, 0xf1, 0x52, 0x6f, 0x2f, 0x07, 0xe3, 0x88, 0x81, 0x77, 0xdd, 0x7c, 0x88, 0x82},
+ },
+ { /* 7P*/
+ addYX: fp.Elt{0xf7, 0xee, 0x88, 0xfd, 0x3a, 0xbf, 0x7e, 0x28, 0x39, 0x23, 0x79, 0xe6, 0x5c, 0x56, 0xcb, 0xb5, 0x48, 0x6a, 0x80, 0x6d, 0x37, 0x60, 0x6c, 0x10, 0x35, 0x49, 0x4b, 0x46, 0x60, 0xd4, 0x79, 0xd4, 0x53, 0xd3, 0x67, 0x88, 0xd0, 0x41, 0xd5, 0x43, 0x85, 0xc8, 0x71, 0xe3, 0x1c, 0xb6, 0xda, 0x22, 0x64, 0x8f, 0x80, 0xac, 0xad, 0x7d, 0xd5, 0x82},
+ subYX: fp.Elt{0x92, 0x40, 0xc1, 0x83, 0x21, 0x9b, 0xd5, 0x7d, 0x3f, 0x29, 0xb6, 0x26, 0xef, 0x12, 0xb9, 0x27, 0x39, 0x42, 0x37, 0x97, 0x09, 0x9a, 0x08, 0xe1, 0x68, 0xb6, 0x7a, 0x3f, 0x9f, 0x45, 0xf8, 0x37, 0x19, 0x83, 0x97, 0xe6, 0x73, 0x30, 0x32, 0x35, 0xcf, 0xae, 0x5c, 0x12, 0x68, 0xdf, 0x6e, 0x2b, 0xde, 0x83, 0x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xa5, 0xa2, 0x63, 0x94, 0xd1, 0x1c, 0x39, 0x58, 0x57, 0x02, 0x27, 0x98, 0xb6, 0x47, 0xc6, 0x61, 0x4b, 0x5c, 0xab, 0x6f, 0x2d, 0xab, 0xe3, 0xc1, 0x69, 0xf9, 0x12, 0xb0, 0xc8, 0xd5},
+ },
+ { /* 19P*/
+ addYX: fp.Elt{0x19, 0x7d, 0xd5, 0xac, 0x79, 0xa2, 0x82, 0x9b, 0x28, 0x31, 0x22, 0xc0, 0x73, 0x02, 0x76, 0x17, 0x10, 0x70, 0x79, 0x57, 0xc9, 0x84, 0x62, 0x8e, 0x04, 0x04, 0x61, 0x67, 0x08, 0x48, 0xb4, 0x4b, 0xde, 0x53, 0x8c, 0xff, 0x36, 0x1b, 0x62, 0x86, 0x5d, 0xe1, 0x9b, 0xb1, 0xe5, 0xe8, 0x44, 0x64, 0xa1, 0x68, 0x3f, 0xa8, 0x45, 0x52, 0x91, 0xed},
+ subYX: fp.Elt{0x42, 0x1a, 0x36, 0x1f, 0x90, 0x15, 0x24, 0x8d, 0x24, 0x80, 0xe6, 0xfe, 0x1e, 0xf0, 0xad, 0xaf, 0x6a, 0x93, 0xf0, 0xa6, 0x0d, 0x5d, 0xea, 0xf6, 0x62, 0x96, 0x7a, 0x05, 0x76, 0x85, 0x74, 0x32, 0xc7, 0xc8, 0x64, 0x53, 0x62, 0xe7, 0x54, 0x84, 0xe0, 0x40, 0x66, 0x19, 0x70, 0x40, 0x95, 0x35, 0x68, 0x64, 0x43, 0xcd, 0xba, 0x29, 0x32, 0xa8},
+ dt2: fp.Elt{0x3e, 0xf6, 0xd6, 0xe4, 0x99, 0xeb, 0x20, 0x66, 0x08, 0x2e, 0x26, 0x64, 0xd7, 0x76, 0xf3, 0xb4, 0xc5, 0xa4, 0x35, 0x92, 0xd2, 0x99, 0x70, 0x5a, 0x1a, 0xe9, 0xe9, 0x3d, 0x3b, 0xe1, 0xcd, 0x0e, 0xee, 0x24, 0x13, 0x03, 0x22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64, 0x66, 0x61, 0xde, 0xf3, 0x6d, 0xd4, 0xae, 0x8e, 0xb1, 0x72, 0xe0, 0xcd, 0x37, 0x01, 0x28, 0x52, 0xd7, 0x39, 0x46, 0x0c, 0x55, 0xcf, 0x47, 0x70, 0xef, 0xa1, 0x17},
+ subYX: fp.Elt{0x8d, 0x58, 0xde, 0x83, 0x88, 0x16, 0x0e, 0x12, 0x42, 0x03, 0x50, 0x60, 0x4b, 0xdf, 0xbf, 0x95, 0xcc, 0x7d, 0x18, 0x17, 0x7e, 0x31, 0x5d, 0x8a, 0x66, 0xc1, 0xcf, 0x14, 0xea, 0xf4, 0xf4, 0xe5, 0x63, 0x2d, 0x32, 0x86, 0x9b, 0xed, 0x1f, 0x4f, 0x03, 0xaf, 0x33, 0x92, 0xcb, 0xaf, 0x9c, 0x05, 0x0d, 0x47, 0x1b, 0x42, 0xba, 0x13, 0x22, 0x98},
+ dt2: fp.Elt{0xb5, 0x48, 0xeb, 0x7d, 0x3d, 0x10, 0x9f, 0x59, 0xde, 0xf8, 0x1c, 0x4f, 0x7d, 0x9d, 0x40, 0x4d, 0x9e, 0x13, 0x24, 0xb5, 0x21, 0x09, 0xb7, 0xee, 0x98, 0x5c, 0x56, 0xbc, 0x5e, 0x2b, 0x78, 0x38, 0x06, 0xac, 0xe3, 0xe0, 0xfa, 0x2e, 0xde, 0x4f, 0xd2, 0xb3, 0xfb, 0x2d, 0x71, 0x84, 0xd1, 0x9d, 0x12, 0x5b, 0x35, 0xc8, 0x03, 0x68, 0x67, 0xc7},
+ },
+ { /* 39P*/
+ addYX: fp.Elt{0xb6, 0x65, 0xfb, 0xa7, 0x06, 0x35, 0xbb, 0xe0, 0x31, 0x8d, 0x91, 0x40, 0x98, 0xab, 0x30, 0xe4, 0xca, 0x12, 0x59, 0x89, 0xed, 0x65, 0x5d, 0x7f, 0xae, 0x69, 0xa0, 0xa4, 0xfa, 0x78, 0xb4, 0xf7, 0xed, 0xae, 0x86, 0x78, 0x79, 0x64, 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, 0x3f, 0x7c, 0x27, 0x35, 0x15, 0x91, 0x33, 0x8d, 0xf9, 0xc4, 0xf4, 0xf3, 0x90, 0x09, 0x75, 0x69, 0x62, 0x9f, 0x61, 0x35, 0x83, 0x92, 0x04, 0xef, 0x96, 0x38, 0x80, 0x9e, 0x88, 0xb3, 0x67, 0x95, 0xbe, 0x79, 0x3c, 0x35, 0xd8, 0xdc, 0xb2, 0x3e, 0x2d, 0xe6, 0x46, 0xbe, 0x81, 0xf3, 0x32, 0x0e, 0x37, 0x23, 0x75, 0x2a, 0x3d, 0xa0},
+ },
+}
diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/twist_basemult.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/twist_basemult.go
new file mode 100644
index 0000000000..f6ac5edbbb
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/ecc/goldilocks/twist_basemult.go
@@ -0,0 +1,62 @@
+package goldilocks
+
+import (
+ "crypto/subtle"
+
+ mlsb "github.com/cloudflare/circl/math/mlsbset"
+)
+
+const (
+ // MLSBRecoding parameters
+ fxT = 448
+ fxV = 2
+ fxW = 3
+ fx2w1 = 1 << (uint(fxW) - 1)
+)
+
+// ScalarBaseMult returns kG where G is the generator point.
+func (e twistCurve) ScalarBaseMult(k *Scalar) *twistPoint {
+ m, err := mlsb.New(fxT, fxV, fxW)
+ if err != nil {
+ panic(err)
+ }
+ if m.IsExtended() {
+ panic("not extended")
+ }
+
+ var isZero int
+ if k.IsZero() {
+ isZero = 1
+ }
+ subtle.ConstantTimeCopy(isZero, k[:], order[:])
+
+ minusK := *k
+ isEven := 1 - int(k[0]&0x1)
+ minusK.Neg()
+ subtle.ConstantTimeCopy(isEven, k[:], minusK[:])
+ c, err := m.Encode(k[:])
+ if err != nil {
+ panic(err)
+ }
+
+ gP := c.Exp(groupMLSB{})
+ P := gP.(*twistPoint)
+ P.cneg(uint(isEven))
+ return P
+}
+
+type groupMLSB struct{}
+
+func (e groupMLSB) ExtendedEltP() mlsb.EltP { return nil }
+func (e groupMLSB) Sqr(x mlsb.EltG) { x.(*twistPoint).Double() }
+func (e groupMLSB) Mul(x mlsb.EltG, y mlsb.EltP) { x.(*twistPoint).mixAddZ1(y.(*preTwistPointAffine)) }
+func (e groupMLSB) Identity() mlsb.EltG { return twistCurve{}.Identity() }
+func (e groupMLSB) NewEltP() mlsb.EltP { return &preTwistPointAffine{} }
+func (e groupMLSB) Lookup(a mlsb.EltP, v uint, s, u int32) {
+ Tabj := &tabFixMult[v]
+ P := a.(*preTwistPointAffine)
+ for k := range Tabj {
+ P.cmov(&Tabj[k], uint(subtle.ConstantTimeEq(int32(k), u)))
+ }
+ P.cneg(int(s >> 31))
+}
diff --git a/vendor/github.com/cloudflare/circl/internal/conv/conv.go b/vendor/github.com/cloudflare/circl/internal/conv/conv.go
new file mode 100644
index 0000000000..3fd0df496f
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/internal/conv/conv.go
@@ -0,0 +1,173 @@
+package conv
+
+import (
+ "encoding/binary"
+ "fmt"
+ "math/big"
+ "strings"
+
+ "golang.org/x/crypto/cryptobyte"
+)
+
+// BytesLe2Hex returns an hexadecimal string of a number stored in a
+// little-endian order slice x.
+func BytesLe2Hex(x []byte) string {
+ b := &strings.Builder{}
+ b.Grow(2*len(x) + 2)
+ fmt.Fprint(b, "0x")
+ if len(x) == 0 {
+ fmt.Fprint(b, "00")
+ }
+ for i := len(x) - 1; i >= 0; i-- {
+ fmt.Fprintf(b, "%02x", x[i])
+ }
+ return b.String()
+}
+
+// BytesLe2BigInt converts a little-endian slice x into a big-endian
+// math/big.Int.
+func BytesLe2BigInt(x []byte) *big.Int {
+ n := len(x)
+ b := new(big.Int)
+ if len(x) > 0 {
+ y := make([]byte, n)
+ for i := 0; i < n; i++ {
+ y[n-1-i] = x[i]
+ }
+ b.SetBytes(y)
+ }
+ return b
+}
+
+// BytesBe2Uint64Le converts a big-endian slice x to a little-endian slice of uint64.
+func BytesBe2Uint64Le(x []byte) []uint64 {
+ l := len(x)
+ z := make([]uint64, (l+7)/8)
+ blocks := l / 8
+ for i := 0; i < blocks; i++ {
+ z[i] = binary.BigEndian.Uint64(x[l-8*(i+1):])
+ }
+ remBytes := l % 8
+ for i := 0; i < remBytes; i++ {
+ z[blocks] |= uint64(x[l-1-8*blocks-i]) << uint(8*i)
+ }
+ return z
+}
+
+// BigInt2BytesLe stores a positive big.Int number x into a little-endian slice z.
+// The slice is modified if the bitlength of x <= 8*len(z) (padding with zeros).
+// If x does not fit in the slice or is negative, z is not modified.
+func BigInt2BytesLe(z []byte, x *big.Int) {
+ xLen := (x.BitLen() + 7) >> 3
+ zLen := len(z)
+ if zLen >= xLen && x.Sign() >= 0 {
+ y := x.Bytes()
+ for i := 0; i < xLen; i++ {
+ z[i] = y[xLen-1-i]
+ }
+ for i := xLen; i < zLen; i++ {
+ z[i] = 0
+ }
+ }
+}
+
+// Uint64Le2BigInt converts a little-endian slice x into a big number.
+func Uint64Le2BigInt(x []uint64) *big.Int {
+ n := len(x)
+ b := new(big.Int)
+ var bi big.Int
+ for i := n - 1; i >= 0; i-- {
+ bi.SetUint64(x[i])
+ b.Lsh(b, 64)
+ b.Add(b, &bi)
+ }
+ return b
+}
+
+// Uint64Le2BytesLe converts a little-endian slice x to a little-endian slice of bytes.
+func Uint64Le2BytesLe(x []uint64) []byte {
+ b := make([]byte, 8*len(x))
+ n := len(x)
+ for i := 0; i < n; i++ {
+ binary.LittleEndian.PutUint64(b[i*8:], x[i])
+ }
+ return b
+}
+
+// Uint64Le2BytesBe converts a little-endian slice x to a big-endian slice of bytes.
+func Uint64Le2BytesBe(x []uint64) []byte {
+ b := make([]byte, 8*len(x))
+ n := len(x)
+ for i := 0; i < n; i++ {
+ binary.BigEndian.PutUint64(b[i*8:], x[n-1-i])
+ }
+ return b
+}
+
+// Uint64Le2Hex returns an hexadecimal string of a number stored in a
+// little-endian order slice x.
+func Uint64Le2Hex(x []uint64) string {
+ b := new(strings.Builder)
+ b.Grow(16*len(x) + 2)
+ fmt.Fprint(b, "0x")
+ if len(x) == 0 {
+ fmt.Fprint(b, "00")
+ }
+ for i := len(x) - 1; i >= 0; i-- {
+ fmt.Fprintf(b, "%016x", x[i])
+ }
+ return b.String()
+}
+
+// BigInt2Uint64Le stores a positive big.Int number x into a little-endian slice z.
+// The slice is modified if the bitlength of x <= 8*len(z) (padding with zeros).
+// If x does not fit in the slice or is negative, z is not modified.
+func BigInt2Uint64Le(z []uint64, x *big.Int) {
+ xLen := (x.BitLen() + 63) >> 6 // number of 64-bit words
+ zLen := len(z)
+ if zLen >= xLen && x.Sign() > 0 {
+ var y, yi big.Int
+ y.Set(x)
+ two64 := big.NewInt(1)
+ two64.Lsh(two64, 64).Sub(two64, big.NewInt(1))
+ for i := 0; i < xLen; i++ {
+ yi.And(&y, two64)
+ z[i] = yi.Uint64()
+ y.Rsh(&y, 64)
+ }
+ }
+ for i := xLen; i < zLen; i++ {
+ z[i] = 0
+ }
+}
+
+// MarshalBinary encodes a value into a byte array in a format readable by UnmarshalBinary.
+func MarshalBinary(v cryptobyte.MarshalingValue) ([]byte, error) {
+ const DefaultSize = 32
+ b := cryptobyte.NewBuilder(make([]byte, 0, DefaultSize))
+ b.AddValue(v)
+ return b.Bytes()
+}
+
+// MarshalBinaryLen encodes a value into an array of n bytes in a format readable by UnmarshalBinary.
+func MarshalBinaryLen(v cryptobyte.MarshalingValue, length uint) ([]byte, error) {
+ b := cryptobyte.NewFixedBuilder(make([]byte, 0, length))
+ b.AddValue(v)
+ return b.Bytes()
+}
+
+// A UnmarshalingValue decodes itself from a cryptobyte.String and advances the pointer.
+// It reports whether the read was successful.
+type UnmarshalingValue interface {
+ Unmarshal(*cryptobyte.String) bool
+}
+
+// UnmarshalBinary recovers a value from a byte array.
+// It returns an error if the read was unsuccessful.
+func UnmarshalBinary(v UnmarshalingValue, data []byte) (err error) {
+ s := cryptobyte.String(data)
+ if data == nil || !v.Unmarshal(&s) || !s.Empty() {
+ err = fmt.Errorf("cannot read %T from input string", v)
+ }
+ return
+}
diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/doc.go b/vendor/github.com/cloudflare/circl/internal/sha3/doc.go
new file mode 100644
index 0000000000..7e02309070
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/internal/sha3/doc.go
@@ -0,0 +1,62 @@
+// 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 sha3 implements the SHA-3 fixed-output-length hash functions and
+// the SHAKE variable-output-length hash functions defined by FIPS-202.
+//
+// Both types of hash function use the "sponge" construction and the Keccak
+// permutation. For a detailed specification see http://keccak.noekeon.org/
+//
+// # Guidance
+//
+// If you aren't sure what function you need, use SHAKE256 with at least 64
+// bytes of output. The SHAKE instances are faster than the SHA3 instances;
+// the latter have to allocate memory to conform to the hash.Hash interface.
+//
+// If you need a secret-key MAC (message authentication code), prepend the
+// secret key to the input, hash with SHAKE256 and read at least 32 bytes of
+// output.
+//
+// # Security strengths
+//
+// The SHA3-x (x equals 224, 256, 384, or 512) functions have a security
+// strength against preimage attacks of x bits. Since they only produce "x"
+// bits of output, their collision-resistance is only "x/2" bits.
+//
+// The SHAKE-256 and -128 functions have a generic security strength of 256 and
+// 128 bits against all attacks, provided that at least 2x bits of their output
+// is used. Requesting more than 64 or 32 bytes of output, respectively, does
+// not increase the collision-resistance of the SHAKE functions.
+//
+// # The sponge construction
+//
+// A sponge builds a pseudo-random function from a public pseudo-random
+// permutation, by applying the permutation to a state of "rate + capacity"
+// bytes, but hiding "capacity" of the bytes.
+//
+// A sponge starts out with a zero state. To hash an input using a sponge, up
+// to "rate" bytes of the input are XORed into the sponge's state. The sponge
+// is then "full" and the permutation is applied to "empty" it. This process is
+// repeated until all the input has been "absorbed". The input is then padded.
+// The digest is "squeezed" from the sponge in the same way, except that output
+// is copied out instead of input being XORed in.
+//
+// A sponge is parameterized by its generic security strength, which is equal
+// to half its capacity; capacity + rate is equal to the permutation's width.
+// Since the KeccakF-1600 permutation is 1600 bits (200 bytes) wide, this means
+// that the security strength of a sponge instance is equal to (1600 - bitrate) / 2.
+//
+// # Recommendations
+//
+// The SHAKE functions are recommended for most new uses. They can produce
+// output of arbitrary length. SHAKE256, with an output length of at least
+// 64 bytes, provides 256-bit security against all attacks. The Keccak team
+// recommends it for most applications upgrading from SHA2-512. (NIST chose a
+// much stronger, but much slower, sponge instance for SHA3-512.)
+//
+// The SHA-3 functions are "drop-in" replacements for the SHA-2 functions.
+// They produce output of the same length, with the same security strengths
+// against all attacks. This means, in particular, that SHA3-256 only has
+// 128-bit collision resistance, because its output length is 32 bytes.
+package sha3
diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/hashes.go b/vendor/github.com/cloudflare/circl/internal/sha3/hashes.go
new file mode 100644
index 0000000000..7d2365a76e
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/internal/sha3/hashes.go
@@ -0,0 +1,69 @@
+// 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 sha3
+
+// This file provides functions for creating instances of the SHA-3
+// and SHAKE hash functions, as well as utility functions for hashing
+// bytes.
+
+// New224 creates a new SHA3-224 hash.
+// Its generic security strength is 224 bits against preimage attacks,
+// and 112 bits against collision attacks.
+func New224() State {
+ return State{rate: 144, outputLen: 28, dsbyte: 0x06}
+}
+
+// New256 creates a new SHA3-256 hash.
+// Its generic security strength is 256 bits against preimage attacks,
+// and 128 bits against collision attacks.
+func New256() State {
+ return State{rate: 136, outputLen: 32, dsbyte: 0x06}
+}
+
+// New384 creates a new SHA3-384 hash.
+// Its generic security strength is 384 bits against preimage attacks,
+// and 192 bits against collision attacks.
+func New384() State {
+ return State{rate: 104, outputLen: 48, dsbyte: 0x06}
+}
+
+// New512 creates a new SHA3-512 hash.
+// Its generic security strength is 512 bits against preimage attacks,
+// and 256 bits against collision attacks.
+func New512() State {
+ return State{rate: 72, outputLen: 64, dsbyte: 0x06}
+}
+
+// Sum224 returns the SHA3-224 digest of the data.
+func Sum224(data []byte) (digest [28]byte) {
+ h := New224()
+ _, _ = h.Write(data)
+ h.Sum(digest[:0])
+ return
+}
+
+// Sum256 returns the SHA3-256 digest of the data.
+func Sum256(data []byte) (digest [32]byte) {
+ h := New256()
+ _, _ = h.Write(data)
+ h.Sum(digest[:0])
+ return
+}
+
+// Sum384 returns the SHA3-384 digest of the data.
+func Sum384(data []byte) (digest [48]byte) {
+ h := New384()
+ _, _ = h.Write(data)
+ h.Sum(digest[:0])
+ return
+}
+
+// Sum512 returns the SHA3-512 digest of the data.
+func Sum512(data []byte) (digest [64]byte) {
+ h := New512()
+ _, _ = h.Write(data)
+ h.Sum(digest[:0])
+ return
+}
diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/keccakf.go b/vendor/github.com/cloudflare/circl/internal/sha3/keccakf.go
new file mode 100644
index 0000000000..1755fd1e6d
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/internal/sha3/keccakf.go
@@ -0,0 +1,391 @@
+// 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 sha3
+
+// KeccakF1600 applies the Keccak permutation to a 1600b-wide
+// state represented as a slice of 25 uint64s.
+// If turbo is true, applies the 12-round variant instead of the
+// regular 24-round variant.
+// nolint:funlen
+func KeccakF1600(a *[25]uint64, turbo bool) {
+ // Implementation translated from Keccak-inplace.c
+ // in the keccak reference code.
+ var t, bc0, bc1, bc2, bc3, bc4, d0, d1, d2, d3, d4 uint64
+
+ i := 0
+
+ if turbo {
+ i = 12
+ }
+
+ for ; i < 24; i += 4 {
+ // Combines the 5 steps in each round into 2 steps.
+ // Unrolls 4 rounds per loop and spreads some steps across rounds.
+
+ // Round 1
+ bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]
+ bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]
+ bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]
+ bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]
+ bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]
+ d0 = bc4 ^ (bc1<<1 | bc1>>63)
+ d1 = bc0 ^ (bc2<<1 | bc2>>63)
+ d2 = bc1 ^ (bc3<<1 | bc3>>63)
+ d3 = bc2 ^ (bc4<<1 | bc4>>63)
+ d4 = bc3 ^ (bc0<<1 | bc0>>63)
+
+ bc0 = a[0] ^ d0
+ t = a[6] ^ d1
+ bc1 = t<<44 | t>>(64-44)
+ t = a[12] ^ d2
+ bc2 = t<<43 | t>>(64-43)
+ t = a[18] ^ d3
+ bc3 = t<<21 | t>>(64-21)
+ t = a[24] ^ d4
+ bc4 = t<<14 | t>>(64-14)
+ a[0] = bc0 ^ (bc2 &^ bc1) ^ RC[i]
+ a[6] = bc1 ^ (bc3 &^ bc2)
+ a[12] = bc2 ^ (bc4 &^ bc3)
+ a[18] = bc3 ^ (bc0 &^ bc4)
+ a[24] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[10] ^ d0
+ bc2 = t<<3 | t>>(64-3)
+ t = a[16] ^ d1
+ bc3 = t<<45 | t>>(64-45)
+ t = a[22] ^ d2
+ bc4 = t<<61 | t>>(64-61)
+ t = a[3] ^ d3
+ bc0 = t<<28 | t>>(64-28)
+ t = a[9] ^ d4
+ bc1 = t<<20 | t>>(64-20)
+ a[10] = bc0 ^ (bc2 &^ bc1)
+ a[16] = bc1 ^ (bc3 &^ bc2)
+ a[22] = bc2 ^ (bc4 &^ bc3)
+ a[3] = bc3 ^ (bc0 &^ bc4)
+ a[9] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[20] ^ d0
+ bc4 = t<<18 | t>>(64-18)
+ t = a[1] ^ d1
+ bc0 = t<<1 | t>>(64-1)
+ t = a[7] ^ d2
+ bc1 = t<<6 | t>>(64-6)
+ t = a[13] ^ d3
+ bc2 = t<<25 | t>>(64-25)
+ t = a[19] ^ d4
+ bc3 = t<<8 | t>>(64-8)
+ a[20] = bc0 ^ (bc2 &^ bc1)
+ a[1] = bc1 ^ (bc3 &^ bc2)
+ a[7] = bc2 ^ (bc4 &^ bc3)
+ a[13] = bc3 ^ (bc0 &^ bc4)
+ a[19] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[5] ^ d0
+ bc1 = t<<36 | t>>(64-36)
+ t = a[11] ^ d1
+ bc2 = t<<10 | t>>(64-10)
+ t = a[17] ^ d2
+ bc3 = t<<15 | t>>(64-15)
+ t = a[23] ^ d3
+ bc4 = t<<56 | t>>(64-56)
+ t = a[4] ^ d4
+ bc0 = t<<27 | t>>(64-27)
+ a[5] = bc0 ^ (bc2 &^ bc1)
+ a[11] = bc1 ^ (bc3 &^ bc2)
+ a[17] = bc2 ^ (bc4 &^ bc3)
+ a[23] = bc3 ^ (bc0 &^ bc4)
+ a[4] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[15] ^ d0
+ bc3 = t<<41 | t>>(64-41)
+ t = a[21] ^ d1
+ bc4 = t<<2 | t>>(64-2)
+ t = a[2] ^ d2
+ bc0 = t<<62 | t>>(64-62)
+ t = a[8] ^ d3
+ bc1 = t<<55 | t>>(64-55)
+ t = a[14] ^ d4
+ bc2 = t<<39 | t>>(64-39)
+ a[15] = bc0 ^ (bc2 &^ bc1)
+ a[21] = bc1 ^ (bc3 &^ bc2)
+ a[2] = bc2 ^ (bc4 &^ bc3)
+ a[8] = bc3 ^ (bc0 &^ bc4)
+ a[14] = bc4 ^ (bc1 &^ bc0)
+
+ // Round 2
+ bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]
+ bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]
+ bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]
+ bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]
+ bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]
+ d0 = bc4 ^ (bc1<<1 | bc1>>63)
+ d1 = bc0 ^ (bc2<<1 | bc2>>63)
+ d2 = bc1 ^ (bc3<<1 | bc3>>63)
+ d3 = bc2 ^ (bc4<<1 | bc4>>63)
+ d4 = bc3 ^ (bc0<<1 | bc0>>63)
+
+ bc0 = a[0] ^ d0
+ t = a[16] ^ d1
+ bc1 = t<<44 | t>>(64-44)
+ t = a[7] ^ d2
+ bc2 = t<<43 | t>>(64-43)
+ t = a[23] ^ d3
+ bc3 = t<<21 | t>>(64-21)
+ t = a[14] ^ d4
+ bc4 = t<<14 | t>>(64-14)
+ a[0] = bc0 ^ (bc2 &^ bc1) ^ RC[i+1]
+ a[16] = bc1 ^ (bc3 &^ bc2)
+ a[7] = bc2 ^ (bc4 &^ bc3)
+ a[23] = bc3 ^ (bc0 &^ bc4)
+ a[14] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[20] ^ d0
+ bc2 = t<<3 | t>>(64-3)
+ t = a[11] ^ d1
+ bc3 = t<<45 | t>>(64-45)
+ t = a[2] ^ d2
+ bc4 = t<<61 | t>>(64-61)
+ t = a[18] ^ d3
+ bc0 = t<<28 | t>>(64-28)
+ t = a[9] ^ d4
+ bc1 = t<<20 | t>>(64-20)
+ a[20] = bc0 ^ (bc2 &^ bc1)
+ a[11] = bc1 ^ (bc3 &^ bc2)
+ a[2] = bc2 ^ (bc4 &^ bc3)
+ a[18] = bc3 ^ (bc0 &^ bc4)
+ a[9] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[15] ^ d0
+ bc4 = t<<18 | t>>(64-18)
+ t = a[6] ^ d1
+ bc0 = t<<1 | t>>(64-1)
+ t = a[22] ^ d2
+ bc1 = t<<6 | t>>(64-6)
+ t = a[13] ^ d3
+ bc2 = t<<25 | t>>(64-25)
+ t = a[4] ^ d4
+ bc3 = t<<8 | t>>(64-8)
+ a[15] = bc0 ^ (bc2 &^ bc1)
+ a[6] = bc1 ^ (bc3 &^ bc2)
+ a[22] = bc2 ^ (bc4 &^ bc3)
+ a[13] = bc3 ^ (bc0 &^ bc4)
+ a[4] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[10] ^ d0
+ bc1 = t<<36 | t>>(64-36)
+ t = a[1] ^ d1
+ bc2 = t<<10 | t>>(64-10)
+ t = a[17] ^ d2
+ bc3 = t<<15 | t>>(64-15)
+ t = a[8] ^ d3
+ bc4 = t<<56 | t>>(64-56)
+ t = a[24] ^ d4
+ bc0 = t<<27 | t>>(64-27)
+ a[10] = bc0 ^ (bc2 &^ bc1)
+ a[1] = bc1 ^ (bc3 &^ bc2)
+ a[17] = bc2 ^ (bc4 &^ bc3)
+ a[8] = bc3 ^ (bc0 &^ bc4)
+ a[24] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[5] ^ d0
+ bc3 = t<<41 | t>>(64-41)
+ t = a[21] ^ d1
+ bc4 = t<<2 | t>>(64-2)
+ t = a[12] ^ d2
+ bc0 = t<<62 | t>>(64-62)
+ t = a[3] ^ d3
+ bc1 = t<<55 | t>>(64-55)
+ t = a[19] ^ d4
+ bc2 = t<<39 | t>>(64-39)
+ a[5] = bc0 ^ (bc2 &^ bc1)
+ a[21] = bc1 ^ (bc3 &^ bc2)
+ a[12] = bc2 ^ (bc4 &^ bc3)
+ a[3] = bc3 ^ (bc0 &^ bc4)
+ a[19] = bc4 ^ (bc1 &^ bc0)
+
+ // Round 3
+ bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]
+ bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]
+ bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]
+ bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]
+ bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]
+ d0 = bc4 ^ (bc1<<1 | bc1>>63)
+ d1 = bc0 ^ (bc2<<1 | bc2>>63)
+ d2 = bc1 ^ (bc3<<1 | bc3>>63)
+ d3 = bc2 ^ (bc4<<1 | bc4>>63)
+ d4 = bc3 ^ (bc0<<1 | bc0>>63)
+
+ bc0 = a[0] ^ d0
+ t = a[11] ^ d1
+ bc1 = t<<44 | t>>(64-44)
+ t = a[22] ^ d2
+ bc2 = t<<43 | t>>(64-43)
+ t = a[8] ^ d3
+ bc3 = t<<21 | t>>(64-21)
+ t = a[19] ^ d4
+ bc4 = t<<14 | t>>(64-14)
+ a[0] = bc0 ^ (bc2 &^ bc1) ^ RC[i+2]
+ a[11] = bc1 ^ (bc3 &^ bc2)
+ a[22] = bc2 ^ (bc4 &^ bc3)
+ a[8] = bc3 ^ (bc0 &^ bc4)
+ a[19] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[15] ^ d0
+ bc2 = t<<3 | t>>(64-3)
+ t = a[1] ^ d1
+ bc3 = t<<45 | t>>(64-45)
+ t = a[12] ^ d2
+ bc4 = t<<61 | t>>(64-61)
+ t = a[23] ^ d3
+ bc0 = t<<28 | t>>(64-28)
+ t = a[9] ^ d4
+ bc1 = t<<20 | t>>(64-20)
+ a[15] = bc0 ^ (bc2 &^ bc1)
+ a[1] = bc1 ^ (bc3 &^ bc2)
+ a[12] = bc2 ^ (bc4 &^ bc3)
+ a[23] = bc3 ^ (bc0 &^ bc4)
+ a[9] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[5] ^ d0
+ bc4 = t<<18 | t>>(64-18)
+ t = a[16] ^ d1
+ bc0 = t<<1 | t>>(64-1)
+ t = a[2] ^ d2
+ bc1 = t<<6 | t>>(64-6)
+ t = a[13] ^ d3
+ bc2 = t<<25 | t>>(64-25)
+ t = a[24] ^ d4
+ bc3 = t<<8 | t>>(64-8)
+ a[5] = bc0 ^ (bc2 &^ bc1)
+ a[16] = bc1 ^ (bc3 &^ bc2)
+ a[2] = bc2 ^ (bc4 &^ bc3)
+ a[13] = bc3 ^ (bc0 &^ bc4)
+ a[24] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[20] ^ d0
+ bc1 = t<<36 | t>>(64-36)
+ t = a[6] ^ d1
+ bc2 = t<<10 | t>>(64-10)
+ t = a[17] ^ d2
+ bc3 = t<<15 | t>>(64-15)
+ t = a[3] ^ d3
+ bc4 = t<<56 | t>>(64-56)
+ t = a[14] ^ d4
+ bc0 = t<<27 | t>>(64-27)
+ a[20] = bc0 ^ (bc2 &^ bc1)
+ a[6] = bc1 ^ (bc3 &^ bc2)
+ a[17] = bc2 ^ (bc4 &^ bc3)
+ a[3] = bc3 ^ (bc0 &^ bc4)
+ a[14] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[10] ^ d0
+ bc3 = t<<41 | t>>(64-41)
+ t = a[21] ^ d1
+ bc4 = t<<2 | t>>(64-2)
+ t = a[7] ^ d2
+ bc0 = t<<62 | t>>(64-62)
+ t = a[18] ^ d3
+ bc1 = t<<55 | t>>(64-55)
+ t = a[4] ^ d4
+ bc2 = t<<39 | t>>(64-39)
+ a[10] = bc0 ^ (bc2 &^ bc1)
+ a[21] = bc1 ^ (bc3 &^ bc2)
+ a[7] = bc2 ^ (bc4 &^ bc3)
+ a[18] = bc3 ^ (bc0 &^ bc4)
+ a[4] = bc4 ^ (bc1 &^ bc0)
+
+ // Round 4
+ bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]
+ bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]
+ bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]
+ bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]
+ bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]
+ d0 = bc4 ^ (bc1<<1 | bc1>>63)
+ d1 = bc0 ^ (bc2<<1 | bc2>>63)
+ d2 = bc1 ^ (bc3<<1 | bc3>>63)
+ d3 = bc2 ^ (bc4<<1 | bc4>>63)
+ d4 = bc3 ^ (bc0<<1 | bc0>>63)
+
+ bc0 = a[0] ^ d0
+ t = a[1] ^ d1
+ bc1 = t<<44 | t>>(64-44)
+ t = a[2] ^ d2
+ bc2 = t<<43 | t>>(64-43)
+ t = a[3] ^ d3
+ bc3 = t<<21 | t>>(64-21)
+ t = a[4] ^ d4
+ bc4 = t<<14 | t>>(64-14)
+ a[0] = bc0 ^ (bc2 &^ bc1) ^ RC[i+3]
+ a[1] = bc1 ^ (bc3 &^ bc2)
+ a[2] = bc2 ^ (bc4 &^ bc3)
+ a[3] = bc3 ^ (bc0 &^ bc4)
+ a[4] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[5] ^ d0
+ bc2 = t<<3 | t>>(64-3)
+ t = a[6] ^ d1
+ bc3 = t<<45 | t>>(64-45)
+ t = a[7] ^ d2
+ bc4 = t<<61 | t>>(64-61)
+ t = a[8] ^ d3
+ bc0 = t<<28 | t>>(64-28)
+ t = a[9] ^ d4
+ bc1 = t<<20 | t>>(64-20)
+ a[5] = bc0 ^ (bc2 &^ bc1)
+ a[6] = bc1 ^ (bc3 &^ bc2)
+ a[7] = bc2 ^ (bc4 &^ bc3)
+ a[8] = bc3 ^ (bc0 &^ bc4)
+ a[9] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[10] ^ d0
+ bc4 = t<<18 | t>>(64-18)
+ t = a[11] ^ d1
+ bc0 = t<<1 | t>>(64-1)
+ t = a[12] ^ d2
+ bc1 = t<<6 | t>>(64-6)
+ t = a[13] ^ d3
+ bc2 = t<<25 | t>>(64-25)
+ t = a[14] ^ d4
+ bc3 = t<<8 | t>>(64-8)
+ a[10] = bc0 ^ (bc2 &^ bc1)
+ a[11] = bc1 ^ (bc3 &^ bc2)
+ a[12] = bc2 ^ (bc4 &^ bc3)
+ a[13] = bc3 ^ (bc0 &^ bc4)
+ a[14] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[15] ^ d0
+ bc1 = t<<36 | t>>(64-36)
+ t = a[16] ^ d1
+ bc2 = t<<10 | t>>(64-10)
+ t = a[17] ^ d2
+ bc3 = t<<15 | t>>(64-15)
+ t = a[18] ^ d3
+ bc4 = t<<56 | t>>(64-56)
+ t = a[19] ^ d4
+ bc0 = t<<27 | t>>(64-27)
+ a[15] = bc0 ^ (bc2 &^ bc1)
+ a[16] = bc1 ^ (bc3 &^ bc2)
+ a[17] = bc2 ^ (bc4 &^ bc3)
+ a[18] = bc3 ^ (bc0 &^ bc4)
+ a[19] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[20] ^ d0
+ bc3 = t<<41 | t>>(64-41)
+ t = a[21] ^ d1
+ bc4 = t<<2 | t>>(64-2)
+ t = a[22] ^ d2
+ bc0 = t<<62 | t>>(64-62)
+ t = a[23] ^ d3
+ bc1 = t<<55 | t>>(64-55)
+ t = a[24] ^ d4
+ bc2 = t<<39 | t>>(64-39)
+ a[20] = bc0 ^ (bc2 &^ bc1)
+ a[21] = bc1 ^ (bc3 &^ bc2)
+ a[22] = bc2 ^ (bc4 &^ bc3)
+ a[23] = bc3 ^ (bc0 &^ bc4)
+ a[24] = bc4 ^ (bc1 &^ bc0)
+ }
+}
diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/rc.go b/vendor/github.com/cloudflare/circl/internal/sha3/rc.go
new file mode 100644
index 0000000000..6a3df42f30
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/internal/sha3/rc.go
@@ -0,0 +1,29 @@
+package sha3
+
+// RC stores the round constants for use in the ι step.
+var RC = [24]uint64{
+ 0x0000000000000001,
+ 0x0000000000008082,
+ 0x800000000000808A,
+ 0x8000000080008000,
+ 0x000000000000808B,
+ 0x0000000080000001,
+ 0x8000000080008081,
+ 0x8000000000008009,
+ 0x000000000000008A,
+ 0x0000000000000088,
+ 0x0000000080008009,
+ 0x000000008000000A,
+ 0x000000008000808B,
+ 0x800000000000008B,
+ 0x8000000000008089,
+ 0x8000000000008003,
+ 0x8000000000008002,
+ 0x8000000000000080,
+ 0x000000000000800A,
+ 0x800000008000000A,
+ 0x8000000080008081,
+ 0x8000000000008080,
+ 0x0000000080000001,
+ 0x8000000080008008,
+}
diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/sha3.go b/vendor/github.com/cloudflare/circl/internal/sha3/sha3.go
new file mode 100644
index 0000000000..a0df5aa6c5
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/internal/sha3/sha3.go
@@ -0,0 +1,200 @@
+// 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 sha3
+
+// spongeDirection indicates the direction bytes are flowing through the sponge.
+type spongeDirection int
+
+const (
+ // spongeAbsorbing indicates that the sponge is absorbing input.
+ spongeAbsorbing spongeDirection = iota
+ // spongeSqueezing indicates that the sponge is being squeezed.
+ spongeSqueezing
+)
+
+const (
+ // maxRate is the maximum size of the internal buffer. SHAKE-256
+ // currently needs the largest buffer.
+ maxRate = 168
+)
+
+func (d *State) buf() []byte {
+ return d.storage.asBytes()[d.bufo:d.bufe]
+}
+
+type State struct {
+ // Generic sponge components.
+ a [25]uint64 // main state of the hash
+ rate int // the number of bytes of state to use
+
+ bufo int // offset of buffer in storage
+ bufe int // end of buffer in storage
+
+ // dsbyte contains the "domain separation" bits and the first bit of
+ // the padding. Sections 6.1 and 6.2 of [1] separate the outputs of the
+ // SHA-3 and SHAKE functions by appending bitstrings to the message.
+ // Using a little-endian bit-ordering convention, these are "01" for SHA-3
+ // and "1111" for SHAKE, or 00000010b and 00001111b, respectively. Then the
+ // padding rule from section 5.1 is applied to pad the message to a multiple
+ // of the rate, which involves adding a "1" bit, zero or more "0" bits, and
+ // a final "1" bit. We merge the first "1" bit from the padding into dsbyte,
+ // giving 00000110b (0x06) and 00011111b (0x1f).
+ // [1] http://csrc.nist.gov/publications/drafts/fips-202/fips_202_draft.pdf
+ // "Draft FIPS 202: SHA-3 Standard: Permutation-Based Hash and
+ // Extendable-Output Functions (May 2014)"
+ dsbyte byte
+
+ storage storageBuf
+
+ // Specific to SHA-3 and SHAKE.
+ outputLen int // the default output size in bytes
+ state spongeDirection // whether the sponge is absorbing or squeezing
+ turbo bool // Whether we're using 12 rounds instead of 24
+}
+
+// BlockSize returns the rate of sponge underlying this hash function.
+func (d *State) BlockSize() int { return d.rate }
+
+// Size returns the output size of the hash function in bytes.
+func (d *State) Size() int { return d.outputLen }
+
+// Reset clears the internal state by zeroing the sponge state and
+// the byte buffer, and setting Sponge.state to absorbing.
+func (d *State) Reset() {
+ // Zero the permutation's state.
+ for i := range d.a {
+ d.a[i] = 0
+ }
+ d.state = spongeAbsorbing
+ d.bufo = 0
+ d.bufe = 0
+}
+
+func (d *State) clone() *State {
+ ret := *d
+ return &ret
+}
+
+// permute applies the KeccakF-1600 permutation. It handles
+// any input-output buffering.
+func (d *State) permute() {
+ switch d.state {
+ case spongeAbsorbing:
+ // If we're absorbing, we need to xor the input into the state
+ // before applying the permutation.
+ xorIn(d, d.buf())
+ d.bufe = 0
+ d.bufo = 0
+ KeccakF1600(&d.a, d.turbo)
+ case spongeSqueezing:
+ // If we're squeezing, we need to apply the permutation before
+ // copying more output.
+ KeccakF1600(&d.a, d.turbo)
+ d.bufe = d.rate
+ d.bufo = 0
+ copyOut(d, d.buf())
+ }
+}
+
+// pads appends the domain separation bits in dsbyte, applies
+// the multi-bitrate 10..1 padding rule, and permutes the state.
+func (d *State) padAndPermute(dsbyte byte) {
+ // Pad with this instance's domain-separator bits. We know that there's
+ // at least one byte of space in d.buf() because, if it were full,
+ // permute would have been called to empty it. dsbyte also contains the
+ // first one bit for the padding. See the comment in the state struct.
+ zerosStart := d.bufe + 1
+ d.bufe = d.rate
+ buf := d.buf()
+ buf[zerosStart-1] = dsbyte
+ for i := zerosStart; i < d.rate; i++ {
+ buf[i] = 0
+ }
+ // This adds the final one bit for the padding. Because of the way that
+ // bits are numbered from the LSB upwards, the final bit is the MSB of
+ // the last byte.
+ buf[d.rate-1] ^= 0x80
+ // Apply the permutation
+ d.permute()
+ d.state = spongeSqueezing
+ d.bufe = d.rate
+ copyOut(d, buf)
+}
+
+// Write absorbs more data into the hash's state. It produces an error
+// if more data is written to the ShakeHash after writing
+func (d *State) Write(p []byte) (written int, err error) {
+ if d.state != spongeAbsorbing {
+ panic("sha3: write to sponge after read")
+ }
+ written = len(p)
+
+ for len(p) > 0 {
+ bufl := d.bufe - d.bufo
+ if bufl == 0 && len(p) >= d.rate {
+ // The fast path; absorb a full "rate" bytes of input and apply the permutation.
+ xorIn(d, p[:d.rate])
+ p = p[d.rate:]
+ KeccakF1600(&d.a, d.turbo)
+ } else {
+ // The slow path; buffer the input until we can fill the sponge, and then xor it in.
+ todo := d.rate - bufl
+ if todo > len(p) {
+ todo = len(p)
+ }
+ d.bufe += todo
+ buf := d.buf()
+ copy(buf[bufl:], p[:todo])
+ p = p[todo:]
+
+ // If the sponge is full, apply the permutation.
+ if d.bufe == d.rate {
+ d.permute()
+ }
+ }
+ }
+
+ return written, nil
+}
+
+// Read squeezes an arbitrary number of bytes from the sponge.
+func (d *State) Read(out []byte) (n int, err error) {
+ // If we're still absorbing, pad and apply the permutation.
+ if d.state == spongeAbsorbing {
+ d.padAndPermute(d.dsbyte)
+ }
+
+ n = len(out)
+
+ // Now, do the squeezing.
+ for len(out) > 0 {
+ buf := d.buf()
+ n := copy(out, buf)
+ d.bufo += n
+ out = out[n:]
+
+ // Apply the permutation if we've squeezed the sponge dry.
+ if d.bufo == d.bufe {
+ d.permute()
+ }
+ }
+
+ return
+}
+
+// Sum applies padding to the hash state and then squeezes out the desired
+// number of output bytes.
+func (d *State) Sum(in []byte) []byte {
+ // Make a copy of the original hash so that caller can keep writing
+ // and summing.
+ dup := d.clone()
+ hash := make([]byte, dup.outputLen)
+ _, _ = dup.Read(hash)
+ return append(in, hash...)
+}
+
+func (d *State) IsAbsorbing() bool {
+ return d.state == spongeAbsorbing
+}
diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/sha3_s390x.s b/vendor/github.com/cloudflare/circl/internal/sha3/sha3_s390x.s
new file mode 100644
index 0000000000..8a4458f63f
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/internal/sha3/sha3_s390x.s
@@ -0,0 +1,33 @@
+// 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 !gccgo,!appengine
+
+#include "textflag.h"
+
+// func kimd(function code, chain *[200]byte, src []byte)
+TEXT ·kimd(SB), NOFRAME|NOSPLIT, $0-40
+ MOVD function+0(FP), R0
+ MOVD chain+8(FP), R1
+ LMG src+16(FP), R2, R3 // R2=base, R3=len
+
+continue:
+ WORD $0xB93E0002 // KIMD --, R2
+ BVS continue // continue if interrupted
+ MOVD $0, R0 // reset R0 for pre-go1.8 compilers
+ RET
+
+// func klmd(function code, chain *[200]byte, dst, src []byte)
+TEXT ·klmd(SB), NOFRAME|NOSPLIT, $0-64
+ // TODO: SHAKE support
+ MOVD function+0(FP), R0
+ MOVD chain+8(FP), R1
+ LMG dst+16(FP), R2, R3 // R2=base, R3=len
+ LMG src+40(FP), R4, R5 // R4=base, R5=len
+
+continue:
+ WORD $0xB93F0024 // KLMD R2, R4
+ BVS continue // continue if interrupted
+ MOVD $0, R0 // reset R0 for pre-go1.8 compilers
+ RET
diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/shake.go b/vendor/github.com/cloudflare/circl/internal/sha3/shake.go
new file mode 100644
index 0000000000..77817f758c
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/internal/sha3/shake.go
@@ -0,0 +1,119 @@
+// 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 sha3
+
+// This file defines the ShakeHash interface, and provides
+// functions for creating SHAKE and cSHAKE instances, as well as utility
+// functions for hashing bytes to arbitrary-length output.
+//
+//
+// SHAKE implementation is based on FIPS PUB 202 [1]
+// cSHAKE implementations is based on NIST SP 800-185 [2]
+//
+// [1] https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf
+// [2] https://doi.org/10.6028/NIST.SP.800-185
+
+import (
+ "io"
+)
+
+// ShakeHash defines the interface to hash functions that
+// support arbitrary-length output.
+type ShakeHash interface {
+ // Write absorbs more data into the hash's state. It panics if input is
+ // written to it after output has been read from it.
+ io.Writer
+
+ // Read reads more output from the hash; reading affects the hash's
+ // state. (ShakeHash.Read is thus very different from Hash.Sum)
+ // It never returns an error.
+ io.Reader
+
+ // Clone returns a copy of the ShakeHash in its current state.
+ Clone() ShakeHash
+
+ // Reset resets the ShakeHash to its initial state.
+ Reset()
+}
+
+// Consts for configuring initial SHA-3 state
+const (
+ dsbyteShake = 0x1f
+ rate128 = 168
+ rate256 = 136
+)
+
+// Clone returns copy of SHAKE context within its current state.
+func (d *State) Clone() ShakeHash {
+ return d.clone()
+}
+
+// NewShake128 creates a new SHAKE128 variable-output-length ShakeHash.
+// Its generic security strength is 128 bits against all attacks if at
+// least 32 bytes of its output are used.
+func NewShake128() State {
+ return State{rate: rate128, dsbyte: dsbyteShake}
+}
+
+// NewTurboShake128 creates a new TurboSHAKE128 variable-output-length ShakeHash.
+// Its generic security strength is 128 bits against all attacks if at
+// least 32 bytes of its output are used.
+// D is the domain separation byte and must be between 0x01 and 0x7f inclusive.
+func NewTurboShake128(D byte) State {
+ if D == 0 || D > 0x7f {
+ panic("turboshake: D out of range")
+ }
+ return State{rate: rate128, dsbyte: D, turbo: true}
+}
+
+// NewShake256 creates a new SHAKE256 variable-output-length ShakeHash.
+// Its generic security strength is 256 bits against all attacks if
+// at least 64 bytes of its output are used.
+func NewShake256() State {
+ return State{rate: rate256, dsbyte: dsbyteShake}
+}
+
+// NewTurboShake256 creates a new TurboSHAKE256 variable-output-length ShakeHash.
+// Its generic security strength is 256 bits against all attacks if
+// at least 64 bytes of its output are used.
+// D is the domain separation byte and must be between 0x01 and 0x7f inclusive.
+func NewTurboShake256(D byte) State {
+ if D == 0 || D > 0x7f {
+ panic("turboshake: D out of range")
+ }
+ return State{rate: rate256, dsbyte: D, turbo: true}
+}
+
+// ShakeSum128 writes an arbitrary-length digest of data into hash.
+func ShakeSum128(hash, data []byte) {
+ h := NewShake128()
+ _, _ = h.Write(data)
+ _, _ = h.Read(hash)
+}
+
+// ShakeSum256 writes an arbitrary-length digest of data into hash.
+func ShakeSum256(hash, data []byte) {
+ h := NewShake256()
+ _, _ = h.Write(data)
+ _, _ = h.Read(hash)
+}
+
+// TurboShakeSum128 writes an arbitrary-length digest of data into hash.
+func TurboShakeSum128(hash, data []byte, D byte) {
+ h := NewTurboShake128(D)
+ _, _ = h.Write(data)
+ _, _ = h.Read(hash)
+}
+
+// TurboShakeSum256 writes an arbitrary-length digest of data into hash.
+func TurboShakeSum256(hash, data []byte, D byte) {
+ h := NewTurboShake256(D)
+ _, _ = h.Write(data)
+ _, _ = h.Read(hash)
+}
+
+func (d *State) SwitchDS(D byte) {
+ d.dsbyte = D
+}
diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/xor.go b/vendor/github.com/cloudflare/circl/internal/sha3/xor.go
new file mode 100644
index 0000000000..1e21337454
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/internal/sha3/xor.go
@@ -0,0 +1,15 @@
+// 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.
+
+//go:build (!amd64 && !386 && !ppc64le) || appengine
+// +build !amd64,!386,!ppc64le appengine
+
+package sha3
+
+// A storageBuf is an aligned array of maxRate bytes.
+type storageBuf [maxRate]byte
+
+func (b *storageBuf) asBytes() *[maxRate]byte {
+ return (*[maxRate]byte)(b)
+}
diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/xor_generic.go b/vendor/github.com/cloudflare/circl/internal/sha3/xor_generic.go
new file mode 100644
index 0000000000..2b0c661790
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/internal/sha3/xor_generic.go
@@ -0,0 +1,33 @@
+// 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.
+
+//go:build (!amd64 || appengine) && (!386 || appengine) && (!ppc64le || appengine)
+// +build !amd64 appengine
+// +build !386 appengine
+// +build !ppc64le appengine
+
+package sha3
+
+import "encoding/binary"
+
+// xorIn xors the bytes in buf into the state; it
+// makes no non-portable assumptions about memory layout
+// or alignment.
+func xorIn(d *State, buf []byte) {
+ n := len(buf) / 8
+
+ for i := 0; i < n; i++ {
+ a := binary.LittleEndian.Uint64(buf)
+ d.a[i] ^= a
+ buf = buf[8:]
+ }
+}
+
+// copyOut copies ulint64s to a byte buffer.
+func copyOut(d *State, b []byte) {
+ for i := 0; len(b) >= 8; i++ {
+ binary.LittleEndian.PutUint64(b, d.a[i])
+ b = b[8:]
+ }
+}
diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/xor_unaligned.go b/vendor/github.com/cloudflare/circl/internal/sha3/xor_unaligned.go
new file mode 100644
index 0000000000..0910613465
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/internal/sha3/xor_unaligned.go
@@ -0,0 +1,61 @@
+// 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.
+
+//go:build (amd64 || 386 || ppc64le) && !appengine
+// +build amd64 386 ppc64le
+// +build !appengine
+
+package sha3
+
+import "unsafe"
+
+// A storageBuf is an aligned array of maxRate bytes.
+type storageBuf [maxRate / 8]uint64
+
+func (b *storageBuf) asBytes() *[maxRate]byte {
+ return (*[maxRate]byte)(unsafe.Pointer(b)) //nolint:gosec
+}
+
+// xorInuses unaligned reads and writes to update d.a to contain d.a
+// XOR buf.
+func xorIn(d *State, buf []byte) {
+ n := len(buf)
+ bw := (*[maxRate / 8]uint64)(unsafe.Pointer(&buf[0]))[: n/8 : n/8] //nolint:gosec
+ if n >= 72 {
+ d.a[0] ^= bw[0]
+ d.a[1] ^= bw[1]
+ d.a[2] ^= bw[2]
+ d.a[3] ^= bw[3]
+ d.a[4] ^= bw[4]
+ d.a[5] ^= bw[5]
+ d.a[6] ^= bw[6]
+ d.a[7] ^= bw[7]
+ d.a[8] ^= bw[8]
+ }
+ if n >= 104 {
+ d.a[9] ^= bw[9]
+ d.a[10] ^= bw[10]
+ d.a[11] ^= bw[11]
+ d.a[12] ^= bw[12]
+ }
+ if n >= 136 {
+ d.a[13] ^= bw[13]
+ d.a[14] ^= bw[14]
+ d.a[15] ^= bw[15]
+ d.a[16] ^= bw[16]
+ }
+ if n >= 144 {
+ d.a[17] ^= bw[17]
+ }
+ if n >= 168 {
+ d.a[18] ^= bw[18]
+ d.a[19] ^= bw[19]
+ d.a[20] ^= bw[20]
+ }
+}
+
+func copyOut(d *State, buf []byte) {
+ ab := (*[maxRate]uint8)(unsafe.Pointer(&d.a[0])) //nolint:gosec
+ copy(buf, ab[:])
+}
diff --git a/vendor/github.com/cloudflare/circl/math/fp25519/fp.go b/vendor/github.com/cloudflare/circl/math/fp25519/fp.go
new file mode 100644
index 0000000000..57a50ff5e9
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/fp25519/fp.go
@@ -0,0 +1,205 @@
+// Package fp25519 provides prime field arithmetic over GF(2^255-19).
+package fp25519
+
+import (
+ "errors"
+
+ "github.com/cloudflare/circl/internal/conv"
+)
+
+// Size in bytes of an element.
+const Size = 32
+
+// Elt is a prime field element.
+type Elt [Size]byte
+
+func (e Elt) String() string { return conv.BytesLe2Hex(e[:]) }
+
+// p is the prime modulus 2^255-19.
+var p = Elt{
+ 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+}
+
+// P returns the prime modulus 2^255-19.
+func P() Elt { return p }
+
+// ToBytes stores in b the little-endian byte representation of x.
+func ToBytes(b []byte, x *Elt) error {
+ if len(b) != Size {
+ return errors.New("wrong size")
+ }
+ Modp(x)
+ copy(b, x[:])
+ return nil
+}
+
+// IsZero returns true if x is equal to 0.
+func IsZero(x *Elt) bool { Modp(x); return *x == Elt{} }
+
+// SetOne assigns x=1.
+func SetOne(x *Elt) { *x = Elt{}; x[0] = 1 }
+
+// Neg calculates z = -x.
+func Neg(z, x *Elt) { Sub(z, &p, x) }
+
+// InvSqrt calculates z = sqrt(x/y) iff x/y is a quadratic-residue, which is
+// indicated by returning isQR = true. Otherwise, when x/y is a quadratic
+// non-residue, z will have an undetermined value and isQR = false.
+func InvSqrt(z, x, y *Elt) (isQR bool) {
+ sqrtMinusOne := &Elt{
+ 0xb0, 0xa0, 0x0e, 0x4a, 0x27, 0x1b, 0xee, 0xc4,
+ 0x78, 0xe4, 0x2f, 0xad, 0x06, 0x18, 0x43, 0x2f,
+ 0xa7, 0xd7, 0xfb, 0x3d, 0x99, 0x00, 0x4d, 0x2b,
+ 0x0b, 0xdf, 0xc1, 0x4f, 0x80, 0x24, 0x83, 0x2b,
+ }
+ t0, t1, t2, t3 := &Elt{}, &Elt{}, &Elt{}, &Elt{}
+
+ Mul(t0, x, y) // t0 = u*v
+ Sqr(t1, y) // t1 = v^2
+ Mul(t2, t0, t1) // t2 = u*v^3
+ Sqr(t0, t1) // t0 = v^4
+ Mul(t1, t0, t2) // t1 = u*v^7
+
+ var Tab [4]*Elt
+ Tab[0] = &Elt{}
+ Tab[1] = &Elt{}
+ Tab[2] = t3
+ Tab[3] = t1
+
+ *Tab[0] = *t1
+ Sqr(Tab[0], Tab[0])
+ Sqr(Tab[1], Tab[0])
+ Sqr(Tab[1], Tab[1])
+ Mul(Tab[1], Tab[1], Tab[3])
+ Mul(Tab[0], Tab[0], Tab[1])
+ Sqr(Tab[0], Tab[0])
+ Mul(Tab[0], Tab[0], Tab[1])
+ Sqr(Tab[1], Tab[0])
+ for i := 0; i < 4; i++ {
+ Sqr(Tab[1], Tab[1])
+ }
+ Mul(Tab[1], Tab[1], Tab[0])
+ Sqr(Tab[2], Tab[1])
+ for i := 0; i < 4; i++ {
+ Sqr(Tab[2], Tab[2])
+ }
+ Mul(Tab[2], Tab[2], Tab[0])
+ Sqr(Tab[1], Tab[2])
+ for i := 0; i < 14; i++ {
+ Sqr(Tab[1], Tab[1])
+ }
+ Mul(Tab[1], Tab[1], Tab[2])
+ Sqr(Tab[2], Tab[1])
+ for i := 0; i < 29; i++ {
+ Sqr(Tab[2], Tab[2])
+ }
+ Mul(Tab[2], Tab[2], Tab[1])
+ Sqr(Tab[1], Tab[2])
+ for i := 0; i < 59; i++ {
+ Sqr(Tab[1], Tab[1])
+ }
+ Mul(Tab[1], Tab[1], Tab[2])
+ for i := 0; i < 5; i++ {
+ Sqr(Tab[1], Tab[1])
+ }
+ Mul(Tab[1], Tab[1], Tab[0])
+ Sqr(Tab[2], Tab[1])
+ for i := 0; i < 124; i++ {
+ Sqr(Tab[2], Tab[2])
+ }
+ Mul(Tab[2], Tab[2], Tab[1])
+ Sqr(Tab[2], Tab[2])
+ Sqr(Tab[2], Tab[2])
+ Mul(Tab[2], Tab[2], Tab[3])
+
+ Mul(z, t3, t2) // z = xy^(p+3)/8 = xy^3*(xy^7)^(p-5)/8
+ // Checking whether y z^2 == x
+ Sqr(t0, z) // t0 = z^2
+ Mul(t0, t0, y) // t0 = yz^2
+ Sub(t1, t0, x) // t1 = t0-u
+ Add(t2, t0, x) // t2 = t0+u
+ if IsZero(t1) {
+ return true
+ } else if IsZero(t2) {
+ Mul(z, z, sqrtMinusOne) // z = z*sqrt(-1)
+ return true
+ } else {
+ return false
+ }
+}
+
+// Inv calculates z = 1/x mod p.
+func Inv(z, x *Elt) {
+ x0, x1, x2 := &Elt{}, &Elt{}, &Elt{}
+ Sqr(x1, x)
+ Sqr(x0, x1)
+ Sqr(x0, x0)
+ Mul(x0, x0, x)
+ Mul(z, x0, x1)
+ Sqr(x1, z)
+ Mul(x0, x0, x1)
+ Sqr(x1, x0)
+ for i := 0; i < 4; i++ {
+ Sqr(x1, x1)
+ }
+ Mul(x0, x0, x1)
+ Sqr(x1, x0)
+ for i := 0; i < 9; i++ {
+ Sqr(x1, x1)
+ }
+ Mul(x1, x1, x0)
+ Sqr(x2, x1)
+ for i := 0; i < 19; i++ {
+ Sqr(x2, x2)
+ }
+ Mul(x2, x2, x1)
+ for i := 0; i < 10; i++ {
+ Sqr(x2, x2)
+ }
+ Mul(x2, x2, x0)
+ Sqr(x0, x2)
+ for i := 0; i < 49; i++ {
+ Sqr(x0, x0)
+ }
+ Mul(x0, x0, x2)
+ Sqr(x1, x0)
+ for i := 0; i < 99; i++ {
+ Sqr(x1, x1)
+ }
+ Mul(x1, x1, x0)
+ for i := 0; i < 50; i++ {
+ Sqr(x1, x1)
+ }
+ Mul(x1, x1, x2)
+ for i := 0; i < 5; i++ {
+ Sqr(x1, x1)
+ }
+ Mul(z, z, x1)
+}
+
+// Cmov assigns y to x if n is 1.
+func Cmov(x, y *Elt, n uint) { cmov(x, y, n) }
+
+// Cswap interchanges x and y if n is 1.
+func Cswap(x, y *Elt, n uint) { cswap(x, y, n) }
+
+// Add calculates z = x+y mod p.
+func Add(z, x, y *Elt) { add(z, x, y) }
+
+// Sub calculates z = x-y mod p.
+func Sub(z, x, y *Elt) { sub(z, x, y) }
+
+// AddSub calculates (x,y) = (x+y mod p, x-y mod p).
+func AddSub(x, y *Elt) { addsub(x, y) }
+
+// Mul calculates z = x*y mod p.
+func Mul(z, x, y *Elt) { mul(z, x, y) }
+
+// Sqr calculates z = x^2 mod p.
+func Sqr(z, x *Elt) { sqr(z, x) }
+
+// Modp ensures that z is between [0,p-1].
+func Modp(z *Elt) { modp(z) }
diff --git a/vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.go b/vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.go
new file mode 100644
index 0000000000..057f0d2803
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.go
@@ -0,0 +1,45 @@
+//go:build amd64 && !purego
+// +build amd64,!purego
+
+package fp25519
+
+import (
+ "golang.org/x/sys/cpu"
+)
+
+var hasBmi2Adx = cpu.X86.HasBMI2 && cpu.X86.HasADX
+
+var _ = hasBmi2Adx
+
+func cmov(x, y *Elt, n uint) { cmovAmd64(x, y, n) }
+func cswap(x, y *Elt, n uint) { cswapAmd64(x, y, n) }
+func add(z, x, y *Elt) { addAmd64(z, x, y) }
+func sub(z, x, y *Elt) { subAmd64(z, x, y) }
+func addsub(x, y *Elt) { addsubAmd64(x, y) }
+func mul(z, x, y *Elt) { mulAmd64(z, x, y) }
+func sqr(z, x *Elt) { sqrAmd64(z, x) }
+func modp(z *Elt) { modpAmd64(z) }
+
+//go:noescape
+func cmovAmd64(x, y *Elt, n uint)
+
+//go:noescape
+func cswapAmd64(x, y *Elt, n uint)
+
+//go:noescape
+func addAmd64(z, x, y *Elt)
+
+//go:noescape
+func subAmd64(z, x, y *Elt)
+
+//go:noescape
+func addsubAmd64(x, y *Elt)
+
+//go:noescape
+func mulAmd64(z, x, y *Elt)
+
+//go:noescape
+func sqrAmd64(z, x *Elt)
+
+//go:noescape
+func modpAmd64(z *Elt)
diff --git a/vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.h b/vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.h
new file mode 100644
index 0000000000..b884b584ab
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.h
@@ -0,0 +1,351 @@
+// This code was imported from https://github.com/armfazh/rfc7748_precomputed
+
+// CHECK_BMI2ADX triggers bmi2adx if supported,
+// otherwise it fallbacks to legacy code.
+#define CHECK_BMI2ADX(label, legacy, bmi2adx) \
+ CMPB ·hasBmi2Adx(SB), $0 \
+ JE label \
+ bmi2adx \
+ RET \
+ label: \
+ legacy \
+ RET
+
+// cselect is a conditional move
+// if b=1: it copies y into x;
+// if b=0: x remains with the same value;
+// if b<> 0,1: undefined.
+// Uses: AX, DX, FLAGS
+// Instr: x86_64, cmov
+#define cselect(x,y,b) \
+ TESTQ b, b \
+ MOVQ 0+x, AX; MOVQ 0+y, DX; CMOVQNE DX, AX; MOVQ AX, 0+x; \
+ MOVQ 8+x, AX; MOVQ 8+y, DX; CMOVQNE DX, AX; MOVQ AX, 8+x; \
+ MOVQ 16+x, AX; MOVQ 16+y, DX; CMOVQNE DX, AX; MOVQ AX, 16+x; \
+ MOVQ 24+x, AX; MOVQ 24+y, DX; CMOVQNE DX, AX; MOVQ AX, 24+x;
+
+// cswap is a conditional swap
+// if b=1: x,y <- y,x;
+// if b=0: x,y remain with the same values;
+// if b<> 0,1: undefined.
+// Uses: AX, DX, R8, FLAGS
+// Instr: x86_64, cmov
+#define cswap(x,y,b) \
+ TESTQ b, b \
+ MOVQ 0+x, AX; MOVQ AX, R8; MOVQ 0+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 0+x; MOVQ DX, 0+y; \
+ MOVQ 8+x, AX; MOVQ AX, R8; MOVQ 8+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 8+x; MOVQ DX, 8+y; \
+ MOVQ 16+x, AX; MOVQ AX, R8; MOVQ 16+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 16+x; MOVQ DX, 16+y; \
+ MOVQ 24+x, AX; MOVQ AX, R8; MOVQ 24+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 24+x; MOVQ DX, 24+y;
+
+// additionLeg adds x and y and stores in z
+// Uses: AX, DX, R8-R11, FLAGS
+// Instr: x86_64, cmov
+#define additionLeg(z,x,y) \
+ MOVL $38, AX; \
+ MOVL $0, DX; \
+ MOVQ 0+x, R8; ADDQ 0+y, R8; \
+ MOVQ 8+x, R9; ADCQ 8+y, R9; \
+ MOVQ 16+x, R10; ADCQ 16+y, R10; \
+ MOVQ 24+x, R11; ADCQ 24+y, R11; \
+ CMOVQCS AX, DX; \
+ ADDQ DX, R8; \
+ ADCQ $0, R9; MOVQ R9, 8+z; \
+ ADCQ $0, R10; MOVQ R10, 16+z; \
+ ADCQ $0, R11; MOVQ R11, 24+z; \
+ MOVL $0, DX; \
+ CMOVQCS AX, DX; \
+ ADDQ DX, R8; MOVQ R8, 0+z;
+
+// additionAdx adds x and y and stores in z
+// Uses: AX, DX, R8-R11, FLAGS
+// Instr: x86_64, cmov, adx
+#define additionAdx(z,x,y) \
+ MOVL $38, AX; \
+ XORL DX, DX; \
+ MOVQ 0+x, R8; ADCXQ 0+y, R8; \
+ MOVQ 8+x, R9; ADCXQ 8+y, R9; \
+ MOVQ 16+x, R10; ADCXQ 16+y, R10; \
+ MOVQ 24+x, R11; ADCXQ 24+y, R11; \
+ CMOVQCS AX, DX ; \
+ XORL AX, AX; \
+ ADCXQ DX, R8; \
+ ADCXQ AX, R9; MOVQ R9, 8+z; \
+ ADCXQ AX, R10; MOVQ R10, 16+z; \
+ ADCXQ AX, R11; MOVQ R11, 24+z; \
+ MOVL $38, DX; \
+ CMOVQCS DX, AX; \
+ ADDQ AX, R8; MOVQ R8, 0+z;
+
+// subtraction subtracts y from x and stores in z
+// Uses: AX, DX, R8-R11, FLAGS
+// Instr: x86_64, cmov
+#define subtraction(z,x,y) \
+ MOVL $38, AX; \
+ MOVQ 0+x, R8; SUBQ 0+y, R8; \
+ MOVQ 8+x, R9; SBBQ 8+y, R9; \
+ MOVQ 16+x, R10; SBBQ 16+y, R10; \
+ MOVQ 24+x, R11; SBBQ 24+y, R11; \
+ MOVL $0, DX; \
+ CMOVQCS AX, DX; \
+ SUBQ DX, R8; \
+ SBBQ $0, R9; MOVQ R9, 8+z; \
+ SBBQ $0, R10; MOVQ R10, 16+z; \
+ SBBQ $0, R11; MOVQ R11, 24+z; \
+ MOVL $0, DX; \
+ CMOVQCS AX, DX; \
+ SUBQ DX, R8; MOVQ R8, 0+z;
+
+// integerMulAdx multiplies x and y and stores in z
+// Uses: AX, DX, R8-R15, FLAGS
+// Instr: x86_64, bmi2, adx
+#define integerMulAdx(z,x,y) \
+ MOVL $0,R15; \
+ MOVQ 0+y, DX; XORL AX, AX; \
+ MULXQ 0+x, AX, R8; MOVQ AX, 0+z; \
+ MULXQ 8+x, AX, R9; ADCXQ AX, R8; \
+ MULXQ 16+x, AX, R10; ADCXQ AX, R9; \
+ MULXQ 24+x, AX, R11; ADCXQ AX, R10; \
+ MOVL $0, AX;;;;;;;;; ADCXQ AX, R11; \
+ MOVQ 8+y, DX; XORL AX, AX; \
+ MULXQ 0+x, AX, R12; ADCXQ R8, AX; MOVQ AX, 8+z; \
+ MULXQ 8+x, AX, R13; ADCXQ R9, R12; ADOXQ AX, R12; \
+ MULXQ 16+x, AX, R14; ADCXQ R10, R13; ADOXQ AX, R13; \
+ MULXQ 24+x, AX, R15; ADCXQ R11, R14; ADOXQ AX, R14; \
+ MOVL $0, AX;;;;;;;;; ADCXQ AX, R15; ADOXQ AX, R15; \
+ MOVQ 16+y, DX; XORL AX, AX; \
+ MULXQ 0+x, AX, R8; ADCXQ R12, AX; MOVQ AX, 16+z; \
+ MULXQ 8+x, AX, R9; ADCXQ R13, R8; ADOXQ AX, R8; \
+ MULXQ 16+x, AX, R10; ADCXQ R14, R9; ADOXQ AX, R9; \
+ MULXQ 24+x, AX, R11; ADCXQ R15, R10; ADOXQ AX, R10; \
+ MOVL $0, AX;;;;;;;;; ADCXQ AX, R11; ADOXQ AX, R11; \
+ MOVQ 24+y, DX; XORL AX, AX; \
+ MULXQ 0+x, AX, R12; ADCXQ R8, AX; MOVQ AX, 24+z; \
+ MULXQ 8+x, AX, R13; ADCXQ R9, R12; ADOXQ AX, R12; MOVQ R12, 32+z; \
+ MULXQ 16+x, AX, R14; ADCXQ R10, R13; ADOXQ AX, R13; MOVQ R13, 40+z; \
+ MULXQ 24+x, AX, R15; ADCXQ R11, R14; ADOXQ AX, R14; MOVQ R14, 48+z; \
+ MOVL $0, AX;;;;;;;;; ADCXQ AX, R15; ADOXQ AX, R15; MOVQ R15, 56+z;
+
+// integerMulLeg multiplies x and y and stores in z
+// Uses: AX, DX, R8-R15, FLAGS
+// Instr: x86_64
+#define integerMulLeg(z,x,y) \
+ MOVQ 0+y, R8; \
+ MOVQ 0+x, AX; MULQ R8; MOVQ AX, 0+z; MOVQ DX, R15; \
+ MOVQ 8+x, AX; MULQ R8; MOVQ AX, R13; MOVQ DX, R10; \
+ MOVQ 16+x, AX; MULQ R8; MOVQ AX, R14; MOVQ DX, R11; \
+ MOVQ 24+x, AX; MULQ R8; \
+ ADDQ R13, R15; \
+ ADCQ R14, R10; MOVQ R10, 16+z; \
+ ADCQ AX, R11; MOVQ R11, 24+z; \
+ ADCQ $0, DX; MOVQ DX, 32+z; \
+ MOVQ 8+y, R8; \
+ MOVQ 0+x, AX; MULQ R8; MOVQ AX, R12; MOVQ DX, R9; \
+ MOVQ 8+x, AX; MULQ R8; MOVQ AX, R13; MOVQ DX, R10; \
+ MOVQ 16+x, AX; MULQ R8; MOVQ AX, R14; MOVQ DX, R11; \
+ MOVQ 24+x, AX; MULQ R8; \
+ ADDQ R12, R15; MOVQ R15, 8+z; \
+ ADCQ R13, R9; \
+ ADCQ R14, R10; \
+ ADCQ AX, R11; \
+ ADCQ $0, DX; \
+ ADCQ 16+z, R9; MOVQ R9, R15; \
+ ADCQ 24+z, R10; MOVQ R10, 24+z; \
+ ADCQ 32+z, R11; MOVQ R11, 32+z; \
+ ADCQ $0, DX; MOVQ DX, 40+z; \
+ MOVQ 16+y, R8; \
+ MOVQ 0+x, AX; MULQ R8; MOVQ AX, R12; MOVQ DX, R9; \
+ MOVQ 8+x, AX; MULQ R8; MOVQ AX, R13; MOVQ DX, R10; \
+ MOVQ 16+x, AX; MULQ R8; MOVQ AX, R14; MOVQ DX, R11; \
+ MOVQ 24+x, AX; MULQ R8; \
+ ADDQ R12, R15; MOVQ R15, 16+z; \
+ ADCQ R13, R9; \
+ ADCQ R14, R10; \
+ ADCQ AX, R11; \
+ ADCQ $0, DX; \
+ ADCQ 24+z, R9; MOVQ R9, R15; \
+ ADCQ 32+z, R10; MOVQ R10, 32+z; \
+ ADCQ 40+z, R11; MOVQ R11, 40+z; \
+ ADCQ $0, DX; MOVQ DX, 48+z; \
+ MOVQ 24+y, R8; \
+ MOVQ 0+x, AX; MULQ R8; MOVQ AX, R12; MOVQ DX, R9; \
+ MOVQ 8+x, AX; MULQ R8; MOVQ AX, R13; MOVQ DX, R10; \
+ MOVQ 16+x, AX; MULQ R8; MOVQ AX, R14; MOVQ DX, R11; \
+ MOVQ 24+x, AX; MULQ R8; \
+ ADDQ R12, R15; MOVQ R15, 24+z; \
+ ADCQ R13, R9; \
+ ADCQ R14, R10; \
+ ADCQ AX, R11; \
+ ADCQ $0, DX; \
+ ADCQ 32+z, R9; MOVQ R9, 32+z; \
+ ADCQ 40+z, R10; MOVQ R10, 40+z; \
+ ADCQ 48+z, R11; MOVQ R11, 48+z; \
+ ADCQ $0, DX; MOVQ DX, 56+z;
+
+// integerSqrLeg squares x and stores in z
+// Uses: AX, CX, DX, R8-R15, FLAGS
+// Instr: x86_64
+#define integerSqrLeg(z,x) \
+ MOVQ 0+x, R8; \
+ MOVQ 8+x, AX; MULQ R8; MOVQ AX, R9; MOVQ DX, R10; /* A[0]*A[1] */ \
+ MOVQ 16+x, AX; MULQ R8; MOVQ AX, R14; MOVQ DX, R11; /* A[0]*A[2] */ \
+ MOVQ 24+x, AX; MULQ R8; MOVQ AX, R15; MOVQ DX, R12; /* A[0]*A[3] */ \
+ MOVQ 24+x, R8; \
+ MOVQ 8+x, AX; MULQ R8; MOVQ AX, CX; MOVQ DX, R13; /* A[3]*A[1] */ \
+ MOVQ 16+x, AX; MULQ R8; /* A[3]*A[2] */ \
+ \
+ ADDQ R14, R10;\
+ ADCQ R15, R11; MOVL $0, R15;\
+ ADCQ CX, R12;\
+ ADCQ AX, R13;\
+ ADCQ $0, DX; MOVQ DX, R14;\
+ MOVQ 8+x, AX; MULQ 16+x;\
+ \
+ ADDQ AX, R11;\
+ ADCQ DX, R12;\
+ ADCQ $0, R13;\
+ ADCQ $0, R14;\
+ ADCQ $0, R15;\
+ \
+ SHLQ $1, R14, R15; MOVQ R15, 56+z;\
+ SHLQ $1, R13, R14; MOVQ R14, 48+z;\
+ SHLQ $1, R12, R13; MOVQ R13, 40+z;\
+ SHLQ $1, R11, R12; MOVQ R12, 32+z;\
+ SHLQ $1, R10, R11; MOVQ R11, 24+z;\
+ SHLQ $1, R9, R10; MOVQ R10, 16+z;\
+ SHLQ $1, R9; MOVQ R9, 8+z;\
+ \
+ MOVQ 0+x,AX; MULQ AX; MOVQ AX, 0+z; MOVQ DX, R9;\
+ MOVQ 8+x,AX; MULQ AX; MOVQ AX, R10; MOVQ DX, R11;\
+ MOVQ 16+x,AX; MULQ AX; MOVQ AX, R12; MOVQ DX, R13;\
+ MOVQ 24+x,AX; MULQ AX; MOVQ AX, R14; MOVQ DX, R15;\
+ \
+ ADDQ 8+z, R9; MOVQ R9, 8+z;\
+ ADCQ 16+z, R10; MOVQ R10, 16+z;\
+ ADCQ 24+z, R11; MOVQ R11, 24+z;\
+ ADCQ 32+z, R12; MOVQ R12, 32+z;\
+ ADCQ 40+z, R13; MOVQ R13, 40+z;\
+ ADCQ 48+z, R14; MOVQ R14, 48+z;\
+ ADCQ 56+z, R15; MOVQ R15, 56+z;
+
+// integerSqrAdx squares x and stores in z
+// Uses: AX, CX, DX, R8-R15, FLAGS
+// Instr: x86_64, bmi2, adx
+#define integerSqrAdx(z,x) \
+ MOVQ 0+x, DX; /* A[0] */ \
+ MULXQ 8+x, R8, R14; /* A[1]*A[0] */ XORL R15, R15; \
+ MULXQ 16+x, R9, R10; /* A[2]*A[0] */ ADCXQ R14, R9; \
+ MULXQ 24+x, AX, CX; /* A[3]*A[0] */ ADCXQ AX, R10; \
+ MOVQ 24+x, DX; /* A[3] */ \
+ MULXQ 8+x, R11, R12; /* A[1]*A[3] */ ADCXQ CX, R11; \
+ MULXQ 16+x, AX, R13; /* A[2]*A[3] */ ADCXQ AX, R12; \
+ MOVQ 8+x, DX; /* A[1] */ ADCXQ R15, R13; \
+ MULXQ 16+x, AX, CX; /* A[2]*A[1] */ MOVL $0, R14; \
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADCXQ R15, R14; \
+ XORL R15, R15; \
+ ADOXQ AX, R10; ADCXQ R8, R8; \
+ ADOXQ CX, R11; ADCXQ R9, R9; \
+ ADOXQ R15, R12; ADCXQ R10, R10; \
+ ADOXQ R15, R13; ADCXQ R11, R11; \
+ ADOXQ R15, R14; ADCXQ R12, R12; \
+ ;;;;;;;;;;;;;;; ADCXQ R13, R13; \
+ ;;;;;;;;;;;;;;; ADCXQ R14, R14; \
+ MOVQ 0+x, DX; MULXQ DX, AX, CX; /* A[0]^2 */ \
+ ;;;;;;;;;;;;;;; MOVQ AX, 0+z; \
+ ADDQ CX, R8; MOVQ R8, 8+z; \
+ MOVQ 8+x, DX; MULXQ DX, AX, CX; /* A[1]^2 */ \
+ ADCQ AX, R9; MOVQ R9, 16+z; \
+ ADCQ CX, R10; MOVQ R10, 24+z; \
+ MOVQ 16+x, DX; MULXQ DX, AX, CX; /* A[2]^2 */ \
+ ADCQ AX, R11; MOVQ R11, 32+z; \
+ ADCQ CX, R12; MOVQ R12, 40+z; \
+ MOVQ 24+x, DX; MULXQ DX, AX, CX; /* A[3]^2 */ \
+ ADCQ AX, R13; MOVQ R13, 48+z; \
+ ADCQ CX, R14; MOVQ R14, 56+z;
+
+// reduceFromDouble finds z congruent to x modulo p such that 0> 63)
+ // PUT BIT 255 IN CARRY FLAG AND CLEAR
+ x3 &^= 1 << 63
+
+ x0, c0 := bits.Add64(x0, cx, 0)
+ x1, c1 := bits.Add64(x1, 0, c0)
+ x2, c2 := bits.Add64(x2, 0, c1)
+ x3, _ = bits.Add64(x3, 0, c2)
+
+ // TEST FOR BIT 255 AGAIN; ONLY TRIGGERED ON OVERFLOW MODULO 2^255-19
+ // cx = C[255] ? 0 : 19
+ cx = uint64(19) &^ (-(x3 >> 63))
+ // CLEAR BIT 255
+ x3 &^= 1 << 63
+
+ x0, c0 = bits.Sub64(x0, cx, 0)
+ x1, c1 = bits.Sub64(x1, 0, c0)
+ x2, c2 = bits.Sub64(x2, 0, c1)
+ x3, _ = bits.Sub64(x3, 0, c2)
+
+ binary.LittleEndian.PutUint64(x[0*8:1*8], x0)
+ binary.LittleEndian.PutUint64(x[1*8:2*8], x1)
+ binary.LittleEndian.PutUint64(x[2*8:3*8], x2)
+ binary.LittleEndian.PutUint64(x[3*8:4*8], x3)
+}
+
+func red64(z *Elt, x0, x1, x2, x3, x4, x5, x6, x7 uint64) {
+ h0, l0 := bits.Mul64(x4, 38)
+ h1, l1 := bits.Mul64(x5, 38)
+ h2, l2 := bits.Mul64(x6, 38)
+ h3, l3 := bits.Mul64(x7, 38)
+
+ l1, c0 := bits.Add64(h0, l1, 0)
+ l2, c1 := bits.Add64(h1, l2, c0)
+ l3, c2 := bits.Add64(h2, l3, c1)
+ l4, _ := bits.Add64(h3, 0, c2)
+
+ l0, c0 = bits.Add64(l0, x0, 0)
+ l1, c1 = bits.Add64(l1, x1, c0)
+ l2, c2 = bits.Add64(l2, x2, c1)
+ l3, c3 := bits.Add64(l3, x3, c2)
+ l4, _ = bits.Add64(l4, 0, c3)
+
+ _, l4 = bits.Mul64(l4, 38)
+ l0, c0 = bits.Add64(l0, l4, 0)
+ z1, c1 := bits.Add64(l1, 0, c0)
+ z2, c2 := bits.Add64(l2, 0, c1)
+ z3, c3 := bits.Add64(l3, 0, c2)
+ z0, _ := bits.Add64(l0, (-c3)&38, 0)
+
+ binary.LittleEndian.PutUint64(z[0*8:1*8], z0)
+ binary.LittleEndian.PutUint64(z[1*8:2*8], z1)
+ binary.LittleEndian.PutUint64(z[2*8:3*8], z2)
+ binary.LittleEndian.PutUint64(z[3*8:4*8], z3)
+}
diff --git a/vendor/github.com/cloudflare/circl/math/fp25519/fp_noasm.go b/vendor/github.com/cloudflare/circl/math/fp25519/fp_noasm.go
new file mode 100644
index 0000000000..26ca4d01b7
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/fp25519/fp_noasm.go
@@ -0,0 +1,13 @@
+//go:build !amd64 || purego
+// +build !amd64 purego
+
+package fp25519
+
+func cmov(x, y *Elt, n uint) { cmovGeneric(x, y, n) }
+func cswap(x, y *Elt, n uint) { cswapGeneric(x, y, n) }
+func add(z, x, y *Elt) { addGeneric(z, x, y) }
+func sub(z, x, y *Elt) { subGeneric(z, x, y) }
+func addsub(x, y *Elt) { addsubGeneric(x, y) }
+func mul(z, x, y *Elt) { mulGeneric(z, x, y) }
+func sqr(z, x *Elt) { sqrGeneric(z, x) }
+func modp(z *Elt) { modpGeneric(z) }
diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fp.go b/vendor/github.com/cloudflare/circl/math/fp448/fp.go
new file mode 100644
index 0000000000..a5e36600bb
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/fp448/fp.go
@@ -0,0 +1,164 @@
+// Package fp448 provides prime field arithmetic over GF(2^448-2^224-1).
+package fp448
+
+import (
+ "errors"
+
+ "github.com/cloudflare/circl/internal/conv"
+)
+
+// Size in bytes of an element.
+const Size = 56
+
+// Elt is a prime field element.
+type Elt [Size]byte
+
+func (e Elt) String() string { return conv.BytesLe2Hex(e[:]) }
+
+// p is the prime modulus 2^448-2^224-1.
+var p = Elt{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+}
+
+// P returns the prime modulus 2^448-2^224-1.
+func P() Elt { return p }
+
+// ToBytes stores in b the little-endian byte representation of x.
+func ToBytes(b []byte, x *Elt) error {
+ if len(b) != Size {
+ return errors.New("wrong size")
+ }
+ Modp(x)
+ copy(b, x[:])
+ return nil
+}
+
+// IsZero returns true if x is equal to 0.
+func IsZero(x *Elt) bool { Modp(x); return *x == Elt{} }
+
+// IsOne returns true if x is equal to 1.
+func IsOne(x *Elt) bool { Modp(x); return *x == Elt{1} }
+
+// SetOne assigns x=1.
+func SetOne(x *Elt) { *x = Elt{1} }
+
+// One returns the 1 element.
+func One() (x Elt) { x = Elt{1}; return }
+
+// Neg calculates z = -x.
+func Neg(z, x *Elt) { Sub(z, &p, x) }
+
+// Modp ensures that z is between [0,p-1].
+func Modp(z *Elt) { Sub(z, z, &p) }
+
+// InvSqrt calculates z = sqrt(x/y) iff x/y is a quadratic-residue. If so,
+// isQR = true; otherwise, isQR = false, since x/y is a quadratic non-residue,
+// and z = sqrt(-x/y).
+func InvSqrt(z, x, y *Elt) (isQR bool) {
+ // First note that x^(2(k+1)) = x^(p-1)/2 * x = legendre(x) * x
+ // so that's x if x is a quadratic residue and -x otherwise.
+ // Next, y^(6k+3) = y^(4k+2) * y^(2k+1) = y^(p-1) * y^((p-1)/2) = legendre(y).
+ // So the z we compute satisfies z^2 y = x^(2(k+1)) y^(6k+3) = legendre(x)*legendre(y).
+ // Thus if x and y are quadratic residues, then z is indeed sqrt(x/y).
+ t0, t1 := &Elt{}, &Elt{}
+ Mul(t0, x, y) // x*y
+ Sqr(t1, y) // y^2
+ Mul(t1, t0, t1) // x*y^3
+ powPminus3div4(z, t1) // (x*y^3)^k
+ Mul(z, z, t0) // z = x*y*(x*y^3)^k = x^(k+1) * y^(3k+1)
+
+ // Check if x/y is a quadratic residue
+ Sqr(t0, z) // z^2
+ Mul(t0, t0, y) // y*z^2
+ Sub(t0, t0, x) // y*z^2-x
+ return IsZero(t0)
+}
+
+// Inv calculates z = 1/x mod p.
+func Inv(z, x *Elt) {
+ // Calculates z = x^(4k+1) = x^(p-3+1) = x^(p-2) = x^-1, where k = (p-3)/4.
+ t := &Elt{}
+ powPminus3div4(t, x) // t = x^k
+ Sqr(t, t) // t = x^2k
+ Sqr(t, t) // t = x^4k
+ Mul(z, t, x) // z = x^(4k+1)
+}
+
+// powPminus3div4 calculates z = x^k mod p, where k = (p-3)/4.
+func powPminus3div4(z, x *Elt) {
+ x0, x1 := &Elt{}, &Elt{}
+ Sqr(z, x)
+ Mul(z, z, x)
+ Sqr(x0, z)
+ Mul(x0, x0, x)
+ Sqr(z, x0)
+ Sqr(z, z)
+ Sqr(z, z)
+ Mul(z, z, x0)
+ Sqr(x1, z)
+ for i := 0; i < 5; i++ {
+ Sqr(x1, x1)
+ }
+ Mul(x1, x1, z)
+ Sqr(z, x1)
+ for i := 0; i < 11; i++ {
+ Sqr(z, z)
+ }
+ Mul(z, z, x1)
+ Sqr(z, z)
+ Sqr(z, z)
+ Sqr(z, z)
+ Mul(z, z, x0)
+ Sqr(x1, z)
+ for i := 0; i < 26; i++ {
+ Sqr(x1, x1)
+ }
+ Mul(x1, x1, z)
+ Sqr(z, x1)
+ for i := 0; i < 53; i++ {
+ Sqr(z, z)
+ }
+ Mul(z, z, x1)
+ Sqr(z, z)
+ Sqr(z, z)
+ Sqr(z, z)
+ Mul(z, z, x0)
+ Sqr(x1, z)
+ for i := 0; i < 110; i++ {
+ Sqr(x1, x1)
+ }
+ Mul(x1, x1, z)
+ Sqr(z, x1)
+ Mul(z, z, x)
+ for i := 0; i < 223; i++ {
+ Sqr(z, z)
+ }
+ Mul(z, z, x1)
+}
+
+// Cmov assigns y to x if n is 1.
+func Cmov(x, y *Elt, n uint) { cmov(x, y, n) }
+
+// Cswap interchanges x and y if n is 1.
+func Cswap(x, y *Elt, n uint) { cswap(x, y, n) }
+
+// Add calculates z = x+y mod p.
+func Add(z, x, y *Elt) { add(z, x, y) }
+
+// Sub calculates z = x-y mod p.
+func Sub(z, x, y *Elt) { sub(z, x, y) }
+
+// AddSub calculates (x,y) = (x+y mod p, x-y mod p).
+func AddSub(x, y *Elt) { addsub(x, y) }
+
+// Mul calculates z = x*y mod p.
+func Mul(z, x, y *Elt) { mul(z, x, y) }
+
+// Sqr calculates z = x^2 mod p.
+func Sqr(z, x *Elt) { sqr(z, x) }
diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.go b/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.go
new file mode 100644
index 0000000000..6a12209a70
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.go
@@ -0,0 +1,43 @@
+//go:build amd64 && !purego
+// +build amd64,!purego
+
+package fp448
+
+import (
+ "golang.org/x/sys/cpu"
+)
+
+var hasBmi2Adx = cpu.X86.HasBMI2 && cpu.X86.HasADX
+
+var _ = hasBmi2Adx
+
+func cmov(x, y *Elt, n uint) { cmovAmd64(x, y, n) }
+func cswap(x, y *Elt, n uint) { cswapAmd64(x, y, n) }
+func add(z, x, y *Elt) { addAmd64(z, x, y) }
+func sub(z, x, y *Elt) { subAmd64(z, x, y) }
+func addsub(x, y *Elt) { addsubAmd64(x, y) }
+func mul(z, x, y *Elt) { mulAmd64(z, x, y) }
+func sqr(z, x *Elt) { sqrAmd64(z, x) }
+
+/* Functions defined in fp_amd64.s */
+
+//go:noescape
+func cmovAmd64(x, y *Elt, n uint)
+
+//go:noescape
+func cswapAmd64(x, y *Elt, n uint)
+
+//go:noescape
+func addAmd64(z, x, y *Elt)
+
+//go:noescape
+func subAmd64(z, x, y *Elt)
+
+//go:noescape
+func addsubAmd64(x, y *Elt)
+
+//go:noescape
+func mulAmd64(z, x, y *Elt)
+
+//go:noescape
+func sqrAmd64(z, x *Elt)
diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.h b/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.h
new file mode 100644
index 0000000000..536fe5bdfe
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.h
@@ -0,0 +1,591 @@
+// This code was imported from https://github.com/armfazh/rfc7748_precomputed
+
+// CHECK_BMI2ADX triggers bmi2adx if supported,
+// otherwise it fallbacks to legacy code.
+#define CHECK_BMI2ADX(label, legacy, bmi2adx) \
+ CMPB ·hasBmi2Adx(SB), $0 \
+ JE label \
+ bmi2adx \
+ RET \
+ label: \
+ legacy \
+ RET
+
+// cselect is a conditional move
+// if b=1: it copies y into x;
+// if b=0: x remains with the same value;
+// if b<> 0,1: undefined.
+// Uses: AX, DX, FLAGS
+// Instr: x86_64, cmov
+#define cselect(x,y,b) \
+ TESTQ b, b \
+ MOVQ 0+x, AX; MOVQ 0+y, DX; CMOVQNE DX, AX; MOVQ AX, 0+x; \
+ MOVQ 8+x, AX; MOVQ 8+y, DX; CMOVQNE DX, AX; MOVQ AX, 8+x; \
+ MOVQ 16+x, AX; MOVQ 16+y, DX; CMOVQNE DX, AX; MOVQ AX, 16+x; \
+ MOVQ 24+x, AX; MOVQ 24+y, DX; CMOVQNE DX, AX; MOVQ AX, 24+x; \
+ MOVQ 32+x, AX; MOVQ 32+y, DX; CMOVQNE DX, AX; MOVQ AX, 32+x; \
+ MOVQ 40+x, AX; MOVQ 40+y, DX; CMOVQNE DX, AX; MOVQ AX, 40+x; \
+ MOVQ 48+x, AX; MOVQ 48+y, DX; CMOVQNE DX, AX; MOVQ AX, 48+x;
+
+// cswap is a conditional swap
+// if b=1: x,y <- y,x;
+// if b=0: x,y remain with the same values;
+// if b<> 0,1: undefined.
+// Uses: AX, DX, R8, FLAGS
+// Instr: x86_64, cmov
+#define cswap(x,y,b) \
+ TESTQ b, b \
+ MOVQ 0+x, AX; MOVQ AX, R8; MOVQ 0+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 0+x; MOVQ DX, 0+y; \
+ MOVQ 8+x, AX; MOVQ AX, R8; MOVQ 8+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 8+x; MOVQ DX, 8+y; \
+ MOVQ 16+x, AX; MOVQ AX, R8; MOVQ 16+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 16+x; MOVQ DX, 16+y; \
+ MOVQ 24+x, AX; MOVQ AX, R8; MOVQ 24+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 24+x; MOVQ DX, 24+y; \
+ MOVQ 32+x, AX; MOVQ AX, R8; MOVQ 32+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 32+x; MOVQ DX, 32+y; \
+ MOVQ 40+x, AX; MOVQ AX, R8; MOVQ 40+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 40+x; MOVQ DX, 40+y; \
+ MOVQ 48+x, AX; MOVQ AX, R8; MOVQ 48+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 48+x; MOVQ DX, 48+y;
+
+// additionLeg adds x and y and stores in z
+// Uses: AX, DX, R8-R14, FLAGS
+// Instr: x86_64
+#define additionLeg(z,x,y) \
+ MOVQ 0+x, R8; ADDQ 0+y, R8; \
+ MOVQ 8+x, R9; ADCQ 8+y, R9; \
+ MOVQ 16+x, R10; ADCQ 16+y, R10; \
+ MOVQ 24+x, R11; ADCQ 24+y, R11; \
+ MOVQ 32+x, R12; ADCQ 32+y, R12; \
+ MOVQ 40+x, R13; ADCQ 40+y, R13; \
+ MOVQ 48+x, R14; ADCQ 48+y, R14; \
+ MOVQ $0, AX; ADCQ $0, AX; \
+ MOVQ AX, DX; \
+ SHLQ $32, DX; \
+ ADDQ AX, R8; MOVQ $0, AX; \
+ ADCQ $0, R9; \
+ ADCQ $0, R10; \
+ ADCQ DX, R11; \
+ ADCQ $0, R12; \
+ ADCQ $0, R13; \
+ ADCQ $0, R14; \
+ ADCQ $0, AX; \
+ MOVQ AX, DX; \
+ SHLQ $32, DX; \
+ ADDQ AX, R8; MOVQ R8, 0+z; \
+ ADCQ $0, R9; MOVQ R9, 8+z; \
+ ADCQ $0, R10; MOVQ R10, 16+z; \
+ ADCQ DX, R11; MOVQ R11, 24+z; \
+ ADCQ $0, R12; MOVQ R12, 32+z; \
+ ADCQ $0, R13; MOVQ R13, 40+z; \
+ ADCQ $0, R14; MOVQ R14, 48+z;
+
+
+// additionAdx adds x and y and stores in z
+// Uses: AX, DX, R8-R15, FLAGS
+// Instr: x86_64, adx
+#define additionAdx(z,x,y) \
+ MOVL $32, R15; \
+ XORL DX, DX; \
+ MOVQ 0+x, R8; ADCXQ 0+y, R8; \
+ MOVQ 8+x, R9; ADCXQ 8+y, R9; \
+ MOVQ 16+x, R10; ADCXQ 16+y, R10; \
+ MOVQ 24+x, R11; ADCXQ 24+y, R11; \
+ MOVQ 32+x, R12; ADCXQ 32+y, R12; \
+ MOVQ 40+x, R13; ADCXQ 40+y, R13; \
+ MOVQ 48+x, R14; ADCXQ 48+y, R14; \
+ ;;;;;;;;;;;;;;; ADCXQ DX, DX; \
+ XORL AX, AX; \
+ ADCXQ DX, R8; SHLXQ R15, DX, DX; \
+ ADCXQ AX, R9; \
+ ADCXQ AX, R10; \
+ ADCXQ DX, R11; \
+ ADCXQ AX, R12; \
+ ADCXQ AX, R13; \
+ ADCXQ AX, R14; \
+ ADCXQ AX, AX; \
+ XORL DX, DX; \
+ ADCXQ AX, R8; MOVQ R8, 0+z; SHLXQ R15, AX, AX; \
+ ADCXQ DX, R9; MOVQ R9, 8+z; \
+ ADCXQ DX, R10; MOVQ R10, 16+z; \
+ ADCXQ AX, R11; MOVQ R11, 24+z; \
+ ADCXQ DX, R12; MOVQ R12, 32+z; \
+ ADCXQ DX, R13; MOVQ R13, 40+z; \
+ ADCXQ DX, R14; MOVQ R14, 48+z;
+
+// subtraction subtracts y from x and stores in z
+// Uses: AX, DX, R8-R14, FLAGS
+// Instr: x86_64
+#define subtraction(z,x,y) \
+ MOVQ 0+x, R8; SUBQ 0+y, R8; \
+ MOVQ 8+x, R9; SBBQ 8+y, R9; \
+ MOVQ 16+x, R10; SBBQ 16+y, R10; \
+ MOVQ 24+x, R11; SBBQ 24+y, R11; \
+ MOVQ 32+x, R12; SBBQ 32+y, R12; \
+ MOVQ 40+x, R13; SBBQ 40+y, R13; \
+ MOVQ 48+x, R14; SBBQ 48+y, R14; \
+ MOVQ $0, AX; SETCS AX; \
+ MOVQ AX, DX; \
+ SHLQ $32, DX; \
+ SUBQ AX, R8; MOVQ $0, AX; \
+ SBBQ $0, R9; \
+ SBBQ $0, R10; \
+ SBBQ DX, R11; \
+ SBBQ $0, R12; \
+ SBBQ $0, R13; \
+ SBBQ $0, R14; \
+ SETCS AX; \
+ MOVQ AX, DX; \
+ SHLQ $32, DX; \
+ SUBQ AX, R8; MOVQ R8, 0+z; \
+ SBBQ $0, R9; MOVQ R9, 8+z; \
+ SBBQ $0, R10; MOVQ R10, 16+z; \
+ SBBQ DX, R11; MOVQ R11, 24+z; \
+ SBBQ $0, R12; MOVQ R12, 32+z; \
+ SBBQ $0, R13; MOVQ R13, 40+z; \
+ SBBQ $0, R14; MOVQ R14, 48+z;
+
+// maddBmi2Adx multiplies x and y and accumulates in z
+// Uses: AX, DX, R15, FLAGS
+// Instr: x86_64, bmi2, adx
+#define maddBmi2Adx(z,x,y,i,r0,r1,r2,r3,r4,r5,r6) \
+ MOVQ i+y, DX; XORL AX, AX; \
+ MULXQ 0+x, AX, R8; ADOXQ AX, r0; ADCXQ R8, r1; MOVQ r0,i+z; \
+ MULXQ 8+x, AX, r0; ADOXQ AX, r1; ADCXQ r0, r2; MOVQ $0, R8; \
+ MULXQ 16+x, AX, r0; ADOXQ AX, r2; ADCXQ r0, r3; \
+ MULXQ 24+x, AX, r0; ADOXQ AX, r3; ADCXQ r0, r4; \
+ MULXQ 32+x, AX, r0; ADOXQ AX, r4; ADCXQ r0, r5; \
+ MULXQ 40+x, AX, r0; ADOXQ AX, r5; ADCXQ r0, r6; \
+ MULXQ 48+x, AX, r0; ADOXQ AX, r6; ADCXQ R8, r0; \
+ ;;;;;;;;;;;;;;;;;;; ADOXQ R8, r0;
+
+// integerMulAdx multiplies x and y and stores in z
+// Uses: AX, DX, R8-R15, FLAGS
+// Instr: x86_64, bmi2, adx
+#define integerMulAdx(z,x,y) \
+ MOVL $0,R15; \
+ MOVQ 0+y, DX; XORL AX, AX; MOVQ $0, R8; \
+ MULXQ 0+x, AX, R9; MOVQ AX, 0+z; \
+ MULXQ 8+x, AX, R10; ADCXQ AX, R9; \
+ MULXQ 16+x, AX, R11; ADCXQ AX, R10; \
+ MULXQ 24+x, AX, R12; ADCXQ AX, R11; \
+ MULXQ 32+x, AX, R13; ADCXQ AX, R12; \
+ MULXQ 40+x, AX, R14; ADCXQ AX, R13; \
+ MULXQ 48+x, AX, R15; ADCXQ AX, R14; \
+ ;;;;;;;;;;;;;;;;;;;; ADCXQ R8, R15; \
+ maddBmi2Adx(z,x,y, 8, R9,R10,R11,R12,R13,R14,R15) \
+ maddBmi2Adx(z,x,y,16,R10,R11,R12,R13,R14,R15, R9) \
+ maddBmi2Adx(z,x,y,24,R11,R12,R13,R14,R15, R9,R10) \
+ maddBmi2Adx(z,x,y,32,R12,R13,R14,R15, R9,R10,R11) \
+ maddBmi2Adx(z,x,y,40,R13,R14,R15, R9,R10,R11,R12) \
+ maddBmi2Adx(z,x,y,48,R14,R15, R9,R10,R11,R12,R13) \
+ MOVQ R15, 56+z; \
+ MOVQ R9, 64+z; \
+ MOVQ R10, 72+z; \
+ MOVQ R11, 80+z; \
+ MOVQ R12, 88+z; \
+ MOVQ R13, 96+z; \
+ MOVQ R14, 104+z;
+
+// maddLegacy multiplies x and y and accumulates in z
+// Uses: AX, DX, R15, FLAGS
+// Instr: x86_64
+#define maddLegacy(z,x,y,i) \
+ MOVQ i+y, R15; \
+ MOVQ 0+x, AX; MULQ R15; MOVQ AX, R8; ;;;;;;;;;;;; MOVQ DX, R9; \
+ MOVQ 8+x, AX; MULQ R15; ADDQ AX, R9; ADCQ $0, DX; MOVQ DX, R10; \
+ MOVQ 16+x, AX; MULQ R15; ADDQ AX, R10; ADCQ $0, DX; MOVQ DX, R11; \
+ MOVQ 24+x, AX; MULQ R15; ADDQ AX, R11; ADCQ $0, DX; MOVQ DX, R12; \
+ MOVQ 32+x, AX; MULQ R15; ADDQ AX, R12; ADCQ $0, DX; MOVQ DX, R13; \
+ MOVQ 40+x, AX; MULQ R15; ADDQ AX, R13; ADCQ $0, DX; MOVQ DX, R14; \
+ MOVQ 48+x, AX; MULQ R15; ADDQ AX, R14; ADCQ $0, DX; \
+ ADDQ 0+i+z, R8; MOVQ R8, 0+i+z; \
+ ADCQ 8+i+z, R9; MOVQ R9, 8+i+z; \
+ ADCQ 16+i+z, R10; MOVQ R10, 16+i+z; \
+ ADCQ 24+i+z, R11; MOVQ R11, 24+i+z; \
+ ADCQ 32+i+z, R12; MOVQ R12, 32+i+z; \
+ ADCQ 40+i+z, R13; MOVQ R13, 40+i+z; \
+ ADCQ 48+i+z, R14; MOVQ R14, 48+i+z; \
+ ADCQ $0, DX; MOVQ DX, 56+i+z;
+
+// integerMulLeg multiplies x and y and stores in z
+// Uses: AX, DX, R8-R15, FLAGS
+// Instr: x86_64
+#define integerMulLeg(z,x,y) \
+ MOVQ 0+y, R15; \
+ MOVQ 0+x, AX; MULQ R15; MOVQ AX, 0+z; ;;;;;;;;;;;; MOVQ DX, R8; \
+ MOVQ 8+x, AX; MULQ R15; ADDQ AX, R8; ADCQ $0, DX; MOVQ DX, R9; MOVQ R8, 8+z; \
+ MOVQ 16+x, AX; MULQ R15; ADDQ AX, R9; ADCQ $0, DX; MOVQ DX, R10; MOVQ R9, 16+z; \
+ MOVQ 24+x, AX; MULQ R15; ADDQ AX, R10; ADCQ $0, DX; MOVQ DX, R11; MOVQ R10, 24+z; \
+ MOVQ 32+x, AX; MULQ R15; ADDQ AX, R11; ADCQ $0, DX; MOVQ DX, R12; MOVQ R11, 32+z; \
+ MOVQ 40+x, AX; MULQ R15; ADDQ AX, R12; ADCQ $0, DX; MOVQ DX, R13; MOVQ R12, 40+z; \
+ MOVQ 48+x, AX; MULQ R15; ADDQ AX, R13; ADCQ $0, DX; MOVQ DX,56+z; MOVQ R13, 48+z; \
+ maddLegacy(z,x,y, 8) \
+ maddLegacy(z,x,y,16) \
+ maddLegacy(z,x,y,24) \
+ maddLegacy(z,x,y,32) \
+ maddLegacy(z,x,y,40) \
+ maddLegacy(z,x,y,48)
+
+// integerSqrLeg squares x and stores in z
+// Uses: AX, CX, DX, R8-R15, FLAGS
+// Instr: x86_64
+#define integerSqrLeg(z,x) \
+ XORL R15, R15; \
+ MOVQ 0+x, CX; \
+ MOVQ CX, AX; MULQ CX; MOVQ AX, 0+z; MOVQ DX, R8; \
+ ADDQ CX, CX; ADCQ $0, R15; \
+ MOVQ 8+x, AX; MULQ CX; ADDQ AX, R8; ADCQ $0, DX; MOVQ DX, R9; MOVQ R8, 8+z; \
+ MOVQ 16+x, AX; MULQ CX; ADDQ AX, R9; ADCQ $0, DX; MOVQ DX, R10; \
+ MOVQ 24+x, AX; MULQ CX; ADDQ AX, R10; ADCQ $0, DX; MOVQ DX, R11; \
+ MOVQ 32+x, AX; MULQ CX; ADDQ AX, R11; ADCQ $0, DX; MOVQ DX, R12; \
+ MOVQ 40+x, AX; MULQ CX; ADDQ AX, R12; ADCQ $0, DX; MOVQ DX, R13; \
+ MOVQ 48+x, AX; MULQ CX; ADDQ AX, R13; ADCQ $0, DX; MOVQ DX, R14; \
+ \
+ MOVQ 8+x, CX; \
+ MOVQ CX, AX; ADDQ R15, CX; MOVQ $0, R15; ADCQ $0, R15; \
+ ;;;;;;;;;;;;;; MULQ CX; ADDQ AX, R9; ADCQ $0, DX; MOVQ R9,16+z; \
+ MOVQ R15, AX; NEGQ AX; ANDQ 8+x, AX; ADDQ AX, DX; ADCQ $0, R11; MOVQ DX, R8; \
+ ADDQ 8+x, CX; ADCQ $0, R15; \
+ MOVQ 16+x, AX; MULQ CX; ADDQ AX, R10; ADCQ $0, DX; ADDQ R8, R10; ADCQ $0, DX; MOVQ DX, R8; MOVQ R10, 24+z; \
+ MOVQ 24+x, AX; MULQ CX; ADDQ AX, R11; ADCQ $0, DX; ADDQ R8, R11; ADCQ $0, DX; MOVQ DX, R8; \
+ MOVQ 32+x, AX; MULQ CX; ADDQ AX, R12; ADCQ $0, DX; ADDQ R8, R12; ADCQ $0, DX; MOVQ DX, R8; \
+ MOVQ 40+x, AX; MULQ CX; ADDQ AX, R13; ADCQ $0, DX; ADDQ R8, R13; ADCQ $0, DX; MOVQ DX, R8; \
+ MOVQ 48+x, AX; MULQ CX; ADDQ AX, R14; ADCQ $0, DX; ADDQ R8, R14; ADCQ $0, DX; MOVQ DX, R9; \
+ \
+ MOVQ 16+x, CX; \
+ MOVQ CX, AX; ADDQ R15, CX; MOVQ $0, R15; ADCQ $0, R15; \
+ ;;;;;;;;;;;;;; MULQ CX; ADDQ AX, R11; ADCQ $0, DX; MOVQ R11, 32+z; \
+ MOVQ R15, AX; NEGQ AX; ANDQ 16+x,AX; ADDQ AX, DX; ADCQ $0, R13; MOVQ DX, R8; \
+ ADDQ 16+x, CX; ADCQ $0, R15; \
+ MOVQ 24+x, AX; MULQ CX; ADDQ AX, R12; ADCQ $0, DX; ADDQ R8, R12; ADCQ $0, DX; MOVQ DX, R8; MOVQ R12, 40+z; \
+ MOVQ 32+x, AX; MULQ CX; ADDQ AX, R13; ADCQ $0, DX; ADDQ R8, R13; ADCQ $0, DX; MOVQ DX, R8; \
+ MOVQ 40+x, AX; MULQ CX; ADDQ AX, R14; ADCQ $0, DX; ADDQ R8, R14; ADCQ $0, DX; MOVQ DX, R8; \
+ MOVQ 48+x, AX; MULQ CX; ADDQ AX, R9; ADCQ $0, DX; ADDQ R8, R9; ADCQ $0, DX; MOVQ DX,R10; \
+ \
+ MOVQ 24+x, CX; \
+ MOVQ CX, AX; ADDQ R15, CX; MOVQ $0, R15; ADCQ $0, R15; \
+ ;;;;;;;;;;;;;; MULQ CX; ADDQ AX, R13; ADCQ $0, DX; MOVQ R13, 48+z; \
+ MOVQ R15, AX; NEGQ AX; ANDQ 24+x,AX; ADDQ AX, DX; ADCQ $0, R9; MOVQ DX, R8; \
+ ADDQ 24+x, CX; ADCQ $0, R15; \
+ MOVQ 32+x, AX; MULQ CX; ADDQ AX, R14; ADCQ $0, DX; ADDQ R8, R14; ADCQ $0, DX; MOVQ DX, R8; MOVQ R14, 56+z; \
+ MOVQ 40+x, AX; MULQ CX; ADDQ AX, R9; ADCQ $0, DX; ADDQ R8, R9; ADCQ $0, DX; MOVQ DX, R8; \
+ MOVQ 48+x, AX; MULQ CX; ADDQ AX, R10; ADCQ $0, DX; ADDQ R8, R10; ADCQ $0, DX; MOVQ DX,R11; \
+ \
+ MOVQ 32+x, CX; \
+ MOVQ CX, AX; ADDQ R15, CX; MOVQ $0, R15; ADCQ $0, R15; \
+ ;;;;;;;;;;;;;; MULQ CX; ADDQ AX, R9; ADCQ $0, DX; MOVQ R9, 64+z; \
+ MOVQ R15, AX; NEGQ AX; ANDQ 32+x,AX; ADDQ AX, DX; ADCQ $0, R11; MOVQ DX, R8; \
+ ADDQ 32+x, CX; ADCQ $0, R15; \
+ MOVQ 40+x, AX; MULQ CX; ADDQ AX, R10; ADCQ $0, DX; ADDQ R8, R10; ADCQ $0, DX; MOVQ DX, R8; MOVQ R10, 72+z; \
+ MOVQ 48+x, AX; MULQ CX; ADDQ AX, R11; ADCQ $0, DX; ADDQ R8, R11; ADCQ $0, DX; MOVQ DX,R12; \
+ \
+ XORL R13, R13; \
+ XORL R14, R14; \
+ MOVQ 40+x, CX; \
+ MOVQ CX, AX; ADDQ R15, CX; MOVQ $0, R15; ADCQ $0, R15; \
+ ;;;;;;;;;;;;;; MULQ CX; ADDQ AX, R11; ADCQ $0, DX; MOVQ R11, 80+z; \
+ MOVQ R15, AX; NEGQ AX; ANDQ 40+x,AX; ADDQ AX, DX; ADCQ $0, R13; MOVQ DX, R8; \
+ ADDQ 40+x, CX; ADCQ $0, R15; \
+ MOVQ 48+x, AX; MULQ CX; ADDQ AX, R12; ADCQ $0, DX; ADDQ R8, R12; ADCQ $0, DX; MOVQ DX, R8; MOVQ R12, 88+z; \
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADDQ R8, R13; ADCQ $0,R14; \
+ \
+ XORL R9, R9; \
+ MOVQ 48+x, CX; \
+ MOVQ CX, AX; ADDQ R15, CX; MOVQ $0, R15; ADCQ $0, R15; \
+ ;;;;;;;;;;;;;; MULQ CX; ADDQ AX, R13; ADCQ $0, DX; MOVQ R13, 96+z; \
+ MOVQ R15, AX; NEGQ AX; ANDQ 48+x,AX; ADDQ AX, DX; ADCQ $0, R9; MOVQ DX, R8; \
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADDQ R8,R14; ADCQ $0, R9; MOVQ R14, 104+z;
+
+
+// integerSqrAdx squares x and stores in z
+// Uses: AX, CX, DX, R8-R15, FLAGS
+// Instr: x86_64, bmi2, adx
+#define integerSqrAdx(z,x) \
+ XORL R15, R15; \
+ MOVQ 0+x, DX; \
+ ;;;;;;;;;;;;;; MULXQ DX, AX, R8; MOVQ AX, 0+z; \
+ ADDQ DX, DX; ADCQ $0, R15; CLC; \
+ MULXQ 8+x, AX, R9; ADCXQ AX, R8; MOVQ R8, 8+z; \
+ MULXQ 16+x, AX, R10; ADCXQ AX, R9; MOVQ $0, R8;\
+ MULXQ 24+x, AX, R11; ADCXQ AX, R10; \
+ MULXQ 32+x, AX, R12; ADCXQ AX, R11; \
+ MULXQ 40+x, AX, R13; ADCXQ AX, R12; \
+ MULXQ 48+x, AX, R14; ADCXQ AX, R13; \
+ ;;;;;;;;;;;;;;;;;;;; ADCXQ R8, R14; \
+ \
+ MOVQ 8+x, DX; \
+ MOVQ DX, AX; ADDQ R15, DX; MOVQ $0, R15; ADCQ $0, R15; \
+ MULXQ AX, AX, CX; \
+ MOVQ R15, R8; NEGQ R8; ANDQ 8+x, R8; \
+ ADDQ AX, R9; MOVQ R9, 16+z; \
+ ADCQ CX, R8; \
+ ADCQ $0, R11; \
+ ADDQ 8+x, DX; \
+ ADCQ $0, R15; \
+ XORL R9, R9; ;;;;;;;;;;;;;;;;;;;;; ADOXQ R8, R10; \
+ MULXQ 16+x, AX, CX; ADCXQ AX, R10; ADOXQ CX, R11; MOVQ R10, 24+z; \
+ MULXQ 24+x, AX, CX; ADCXQ AX, R11; ADOXQ CX, R12; MOVQ $0, R10; \
+ MULXQ 32+x, AX, CX; ADCXQ AX, R12; ADOXQ CX, R13; \
+ MULXQ 40+x, AX, CX; ADCXQ AX, R13; ADOXQ CX, R14; \
+ MULXQ 48+x, AX, CX; ADCXQ AX, R14; ADOXQ CX, R9; \
+ ;;;;;;;;;;;;;;;;;;; ADCXQ R10, R9; \
+ \
+ MOVQ 16+x, DX; \
+ MOVQ DX, AX; ADDQ R15, DX; MOVQ $0, R15; ADCQ $0, R15; \
+ MULXQ AX, AX, CX; \
+ MOVQ R15, R8; NEGQ R8; ANDQ 16+x, R8; \
+ ADDQ AX, R11; MOVQ R11, 32+z; \
+ ADCQ CX, R8; \
+ ADCQ $0, R13; \
+ ADDQ 16+x, DX; \
+ ADCQ $0, R15; \
+ XORL R11, R11; ;;;;;;;;;;;;;;;;;;; ADOXQ R8, R12; \
+ MULXQ 24+x, AX, CX; ADCXQ AX, R12; ADOXQ CX, R13; MOVQ R12, 40+z; \
+ MULXQ 32+x, AX, CX; ADCXQ AX, R13; ADOXQ CX, R14; MOVQ $0, R12; \
+ MULXQ 40+x, AX, CX; ADCXQ AX, R14; ADOXQ CX, R9; \
+ MULXQ 48+x, AX, CX; ADCXQ AX, R9; ADOXQ CX, R10; \
+ ;;;;;;;;;;;;;;;;;;; ADCXQ R11,R10; \
+ \
+ MOVQ 24+x, DX; \
+ MOVQ DX, AX; ADDQ R15, DX; MOVQ $0, R15; ADCQ $0, R15; \
+ MULXQ AX, AX, CX; \
+ MOVQ R15, R8; NEGQ R8; ANDQ 24+x, R8; \
+ ADDQ AX, R13; MOVQ R13, 48+z; \
+ ADCQ CX, R8; \
+ ADCQ $0, R9; \
+ ADDQ 24+x, DX; \
+ ADCQ $0, R15; \
+ XORL R13, R13; ;;;;;;;;;;;;;;;;;;; ADOXQ R8, R14; \
+ MULXQ 32+x, AX, CX; ADCXQ AX, R14; ADOXQ CX, R9; MOVQ R14, 56+z; \
+ MULXQ 40+x, AX, CX; ADCXQ AX, R9; ADOXQ CX, R10; MOVQ $0, R14; \
+ MULXQ 48+x, AX, CX; ADCXQ AX, R10; ADOXQ CX, R11; \
+ ;;;;;;;;;;;;;;;;;;; ADCXQ R12,R11; \
+ \
+ MOVQ 32+x, DX; \
+ MOVQ DX, AX; ADDQ R15, DX; MOVQ $0, R15; ADCQ $0, R15; \
+ MULXQ AX, AX, CX; \
+ MOVQ R15, R8; NEGQ R8; ANDQ 32+x, R8; \
+ ADDQ AX, R9; MOVQ R9, 64+z; \
+ ADCQ CX, R8; \
+ ADCQ $0, R11; \
+ ADDQ 32+x, DX; \
+ ADCQ $0, R15; \
+ XORL R9, R9; ;;;;;;;;;;;;;;;;;;;;; ADOXQ R8, R10; \
+ MULXQ 40+x, AX, CX; ADCXQ AX, R10; ADOXQ CX, R11; MOVQ R10, 72+z; \
+ MULXQ 48+x, AX, CX; ADCXQ AX, R11; ADOXQ CX, R12; \
+ ;;;;;;;;;;;;;;;;;;; ADCXQ R13,R12; \
+ \
+ MOVQ 40+x, DX; \
+ MOVQ DX, AX; ADDQ R15, DX; MOVQ $0, R15; ADCQ $0, R15; \
+ MULXQ AX, AX, CX; \
+ MOVQ R15, R8; NEGQ R8; ANDQ 40+x, R8; \
+ ADDQ AX, R11; MOVQ R11, 80+z; \
+ ADCQ CX, R8; \
+ ADCQ $0, R13; \
+ ADDQ 40+x, DX; \
+ ADCQ $0, R15; \
+ XORL R11, R11; ;;;;;;;;;;;;;;;;;;; ADOXQ R8, R12; \
+ MULXQ 48+x, AX, CX; ADCXQ AX, R12; ADOXQ CX, R13; MOVQ R12, 88+z; \
+ ;;;;;;;;;;;;;;;;;;; ADCXQ R14,R13; \
+ \
+ MOVQ 48+x, DX; \
+ MOVQ DX, AX; ADDQ R15, DX; MOVQ $0, R15; ADCQ $0, R15; \
+ MULXQ AX, AX, CX; \
+ MOVQ R15, R8; NEGQ R8; ANDQ 48+x, R8; \
+ XORL R10, R10; ;;;;;;;;;;;;;; ADOXQ CX, R14; \
+ ;;;;;;;;;;;;;; ADCXQ AX, R13; ;;;;;;;;;;;;;; MOVQ R13, 96+z; \
+ ;;;;;;;;;;;;;; ADCXQ R8, R14; MOVQ R14, 104+z;
+
+// reduceFromDoubleLeg finds a z=x modulo p such that z<2^448 and stores in z
+// Uses: AX, R8-R15, FLAGS
+// Instr: x86_64
+#define reduceFromDoubleLeg(z,x) \
+ /* ( ,2C13,2C12,2C11,2C10|C10,C9,C8, C7) + (C6,...,C0) */ \
+ /* (r14, r13, r12, r11, r10,r9,r8,r15) */ \
+ MOVQ 80+x,AX; MOVQ AX,R10; \
+ MOVQ $0xFFFFFFFF00000000, R8; \
+ ANDQ R8,R10; \
+ \
+ MOVQ $0,R14; \
+ MOVQ 104+x,R13; SHLQ $1,R13,R14; \
+ MOVQ 96+x,R12; SHLQ $1,R12,R13; \
+ MOVQ 88+x,R11; SHLQ $1,R11,R12; \
+ MOVQ 72+x, R9; SHLQ $1,R10,R11; \
+ MOVQ 64+x, R8; SHLQ $1,R10; \
+ MOVQ $0xFFFFFFFF,R15; ANDQ R15,AX; ORQ AX,R10; \
+ MOVQ 56+x,R15; \
+ \
+ ADDQ 0+x,R15; MOVQ R15, 0+z; MOVQ 56+x,R15; \
+ ADCQ 8+x, R8; MOVQ R8, 8+z; MOVQ 64+x, R8; \
+ ADCQ 16+x, R9; MOVQ R9,16+z; MOVQ 72+x, R9; \
+ ADCQ 24+x,R10; MOVQ R10,24+z; MOVQ 80+x,R10; \
+ ADCQ 32+x,R11; MOVQ R11,32+z; MOVQ 88+x,R11; \
+ ADCQ 40+x,R12; MOVQ R12,40+z; MOVQ 96+x,R12; \
+ ADCQ 48+x,R13; MOVQ R13,48+z; MOVQ 104+x,R13; \
+ ADCQ $0,R14; \
+ /* (c10c9,c9c8,c8c7,c7c13,c13c12,c12c11,c11c10) + (c6,...,c0) */ \
+ /* ( r9, r8, r15, r13, r12, r11, r10) */ \
+ MOVQ R10, AX; \
+ SHRQ $32,R11,R10; \
+ SHRQ $32,R12,R11; \
+ SHRQ $32,R13,R12; \
+ SHRQ $32,R15,R13; \
+ SHRQ $32, R8,R15; \
+ SHRQ $32, R9, R8; \
+ SHRQ $32, AX, R9; \
+ \
+ ADDQ 0+z,R10; \
+ ADCQ 8+z,R11; \
+ ADCQ 16+z,R12; \
+ ADCQ 24+z,R13; \
+ ADCQ 32+z,R15; \
+ ADCQ 40+z, R8; \
+ ADCQ 48+z, R9; \
+ ADCQ $0,R14; \
+ /* ( c7) + (c6,...,c0) */ \
+ /* (r14) */ \
+ MOVQ R14, AX; SHLQ $32, AX; \
+ ADDQ R14,R10; MOVQ $0,R14; \
+ ADCQ $0,R11; \
+ ADCQ $0,R12; \
+ ADCQ AX,R13; \
+ ADCQ $0,R15; \
+ ADCQ $0, R8; \
+ ADCQ $0, R9; \
+ ADCQ $0,R14; \
+ /* ( c7) + (c6,...,c0) */ \
+ /* (r14) */ \
+ MOVQ R14, AX; SHLQ $32,AX; \
+ ADDQ R14,R10; MOVQ R10, 0+z; \
+ ADCQ $0,R11; MOVQ R11, 8+z; \
+ ADCQ $0,R12; MOVQ R12,16+z; \
+ ADCQ AX,R13; MOVQ R13,24+z; \
+ ADCQ $0,R15; MOVQ R15,32+z; \
+ ADCQ $0, R8; MOVQ R8,40+z; \
+ ADCQ $0, R9; MOVQ R9,48+z;
+
+// reduceFromDoubleAdx finds a z=x modulo p such that z<2^448 and stores in z
+// Uses: AX, R8-R15, FLAGS
+// Instr: x86_64, adx
+#define reduceFromDoubleAdx(z,x) \
+ /* ( ,2C13,2C12,2C11,2C10|C10,C9,C8, C7) + (C6,...,C0) */ \
+ /* (r14, r13, r12, r11, r10,r9,r8,r15) */ \
+ MOVQ 80+x,AX; MOVQ AX,R10; \
+ MOVQ $0xFFFFFFFF00000000, R8; \
+ ANDQ R8,R10; \
+ \
+ MOVQ $0,R14; \
+ MOVQ 104+x,R13; SHLQ $1,R13,R14; \
+ MOVQ 96+x,R12; SHLQ $1,R12,R13; \
+ MOVQ 88+x,R11; SHLQ $1,R11,R12; \
+ MOVQ 72+x, R9; SHLQ $1,R10,R11; \
+ MOVQ 64+x, R8; SHLQ $1,R10; \
+ MOVQ $0xFFFFFFFF,R15; ANDQ R15,AX; ORQ AX,R10; \
+ MOVQ 56+x,R15; \
+ \
+ XORL AX,AX; \
+ ADCXQ 0+x,R15; MOVQ R15, 0+z; MOVQ 56+x,R15; \
+ ADCXQ 8+x, R8; MOVQ R8, 8+z; MOVQ 64+x, R8; \
+ ADCXQ 16+x, R9; MOVQ R9,16+z; MOVQ 72+x, R9; \
+ ADCXQ 24+x,R10; MOVQ R10,24+z; MOVQ 80+x,R10; \
+ ADCXQ 32+x,R11; MOVQ R11,32+z; MOVQ 88+x,R11; \
+ ADCXQ 40+x,R12; MOVQ R12,40+z; MOVQ 96+x,R12; \
+ ADCXQ 48+x,R13; MOVQ R13,48+z; MOVQ 104+x,R13; \
+ ADCXQ AX,R14; \
+ /* (c10c9,c9c8,c8c7,c7c13,c13c12,c12c11,c11c10) + (c6,...,c0) */ \
+ /* ( r9, r8, r15, r13, r12, r11, r10) */ \
+ MOVQ R10, AX; \
+ SHRQ $32,R11,R10; \
+ SHRQ $32,R12,R11; \
+ SHRQ $32,R13,R12; \
+ SHRQ $32,R15,R13; \
+ SHRQ $32, R8,R15; \
+ SHRQ $32, R9, R8; \
+ SHRQ $32, AX, R9; \
+ \
+ XORL AX,AX; \
+ ADCXQ 0+z,R10; \
+ ADCXQ 8+z,R11; \
+ ADCXQ 16+z,R12; \
+ ADCXQ 24+z,R13; \
+ ADCXQ 32+z,R15; \
+ ADCXQ 40+z, R8; \
+ ADCXQ 48+z, R9; \
+ ADCXQ AX,R14; \
+ /* ( c7) + (c6,...,c0) */ \
+ /* (r14) */ \
+ MOVQ R14, AX; SHLQ $32, AX; \
+ CLC; \
+ ADCXQ R14,R10; MOVQ $0,R14; \
+ ADCXQ R14,R11; \
+ ADCXQ R14,R12; \
+ ADCXQ AX,R13; \
+ ADCXQ R14,R15; \
+ ADCXQ R14, R8; \
+ ADCXQ R14, R9; \
+ ADCXQ R14,R14; \
+ /* ( c7) + (c6,...,c0) */ \
+ /* (r14) */ \
+ MOVQ R14, AX; SHLQ $32, AX; \
+ CLC; \
+ ADCXQ R14,R10; MOVQ R10, 0+z; MOVQ $0,R14; \
+ ADCXQ R14,R11; MOVQ R11, 8+z; \
+ ADCXQ R14,R12; MOVQ R12,16+z; \
+ ADCXQ AX,R13; MOVQ R13,24+z; \
+ ADCXQ R14,R15; MOVQ R15,32+z; \
+ ADCXQ R14, R8; MOVQ R8,40+z; \
+ ADCXQ R14, R9; MOVQ R9,48+z;
+
+// addSub calculates two operations: x,y = x+y,x-y
+// Uses: AX, DX, R8-R15, FLAGS
+#define addSub(x,y) \
+ MOVQ 0+x, R8; ADDQ 0+y, R8; \
+ MOVQ 8+x, R9; ADCQ 8+y, R9; \
+ MOVQ 16+x, R10; ADCQ 16+y, R10; \
+ MOVQ 24+x, R11; ADCQ 24+y, R11; \
+ MOVQ 32+x, R12; ADCQ 32+y, R12; \
+ MOVQ 40+x, R13; ADCQ 40+y, R13; \
+ MOVQ 48+x, R14; ADCQ 48+y, R14; \
+ MOVQ $0, AX; ADCQ $0, AX; \
+ MOVQ AX, DX; \
+ SHLQ $32, DX; \
+ ADDQ AX, R8; MOVQ $0, AX; \
+ ADCQ $0, R9; \
+ ADCQ $0, R10; \
+ ADCQ DX, R11; \
+ ADCQ $0, R12; \
+ ADCQ $0, R13; \
+ ADCQ $0, R14; \
+ ADCQ $0, AX; \
+ MOVQ AX, DX; \
+ SHLQ $32, DX; \
+ ADDQ AX, R8; MOVQ 0+x,AX; MOVQ R8, 0+x; MOVQ AX, R8; \
+ ADCQ $0, R9; MOVQ 8+x,AX; MOVQ R9, 8+x; MOVQ AX, R9; \
+ ADCQ $0, R10; MOVQ 16+x,AX; MOVQ R10, 16+x; MOVQ AX, R10; \
+ ADCQ DX, R11; MOVQ 24+x,AX; MOVQ R11, 24+x; MOVQ AX, R11; \
+ ADCQ $0, R12; MOVQ 32+x,AX; MOVQ R12, 32+x; MOVQ AX, R12; \
+ ADCQ $0, R13; MOVQ 40+x,AX; MOVQ R13, 40+x; MOVQ AX, R13; \
+ ADCQ $0, R14; MOVQ 48+x,AX; MOVQ R14, 48+x; MOVQ AX, R14; \
+ SUBQ 0+y, R8; \
+ SBBQ 8+y, R9; \
+ SBBQ 16+y, R10; \
+ SBBQ 24+y, R11; \
+ SBBQ 32+y, R12; \
+ SBBQ 40+y, R13; \
+ SBBQ 48+y, R14; \
+ MOVQ $0, AX; SETCS AX; \
+ MOVQ AX, DX; \
+ SHLQ $32, DX; \
+ SUBQ AX, R8; MOVQ $0, AX; \
+ SBBQ $0, R9; \
+ SBBQ $0, R10; \
+ SBBQ DX, R11; \
+ SBBQ $0, R12; \
+ SBBQ $0, R13; \
+ SBBQ $0, R14; \
+ SETCS AX; \
+ MOVQ AX, DX; \
+ SHLQ $32, DX; \
+ SUBQ AX, R8; MOVQ R8, 0+y; \
+ SBBQ $0, R9; MOVQ R9, 8+y; \
+ SBBQ $0, R10; MOVQ R10, 16+y; \
+ SBBQ DX, R11; MOVQ R11, 24+y; \
+ SBBQ $0, R12; MOVQ R12, 32+y; \
+ SBBQ $0, R13; MOVQ R13, 40+y; \
+ SBBQ $0, R14; MOVQ R14, 48+y;
diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.s b/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.s
new file mode 100644
index 0000000000..3f1f07c986
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.s
@@ -0,0 +1,75 @@
+//go:build amd64 && !purego
+// +build amd64,!purego
+
+#include "textflag.h"
+#include "fp_amd64.h"
+
+// func cmovAmd64(x, y *Elt, n uint)
+TEXT ·cmovAmd64(SB),NOSPLIT,$0-24
+ MOVQ x+0(FP), DI
+ MOVQ y+8(FP), SI
+ MOVQ n+16(FP), BX
+ cselect(0(DI),0(SI),BX)
+ RET
+
+// func cswapAmd64(x, y *Elt, n uint)
+TEXT ·cswapAmd64(SB),NOSPLIT,$0-24
+ MOVQ x+0(FP), DI
+ MOVQ y+8(FP), SI
+ MOVQ n+16(FP), BX
+ cswap(0(DI),0(SI),BX)
+ RET
+
+// func subAmd64(z, x, y *Elt)
+TEXT ·subAmd64(SB),NOSPLIT,$0-24
+ MOVQ z+0(FP), DI
+ MOVQ x+8(FP), SI
+ MOVQ y+16(FP), BX
+ subtraction(0(DI),0(SI),0(BX))
+ RET
+
+// func addsubAmd64(x, y *Elt)
+TEXT ·addsubAmd64(SB),NOSPLIT,$0-16
+ MOVQ x+0(FP), DI
+ MOVQ y+8(FP), SI
+ addSub(0(DI),0(SI))
+ RET
+
+#define addLegacy \
+ additionLeg(0(DI),0(SI),0(BX))
+#define addBmi2Adx \
+ additionAdx(0(DI),0(SI),0(BX))
+
+#define mulLegacy \
+ integerMulLeg(0(SP),0(SI),0(BX)) \
+ reduceFromDoubleLeg(0(DI),0(SP))
+#define mulBmi2Adx \
+ integerMulAdx(0(SP),0(SI),0(BX)) \
+ reduceFromDoubleAdx(0(DI),0(SP))
+
+#define sqrLegacy \
+ integerSqrLeg(0(SP),0(SI)) \
+ reduceFromDoubleLeg(0(DI),0(SP))
+#define sqrBmi2Adx \
+ integerSqrAdx(0(SP),0(SI)) \
+ reduceFromDoubleAdx(0(DI),0(SP))
+
+// func addAmd64(z, x, y *Elt)
+TEXT ·addAmd64(SB),NOSPLIT,$0-24
+ MOVQ z+0(FP), DI
+ MOVQ x+8(FP), SI
+ MOVQ y+16(FP), BX
+ CHECK_BMI2ADX(LADD, addLegacy, addBmi2Adx)
+
+// func mulAmd64(z, x, y *Elt)
+TEXT ·mulAmd64(SB),NOSPLIT,$112-24
+ MOVQ z+0(FP), DI
+ MOVQ x+8(FP), SI
+ MOVQ y+16(FP), BX
+ CHECK_BMI2ADX(LMUL, mulLegacy, mulBmi2Adx)
+
+// func sqrAmd64(z, x *Elt)
+TEXT ·sqrAmd64(SB),NOSPLIT,$112-16
+ MOVQ z+0(FP), DI
+ MOVQ x+8(FP), SI
+ CHECK_BMI2ADX(LSQR, sqrLegacy, sqrBmi2Adx)
diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fp_generic.go b/vendor/github.com/cloudflare/circl/math/fp448/fp_generic.go
new file mode 100644
index 0000000000..47a0b63205
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/fp448/fp_generic.go
@@ -0,0 +1,339 @@
+package fp448
+
+import (
+ "encoding/binary"
+ "math/bits"
+)
+
+func cmovGeneric(x, y *Elt, n uint) {
+ m := -uint64(n & 0x1)
+ x0 := binary.LittleEndian.Uint64(x[0*8 : 1*8])
+ x1 := binary.LittleEndian.Uint64(x[1*8 : 2*8])
+ x2 := binary.LittleEndian.Uint64(x[2*8 : 3*8])
+ x3 := binary.LittleEndian.Uint64(x[3*8 : 4*8])
+ x4 := binary.LittleEndian.Uint64(x[4*8 : 5*8])
+ x5 := binary.LittleEndian.Uint64(x[5*8 : 6*8])
+ x6 := binary.LittleEndian.Uint64(x[6*8 : 7*8])
+
+ y0 := binary.LittleEndian.Uint64(y[0*8 : 1*8])
+ y1 := binary.LittleEndian.Uint64(y[1*8 : 2*8])
+ y2 := binary.LittleEndian.Uint64(y[2*8 : 3*8])
+ y3 := binary.LittleEndian.Uint64(y[3*8 : 4*8])
+ y4 := binary.LittleEndian.Uint64(y[4*8 : 5*8])
+ y5 := binary.LittleEndian.Uint64(y[5*8 : 6*8])
+ y6 := binary.LittleEndian.Uint64(y[6*8 : 7*8])
+
+ x0 = (x0 &^ m) | (y0 & m)
+ x1 = (x1 &^ m) | (y1 & m)
+ x2 = (x2 &^ m) | (y2 & m)
+ x3 = (x3 &^ m) | (y3 & m)
+ x4 = (x4 &^ m) | (y4 & m)
+ x5 = (x5 &^ m) | (y5 & m)
+ x6 = (x6 &^ m) | (y6 & m)
+
+ binary.LittleEndian.PutUint64(x[0*8:1*8], x0)
+ binary.LittleEndian.PutUint64(x[1*8:2*8], x1)
+ binary.LittleEndian.PutUint64(x[2*8:3*8], x2)
+ binary.LittleEndian.PutUint64(x[3*8:4*8], x3)
+ binary.LittleEndian.PutUint64(x[4*8:5*8], x4)
+ binary.LittleEndian.PutUint64(x[5*8:6*8], x5)
+ binary.LittleEndian.PutUint64(x[6*8:7*8], x6)
+}
+
+func cswapGeneric(x, y *Elt, n uint) {
+ m := -uint64(n & 0x1)
+ x0 := binary.LittleEndian.Uint64(x[0*8 : 1*8])
+ x1 := binary.LittleEndian.Uint64(x[1*8 : 2*8])
+ x2 := binary.LittleEndian.Uint64(x[2*8 : 3*8])
+ x3 := binary.LittleEndian.Uint64(x[3*8 : 4*8])
+ x4 := binary.LittleEndian.Uint64(x[4*8 : 5*8])
+ x5 := binary.LittleEndian.Uint64(x[5*8 : 6*8])
+ x6 := binary.LittleEndian.Uint64(x[6*8 : 7*8])
+
+ y0 := binary.LittleEndian.Uint64(y[0*8 : 1*8])
+ y1 := binary.LittleEndian.Uint64(y[1*8 : 2*8])
+ y2 := binary.LittleEndian.Uint64(y[2*8 : 3*8])
+ y3 := binary.LittleEndian.Uint64(y[3*8 : 4*8])
+ y4 := binary.LittleEndian.Uint64(y[4*8 : 5*8])
+ y5 := binary.LittleEndian.Uint64(y[5*8 : 6*8])
+ y6 := binary.LittleEndian.Uint64(y[6*8 : 7*8])
+
+ t0 := m & (x0 ^ y0)
+ t1 := m & (x1 ^ y1)
+ t2 := m & (x2 ^ y2)
+ t3 := m & (x3 ^ y3)
+ t4 := m & (x4 ^ y4)
+ t5 := m & (x5 ^ y5)
+ t6 := m & (x6 ^ y6)
+ x0 ^= t0
+ x1 ^= t1
+ x2 ^= t2
+ x3 ^= t3
+ x4 ^= t4
+ x5 ^= t5
+ x6 ^= t6
+ y0 ^= t0
+ y1 ^= t1
+ y2 ^= t2
+ y3 ^= t3
+ y4 ^= t4
+ y5 ^= t5
+ y6 ^= t6
+
+ binary.LittleEndian.PutUint64(x[0*8:1*8], x0)
+ binary.LittleEndian.PutUint64(x[1*8:2*8], x1)
+ binary.LittleEndian.PutUint64(x[2*8:3*8], x2)
+ binary.LittleEndian.PutUint64(x[3*8:4*8], x3)
+ binary.LittleEndian.PutUint64(x[4*8:5*8], x4)
+ binary.LittleEndian.PutUint64(x[5*8:6*8], x5)
+ binary.LittleEndian.PutUint64(x[6*8:7*8], x6)
+
+ binary.LittleEndian.PutUint64(y[0*8:1*8], y0)
+ binary.LittleEndian.PutUint64(y[1*8:2*8], y1)
+ binary.LittleEndian.PutUint64(y[2*8:3*8], y2)
+ binary.LittleEndian.PutUint64(y[3*8:4*8], y3)
+ binary.LittleEndian.PutUint64(y[4*8:5*8], y4)
+ binary.LittleEndian.PutUint64(y[5*8:6*8], y5)
+ binary.LittleEndian.PutUint64(y[6*8:7*8], y6)
+}
+
+func addGeneric(z, x, y *Elt) {
+ x0 := binary.LittleEndian.Uint64(x[0*8 : 1*8])
+ x1 := binary.LittleEndian.Uint64(x[1*8 : 2*8])
+ x2 := binary.LittleEndian.Uint64(x[2*8 : 3*8])
+ x3 := binary.LittleEndian.Uint64(x[3*8 : 4*8])
+ x4 := binary.LittleEndian.Uint64(x[4*8 : 5*8])
+ x5 := binary.LittleEndian.Uint64(x[5*8 : 6*8])
+ x6 := binary.LittleEndian.Uint64(x[6*8 : 7*8])
+
+ y0 := binary.LittleEndian.Uint64(y[0*8 : 1*8])
+ y1 := binary.LittleEndian.Uint64(y[1*8 : 2*8])
+ y2 := binary.LittleEndian.Uint64(y[2*8 : 3*8])
+ y3 := binary.LittleEndian.Uint64(y[3*8 : 4*8])
+ y4 := binary.LittleEndian.Uint64(y[4*8 : 5*8])
+ y5 := binary.LittleEndian.Uint64(y[5*8 : 6*8])
+ y6 := binary.LittleEndian.Uint64(y[6*8 : 7*8])
+
+ z0, c0 := bits.Add64(x0, y0, 0)
+ z1, c1 := bits.Add64(x1, y1, c0)
+ z2, c2 := bits.Add64(x2, y2, c1)
+ z3, c3 := bits.Add64(x3, y3, c2)
+ z4, c4 := bits.Add64(x4, y4, c3)
+ z5, c5 := bits.Add64(x5, y5, c4)
+ z6, z7 := bits.Add64(x6, y6, c5)
+
+ z0, c0 = bits.Add64(z0, z7, 0)
+ z1, c1 = bits.Add64(z1, 0, c0)
+ z2, c2 = bits.Add64(z2, 0, c1)
+ z3, c3 = bits.Add64(z3, z7<<32, c2)
+ z4, c4 = bits.Add64(z4, 0, c3)
+ z5, c5 = bits.Add64(z5, 0, c4)
+ z6, z7 = bits.Add64(z6, 0, c5)
+
+ z0, c0 = bits.Add64(z0, z7, 0)
+ z1, c1 = bits.Add64(z1, 0, c0)
+ z2, c2 = bits.Add64(z2, 0, c1)
+ z3, c3 = bits.Add64(z3, z7<<32, c2)
+ z4, c4 = bits.Add64(z4, 0, c3)
+ z5, c5 = bits.Add64(z5, 0, c4)
+ z6, _ = bits.Add64(z6, 0, c5)
+
+ binary.LittleEndian.PutUint64(z[0*8:1*8], z0)
+ binary.LittleEndian.PutUint64(z[1*8:2*8], z1)
+ binary.LittleEndian.PutUint64(z[2*8:3*8], z2)
+ binary.LittleEndian.PutUint64(z[3*8:4*8], z3)
+ binary.LittleEndian.PutUint64(z[4*8:5*8], z4)
+ binary.LittleEndian.PutUint64(z[5*8:6*8], z5)
+ binary.LittleEndian.PutUint64(z[6*8:7*8], z6)
+}
+
+func subGeneric(z, x, y *Elt) {
+ x0 := binary.LittleEndian.Uint64(x[0*8 : 1*8])
+ x1 := binary.LittleEndian.Uint64(x[1*8 : 2*8])
+ x2 := binary.LittleEndian.Uint64(x[2*8 : 3*8])
+ x3 := binary.LittleEndian.Uint64(x[3*8 : 4*8])
+ x4 := binary.LittleEndian.Uint64(x[4*8 : 5*8])
+ x5 := binary.LittleEndian.Uint64(x[5*8 : 6*8])
+ x6 := binary.LittleEndian.Uint64(x[6*8 : 7*8])
+
+ y0 := binary.LittleEndian.Uint64(y[0*8 : 1*8])
+ y1 := binary.LittleEndian.Uint64(y[1*8 : 2*8])
+ y2 := binary.LittleEndian.Uint64(y[2*8 : 3*8])
+ y3 := binary.LittleEndian.Uint64(y[3*8 : 4*8])
+ y4 := binary.LittleEndian.Uint64(y[4*8 : 5*8])
+ y5 := binary.LittleEndian.Uint64(y[5*8 : 6*8])
+ y6 := binary.LittleEndian.Uint64(y[6*8 : 7*8])
+
+ z0, c0 := bits.Sub64(x0, y0, 0)
+ z1, c1 := bits.Sub64(x1, y1, c0)
+ z2, c2 := bits.Sub64(x2, y2, c1)
+ z3, c3 := bits.Sub64(x3, y3, c2)
+ z4, c4 := bits.Sub64(x4, y4, c3)
+ z5, c5 := bits.Sub64(x5, y5, c4)
+ z6, z7 := bits.Sub64(x6, y6, c5)
+
+ z0, c0 = bits.Sub64(z0, z7, 0)
+ z1, c1 = bits.Sub64(z1, 0, c0)
+ z2, c2 = bits.Sub64(z2, 0, c1)
+ z3, c3 = bits.Sub64(z3, z7<<32, c2)
+ z4, c4 = bits.Sub64(z4, 0, c3)
+ z5, c5 = bits.Sub64(z5, 0, c4)
+ z6, z7 = bits.Sub64(z6, 0, c5)
+
+ z0, c0 = bits.Sub64(z0, z7, 0)
+ z1, c1 = bits.Sub64(z1, 0, c0)
+ z2, c2 = bits.Sub64(z2, 0, c1)
+ z3, c3 = bits.Sub64(z3, z7<<32, c2)
+ z4, c4 = bits.Sub64(z4, 0, c3)
+ z5, c5 = bits.Sub64(z5, 0, c4)
+ z6, _ = bits.Sub64(z6, 0, c5)
+
+ binary.LittleEndian.PutUint64(z[0*8:1*8], z0)
+ binary.LittleEndian.PutUint64(z[1*8:2*8], z1)
+ binary.LittleEndian.PutUint64(z[2*8:3*8], z2)
+ binary.LittleEndian.PutUint64(z[3*8:4*8], z3)
+ binary.LittleEndian.PutUint64(z[4*8:5*8], z4)
+ binary.LittleEndian.PutUint64(z[5*8:6*8], z5)
+ binary.LittleEndian.PutUint64(z[6*8:7*8], z6)
+}
+
+func addsubGeneric(x, y *Elt) {
+ z := &Elt{}
+ addGeneric(z, x, y)
+ subGeneric(y, x, y)
+ *x = *z
+}
+
+func mulGeneric(z, x, y *Elt) {
+ x0 := binary.LittleEndian.Uint64(x[0*8 : 1*8])
+ x1 := binary.LittleEndian.Uint64(x[1*8 : 2*8])
+ x2 := binary.LittleEndian.Uint64(x[2*8 : 3*8])
+ x3 := binary.LittleEndian.Uint64(x[3*8 : 4*8])
+ x4 := binary.LittleEndian.Uint64(x[4*8 : 5*8])
+ x5 := binary.LittleEndian.Uint64(x[5*8 : 6*8])
+ x6 := binary.LittleEndian.Uint64(x[6*8 : 7*8])
+
+ y0 := binary.LittleEndian.Uint64(y[0*8 : 1*8])
+ y1 := binary.LittleEndian.Uint64(y[1*8 : 2*8])
+ y2 := binary.LittleEndian.Uint64(y[2*8 : 3*8])
+ y3 := binary.LittleEndian.Uint64(y[3*8 : 4*8])
+ y4 := binary.LittleEndian.Uint64(y[4*8 : 5*8])
+ y5 := binary.LittleEndian.Uint64(y[5*8 : 6*8])
+ y6 := binary.LittleEndian.Uint64(y[6*8 : 7*8])
+
+ yy := [7]uint64{y0, y1, y2, y3, y4, y5, y6}
+ zz := [7]uint64{}
+
+ yi := yy[0]
+ h0, l0 := bits.Mul64(x0, yi)
+ h1, l1 := bits.Mul64(x1, yi)
+ h2, l2 := bits.Mul64(x2, yi)
+ h3, l3 := bits.Mul64(x3, yi)
+ h4, l4 := bits.Mul64(x4, yi)
+ h5, l5 := bits.Mul64(x5, yi)
+ h6, l6 := bits.Mul64(x6, yi)
+
+ zz[0] = l0
+ a0, c0 := bits.Add64(h0, l1, 0)
+ a1, c1 := bits.Add64(h1, l2, c0)
+ a2, c2 := bits.Add64(h2, l3, c1)
+ a3, c3 := bits.Add64(h3, l4, c2)
+ a4, c4 := bits.Add64(h4, l5, c3)
+ a5, c5 := bits.Add64(h5, l6, c4)
+ a6, _ := bits.Add64(h6, 0, c5)
+
+ for i := 1; i < 7; i++ {
+ yi = yy[i]
+ h0, l0 = bits.Mul64(x0, yi)
+ h1, l1 = bits.Mul64(x1, yi)
+ h2, l2 = bits.Mul64(x2, yi)
+ h3, l3 = bits.Mul64(x3, yi)
+ h4, l4 = bits.Mul64(x4, yi)
+ h5, l5 = bits.Mul64(x5, yi)
+ h6, l6 = bits.Mul64(x6, yi)
+
+ zz[i], c0 = bits.Add64(a0, l0, 0)
+ a0, c1 = bits.Add64(a1, l1, c0)
+ a1, c2 = bits.Add64(a2, l2, c1)
+ a2, c3 = bits.Add64(a3, l3, c2)
+ a3, c4 = bits.Add64(a4, l4, c3)
+ a4, c5 = bits.Add64(a5, l5, c4)
+ a5, a6 = bits.Add64(a6, l6, c5)
+
+ a0, c0 = bits.Add64(a0, h0, 0)
+ a1, c1 = bits.Add64(a1, h1, c0)
+ a2, c2 = bits.Add64(a2, h2, c1)
+ a3, c3 = bits.Add64(a3, h3, c2)
+ a4, c4 = bits.Add64(a4, h4, c3)
+ a5, c5 = bits.Add64(a5, h5, c4)
+ a6, _ = bits.Add64(a6, h6, c5)
+ }
+ red64(z, &zz, &[7]uint64{a0, a1, a2, a3, a4, a5, a6})
+}
+
+func sqrGeneric(z, x *Elt) { mulGeneric(z, x, x) }
+
+func red64(z *Elt, l, h *[7]uint64) {
+ /* (2C13, 2C12, 2C11, 2C10|C10, C9, C8, C7) + (C6,...,C0) */
+ h0 := h[0]
+ h1 := h[1]
+ h2 := h[2]
+ h3 := ((h[3] & (0xFFFFFFFF << 32)) << 1) | (h[3] & 0xFFFFFFFF)
+ h4 := (h[3] >> 63) | (h[4] << 1)
+ h5 := (h[4] >> 63) | (h[5] << 1)
+ h6 := (h[5] >> 63) | (h[6] << 1)
+ h7 := (h[6] >> 63)
+
+ l0, c0 := bits.Add64(h0, l[0], 0)
+ l1, c1 := bits.Add64(h1, l[1], c0)
+ l2, c2 := bits.Add64(h2, l[2], c1)
+ l3, c3 := bits.Add64(h3, l[3], c2)
+ l4, c4 := bits.Add64(h4, l[4], c3)
+ l5, c5 := bits.Add64(h5, l[5], c4)
+ l6, c6 := bits.Add64(h6, l[6], c5)
+ l7, _ := bits.Add64(h7, 0, c6)
+
+ /* (C10C9, C9C8,C8C7,C7C13,C13C12,C12C11,C11C10) + (C6,...,C0) */
+ h0 = (h[3] >> 32) | (h[4] << 32)
+ h1 = (h[4] >> 32) | (h[5] << 32)
+ h2 = (h[5] >> 32) | (h[6] << 32)
+ h3 = (h[6] >> 32) | (h[0] << 32)
+ h4 = (h[0] >> 32) | (h[1] << 32)
+ h5 = (h[1] >> 32) | (h[2] << 32)
+ h6 = (h[2] >> 32) | (h[3] << 32)
+
+ l0, c0 = bits.Add64(l0, h0, 0)
+ l1, c1 = bits.Add64(l1, h1, c0)
+ l2, c2 = bits.Add64(l2, h2, c1)
+ l3, c3 = bits.Add64(l3, h3, c2)
+ l4, c4 = bits.Add64(l4, h4, c3)
+ l5, c5 = bits.Add64(l5, h5, c4)
+ l6, c6 = bits.Add64(l6, h6, c5)
+ l7, _ = bits.Add64(l7, 0, c6)
+
+ /* (C7) + (C6,...,C0) */
+ l0, c0 = bits.Add64(l0, l7, 0)
+ l1, c1 = bits.Add64(l1, 0, c0)
+ l2, c2 = bits.Add64(l2, 0, c1)
+ l3, c3 = bits.Add64(l3, l7<<32, c2)
+ l4, c4 = bits.Add64(l4, 0, c3)
+ l5, c5 = bits.Add64(l5, 0, c4)
+ l6, l7 = bits.Add64(l6, 0, c5)
+
+ /* (C7) + (C6,...,C0) */
+ l0, c0 = bits.Add64(l0, l7, 0)
+ l1, c1 = bits.Add64(l1, 0, c0)
+ l2, c2 = bits.Add64(l2, 0, c1)
+ l3, c3 = bits.Add64(l3, l7<<32, c2)
+ l4, c4 = bits.Add64(l4, 0, c3)
+ l5, c5 = bits.Add64(l5, 0, c4)
+ l6, _ = bits.Add64(l6, 0, c5)
+
+ binary.LittleEndian.PutUint64(z[0*8:1*8], l0)
+ binary.LittleEndian.PutUint64(z[1*8:2*8], l1)
+ binary.LittleEndian.PutUint64(z[2*8:3*8], l2)
+ binary.LittleEndian.PutUint64(z[3*8:4*8], l3)
+ binary.LittleEndian.PutUint64(z[4*8:5*8], l4)
+ binary.LittleEndian.PutUint64(z[5*8:6*8], l5)
+ binary.LittleEndian.PutUint64(z[6*8:7*8], l6)
+}
diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fp_noasm.go b/vendor/github.com/cloudflare/circl/math/fp448/fp_noasm.go
new file mode 100644
index 0000000000..a62225d296
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/fp448/fp_noasm.go
@@ -0,0 +1,12 @@
+//go:build !amd64 || purego
+// +build !amd64 purego
+
+package fp448
+
+func cmov(x, y *Elt, n uint) { cmovGeneric(x, y, n) }
+func cswap(x, y *Elt, n uint) { cswapGeneric(x, y, n) }
+func add(z, x, y *Elt) { addGeneric(z, x, y) }
+func sub(z, x, y *Elt) { subGeneric(z, x, y) }
+func addsub(x, y *Elt) { addsubGeneric(x, y) }
+func mul(z, x, y *Elt) { mulGeneric(z, x, y) }
+func sqr(z, x *Elt) { sqrGeneric(z, x) }
diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fuzzer.go b/vendor/github.com/cloudflare/circl/math/fp448/fuzzer.go
new file mode 100644
index 0000000000..2d7afc8059
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/fp448/fuzzer.go
@@ -0,0 +1,75 @@
+//go:build gofuzz
+// +build gofuzz
+
+// How to run the fuzzer:
+//
+// $ go get -u github.com/dvyukov/go-fuzz/go-fuzz
+// $ go get -u github.com/dvyukov/go-fuzz/go-fuzz-build
+// $ go-fuzz-build -libfuzzer -func FuzzReduction -o lib.a
+// $ clang -fsanitize=fuzzer lib.a -o fu.exe
+// $ ./fu.exe
+package fp448
+
+import (
+ "encoding/binary"
+ "fmt"
+ "math/big"
+
+ "github.com/cloudflare/circl/internal/conv"
+)
+
+// FuzzReduction is a fuzzer target for red64 function, which reduces t
+// (112 bits) to a number t' (56 bits) congruent modulo p448.
+func FuzzReduction(data []byte) int {
+ if len(data) != 2*Size {
+ return -1
+ }
+ var got, want Elt
+ var lo, hi [7]uint64
+ a := data[:Size]
+ b := data[Size:]
+ lo[0] = binary.LittleEndian.Uint64(a[0*8 : 1*8])
+ lo[1] = binary.LittleEndian.Uint64(a[1*8 : 2*8])
+ lo[2] = binary.LittleEndian.Uint64(a[2*8 : 3*8])
+ lo[3] = binary.LittleEndian.Uint64(a[3*8 : 4*8])
+ lo[4] = binary.LittleEndian.Uint64(a[4*8 : 5*8])
+ lo[5] = binary.LittleEndian.Uint64(a[5*8 : 6*8])
+ lo[6] = binary.LittleEndian.Uint64(a[6*8 : 7*8])
+
+ hi[0] = binary.LittleEndian.Uint64(b[0*8 : 1*8])
+ hi[1] = binary.LittleEndian.Uint64(b[1*8 : 2*8])
+ hi[2] = binary.LittleEndian.Uint64(b[2*8 : 3*8])
+ hi[3] = binary.LittleEndian.Uint64(b[3*8 : 4*8])
+ hi[4] = binary.LittleEndian.Uint64(b[4*8 : 5*8])
+ hi[5] = binary.LittleEndian.Uint64(b[5*8 : 6*8])
+ hi[6] = binary.LittleEndian.Uint64(b[6*8 : 7*8])
+
+ red64(&got, &lo, &hi)
+
+ t := conv.BytesLe2BigInt(data[:2*Size])
+
+ two448 := big.NewInt(1)
+ two448.Lsh(two448, 448) // 2^448
+ mask448 := big.NewInt(1)
+ mask448.Sub(two448, mask448) // 2^448-1
+ two224plus1 := big.NewInt(1)
+ two224plus1.Lsh(two224plus1, 224)
+ two224plus1.Add(two224plus1, big.NewInt(1)) // 2^224+1
+
+ var loBig, hiBig big.Int
+ for t.Cmp(two448) >= 0 {
+ loBig.And(t, mask448)
+ hiBig.Rsh(t, 448)
+ t.Mul(&hiBig, two224plus1)
+ t.Add(t, &loBig)
+ }
+ conv.BigInt2BytesLe(want[:], t)
+
+ if got != want {
+ fmt.Printf("in: %v\n", conv.BytesLe2BigInt(data[:2*Size]))
+ fmt.Printf("got: %v\n", got)
+ fmt.Printf("want: %v\n", want)
+ panic("error found")
+ }
+ return 1
+}
diff --git a/vendor/github.com/cloudflare/circl/math/integer.go b/vendor/github.com/cloudflare/circl/math/integer.go
new file mode 100644
index 0000000000..9c80c23b59
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/integer.go
@@ -0,0 +1,16 @@
+package math
+
+import "math/bits"
+
+// NextPow2 finds the next power of two (N=2^k, k>=0) greater than n.
+// If n is already a power of two, then this function returns n, and log2(n).
+func NextPow2(n uint) (N uint, k uint) {
+ if bits.OnesCount(n) == 1 {
+ k = uint(bits.TrailingZeros(n))
+ N = n
+ } else {
+ k = uint(bits.Len(n))
+ N = uint(1) << k
+ }
+ return
+}
diff --git a/vendor/github.com/cloudflare/circl/math/mlsbset/mlsbset.go b/vendor/github.com/cloudflare/circl/math/mlsbset/mlsbset.go
new file mode 100644
index 0000000000..a43851b8bb
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/mlsbset/mlsbset.go
@@ -0,0 +1,122 @@
+// Package mlsbset provides a constant-time exponentiation method with precomputation.
+//
+// References: "Efficient and secure algorithms for GLV-based scalar
+// multiplication and their implementation on GLV–GLS curves" by (Faz-Hernandez et al.)
+// - https://doi.org/10.1007/s13389-014-0085-7
+// - https://eprint.iacr.org/2013/158
+package mlsbset
+
+import (
+ "errors"
+ "fmt"
+ "math/big"
+
+ "github.com/cloudflare/circl/internal/conv"
+)
+
+// EltG is a group element.
+type EltG interface{}
+
+// EltP is a precomputed group element.
+type EltP interface{}
+
+// Group defines the operations required by MLSBSet exponentiation method.
+type Group interface {
+ Identity() EltG // Returns the identity of the group.
+ Sqr(x EltG) // Calculates x = x^2.
+ Mul(x EltG, y EltP) // Calculates x = x*y.
+ NewEltP() EltP // Returns an arbitrary precomputed element.
+ ExtendedEltP() EltP // Returns the precomputed element x^(2^(w*d)).
+ Lookup(a EltP, v uint, s, u int32) // Sets a = s*T[v][u].
+}
+
+// Params contains the parameters of the encoding.
+type Params struct {
+ T uint // T is the maximum size (in bits) of exponents.
+ V uint // V is the number of tables.
+ W uint // W is the window size.
+ E uint // E is the number of digits per table.
+ D uint // D is the number of digits in total.
+ L uint // L is the length of the code.
+}
+
+// Encoder allows to convert integers into valid powers.
+type Encoder struct{ p Params }
+
+// New produces an encoder of the MLSBSet algorithm.
+func New(t, v, w uint) (Encoder, error) {
+ if !(t > 1 && v >= 1 && w >= 2) {
+ return Encoder{}, errors.New("t>1, v>=1, w>=2")
+ }
+ e := (t + w*v - 1) / (w * v)
+ d := e * v
+ l := d * w
+ return Encoder{Params{t, v, w, e, d, l}}, nil
+}
+
+// Encode converts an odd integer k into a valid power for exponentiation.
+func (m Encoder) Encode(k []byte) (*Power, error) {
+ if len(k) == 0 {
+ return nil, errors.New("empty slice")
+ }
+ if !(len(k) <= int(m.p.L+7)>>3) {
+ return nil, errors.New("k too big")
+ }
+ if k[0]%2 == 0 {
+ return nil, errors.New("k must be odd")
+ }
+ ap := int((m.p.L+7)/8) - len(k)
+ k = append(k, make([]byte, ap)...)
+ s := m.signs(k)
+ b := make([]int32, m.p.L-m.p.D)
+ c := conv.BytesLe2BigInt(k)
+ c.Rsh(c, m.p.D)
+ var bi big.Int
+ for i := m.p.D; i < m.p.L; i++ {
+ c0 := int32(c.Bit(0))
+ b[i-m.p.D] = s[i%m.p.D] * c0
+ bi.SetInt64(int64(b[i-m.p.D] >> 1))
+ c.Rsh(c, 1)
+ c.Sub(c, &bi)
+ }
+ carry := int(c.Int64())
+ return &Power{m, s, b, carry}, nil
+}
+
+// signs calculates the set of signs.
+func (m Encoder) signs(k []byte) []int32 {
+ s := make([]int32, m.p.D)
+ s[m.p.D-1] = 1
+ for i := uint(1); i < m.p.D; i++ {
+ ki := int32((k[i>>3] >> (i & 0x7)) & 0x1)
+ s[i-1] = 2*ki - 1
+ }
+ return s
+}
+
+// GetParams returns the complementary parameters of the encoding.
+func (m Encoder) GetParams() Params { return m.p }
+
+// tableSize returns the size of each table.
+func (m Encoder) tableSize() uint { return 1 << (m.p.W - 1) }
+
+// Elts returns the total number of elements that must be precomputed.
+func (m Encoder) Elts() uint { return m.p.V * m.tableSize() }
+
+// IsExtended returns true if the element x^(2^(wd)) must be calculated.
+func (m Encoder) IsExtended() bool { q := m.p.T / (m.p.V * m.p.W); return m.p.T == q*m.p.V*m.p.W }
+
+// Ops returns the number of squares and multiplications executed during an exponentiation.
+func (m Encoder) Ops() (S uint, M uint) {
+ S = m.p.E
+ M = m.p.E * m.p.V
+ if m.IsExtended() {
+ M++
+ }
+ return
+}
+
+func (m Encoder) String() string {
+ return fmt.Sprintf("T: %v W: %v V: %v e: %v d: %v l: %v wv|t: %v",
+ m.p.T, m.p.W, m.p.V, m.p.E, m.p.D, m.p.L, m.IsExtended())
+}
diff --git a/vendor/github.com/cloudflare/circl/math/mlsbset/power.go b/vendor/github.com/cloudflare/circl/math/mlsbset/power.go
new file mode 100644
index 0000000000..3f214c3046
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/mlsbset/power.go
@@ -0,0 +1,64 @@
+package mlsbset
+
+import "fmt"
+
+// Power is a valid exponent produced by the MLSBSet encoding algorithm.
+type Power struct {
+ set Encoder // parameters of code.
+ s []int32 // set of signs.
+ b []int32 // set of digits.
+ c int // carry is {0,1}.
+}
+
+// Exp is calculates x^k, where x is a predetermined element of a group G.
+func (p *Power) Exp(G Group) EltG {
+ a, b := G.Identity(), G.NewEltP()
+ for e := int(p.set.p.E - 1); e >= 0; e-- {
+ G.Sqr(a)
+ for v := uint(0); v < p.set.p.V; v++ {
+ sgnElt, idElt := p.Digit(v, uint(e))
+ G.Lookup(b, v, sgnElt, idElt)
+ G.Mul(a, b)
+ }
+ }
+ if p.set.IsExtended() && p.c == 1 {
+ G.Mul(a, G.ExtendedEltP())
+ }
+ return a
+}
+
+// Digit returns the (v,e)-th digit and its sign.
+func (p *Power) Digit(v, e uint) (sgn, dig int32) {
+ sgn = p.bit(0, v, e)
+ dig = 0
+ for i := p.set.p.W - 1; i > 0; i-- {
+ dig = 2*dig + p.bit(i, v, e)
+ }
+ mask := dig >> 31
+ dig = (dig + mask) ^ mask
+ return sgn, dig
+}
+
+// bit returns the (w,v,e)-th bit of the code.
+func (p *Power) bit(w, v, e uint) int32 {
+ if !(w < p.set.p.W &&
+ v < p.set.p.V &&
+ e < p.set.p.E) {
+ panic(fmt.Errorf("indexes outside (%v,%v,%v)", w, v, e))
+ }
+ if w == 0 {
+ return p.s[p.set.p.E*v+e]
+ }
+ return p.b[p.set.p.D*(w-1)+p.set.p.E*v+e]
+}
+
+func (p *Power) String() string {
+ dig := ""
+ for j := uint(0); j < p.set.p.V; j++ {
+ for i := uint(0); i < p.set.p.E; i++ {
+ s, d := p.Digit(j, i)
+ dig += fmt.Sprintf("(%2v,%2v) = %+2v %+2v\n", j, i, s, d)
+ }
+ }
+ return fmt.Sprintf("len: %v\ncarry: %v\ndigits:\n%v", len(p.b)+len(p.s), p.c, dig)
+}
diff --git a/vendor/github.com/cloudflare/circl/math/primes.go b/vendor/github.com/cloudflare/circl/math/primes.go
new file mode 100644
index 0000000000..158fd83a7a
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/primes.go
@@ -0,0 +1,34 @@
+package math
+
+import (
+ "crypto/rand"
+ "io"
+ "math/big"
+)
+
+// IsSafePrime reports whether p is (probably) a safe prime.
+// The prime p=2*q+1 is safe prime if both p and q are primes.
+// Note that ProbablyPrime is not suitable for judging primes
+// that an adversary may have crafted to fool the test.
+func IsSafePrime(p *big.Int) bool {
+ pdiv2 := new(big.Int).Rsh(p, 1)
+ return p.ProbablyPrime(20) && pdiv2.ProbablyPrime(20)
+}
+
+// SafePrime returns a number of the given bit length that is a safe prime with high probability.
+// The number returned p=2*q+1 is a safe prime if both p and q are primes.
+// SafePrime will return error for any error returned by rand.Read or if bits < 2.
+func SafePrime(random io.Reader, bits int) (*big.Int, error) {
+ one := big.NewInt(1)
+ p := new(big.Int)
+ for {
+ q, err := rand.Prime(random, bits-1)
+ if err != nil {
+ return nil, err
+ }
+ p.Lsh(q, 1).Add(p, one)
+ if p.ProbablyPrime(20) {
+ return p, nil
+ }
+ }
+}
diff --git a/vendor/github.com/cloudflare/circl/math/wnaf.go b/vendor/github.com/cloudflare/circl/math/wnaf.go
new file mode 100644
index 0000000000..94a1ec5042
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/math/wnaf.go
@@ -0,0 +1,84 @@
+// Package math provides some utility functions for big integers.
+package math
+
+import "math/big"
+
+// SignedDigit obtains the signed-digit recoding of n and returns a list L of
+// digits such that n = sum( L[i]*2^(i*(w-1)) ), and each L[i] is an odd number
+// in the set {±1, ±3, ..., ±2^(w-1)-1}. The third parameter ensures that the
+// output has ceil(l/(w-1)) digits.
+//
+// Restrictions:
+// - n is odd and n > 0.
+// - 1 < w < 32.
+// - l >= bit length of n.
+//
+// References:
+// - Alg.6 in "Exponent Recoding and Regular Exponentiation Algorithms"
+// by Joye-Tunstall. http://doi.org/10.1007/978-3-642-02384-2_21
+// - Alg.6 in "Selecting Elliptic Curves for Cryptography: An Efficiency and
+// Security Analysis" by Bos et al. http://doi.org/10.1007/s13389-015-0097-y
+func SignedDigit(n *big.Int, w, l uint) []int32 {
+ if n.Sign() <= 0 || n.Bit(0) == 0 {
+ panic("n must be non-zero, odd, and positive")
+ }
+ if w <= 1 || w >= 32 {
+ panic("Verify that 1 < w < 32")
+ }
+ if uint(n.BitLen()) > l {
+ panic("n is too big to fit in l digits")
+ }
+ lenN := (l + (w - 1) - 1) / (w - 1) // ceil(l/(w-1))
+ L := make([]int32, lenN+1)
+ var k, v big.Int
+ k.Set(n)
+
+ var i uint
+ for i = 0; i < lenN; i++ {
+ words := k.Bits()
+ value := int32(words[0] & ((1 << w) - 1))
+ value -= int32(1) << (w - 1)
+ L[i] = value
+ v.SetInt64(int64(value))
+ k.Sub(&k, &v)
+ k.Rsh(&k, w-1)
+ }
+ L[i] = int32(k.Int64())
+ return L
+}
+
+// OmegaNAF obtains the window-w Non-Adjacent Form of a positive number n and
+// 1 < w < 32. The returned slice L holds n = sum( L[i]*2^i ).
+//
+// Reference:
+// - Alg.9 "Efficient arithmetic on Koblitz curves" by Solinas.
+// http://doi.org/10.1023/A:1008306223194
+func OmegaNAF(n *big.Int, w uint) (L []int32) {
+ if n.Sign() < 0 {
+ panic("n must be positive")
+ }
+ if w <= 1 || w >= 32 {
+ panic("Verify that 1 < w < 32")
+ }
+
+ L = make([]int32, n.BitLen()+1)
+ var k, v big.Int
+ k.Set(n)
+
+ i := 0
+ for ; k.Sign() > 0; i++ {
+ value := int32(0)
+ if k.Bit(0) == 1 {
+ words := k.Bits()
+ value = int32(words[0] & ((1 << w) - 1))
+ if value >= (int32(1) << (w - 1)) {
+ value -= int32(1) << w
+ }
+ v.SetInt64(int64(value))
+ k.Sub(&k, &v)
+ }
+ L[i] = value
+ k.Rsh(&k, 1)
+ }
+ return L[:i]
+}
diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/ed25519.go b/vendor/github.com/cloudflare/circl/sign/ed25519/ed25519.go
new file mode 100644
index 0000000000..2c73c26fb1
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/sign/ed25519/ed25519.go
@@ -0,0 +1,453 @@
+// Package ed25519 implements Ed25519 signature scheme as described in RFC-8032.
+//
+// This package provides optimized implementations of the three signature
+// variants and maintaining closer compatibility with crypto/ed25519.
+//
+// | Scheme Name | Sign Function | Verification | Context |
+// |-------------|-------------------|---------------|-------------------|
+// | Ed25519 | Sign | Verify | None |
+// | Ed25519Ph | SignPh | VerifyPh | Yes, can be empty |
+// | Ed25519Ctx | SignWithCtx | VerifyWithCtx | Yes, non-empty |
+// | All above | (PrivateKey).Sign | VerifyAny | As above |
+//
+// Specific functions for sign and verify are defined. A generic signing
+// function for all schemes is available through the crypto.Signer interface,
+// which is implemented by the PrivateKey type. A correspond all-in-one
+// verification method is provided by the VerifyAny function.
+//
+// Signing with Ed25519Ph or Ed25519Ctx requires a context string for domain
+// separation. This parameter is passed using a SignerOptions struct defined
+// in this package. While Ed25519Ph accepts an empty context, Ed25519Ctx
+// enforces non-empty context strings.
+//
+// # Compatibility with crypto.ed25519
+//
+// These functions are compatible with the “Ed25519” function defined in
+// RFC-8032. However, unlike RFC 8032's formulation, this package's private
+// key representation includes a public key suffix to make multiple signing
+// operations with the same key more efficient. This package refers to the
+// RFC-8032 private key as the “seed”.
+//
+// References
+//
+// - RFC-8032: https://rfc-editor.org/rfc/rfc8032.txt
+// - Ed25519: https://ed25519.cr.yp.to/
+// - EdDSA: High-speed high-security signatures. https://doi.org/10.1007/s13389-012-0027-1
+package ed25519
+
+import (
+ "bytes"
+ "crypto"
+ cryptoRand "crypto/rand"
+ "crypto/sha512"
+ "crypto/subtle"
+ "errors"
+ "fmt"
+ "io"
+ "strconv"
+
+ "github.com/cloudflare/circl/sign"
+)
+
+const (
+ // ContextMaxSize is the maximum length (in bytes) allowed for context.
+ ContextMaxSize = 255
+ // PublicKeySize is the size, in bytes, of public keys as used in this package.
+ PublicKeySize = 32
+ // PrivateKeySize is the size, in bytes, of private keys as used in this package.
+ PrivateKeySize = 64
+ // SignatureSize is the size, in bytes, of signatures generated and verified by this package.
+ SignatureSize = 64
+ // SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032.
+ SeedSize = 32
+)
+
+const (
+ paramB = 256 / 8 // Size of keys in bytes.
+)
+
+// SignerOptions implements crypto.SignerOpts and augments with parameters
+// that are specific to the Ed25519 signature schemes.
+type SignerOptions struct {
+ // Hash must be crypto.Hash(0) for Ed25519/Ed25519ctx, or crypto.SHA512
+ // for Ed25519ph.
+ crypto.Hash
+
+ // Context is an optional domain separation string for Ed25519ph and a
+ // must for Ed25519ctx. Its length must be less or equal than 255 bytes.
+ Context string
+
+ // Scheme is an identifier for choosing a signature scheme. The zero value
+ // is ED25519.
+ Scheme SchemeID
+}
+
+// SchemeID is an identifier for each signature scheme.
+type SchemeID uint
+
+const (
+ ED25519 SchemeID = iota
+ ED25519Ph
+ ED25519Ctx
+)
+
+// PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer.
+type PrivateKey []byte
+
+// Equal reports whether priv and x have the same value.
+func (priv PrivateKey) Equal(x crypto.PrivateKey) bool {
+ xx, ok := x.(PrivateKey)
+ return ok && subtle.ConstantTimeCompare(priv, xx) == 1
+}
+
+// Public returns the PublicKey corresponding to priv.
+func (priv PrivateKey) Public() crypto.PublicKey {
+ publicKey := make(PublicKey, PublicKeySize)
+ copy(publicKey, priv[SeedSize:])
+ return publicKey
+}
+
+// Seed returns the private key seed corresponding to priv. It is provided for
+// interoperability with RFC 8032. RFC 8032's private keys correspond to seeds
+// in this package.
+func (priv PrivateKey) Seed() []byte {
+ seed := make([]byte, SeedSize)
+ copy(seed, priv[:SeedSize])
+ return seed
+}
+
+func (priv PrivateKey) Scheme() sign.Scheme { return sch }
+
+func (pub PublicKey) Scheme() sign.Scheme { return sch }
+
+func (priv PrivateKey) MarshalBinary() (data []byte, err error) {
+ privateKey := make(PrivateKey, PrivateKeySize)
+ copy(privateKey, priv)
+ return privateKey, nil
+}
+
+func (pub PublicKey) MarshalBinary() (data []byte, err error) {
+ publicKey := make(PublicKey, PublicKeySize)
+ copy(publicKey, pub)
+ return publicKey, nil
+}
+
+// Equal reports whether pub and x have the same value.
+func (pub PublicKey) Equal(x crypto.PublicKey) bool {
+ xx, ok := x.(PublicKey)
+ return ok && bytes.Equal(pub, xx)
+}
+
+// Sign creates a signature of a message with priv key.
+// This function is compatible with crypto.ed25519 and also supports the
+// three signature variants defined in RFC-8032, namely Ed25519 (or pure
+// EdDSA), Ed25519Ph, and Ed25519Ctx.
+// The opts.HashFunc() must return zero to specify either Ed25519 or Ed25519Ctx
+// variant. This can be achieved by passing crypto.Hash(0) as the value for
+// opts.
+// The opts.HashFunc() must return SHA512 to specify the Ed25519Ph variant.
+// This can be achieved by passing crypto.SHA512 as the value for opts.
+// Use a SignerOptions struct (defined in this package) to pass a context
+// string for signing.
+func (priv PrivateKey) Sign(
+ rand io.Reader,
+ message []byte,
+ opts crypto.SignerOpts,
+) (signature []byte, err error) {
+ var ctx string
+ var scheme SchemeID
+ if o, ok := opts.(SignerOptions); ok {
+ ctx = o.Context
+ scheme = o.Scheme
+ }
+
+ switch true {
+ case scheme == ED25519 && opts.HashFunc() == crypto.Hash(0):
+ return Sign(priv, message), nil
+ case scheme == ED25519Ph && opts.HashFunc() == crypto.SHA512:
+ return SignPh(priv, message, ctx), nil
+ case scheme == ED25519Ctx && opts.HashFunc() == crypto.Hash(0) && len(ctx) > 0:
+ return SignWithCtx(priv, message, ctx), nil
+ default:
+ return nil, errors.New("ed25519: bad hash algorithm")
+ }
+}
+
+// GenerateKey generates a public/private key pair using entropy from rand.
+// If rand is nil, crypto/rand.Reader will be used.
+func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) {
+ if rand == nil {
+ rand = cryptoRand.Reader
+ }
+
+ seed := make([]byte, SeedSize)
+ if _, err := io.ReadFull(rand, seed); err != nil {
+ return nil, nil, err
+ }
+
+ privateKey := NewKeyFromSeed(seed)
+ publicKey := make(PublicKey, PublicKeySize)
+ copy(publicKey, privateKey[SeedSize:])
+
+ return publicKey, privateKey, nil
+}
+
+// NewKeyFromSeed calculates a private key from a seed. It will panic if
+// len(seed) is not SeedSize. This function is provided for interoperability
+// with RFC 8032. RFC 8032's private keys correspond to seeds in this
+// package.
+func NewKeyFromSeed(seed []byte) PrivateKey {
+ privateKey := make(PrivateKey, PrivateKeySize)
+ newKeyFromSeed(privateKey, seed)
+ return privateKey
+}
+
+func newKeyFromSeed(privateKey, seed []byte) {
+ if l := len(seed); l != SeedSize {
+ panic("ed25519: bad seed length: " + strconv.Itoa(l))
+ }
+ var P pointR1
+ k := sha512.Sum512(seed)
+ clamp(k[:])
+ reduceModOrder(k[:paramB], false)
+ P.fixedMult(k[:paramB])
+ copy(privateKey[:SeedSize], seed)
+ _ = P.ToBytes(privateKey[SeedSize:])
+}
+
+func signAll(signature []byte, privateKey PrivateKey, message, ctx []byte, preHash bool) {
+ if l := len(privateKey); l != PrivateKeySize {
+ panic("ed25519: bad private key length: " + strconv.Itoa(l))
+ }
+
+ H := sha512.New()
+ var PHM []byte
+
+ if preHash {
+ _, _ = H.Write(message)
+ PHM = H.Sum(nil)
+ H.Reset()
+ } else {
+ PHM = message
+ }
+
+ // 1. Hash the 32-byte private key using SHA-512.
+ _, _ = H.Write(privateKey[:SeedSize])
+ h := H.Sum(nil)
+ clamp(h[:])
+ prefix, s := h[paramB:], h[:paramB]
+
+ // 2. Compute SHA-512(dom2(F, C) || prefix || PH(M))
+ H.Reset()
+
+ writeDom(H, ctx, preHash)
+
+ _, _ = H.Write(prefix)
+ _, _ = H.Write(PHM)
+ r := H.Sum(nil)
+ reduceModOrder(r[:], true)
+
+ // 3. Compute the point [r]B.
+ var P pointR1
+ P.fixedMult(r[:paramB])
+ R := (&[paramB]byte{})[:]
+ if err := P.ToBytes(R); err != nil {
+ panic(err)
+ }
+
+ // 4. Compute SHA512(dom2(F, C) || R || A || PH(M)).
+ H.Reset()
+
+ writeDom(H, ctx, preHash)
+
+ _, _ = H.Write(R)
+ _, _ = H.Write(privateKey[SeedSize:])
+ _, _ = H.Write(PHM)
+ hRAM := H.Sum(nil)
+
+ reduceModOrder(hRAM[:], true)
+
+ // 5. Compute S = (r + k * s) mod order.
+ S := (&[paramB]byte{})[:]
+ calculateS(S, r[:paramB], hRAM[:paramB], s)
+
+ // 6. The signature is the concatenation of R and S.
+ copy(signature[:paramB], R[:])
+ copy(signature[paramB:], S[:])
+}
+
+// Sign signs the message with privateKey and returns a signature.
+// This function supports the signature variant defined in RFC-8032: Ed25519,
+// also known as the pure version of EdDSA.
+// It will panic if len(privateKey) is not PrivateKeySize.
+func Sign(privateKey PrivateKey, message []byte) []byte {
+ signature := make([]byte, SignatureSize)
+ signAll(signature, privateKey, message, []byte(""), false)
+ return signature
+}
+
+// SignPh creates a signature of a message with private key and context.
+// This function supports the signature variant defined in RFC-8032: Ed25519ph,
+// meaning it internally hashes the message using SHA-512, and optionally
+// accepts a context string.
+// It will panic if len(privateKey) is not PrivateKeySize.
+// Context could be passed to this function, which length should be no more than
+// ContextMaxSize=255. It can be empty.
+func SignPh(privateKey PrivateKey, message []byte, ctx string) []byte {
+ if len(ctx) > ContextMaxSize {
+ panic(fmt.Errorf("ed25519: bad context length: %v", len(ctx)))
+ }
+
+ signature := make([]byte, SignatureSize)
+ signAll(signature, privateKey, message, []byte(ctx), true)
+ return signature
+}
+
+// SignWithCtx creates a signature of a message with private key and context.
+// This function supports the signature variant defined in RFC-8032: Ed25519ctx,
+// meaning it accepts a non-empty context string.
+// It will panic if len(privateKey) is not PrivateKeySize.
+// Context must be passed to this function, which length should be no more than
+// ContextMaxSize=255 and cannot be empty.
+func SignWithCtx(privateKey PrivateKey, message []byte, ctx string) []byte {
+ if len(ctx) == 0 || len(ctx) > ContextMaxSize {
+ panic(fmt.Errorf("ed25519: bad context length: %v > %v", len(ctx), ContextMaxSize))
+ }
+
+ signature := make([]byte, SignatureSize)
+ signAll(signature, privateKey, message, []byte(ctx), false)
+ return signature
+}
+
+func verify(public PublicKey, message, signature, ctx []byte, preHash bool) bool {
+ if len(public) != PublicKeySize ||
+ len(signature) != SignatureSize ||
+ !isLessThanOrder(signature[paramB:]) {
+ return false
+ }
+
+ var P pointR1
+ if ok := P.FromBytes(public); !ok {
+ return false
+ }
+
+ H := sha512.New()
+ var PHM []byte
+
+ if preHash {
+ _, _ = H.Write(message)
+ PHM = H.Sum(nil)
+ H.Reset()
+ } else {
+ PHM = message
+ }
+
+ R := signature[:paramB]
+
+ writeDom(H, ctx, preHash)
+
+ _, _ = H.Write(R)
+ _, _ = H.Write(public)
+ _, _ = H.Write(PHM)
+ hRAM := H.Sum(nil)
+ reduceModOrder(hRAM[:], true)
+
+ var Q pointR1
+ encR := (&[paramB]byte{})[:]
+ P.neg()
+ Q.doubleMult(&P, signature[paramB:], hRAM[:paramB])
+ _ = Q.ToBytes(encR)
+ return bytes.Equal(R, encR)
+}
+
+// VerifyAny returns true if the signature is valid. Failure cases are invalid
+// signature, or when the public key cannot be decoded.
+// This function supports all the three signature variants defined in RFC-8032,
+// namely Ed25519 (or pure EdDSA), Ed25519Ph, and Ed25519Ctx.
+// The opts.HashFunc() must return zero to specify either Ed25519 or Ed25519Ctx
+// variant. This can be achieved by passing crypto.Hash(0) as the value for opts.
+// The opts.HashFunc() must return SHA512 to specify the Ed25519Ph variant.
+// This can be achieved by passing crypto.SHA512 as the value for opts.
+// Use a SignerOptions struct to pass a context string for signing.
+func VerifyAny(public PublicKey, message, signature []byte, opts crypto.SignerOpts) bool {
+ var ctx string
+ var scheme SchemeID
+ if o, ok := opts.(SignerOptions); ok {
+ ctx = o.Context
+ scheme = o.Scheme
+ }
+
+ switch true {
+ case scheme == ED25519 && opts.HashFunc() == crypto.Hash(0):
+ return Verify(public, message, signature)
+ case scheme == ED25519Ph && opts.HashFunc() == crypto.SHA512:
+ return VerifyPh(public, message, signature, ctx)
+ case scheme == ED25519Ctx && opts.HashFunc() == crypto.Hash(0) && len(ctx) > 0:
+ return VerifyWithCtx(public, message, signature, ctx)
+ default:
+ return false
+ }
+}
+
+// Verify returns true if the signature is valid. Failure cases are invalid
+// signature, or when the public key cannot be decoded.
+// This function supports the signature variant defined in RFC-8032: Ed25519,
+// also known as the pure version of EdDSA.
+func Verify(public PublicKey, message, signature []byte) bool {
+ return verify(public, message, signature, []byte(""), false)
+}
+
+// VerifyPh returns true if the signature is valid. Failure cases are invalid
+// signature, or when the public key cannot be decoded.
+// This function supports the signature variant defined in RFC-8032: Ed25519ph,
+// meaning it internally hashes the message using SHA-512.
+// Context could be passed to this function, which length should be no more than
+// 255. It can be empty.
+func VerifyPh(public PublicKey, message, signature []byte, ctx string) bool {
+ return verify(public, message, signature, []byte(ctx), true)
+}
+
+// VerifyWithCtx returns true if the signature is valid. Failure cases are invalid
+// signature, or when the public key cannot be decoded, or when context is
+// not provided.
+// This function supports the signature variant defined in RFC-8032: Ed25519ctx,
+// meaning it does not handle prehashed messages. Non-empty context string must be
+// provided, and must not be more than 255 of length.
+func VerifyWithCtx(public PublicKey, message, signature []byte, ctx string) bool {
+ if len(ctx) == 0 || len(ctx) > ContextMaxSize {
+ return false
+ }
+
+ return verify(public, message, signature, []byte(ctx), false)
+}
+
+func clamp(k []byte) {
+ k[0] &= 248
+ k[paramB-1] = (k[paramB-1] & 127) | 64
+}
+
+// isLessThanOrder returns true if 0 <= x < order.
+func isLessThanOrder(x []byte) bool {
+ i := len(order) - 1
+ for i > 0 && x[i] == order[i] {
+ i--
+ }
+ return x[i] < order[i]
+}
+
+func writeDom(h io.Writer, ctx []byte, preHash bool) {
+ dom2 := "SigEd25519 no Ed25519 collisions"
+
+ if len(ctx) > 0 {
+ _, _ = h.Write([]byte(dom2))
+ if preHash {
+ _, _ = h.Write([]byte{byte(0x01), byte(len(ctx))})
+ } else {
+ _, _ = h.Write([]byte{byte(0x00), byte(len(ctx))})
+ }
+ _, _ = h.Write(ctx)
+ } else if preHash {
+ _, _ = h.Write([]byte(dom2))
+ _, _ = h.Write([]byte{0x01, 0x00})
+ }
+}
diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/modular.go b/vendor/github.com/cloudflare/circl/sign/ed25519/modular.go
new file mode 100644
index 0000000000..10efafdcaf
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/sign/ed25519/modular.go
@@ -0,0 +1,175 @@
+package ed25519
+
+import (
+ "encoding/binary"
+ "math/bits"
+)
+
+var order = [paramB]byte{
+ 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58,
+ 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
+}
+
+// isLessThan returns true if 0 <= x < y, and assumes that slices have the same length.
+func isLessThan(x, y []byte) bool {
+ i := len(x) - 1
+ for i > 0 && x[i] == y[i] {
+ i--
+ }
+ return x[i] < y[i]
+}
+
+// reduceModOrder calculates k = k mod order of the curve.
+func reduceModOrder(k []byte, is512Bit bool) {
+ var X [((2 * paramB) * 8) / 64]uint64
+ numWords := len(k) >> 3
+ for i := 0; i < numWords; i++ {
+ X[i] = binary.LittleEndian.Uint64(k[i*8 : (i+1)*8])
+ }
+ red512(&X, is512Bit)
+ for i := 0; i < numWords; i++ {
+ binary.LittleEndian.PutUint64(k[i*8:(i+1)*8], X[i])
+ }
+}
+
+// red512 calculates x = x mod Order of the curve.
+func red512(x *[8]uint64, full bool) {
+ // Implementation of Algs.(14.47)+(14.52) of Handbook of Applied
+ // Cryptography, by A. Menezes, P. van Oorschot, and S. Vanstone.
+ const (
+ ell0 = uint64(0x5812631a5cf5d3ed)
+ ell1 = uint64(0x14def9dea2f79cd6)
+ ell160 = uint64(0x812631a5cf5d3ed0)
+ ell161 = uint64(0x4def9dea2f79cd65)
+ ell162 = uint64(0x0000000000000001)
+ )
+
+ var c0, c1, c2, c3 uint64
+ r0, r1, r2, r3, r4 := x[0], x[1], x[2], x[3], uint64(0)
+
+ if full {
+ q0, q1, q2, q3 := x[4], x[5], x[6], x[7]
+
+ for i := 0; i < 3; i++ {
+ h0, s0 := bits.Mul64(q0, ell160)
+ h1, s1 := bits.Mul64(q1, ell160)
+ h2, s2 := bits.Mul64(q2, ell160)
+ h3, s3 := bits.Mul64(q3, ell160)
+
+ s1, c0 = bits.Add64(h0, s1, 0)
+ s2, c1 = bits.Add64(h1, s2, c0)
+ s3, c2 = bits.Add64(h2, s3, c1)
+ s4, _ := bits.Add64(h3, 0, c2)
+
+ h0, l0 := bits.Mul64(q0, ell161)
+ h1, l1 := bits.Mul64(q1, ell161)
+ h2, l2 := bits.Mul64(q2, ell161)
+ h3, l3 := bits.Mul64(q3, ell161)
+
+ l1, c0 = bits.Add64(h0, l1, 0)
+ l2, c1 = bits.Add64(h1, l2, c0)
+ l3, c2 = bits.Add64(h2, l3, c1)
+ l4, _ := bits.Add64(h3, 0, c2)
+
+ s1, c0 = bits.Add64(s1, l0, 0)
+ s2, c1 = bits.Add64(s2, l1, c0)
+ s3, c2 = bits.Add64(s3, l2, c1)
+ s4, c3 = bits.Add64(s4, l3, c2)
+ s5, s6 := bits.Add64(l4, 0, c3)
+
+ s2, c0 = bits.Add64(s2, q0, 0)
+ s3, c1 = bits.Add64(s3, q1, c0)
+ s4, c2 = bits.Add64(s4, q2, c1)
+ s5, c3 = bits.Add64(s5, q3, c2)
+ s6, s7 := bits.Add64(s6, 0, c3)
+
+ q := q0 | q1 | q2 | q3
+ m := -((q | -q) >> 63) // if q=0 then m=0...0 else m=1..1
+ s0 &= m
+ s1 &= m
+ s2 &= m
+ s3 &= m
+ q0, q1, q2, q3 = s4, s5, s6, s7
+
+ if (i+1)%2 == 0 {
+ r0, c0 = bits.Add64(r0, s0, 0)
+ r1, c1 = bits.Add64(r1, s1, c0)
+ r2, c2 = bits.Add64(r2, s2, c1)
+ r3, c3 = bits.Add64(r3, s3, c2)
+ r4, _ = bits.Add64(r4, 0, c3)
+ } else {
+ r0, c0 = bits.Sub64(r0, s0, 0)
+ r1, c1 = bits.Sub64(r1, s1, c0)
+ r2, c2 = bits.Sub64(r2, s2, c1)
+ r3, c3 = bits.Sub64(r3, s3, c2)
+ r4, _ = bits.Sub64(r4, 0, c3)
+ }
+ }
+
+ m := -(r4 >> 63)
+ r0, c0 = bits.Add64(r0, m&ell160, 0)
+ r1, c1 = bits.Add64(r1, m&ell161, c0)
+ r2, c2 = bits.Add64(r2, m&ell162, c1)
+ r3, c3 = bits.Add64(r3, 0, c2)
+ r4, _ = bits.Add64(r4, m&1, c3)
+ x[4], x[5], x[6], x[7] = 0, 0, 0, 0
+ }
+
+ q0 := (r4 << 4) | (r3 >> 60)
+ r3 &= (uint64(1) << 60) - 1
+
+ h0, s0 := bits.Mul64(ell0, q0)
+ h1, s1 := bits.Mul64(ell1, q0)
+ s1, c0 = bits.Add64(h0, s1, 0)
+ s2, _ := bits.Add64(h1, 0, c0)
+
+ r0, c0 = bits.Sub64(r0, s0, 0)
+ r1, c1 = bits.Sub64(r1, s1, c0)
+ r2, c2 = bits.Sub64(r2, s2, c1)
+ r3, _ = bits.Sub64(r3, 0, c2)
+
+ x[0], x[1], x[2], x[3] = r0, r1, r2, r3
+}
+
+// calculateS performs s = r+k*a mod Order of the curve.
+func calculateS(s, r, k, a []byte) {
+ K := [4]uint64{
+ binary.LittleEndian.Uint64(k[0*8 : 1*8]),
+ binary.LittleEndian.Uint64(k[1*8 : 2*8]),
+ binary.LittleEndian.Uint64(k[2*8 : 3*8]),
+ binary.LittleEndian.Uint64(k[3*8 : 4*8]),
+ }
+ S := [8]uint64{
+ binary.LittleEndian.Uint64(r[0*8 : 1*8]),
+ binary.LittleEndian.Uint64(r[1*8 : 2*8]),
+ binary.LittleEndian.Uint64(r[2*8 : 3*8]),
+ binary.LittleEndian.Uint64(r[3*8 : 4*8]),
+ }
+ var c3 uint64
+ for i := range K {
+ ai := binary.LittleEndian.Uint64(a[i*8 : (i+1)*8])
+
+ h0, l0 := bits.Mul64(K[0], ai)
+ h1, l1 := bits.Mul64(K[1], ai)
+ h2, l2 := bits.Mul64(K[2], ai)
+ h3, l3 := bits.Mul64(K[3], ai)
+
+ l1, c0 := bits.Add64(h0, l1, 0)
+ l2, c1 := bits.Add64(h1, l2, c0)
+ l3, c2 := bits.Add64(h2, l3, c1)
+ l4, _ := bits.Add64(h3, 0, c2)
+
+ S[i+0], c0 = bits.Add64(S[i+0], l0, 0)
+ S[i+1], c1 = bits.Add64(S[i+1], l1, c0)
+ S[i+2], c2 = bits.Add64(S[i+2], l2, c1)
+ S[i+3], c3 = bits.Add64(S[i+3], l3, c2)
+ S[i+4], _ = bits.Add64(S[i+4], l4, c3)
+ }
+ red512(&S, true)
+ binary.LittleEndian.PutUint64(s[0*8:1*8], S[0])
+ binary.LittleEndian.PutUint64(s[1*8:2*8], S[1])
+ binary.LittleEndian.PutUint64(s[2*8:3*8], S[2])
+ binary.LittleEndian.PutUint64(s[3*8:4*8], S[3])
+}
diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/mult.go b/vendor/github.com/cloudflare/circl/sign/ed25519/mult.go
new file mode 100644
index 0000000000..3216aae303
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/sign/ed25519/mult.go
@@ -0,0 +1,180 @@
+package ed25519
+
+import (
+ "crypto/subtle"
+ "encoding/binary"
+ "math/bits"
+
+ "github.com/cloudflare/circl/internal/conv"
+ "github.com/cloudflare/circl/math"
+ fp "github.com/cloudflare/circl/math/fp25519"
+)
+
+var paramD = fp.Elt{
+ 0xa3, 0x78, 0x59, 0x13, 0xca, 0x4d, 0xeb, 0x75,
+ 0xab, 0xd8, 0x41, 0x41, 0x4d, 0x0a, 0x70, 0x00,
+ 0x98, 0xe8, 0x79, 0x77, 0x79, 0x40, 0xc7, 0x8c,
+ 0x73, 0xfe, 0x6f, 0x2b, 0xee, 0x6c, 0x03, 0x52,
+}
+
+// mLSBRecoding parameters.
+const (
+ fxT = 257
+ fxV = 2
+ fxW = 3
+ fx2w1 = 1 << (uint(fxW) - 1)
+ numWords64 = (paramB * 8 / 64)
+)
+
+// mLSBRecoding is the odd-only modified LSB-set.
+//
+// Reference:
+//
+// "Efficient and secure algorithms for GLV-based scalar multiplication and
+// their implementation on GLV–GLS curves" by (Faz-Hernandez et al.)
+// http://doi.org/10.1007/s13389-014-0085-7.
+func mLSBRecoding(L []int8, k []byte) {
+ const ee = (fxT + fxW*fxV - 1) / (fxW * fxV)
+ const dd = ee * fxV
+ const ll = dd * fxW
+ if len(L) == (ll + 1) {
+ var m [numWords64 + 1]uint64
+ for i := 0; i < numWords64; i++ {
+ m[i] = binary.LittleEndian.Uint64(k[8*i : 8*i+8])
+ }
+ condAddOrderN(&m)
+ L[dd-1] = 1
+ for i := 0; i < dd-1; i++ {
+ kip1 := (m[(i+1)/64] >> (uint(i+1) % 64)) & 0x1
+ L[i] = int8(kip1<<1) - 1
+ }
+ { // right-shift by d
+ right := uint(dd % 64)
+ left := uint(64) - right
+ lim := ((numWords64+1)*64 - dd) / 64
+ j := dd / 64
+ for i := 0; i < lim; i++ {
+ m[i] = (m[i+j] >> right) | (m[i+j+1] << left)
+ }
+ m[lim] = m[lim+j] >> right
+ }
+ for i := dd; i < ll; i++ {
+ L[i] = L[i%dd] * int8(m[0]&0x1)
+ div2subY(m[:], int64(L[i]>>1), numWords64)
+ }
+ L[ll] = int8(m[0])
+ }
+}
+
+// absolute returns always a positive value.
+func absolute(x int32) int32 {
+ mask := x >> 31
+ return (x + mask) ^ mask
+}
+
+// condAddOrderN updates x = x+order if x is even, otherwise x remains unchanged.
+func condAddOrderN(x *[numWords64 + 1]uint64) {
+ isOdd := (x[0] & 0x1) - 1
+ c := uint64(0)
+ for i := 0; i < numWords64; i++ {
+ orderWord := binary.LittleEndian.Uint64(order[8*i : 8*i+8])
+ o := isOdd & orderWord
+ x0, c0 := bits.Add64(x[i], o, c)
+ x[i] = x0
+ c = c0
+ }
+ x[numWords64], _ = bits.Add64(x[numWords64], 0, c)
+}
+
+// div2subY update x = (x/2) - y.
+func div2subY(x []uint64, y int64, l int) {
+ s := uint64(y >> 63)
+ for i := 0; i < l-1; i++ {
+ x[i] = (x[i] >> 1) | (x[i+1] << 63)
+ }
+ x[l-1] = (x[l-1] >> 1)
+
+ b := uint64(0)
+ x0, b0 := bits.Sub64(x[0], uint64(y), b)
+ x[0] = x0
+ b = b0
+ for i := 1; i < l-1; i++ {
+ x0, b0 := bits.Sub64(x[i], s, b)
+ x[i] = x0
+ b = b0
+ }
+ x[l-1], _ = bits.Sub64(x[l-1], s, b)
+}
+
+func (P *pointR1) fixedMult(scalar []byte) {
+ if len(scalar) != paramB {
+ panic("wrong scalar size")
+ }
+ const ee = (fxT + fxW*fxV - 1) / (fxW * fxV)
+ const dd = ee * fxV
+ const ll = dd * fxW
+
+ L := make([]int8, ll+1)
+ mLSBRecoding(L[:], scalar)
+ S := &pointR3{}
+ P.SetIdentity()
+ for ii := ee - 1; ii >= 0; ii-- {
+ P.double()
+ for j := 0; j < fxV; j++ {
+ dig := L[fxW*dd-j*ee+ii-ee]
+ for i := (fxW-1)*dd - j*ee + ii - ee; i >= (2*dd - j*ee + ii - ee); i = i - dd {
+ dig = 2*dig + L[i]
+ }
+ idx := absolute(int32(dig))
+ sig := L[dd-j*ee+ii-ee]
+ Tabj := &tabSign[fxV-j-1]
+ for k := 0; k < fx2w1; k++ {
+ S.cmov(&Tabj[k], subtle.ConstantTimeEq(int32(k), idx))
+ }
+ S.cneg(subtle.ConstantTimeEq(int32(sig), -1))
+ P.mixAdd(S)
+ }
+ }
+}
+
+const (
+ omegaFix = 7
+ omegaVar = 5
+)
+
+// doubleMult returns P=mG+nQ.
+func (P *pointR1) doubleMult(Q *pointR1, m, n []byte) {
+ nafFix := math.OmegaNAF(conv.BytesLe2BigInt(m), omegaFix)
+ nafVar := math.OmegaNAF(conv.BytesLe2BigInt(n), omegaVar)
+
+ if len(nafFix) > len(nafVar) {
+ nafVar = append(nafVar, make([]int32, len(nafFix)-len(nafVar))...)
+ } else if len(nafFix) < len(nafVar) {
+ nafFix = append(nafFix, make([]int32, len(nafVar)-len(nafFix))...)
+ }
+
+ var TabQ [1 << (omegaVar - 2)]pointR2
+ Q.oddMultiples(TabQ[:])
+ P.SetIdentity()
+ for i := len(nafFix) - 1; i >= 0; i-- {
+ P.double()
+ // Generator point
+ if nafFix[i] != 0 {
+ idxM := absolute(nafFix[i]) >> 1
+ R := tabVerif[idxM]
+ if nafFix[i] < 0 {
+ R.neg()
+ }
+ P.mixAdd(&R)
+ }
+ // Variable input point
+ if nafVar[i] != 0 {
+ idxN := absolute(nafVar[i]) >> 1
+ S := TabQ[idxN]
+ if nafVar[i] < 0 {
+ S.neg()
+ }
+ P.add(&S)
+ }
+ }
+}
diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/point.go b/vendor/github.com/cloudflare/circl/sign/ed25519/point.go
new file mode 100644
index 0000000000..d1c3b146b7
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/sign/ed25519/point.go
@@ -0,0 +1,195 @@
+package ed25519
+
+import fp "github.com/cloudflare/circl/math/fp25519"
+
+type (
+ pointR1 struct{ x, y, z, ta, tb fp.Elt }
+ pointR2 struct {
+ pointR3
+ z2 fp.Elt
+ }
+)
+type pointR3 struct{ addYX, subYX, dt2 fp.Elt }
+
+func (P *pointR1) neg() {
+ fp.Neg(&P.x, &P.x)
+ fp.Neg(&P.ta, &P.ta)
+}
+
+func (P *pointR1) SetIdentity() {
+ P.x = fp.Elt{}
+ fp.SetOne(&P.y)
+ fp.SetOne(&P.z)
+ P.ta = fp.Elt{}
+ P.tb = fp.Elt{}
+}
+
+func (P *pointR1) toAffine() {
+ fp.Inv(&P.z, &P.z)
+ fp.Mul(&P.x, &P.x, &P.z)
+ fp.Mul(&P.y, &P.y, &P.z)
+ fp.Modp(&P.x)
+ fp.Modp(&P.y)
+ fp.SetOne(&P.z)
+ P.ta = P.x
+ P.tb = P.y
+}
+
+func (P *pointR1) ToBytes(k []byte) error {
+ P.toAffine()
+ var x [fp.Size]byte
+ err := fp.ToBytes(k[:fp.Size], &P.y)
+ if err != nil {
+ return err
+ }
+ err = fp.ToBytes(x[:], &P.x)
+ if err != nil {
+ return err
+ }
+ b := x[0] & 1
+ k[paramB-1] = k[paramB-1] | (b << 7)
+ return nil
+}
+
+func (P *pointR1) FromBytes(k []byte) bool {
+ if len(k) != paramB {
+ panic("wrong size")
+ }
+ signX := k[paramB-1] >> 7
+ copy(P.y[:], k[:fp.Size])
+ P.y[fp.Size-1] &= 0x7F
+ p := fp.P()
+ if !isLessThan(P.y[:], p[:]) {
+ return false
+ }
+
+ one, u, v := &fp.Elt{}, &fp.Elt{}, &fp.Elt{}
+ fp.SetOne(one)
+ fp.Sqr(u, &P.y) // u = y^2
+ fp.Mul(v, u, ¶mD) // v = dy^2
+ fp.Sub(u, u, one) // u = y^2-1
+ fp.Add(v, v, one) // v = dy^2+1
+ isQR := fp.InvSqrt(&P.x, u, v) // x = sqrt(u/v)
+ if !isQR {
+ return false
+ }
+ fp.Modp(&P.x) // x = x mod p
+ if fp.IsZero(&P.x) && signX == 1 {
+ return false
+ }
+ if signX != (P.x[0] & 1) {
+ fp.Neg(&P.x, &P.x)
+ }
+ P.ta = P.x
+ P.tb = P.y
+ fp.SetOne(&P.z)
+ return true
+}
+
+// double calculates 2P for curves with A=-1.
+func (P *pointR1) double() {
+ Px, Py, Pz, Pta, Ptb := &P.x, &P.y, &P.z, &P.ta, &P.tb
+ a, b, c, e, f, g, h := Px, Py, Pz, Pta, Px, Py, Ptb
+ fp.Add(e, Px, Py) // x+y
+ fp.Sqr(a, Px) // A = x^2
+ fp.Sqr(b, Py) // B = y^2
+ fp.Sqr(c, Pz) // z^2
+ fp.Add(c, c, c) // C = 2*z^2
+ fp.Add(h, a, b) // H = A+B
+ fp.Sqr(e, e) // (x+y)^2
+ fp.Sub(e, e, h) // E = (x+y)^2-A-B
+ fp.Sub(g, b, a) // G = B-A
+ fp.Sub(f, c, g) // F = C-G
+ fp.Mul(Pz, f, g) // Z = F * G
+ fp.Mul(Px, e, f) // X = E * F
+ fp.Mul(Py, g, h) // Y = G * H, T = E * H
+}
+
+func (P *pointR1) mixAdd(Q *pointR3) {
+ fp.Add(&P.z, &P.z, &P.z) // D = 2*z1
+ P.coreAddition(Q)
+}
+
+func (P *pointR1) add(Q *pointR2) {
+ fp.Mul(&P.z, &P.z, &Q.z2) // D = 2*z1*z2
+ P.coreAddition(&Q.pointR3)
+}
+
+// coreAddition calculates P=P+Q for curves with A=-1.
+func (P *pointR1) coreAddition(Q *pointR3) {
+ Px, Py, Pz, Pta, Ptb := &P.x, &P.y, &P.z, &P.ta, &P.tb
+ addYX2, subYX2, dt2 := &Q.addYX, &Q.subYX, &Q.dt2
+ a, b, c, d, e, f, g, h := Px, Py, &fp.Elt{}, Pz, Pta, Px, Py, Ptb
+ fp.Mul(c, Pta, Ptb) // t1 = ta*tb
+ fp.Sub(h, Py, Px) // y1-x1
+ fp.Add(b, Py, Px) // y1+x1
+ fp.Mul(a, h, subYX2) // A = (y1-x1)*(y2-x2)
+ fp.Mul(b, b, addYX2) // B = (y1+x1)*(y2+x2)
+ fp.Mul(c, c, dt2) // C = 2*D*t1*t2
+ fp.Sub(e, b, a) // E = B-A
+ fp.Add(h, b, a) // H = B+A
+ fp.Sub(f, d, c) // F = D-C
+ fp.Add(g, d, c) // G = D+C
+ fp.Mul(Pz, f, g) // Z = F * G
+ fp.Mul(Px, e, f) // X = E * F
+ fp.Mul(Py, g, h) // Y = G * H, T = E * H
+}
+
+func (P *pointR1) oddMultiples(T []pointR2) {
+ var R pointR2
+ n := len(T)
+ T[0].fromR1(P)
+ _2P := *P
+ _2P.double()
+ R.fromR1(&_2P)
+ for i := 1; i < n; i++ {
+ P.add(&R)
+ T[i].fromR1(P)
+ }
+}
+
+func (P *pointR1) isEqual(Q *pointR1) bool {
+ l, r := &fp.Elt{}, &fp.Elt{}
+ fp.Mul(l, &P.x, &Q.z)
+ fp.Mul(r, &Q.x, &P.z)
+ fp.Sub(l, l, r)
+ b := fp.IsZero(l)
+ fp.Mul(l, &P.y, &Q.z)
+ fp.Mul(r, &Q.y, &P.z)
+ fp.Sub(l, l, r)
+ b = b && fp.IsZero(l)
+ fp.Mul(l, &P.ta, &P.tb)
+ fp.Mul(l, l, &Q.z)
+ fp.Mul(r, &Q.ta, &Q.tb)
+ fp.Mul(r, r, &P.z)
+ fp.Sub(l, l, r)
+ b = b && fp.IsZero(l)
+ return b && !fp.IsZero(&P.z) && !fp.IsZero(&Q.z)
+}
+
+func (P *pointR3) neg() {
+ P.addYX, P.subYX = P.subYX, P.addYX
+ fp.Neg(&P.dt2, &P.dt2)
+}
+
+func (P *pointR2) fromR1(Q *pointR1) {
+ fp.Add(&P.addYX, &Q.y, &Q.x)
+ fp.Sub(&P.subYX, &Q.y, &Q.x)
+ fp.Mul(&P.dt2, &Q.ta, &Q.tb)
+ fp.Mul(&P.dt2, &P.dt2, ¶mD)
+ fp.Add(&P.dt2, &P.dt2, &P.dt2)
+ fp.Add(&P.z2, &Q.z, &Q.z)
+}
+
+func (P *pointR3) cneg(b int) {
+ t := &fp.Elt{}
+ fp.Cswap(&P.addYX, &P.subYX, uint(b))
+ fp.Neg(t, &P.dt2)
+ fp.Cmov(&P.dt2, t, uint(b))
+}
+
+func (P *pointR3) cmov(Q *pointR3, b int) {
+ fp.Cmov(&P.addYX, &Q.addYX, uint(b))
+ fp.Cmov(&P.subYX, &Q.subYX, uint(b))
+ fp.Cmov(&P.dt2, &Q.dt2, uint(b))
+}
diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/pubkey.go b/vendor/github.com/cloudflare/circl/sign/ed25519/pubkey.go
new file mode 100644
index 0000000000..c3505b67ac
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/sign/ed25519/pubkey.go
@@ -0,0 +1,9 @@
+//go:build go1.13
+// +build go1.13
+
+package ed25519
+
+import cryptoEd25519 "crypto/ed25519"
+
+// PublicKey is the type of Ed25519 public keys.
+type PublicKey cryptoEd25519.PublicKey
diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/pubkey112.go b/vendor/github.com/cloudflare/circl/sign/ed25519/pubkey112.go
new file mode 100644
index 0000000000..d57d86eff0
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/sign/ed25519/pubkey112.go
@@ -0,0 +1,7 @@
+//go:build !go1.13
+// +build !go1.13
+
+package ed25519
+
+// PublicKey is the type of Ed25519 public keys.
+type PublicKey []byte
diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/signapi.go b/vendor/github.com/cloudflare/circl/sign/ed25519/signapi.go
new file mode 100644
index 0000000000..e4520f5203
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/sign/ed25519/signapi.go
@@ -0,0 +1,87 @@
+package ed25519
+
+import (
+ "crypto/rand"
+ "encoding/asn1"
+
+ "github.com/cloudflare/circl/sign"
+)
+
+var sch sign.Scheme = &scheme{}
+
+// Scheme returns a signature interface.
+func Scheme() sign.Scheme { return sch }
+
+type scheme struct{}
+
+func (*scheme) Name() string { return "Ed25519" }
+func (*scheme) PublicKeySize() int { return PublicKeySize }
+func (*scheme) PrivateKeySize() int { return PrivateKeySize }
+func (*scheme) SignatureSize() int { return SignatureSize }
+func (*scheme) SeedSize() int { return SeedSize }
+func (*scheme) TLSIdentifier() uint { return 0x0807 }
+func (*scheme) SupportsContext() bool { return false }
+func (*scheme) Oid() asn1.ObjectIdentifier {
+ return asn1.ObjectIdentifier{1, 3, 101, 112}
+}
+
+func (*scheme) GenerateKey() (sign.PublicKey, sign.PrivateKey, error) {
+ return GenerateKey(rand.Reader)
+}
+
+func (*scheme) Sign(
+ sk sign.PrivateKey,
+ message []byte,
+ opts *sign.SignatureOpts,
+) []byte {
+ priv, ok := sk.(PrivateKey)
+ if !ok {
+ panic(sign.ErrTypeMismatch)
+ }
+ if opts != nil && opts.Context != "" {
+ panic(sign.ErrContextNotSupported)
+ }
+ return Sign(priv, message)
+}
+
+func (*scheme) Verify(
+ pk sign.PublicKey,
+ message, signature []byte,
+ opts *sign.SignatureOpts,
+) bool {
+ pub, ok := pk.(PublicKey)
+ if !ok {
+ panic(sign.ErrTypeMismatch)
+ }
+ if opts != nil {
+ if opts.Context != "" {
+ panic(sign.ErrContextNotSupported)
+ }
+ }
+ return Verify(pub, message, signature)
+}
+
+func (*scheme) DeriveKey(seed []byte) (sign.PublicKey, sign.PrivateKey) {
+ privateKey := NewKeyFromSeed(seed)
+ publicKey := make(PublicKey, PublicKeySize)
+ copy(publicKey, privateKey[SeedSize:])
+ return publicKey, privateKey
+}
+
+func (*scheme) UnmarshalBinaryPublicKey(buf []byte) (sign.PublicKey, error) {
+ if len(buf) < PublicKeySize {
+ return nil, sign.ErrPubKeySize
+ }
+ pub := make(PublicKey, PublicKeySize)
+ copy(pub, buf[:PublicKeySize])
+ return pub, nil
+}
+
+func (*scheme) UnmarshalBinaryPrivateKey(buf []byte) (sign.PrivateKey, error) {
+ if len(buf) < PrivateKeySize {
+ return nil, sign.ErrPrivKeySize
+ }
+ priv := make(PrivateKey, PrivateKeySize)
+ copy(priv, buf[:PrivateKeySize])
+ return priv, nil
+}
diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/tables.go b/vendor/github.com/cloudflare/circl/sign/ed25519/tables.go
new file mode 100644
index 0000000000..8763b426fc
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/sign/ed25519/tables.go
@@ -0,0 +1,213 @@
+package ed25519
+
+import fp "github.com/cloudflare/circl/math/fp25519"
+
+var tabSign = [fxV][fx2w1]pointR3{
+ {
+ pointR3{
+ addYX: fp.Elt{0x85, 0x3b, 0x8c, 0xf5, 0xc6, 0x93, 0xbc, 0x2f, 0x19, 0x0e, 0x8c, 0xfb, 0xc6, 0x2d, 0x93, 0xcf, 0xc2, 0x42, 0x3d, 0x64, 0x98, 0x48, 0x0b, 0x27, 0x65, 0xba, 0xd4, 0x33, 0x3a, 0x9d, 0xcf, 0x07},
+ subYX: fp.Elt{0x3e, 0x91, 0x40, 0xd7, 0x05, 0x39, 0x10, 0x9d, 0xb3, 0xbe, 0x40, 0xd1, 0x05, 0x9f, 0x39, 0xfd, 0x09, 0x8a, 0x8f, 0x68, 0x34, 0x84, 0xc1, 0xa5, 0x67, 0x12, 0xf8, 0x98, 0x92, 0x2f, 0xfd, 0x44},
+ dt2: fp.Elt{0x68, 0xaa, 0x7a, 0x87, 0x05, 0x12, 0xc9, 0xab, 0x9e, 0xc4, 0xaa, 0xcc, 0x23, 0xe8, 0xd9, 0x26, 0x8c, 0x59, 0x43, 0xdd, 0xcb, 0x7d, 0x1b, 0x5a, 0xa8, 0x65, 0x0c, 0x9f, 0x68, 0x7b, 0x11, 0x6f},
+ },
+ {
+ addYX: fp.Elt{0x7c, 0xb0, 0x9e, 0xe6, 0xc5, 0xbf, 0xfa, 0x13, 0x8e, 0x0d, 0x22, 0xde, 0xc8, 0xd1, 0xce, 0x52, 0x02, 0xd5, 0x62, 0x31, 0x71, 0x0e, 0x8e, 0x9d, 0xb0, 0xd6, 0x00, 0xa5, 0x5a, 0x0e, 0xce, 0x72},
+ subYX: fp.Elt{0x1a, 0x8e, 0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 0x37, 0x3e, 0x3c},
+ dt2: fp.Elt{0xd2, 0x2f, 0x06, 0x6b, 0x08, 0x07, 0x69, 0x77, 0xc0, 0x94, 0xcc, 0xae, 0x43, 0x00, 0x59, 0x6e, 0xa3, 0x63, 0xa8, 0xdd, 0xfa, 0x24, 0x18, 0xd0, 0x35, 0xc7, 0x78, 0xf7, 0x0d, 0xd4, 0x5a, 0x1e},
+ },
+ {
+ addYX: fp.Elt{0x45, 0xc1, 0x17, 0x51, 0xf8, 0xed, 0x7e, 0xc7, 0xa9, 0x1a, 0x11, 0x6e, 0x2d, 0xef, 0x0b, 0xd5, 0x3f, 0x98, 0xb0, 0xa3, 0x9d, 0x65, 0xf1, 0xcd, 0x53, 0x4a, 0x8a, 0x18, 0x70, 0x0a, 0x7f, 0x23},
+ subYX: fp.Elt{0xdd, 0xef, 0xbe, 0x3a, 0x31, 0xe0, 0xbc, 0xbe, 0x6d, 0x5d, 0x79, 0x87, 0xd6, 0xbe, 0x68, 0xe3, 0x59, 0x76, 0x8c, 0x86, 0x0e, 0x7a, 0x92, 0x13, 0x14, 0x8f, 0x67, 0xb3, 0xcb, 0x1a, 0x76, 0x76},
+ dt2: fp.Elt{0x56, 0x7a, 0x1c, 0x9d, 0xca, 0x96, 0xf9, 0xf9, 0x03, 0x21, 0xd4, 0xe8, 0xb3, 0xd5, 0xe9, 0x52, 0xc8, 0x54, 0x1e, 0x1b, 0x13, 0xb6, 0xfd, 0x47, 0x7d, 0x02, 0x32, 0x33, 0x27, 0xe2, 0x1f, 0x19},
+ },
+ },
+}
+
+var tabVerif = [1 << (omegaFix - 2)]pointR3{
+ { /* 1P */
+ addYX: fp.Elt{0x85, 0x3b, 0x8c, 0xf5, 0xc6, 0x93, 0xbc, 0x2f, 0x19, 0x0e, 0x8c, 0xfb, 0xc6, 0x2d, 0x93, 0xcf, 0xc2, 0x42, 0x3d, 0x64, 0x98, 0x48, 0x0b, 0x27, 0x65, 0xba, 0xd4, 0x33, 0x3a, 0x9d, 0xcf, 0x07},
+ subYX: fp.Elt{0x3e, 0x91, 0x40, 0xd7, 0x05, 0x39, 0x10, 0x9d, 0xb3, 0xbe, 0x40, 0xd1, 0x05, 0x9f, 0x39, 0xfd, 0x09, 0x8a, 0x8f, 0x68, 0x34, 0x84, 0xc1, 0xa5, 0x67, 0x12, 0xf8, 0x98, 0x92, 0x2f, 0xfd, 0x44},
+ dt2: fp.Elt{0x68, 0xaa, 0x7a, 0x87, 0x05, 0x12, 0xc9, 0xab, 0x9e, 0xc4, 0xaa, 0xcc, 0x23, 0xe8, 0xd9, 0x26, 0x8c, 0x59, 0x43, 0xdd, 0xcb, 0x7d, 0x1b, 0x5a, 0xa8, 0x65, 0x0c, 0x9f, 0x68, 0x7b, 0x11, 0x6f},
+ },
+ { /* 3P */
+ addYX: fp.Elt{0x30, 0x97, 0xee, 0x4c, 0xa8, 0xb0, 0x25, 0xaf, 0x8a, 0x4b, 0x86, 0xe8, 0x30, 0x84, 0x5a, 0x02, 0x32, 0x67, 0x01, 0x9f, 0x02, 0x50, 0x1b, 0xc1, 0xf4, 0xf8, 0x80, 0x9a, 0x1b, 0x4e, 0x16, 0x7a},
+ subYX: fp.Elt{0x65, 0xd2, 0xfc, 0xa4, 0xe8, 0x1f, 0x61, 0x56, 0x7d, 0xba, 0xc1, 0xe5, 0xfd, 0x53, 0xd3, 0x3b, 0xbd, 0xd6, 0x4b, 0x21, 0x1a, 0xf3, 0x31, 0x81, 0x62, 0xda, 0x5b, 0x55, 0x87, 0x15, 0xb9, 0x2a},
+ dt2: fp.Elt{0x89, 0xd8, 0xd0, 0x0d, 0x3f, 0x93, 0xae, 0x14, 0x62, 0xda, 0x35, 0x1c, 0x22, 0x23, 0x94, 0x58, 0x4c, 0xdb, 0xf2, 0x8c, 0x45, 0xe5, 0x70, 0xd1, 0xc6, 0xb4, 0xb9, 0x12, 0xaf, 0x26, 0x28, 0x5a},
+ },
+ { /* 5P */
+ addYX: fp.Elt{0x33, 0xbb, 0xa5, 0x08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0x47, 0x5f, 0x03, 0xb3, 0xf3, 0xad, 0x77, 0x58, 0xba, 0x41, 0x9c, 0x52, 0xa7, 0x90, 0x0f, 0x6a, 0x1c, 0xbb, 0x9f, 0x7a},
+ },
+ { /* 9P */
+ addYX: fp.Elt{0x2f, 0x63, 0xa8, 0xa6, 0x8a, 0x67, 0x2e, 0x9b, 0xc5, 0x46, 0xbc, 0x51, 0x6f, 0x9e, 0x50, 0xa6, 0xb5, 0xf5, 0x86, 0xc6, 0xc9, 0x33, 0xb2, 0xce, 0x59, 0x7f, 0xdd, 0x8a, 0x33, 0xed, 0xb9, 0x34},
+ subYX: fp.Elt{0x64, 0x80, 0x9d, 0x03, 0x7e, 0x21, 0x6e, 0xf3, 0x9b, 0x41, 0x20, 0xf5, 0xb6, 0x81, 0xa0, 0x98, 0x44, 0xb0, 0x5e, 0xe7, 0x08, 0xc6, 0xcb, 0x96, 0x8f, 0x9c, 0xdc, 0xfa, 0x51, 0x5a, 0xc0, 0x49},
+ dt2: fp.Elt{0x1b, 0xaf, 0x45, 0x90, 0xbf, 0xe8, 0xb4, 0x06, 0x2f, 0xd2, 0x19, 0xa7, 0xe8, 0x83, 0xff, 0xe2, 0x16, 0xcf, 0xd4, 0x93, 0x29, 0xfc, 0xf6, 0xaa, 0x06, 0x8b, 0x00, 0x1b, 0x02, 0x72, 0xc1, 0x73},
+ },
+ { /* 11P */
+ addYX: fp.Elt{0xde, 0x2a, 0x80, 0x8a, 0x84, 0x00, 0xbf, 0x2f, 0x27, 0x2e, 0x30, 0x02, 0xcf, 0xfe, 0xd9, 0xe5, 0x06, 0x34, 0x70, 0x17, 0x71, 0x84, 0x3e, 0x11, 0xaf, 0x8f, 0x6d, 0x54, 0xe2, 0xaa, 0x75, 0x42},
+ subYX: fp.Elt{0x48, 0x43, 0x86, 0x49, 0x02, 0x5b, 0x5f, 0x31, 0x81, 0x83, 0x08, 0x77, 0x69, 0xb3, 0xd6, 0x3e, 0x95, 0xeb, 0x8d, 0x6a, 0x55, 0x75, 0xa0, 0xa3, 0x7f, 0xc7, 0xd5, 0x29, 0x80, 0x59, 0xab, 0x18},
+ dt2: fp.Elt{0xe9, 0x89, 0x60, 0xfd, 0xc5, 0x2c, 0x2b, 0xd8, 0xa4, 0xe4, 0x82, 0x32, 0xa1, 0xb4, 0x1e, 0x03, 0x22, 0x86, 0x1a, 0xb5, 0x99, 0x11, 0x31, 0x44, 0x48, 0xf9, 0x3d, 0xb5, 0x22, 0x55, 0xc6, 0x3d},
+ },
+ { /* 13P */
+ addYX: fp.Elt{0x6d, 0x7f, 0x00, 0xa2, 0x22, 0xc2, 0x70, 0xbf, 0xdb, 0xde, 0xbc, 0xb5, 0x9a, 0xb3, 0x84, 0xbf, 0x07, 0xba, 0x07, 0xfb, 0x12, 0x0e, 0x7a, 0x53, 0x41, 0xf2, 0x46, 0xc3, 0xee, 0xd7, 0x4f, 0x23},
+ subYX: fp.Elt{0x93, 0xbf, 0x7f, 0x32, 0x3b, 0x01, 0x6f, 0x50, 0x6b, 0x6f, 0x77, 0x9b, 0xc9, 0xeb, 0xfc, 0xae, 0x68, 0x59, 0xad, 0xaa, 0x32, 0xb2, 0x12, 0x9d, 0xa7, 0x24, 0x60, 0x17, 0x2d, 0x88, 0x67, 0x02},
+ dt2: fp.Elt{0x78, 0xa3, 0x2e, 0x73, 0x19, 0xa1, 0x60, 0x53, 0x71, 0xd4, 0x8d, 0xdf, 0xb1, 0xe6, 0x37, 0x24, 0x33, 0xe5, 0xa7, 0x91, 0xf8, 0x37, 0xef, 0xa2, 0x63, 0x78, 0x09, 0xaa, 0xfd, 0xa6, 0x7b, 0x49},
+ },
+ { /* 15P */
+ addYX: fp.Elt{0xa0, 0xea, 0xcf, 0x13, 0x03, 0xcc, 0xce, 0x24, 0x6d, 0x24, 0x9c, 0x18, 0x8d, 0xc2, 0x48, 0x86, 0xd0, 0xd4, 0xf2, 0xc1, 0xfa, 0xbd, 0xbd, 0x2d, 0x2b, 0xe7, 0x2d, 0xf1, 0x17, 0x29, 0xe2, 0x61},
+ subYX: fp.Elt{0x0b, 0xcf, 0x8c, 0x46, 0x86, 0xcd, 0x0b, 0x04, 0xd6, 0x10, 0x99, 0x2a, 0xa4, 0x9b, 0x82, 0xd3, 0x92, 0x51, 0xb2, 0x07, 0x08, 0x30, 0x08, 0x75, 0xbf, 0x5e, 0xd0, 0x18, 0x42, 0xcd, 0xb5, 0x43},
+ dt2: fp.Elt{0x16, 0xb5, 0xd0, 0x9b, 0x2f, 0x76, 0x9a, 0x5d, 0xee, 0xde, 0x3f, 0x37, 0x4e, 0xaf, 0x38, 0xeb, 0x70, 0x42, 0xd6, 0x93, 0x7d, 0x5a, 0x2e, 0x03, 0x42, 0xd8, 0xe4, 0x0a, 0x21, 0x61, 0x1d, 0x51},
+ },
+ { /* 17P */
+ addYX: fp.Elt{0x81, 0x9d, 0x0e, 0x95, 0xef, 0x76, 0xc6, 0x92, 0x4f, 0x04, 0xd7, 0xc0, 0xcd, 0x20, 0x46, 0xa5, 0x48, 0x12, 0x8f, 0x6f, 0x64, 0x36, 0x9b, 0xaa, 0xe3, 0x55, 0xb8, 0xdd, 0x24, 0x59, 0x32, 0x6d},
+ subYX: fp.Elt{0x87, 0xde, 0x20, 0x44, 0x48, 0x86, 0x13, 0x08, 0xb4, 0xed, 0x92, 0xb5, 0x16, 0xf0, 0x1c, 0x8a, 0x25, 0x2d, 0x94, 0x29, 0x27, 0x4e, 0xfa, 0x39, 0x10, 0x28, 0x48, 0xe2, 0x6f, 0xfe, 0xa7, 0x71},
+ dt2: fp.Elt{0x54, 0xc8, 0xc8, 0xa5, 0xb8, 0x82, 0x71, 0x6c, 0x03, 0x2a, 0x5f, 0xfe, 0x79, 0x14, 0xfd, 0x33, 0x0c, 0x8d, 0x77, 0x83, 0x18, 0x59, 0xcf, 0x72, 0xa9, 0xea, 0x9e, 0x55, 0xb6, 0xc4, 0x46, 0x47},
+ },
+ { /* 19P */
+ addYX: fp.Elt{0x2b, 0x9a, 0xc6, 0x6d, 0x3c, 0x7b, 0x77, 0xd3, 0x17, 0xf6, 0x89, 0x6f, 0x27, 0xb2, 0xfa, 0xde, 0xb5, 0x16, 0x3a, 0xb5, 0xf7, 0x1c, 0x65, 0x45, 0xb7, 0x9f, 0xfe, 0x34, 0xde, 0x51, 0x9a, 0x5c},
+ subYX: fp.Elt{0x47, 0x11, 0x74, 0x64, 0xc8, 0x46, 0x85, 0x34, 0x49, 0xc8, 0xfc, 0x0e, 0xdd, 0xae, 0x35, 0x7d, 0x32, 0xa3, 0x72, 0x06, 0x76, 0x9a, 0x93, 0xff, 0xd6, 0xe6, 0xb5, 0x7d, 0x49, 0x63, 0x96, 0x21},
+ dt2: fp.Elt{0x67, 0x0e, 0xf1, 0x79, 0xcf, 0xf1, 0x10, 0xf5, 0x5b, 0x51, 0x58, 0xe6, 0xa1, 0xda, 0xdd, 0xff, 0x77, 0x22, 0x14, 0x10, 0x17, 0xa7, 0xc3, 0x09, 0xbb, 0x23, 0x82, 0x60, 0x3c, 0x50, 0x04, 0x48},
+ },
+ { /* 21P */
+ addYX: fp.Elt{0xc7, 0x7f, 0xa3, 0x2c, 0xd0, 0x9e, 0x24, 0xc4, 0xab, 0xac, 0x15, 0xa6, 0xe3, 0xa0, 0x59, 0xa0, 0x23, 0x0e, 0x6e, 0xc9, 0xd7, 0x6e, 0xa9, 0x88, 0x6d, 0x69, 0x50, 0x16, 0xa5, 0x98, 0x33, 0x55},
+ subYX: fp.Elt{0x75, 0xd1, 0x36, 0x3a, 0xd2, 0x21, 0x68, 0x3b, 0x32, 0x9e, 0x9b, 0xe9, 0xa7, 0x0a, 0xb4, 0xbb, 0x47, 0x8a, 0x83, 0x20, 0xe4, 0x5c, 0x9e, 0x5d, 0x5e, 0x4c, 0xde, 0x58, 0x88, 0x09, 0x1e, 0x77},
+ dt2: fp.Elt{0xdf, 0x1e, 0x45, 0x78, 0xd2, 0xf5, 0x12, 0x9a, 0xcb, 0x9c, 0x89, 0x85, 0x79, 0x5d, 0xda, 0x3a, 0x08, 0x95, 0xa5, 0x9f, 0x2d, 0x4a, 0x7f, 0x47, 0x11, 0xa6, 0xf5, 0x8f, 0xd6, 0xd1, 0x5e, 0x5a},
+ },
+ { /* 23P */
+ addYX: fp.Elt{0x83, 0x0e, 0x15, 0xfe, 0x2a, 0x12, 0x95, 0x11, 0xd8, 0x35, 0x4b, 0x7e, 0x25, 0x9a, 0x20, 0xcf, 0x20, 0x1e, 0x71, 0x1e, 0x29, 0xf8, 0x87, 0x73, 0xf0, 0x92, 0xbf, 0xd8, 0x97, 0xb8, 0xac, 0x44},
+ subYX: fp.Elt{0x59, 0x73, 0x52, 0x58, 0xc5, 0xe0, 0xe5, 0xba, 0x7e, 0x9d, 0xdb, 0xca, 0x19, 0x5c, 0x2e, 0x39, 0xe9, 0xab, 0x1c, 0xda, 0x1e, 0x3c, 0x65, 0x28, 0x44, 0xdc, 0xef, 0x5f, 0x13, 0x60, 0x9b, 0x01},
+ dt2: fp.Elt{0x83, 0x4b, 0x13, 0x5e, 0x14, 0x68, 0x60, 0x1e, 0x16, 0x4c, 0x30, 0x24, 0x4f, 0xe6, 0xf5, 0xc4, 0xd7, 0x3e, 0x1a, 0xfc, 0xa8, 0x88, 0x6e, 0x50, 0x92, 0x2f, 0xad, 0xe6, 0xfd, 0x49, 0x0c, 0x15},
+ },
+ { /* 25P */
+ addYX: fp.Elt{0x38, 0x11, 0x47, 0x09, 0x95, 0xf2, 0x7b, 0x8e, 0x51, 0xa6, 0x75, 0x4f, 0x39, 0xef, 0x6f, 0x5d, 0xad, 0x08, 0xa7, 0x25, 0xc4, 0x79, 0xaf, 0x10, 0x22, 0x99, 0xb9, 0x5b, 0x07, 0x5a, 0x2b, 0x6b},
+ subYX: fp.Elt{0x68, 0xa8, 0xdc, 0x9c, 0x3c, 0x86, 0x49, 0xb8, 0xd0, 0x4a, 0x71, 0xb8, 0xdb, 0x44, 0x3f, 0xc8, 0x8d, 0x16, 0x36, 0x0c, 0x56, 0xe3, 0x3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xef, 0x06},
+ subYX: fp.Elt{0x34, 0x4a, 0x58, 0x82, 0xbb, 0x9f, 0x1b, 0xd0, 0x2b, 0x79, 0xb4, 0xd2, 0x63, 0x64, 0xab, 0x47, 0x02, 0x62, 0x53, 0x48, 0x9c, 0x63, 0x31, 0xb6, 0x28, 0xd4, 0xd6, 0x69, 0x36, 0x2a, 0xa9, 0x13},
+ dt2: fp.Elt{0xe5, 0x7d, 0x57, 0xc0, 0x1c, 0x77, 0x93, 0xca, 0x5c, 0xdc, 0x35, 0x50, 0x1e, 0xe4, 0x40, 0x75, 0x71, 0xe0, 0x02, 0xd8, 0x01, 0x0f, 0x68, 0x24, 0x6a, 0xf8, 0x2a, 0x8a, 0xdf, 0x6d, 0x29, 0x3c},
+ },
+ { /* 31P */
+ addYX: fp.Elt{0x13, 0xa7, 0x14, 0xd9, 0xf9, 0x15, 0xad, 0xae, 0x12, 0xf9, 0x8f, 0x8c, 0xf9, 0x7b, 0x2f, 0xa9, 0x30, 0xd7, 0x53, 0x9f, 0x17, 0x23, 0xf8, 0xaf, 0xba, 0x77, 0x0c, 0x49, 0x93, 0xd3, 0x99, 0x7a},
+ subYX: fp.Elt{0x41, 0x25, 0x1f, 0xbb, 0x2e, 0x4d, 0xeb, 0xfc, 0x1f, 0xb9, 0xad, 0x40, 0xc7, 0x10, 0x95, 0xb8, 0x05, 0xad, 0xa1, 0xd0, 0x7d, 0xa3, 0x71, 0xfc, 0x7b, 0x71, 0x47, 0x07, 0x70, 0x2c, 0x89, 0x0a},
+ dt2: fp.Elt{0xe8, 0xa3, 0xbd, 0x36, 0x24, 0xed, 0x52, 0x8f, 0x94, 0x07, 0xe8, 0x57, 0x41, 0xc8, 0xa8, 0x77, 0xe0, 0x9c, 0x2f, 0x26, 0x63, 0x65, 0xa9, 0xa5, 0xd2, 0xf7, 0x02, 0x83, 0xd2, 0x62, 0x67, 0x28},
+ },
+ { /* 33P */
+ addYX: fp.Elt{0x25, 0x5b, 0xe3, 0x3c, 0x09,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, 0x8f, 0x2b},
+ subYX: fp.Elt{0x43, 0xf5, 0xb9, 0x35, 0xb1, 0xfe, 0x74, 0x9d, 0x6c, 0x95, 0x8c, 0xde, 0xf1, 0x7d, 0xb3, 0x84, 0xa9, 0x8b, 0x13, 0x57, 0x07, 0x2b, 0x32, 0xe9, 0xe1, 0x4c, 0x0b, 0x79, 0xa8, 0xad, 0xb8, 0x38},
+ dt2: fp.Elt{0x5d, 0xf9, 0x51, 0xdf, 0x9c, 0x4a, 0xc0, 0xb5, 0xac, 0xde, 0x1f, 0xcb, 0xae, 0x52, 0x39, 0x2b, 0xda, 0x66, 0x8b, 0x32, 0x8b, 0x6d, 0x10, 0x1d, 0x53, 0x19, 0xba, 0xce, 0x32, 0xeb, 0x9a, 0x04},
+ },
+ { /* 45P */
+ addYX: fp.Elt{0x31, 0x79, 0xfc, 0x75, 0x0b, 0x7d, 0x50, 0xaa, 0xd3, 0x25, 0x67, 0x7a, 0x4b, 0x92, 0xef, 0x0f, 0x30, 0x39, 0x6b, 0x39, 0x2b, 0x54, 0x82, 0x1d, 0xfc, 0x74, 0xf6, 0x30, 0x75, 0xe1, 0x5e, 0x79},
+ subYX: fp.Elt{0x7e, 0xfe, 0xdc, 0x63, 0x3c, 0x7d, 0x76, 0xd7, 0x40, 0x6e, 0x85, 0x97, 0x48, 0x59, 0x9c, 0x20, 0x13, 0x7c, 0x4f, 0xe1, 0x61, 0x68, 0x67, 0xb6, 0xfc, 0x25, 0xd6, 0xc8, 0xe0, 0x65, 0xc6, 0x51},
+ dt2: fp.Elt{0x81, 0xbd, 0xec, 0x52, 0x0a, 0x5b, 0x4a, 0x25, 0xe7, 0xaf, 0x34, 0xe0, 0x6e, 0x1f, 0x41, 0x5d, 0x31, 0x4a, 0xee, 0xca, 0x0d, 0x4d, 0xa2, 0xe6, 0x77, 0x44, 0xc5, 0x9d, 0xf4, 0x9b, 0xd1, 0x6c},
+ },
+ { /* 47P */
+ addYX: fp.Elt{0x86, 0xc3, 0xaf,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b, 0x6e, 0x69, 0x5a, 0x76, 0xf1, 0xb2, 0xf4, 0x68, 0x16, 0x93, 0xf7, 0x67, 0x3a, 0x4e, 0x4a, 0x61, 0x65, 0xc5, 0x5f},
+ },
+ { /* 51P */
+ addYX: fp.Elt{0x8e, 0x98, 0x90, 0x77, 0xe6, 0xe1, 0x92, 0x48, 0x22, 0xd7, 0x5c, 0x1c, 0x0f, 0x95, 0xd5, 0x01, 0xed, 0x3e, 0x92, 0xe5, 0x9a, 0x81, 0xb0, 0xe3, 0x1b, 0x65, 0x46, 0x9d, 0x40, 0xc7, 0x14, 0x32},
+ subYX: fp.Elt{0xe5, 0x7a, 0x6d, 0xc4, 0x0d, 0x57, 0x6e, 0x13, 0x8f, 0xdc, 0xf8, 0x54, 0xcc, 0xaa, 0xd0, 0x0f, 0x86, 0xad, 0x0d, 0x31, 0x03, 0x9f, 0x54, 0x59, 0xa1, 0x4a, 0x45, 0x4c, 0x41, 0x1c, 0x71, 0x62},
+ dt2: fp.Elt{0x70, 0x17, 0x65, 0x06, 0x74, 0x82, 0x29, 0x13, 0x36, 0x94, 0x27, 0x8a, 0x66, 0xa0, 0xa4, 0x3b, 0x3c, 0x22, 0x5d, 0x18, 0xec, 0xb8, 0xb6, 0xd9, 0x3c, 0x83, 0xcb, 0x3e, 0x07, 0x94, 0xea, 0x5b},
+ },
+ { /* 53P */
+ addYX: fp.Elt{0xf8, 0xd2, 0x43, 0xf3, 0x63, 0xce, 0x70, 0xb4, 0xf1, 0xe8, 0x43, 0x05, 0x8f, 0xba, 0x67, 0x00, 0x6f, 0x7b, 0x11, 0xa2, 0xa1, 0x51, 0xda, 0x35, 0x2f, 0xbd, 0xf1, 0x44, 0x59, 0x78, 0xd0, 0x4a},
+ subYX: fp.Elt{0xe4, 0x9b, 0xc8, 0x12, 0x09, 0xbf, 0x1d, 0x64, 0x9c, 0x57, 0x6e, 0x7d, 0x31, 0x8b, 0xf3, 0xac, 0x65, 0xb0, 0x97, 0xf6, 0x02, 0x9e, 0xfe, 0xab, 0xec, 0x1e, 0xf6, 0x48, 0xc1, 0xd5, 0xac, 0x3a},
+ dt2: fp.Elt{0x01, 0x83, 0x31, 0xc3, 0x34, 0x3b, 0x8e, 0x85, 0x26, 0x68, 0x31, 0x07, 0x47, 0xc0, 0x99, 0xdc, 0x8c, 0xa8, 0x9d, 0xd3, 0x2e, 0x5b, 0x08, 0x34, 0x3d, 0x85, 0x02, 0xd9, 0xb1, 0x0c, 0xff, 0x3a},
+ },
+ { /* 55P */
+ addYX: fp.Elt{0x05, 0x35, 0xc5, 0xf4, 0x0b, 0x43, 0x26, 0x92, 0x83, 0x22, 0x1f, 0x26, 0x13, 0x9c, 0xe4, 0x68, 0xc6, 0x27, 0xd3, 0x8f, 0x78, 0x33, 0xef, 0x09, 0x7f, 0x9e, 0xd9, 0x2b, 0x73, 0x9f, 0xcf, 0x2c},
+ subYX: fp.Elt{0x5e, 0x40, 0x20, 0x3a, 0xeb, 0xc7, 0xc5, 0x87, 0xc9, 0x56, 0xad, 0xed, 0xef, 0x11, 0xe3, 0x8e, 0xf9, 0xd5, 0x29, 0xad, 0x48, 0x2e, 0x25, 0x29, 0x1d, 0x25, 0xcd, 0xf4, 0x86, 0x7e, 0x0e, 0x11},
+ dt2: fp.Elt{0xe4, 0xf5, 0x03, 0xd6, 0x9e, 0xd8, 0xc0, 0x57, 0x0c, 0x20, 0xb0, 0xf0, 0x28, 0x86, 0x88, 0x12, 0xb7, 0x3b, 0x2e, 0xa0, 0x09, 0x27, 0x17, 0x53, 0x37, 0x3a, 0x69, 0xb9, 0xe0, 0x57, 0xc5, 0x05},
+ },
+ { /* 57P */
+ addYX: fp.Elt{0xb0, 0x0e, 0xc2, 0x89, 0xb0, 0xbb, 0x76, 0xf7, 0x5c, 0xd8, 0x0f, 0xfa, 0xf6, 0x5b, 0xf8, 0x61, 0xfb, 0x21, 0x44, 0x63, 0x4e, 0x3f, 0xb9, 0xb6, 0x05, 0x12, 0x86, 0x41, 0x08, 0x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0x19, 0x3f, 0xcc, 0x18, 0x85, 0x1e, 0x64, 0x0a, 0x56, 0x25, 0x4f, 0xc1, 0x91, 0xe4, 0x83, 0x2c, 0x62, 0xa6, 0x53, 0xfc, 0xd1, 0x1e},
+ },
+}
diff --git a/vendor/github.com/cloudflare/circl/sign/ed448/ed448.go b/vendor/github.com/cloudflare/circl/sign/ed448/ed448.go
new file mode 100644
index 0000000000..c368b181b4
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/sign/ed448/ed448.go
@@ -0,0 +1,411 @@
+// Package ed448 implements Ed448 signature scheme as described in RFC-8032.
+//
+// This package implements two signature variants.
+//
+// | Scheme Name | Sign Function | Verification | Context |
+// |-------------|-------------------|---------------|-------------------|
+// | Ed448 | Sign | Verify | Yes, can be empty |
+// | Ed448Ph | SignPh | VerifyPh | Yes, can be empty |
+// | All above | (PrivateKey).Sign | VerifyAny | As above |
+//
+// Specific functions for sign and verify are defined. A generic signing
+// function for all schemes is available through the crypto.Signer interface,
+// which is implemented by the PrivateKey type. A correspond all-in-one
+// verification method is provided by the VerifyAny function.
+//
+// Both schemes require a context string for domain separation. This parameter
+// is passed using a SignerOptions struct defined in this package.
+//
+// References:
+//
+// - RFC8032: https://rfc-editor.org/rfc/rfc8032.txt
+// - EdDSA for more curves: https://eprint.iacr.org/2015/677
+// - High-speed high-security signatures: https://doi.org/10.1007/s13389-012-0027-1
+package ed448
+
+import (
+ "bytes"
+ "crypto"
+ cryptoRand "crypto/rand"
+ "crypto/subtle"
+ "errors"
+ "fmt"
+ "io"
+ "strconv"
+
+ "github.com/cloudflare/circl/ecc/goldilocks"
+ "github.com/cloudflare/circl/internal/sha3"
+ "github.com/cloudflare/circl/sign"
+)
+
+const (
+ // ContextMaxSize is the maximum length (in bytes) allowed for context.
+ ContextMaxSize = 255
+ // PublicKeySize is the length in bytes of Ed448 public keys.
+ PublicKeySize = 57
+ // PrivateKeySize is the length in bytes of Ed448 private keys.
+ PrivateKeySize = 114
+ // SignatureSize is the length in bytes of signatures.
+ SignatureSize = 114
+ // SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032.
+ SeedSize = 57
+)
+
+const (
+ paramB = 456 / 8 // Size of keys in bytes.
+ hashSize = 2 * paramB // Size of the hash function's output.
+)
+
+// SignerOptions implements crypto.SignerOpts and augments with parameters
+// that are specific to the Ed448 signature schemes.
+type SignerOptions struct {
+ // Hash must be crypto.Hash(0) for both Ed448 and Ed448Ph.
+ crypto.Hash
+
+ // Context is an optional domain separation string for signing.
+ // Its length must be less or equal than 255 bytes.
+ Context string
+
+ // Scheme is an identifier for choosing a signature scheme.
+ Scheme SchemeID
+}
+
+// SchemeID is an identifier for each signature scheme.
+type SchemeID uint
+
+const (
+ ED448 SchemeID = iota
+ ED448Ph
+)
+
+// PublicKey is the type of Ed448 public keys.
+type PublicKey []byte
+
+// Equal reports whether pub and x have the same value.
+func (pub PublicKey) Equal(x crypto.PublicKey) bool {
+ xx, ok := x.(PublicKey)
+ return ok && bytes.Equal(pub, xx)
+}
+
+// PrivateKey is the type of Ed448 private keys. It implements crypto.Signer.
+type PrivateKey []byte
+
+// Equal reports whether priv and x have the same value.
+func (priv PrivateKey) Equal(x crypto.PrivateKey) bool {
+ xx, ok := x.(PrivateKey)
+ return ok && subtle.ConstantTimeCompare(priv, xx) == 1
+}
+
+// Public returns the PublicKey corresponding to priv.
+func (priv PrivateKey) Public() crypto.PublicKey {
+ publicKey := make([]byte, PublicKeySize)
+ copy(publicKey, priv[SeedSize:])
+ return PublicKey(publicKey)
+}
+
+// Seed returns the private key seed corresponding to priv. It is provided for
+// interoperability with RFC 8032. RFC 8032's private keys correspond to seeds
+// in this package.
+func (priv PrivateKey) Seed() []byte {
+ seed := make([]byte, SeedSize)
+ copy(seed, priv[:SeedSize])
+ return seed
+}
+
+func (priv PrivateKey) Scheme() sign.Scheme { return sch }
+
+func (pub PublicKey) Scheme() sign.Scheme { return sch }
+
+func (priv PrivateKey) MarshalBinary() (data []byte, err error) {
+ privateKey := make(PrivateKey, PrivateKeySize)
+ copy(privateKey, priv)
+ return privateKey, nil
+}
+
+func (pub PublicKey) MarshalBinary() (data []byte, err error) {
+ publicKey := make(PublicKey, PublicKeySize)
+ copy(publicKey, pub)
+ return publicKey, nil
+}
+
+// Sign creates a signature of a message given a key pair.
+// This function supports all the two signature variants defined in RFC-8032,
+// namely Ed448 (or pure EdDSA) and Ed448Ph.
+// The opts.HashFunc() must return zero to the specify Ed448 variant. This can
+// be achieved by passing crypto.Hash(0) as the value for opts.
+// Use an Options struct to pass a bool indicating that the ed448Ph variant
+// should be used.
+// The struct can also be optionally used to pass a context string for signing.
+func (priv PrivateKey) Sign(
+ rand io.Reader,
+ message []byte,
+ opts crypto.SignerOpts,
+) (signature []byte, err error) {
+ var ctx string
+ var scheme SchemeID
+
+ if o, ok := opts.(SignerOptions); ok {
+ ctx = o.Context
+ scheme = o.Scheme
+ }
+
+ switch true {
+ case scheme == ED448 && opts.HashFunc() == crypto.Hash(0):
+ return Sign(priv, message, ctx), nil
+ case scheme == ED448Ph && opts.HashFunc() == crypto.Hash(0):
+ return SignPh(priv, message, ctx), nil
+ default:
+ return nil, errors.New("ed448: bad hash algorithm")
+ }
+}
+
+// GenerateKey generates a public/private key pair using entropy from rand.
+// If rand is nil, crypto/rand.Reader will be used.
+func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) {
+ if rand == nil {
+ rand = cryptoRand.Reader
+ }
+
+ seed := make(PrivateKey, SeedSize)
+ if _, err := io.ReadFull(rand, seed); err != nil {
+ return nil, nil, err
+ }
+
+ privateKey := NewKeyFromSeed(seed)
+ publicKey := make([]byte, PublicKeySize)
+ copy(publicKey, privateKey[SeedSize:])
+
+ return publicKey, privateKey, nil
+}
+
+// NewKeyFromSeed calculates a private key from a seed. It will panic if
+// len(seed) is not SeedSize. This function is provided for interoperability
+// with RFC 8032. RFC 8032's private keys correspond to seeds in this
+// package.
+func NewKeyFromSeed(seed []byte) PrivateKey {
+ privateKey := make([]byte, PrivateKeySize)
+ newKeyFromSeed(privateKey, seed)
+ return privateKey
+}
+
+func newKeyFromSeed(privateKey, seed []byte) {
+ if l := len(seed); l != SeedSize {
+ panic("ed448: bad seed length: " + strconv.Itoa(l))
+ }
+
+ var h [hashSize]byte
+ H := sha3.NewShake256()
+ _, _ = H.Write(seed)
+ _, _ = H.Read(h[:])
+ s := &goldilocks.Scalar{}
+ deriveSecretScalar(s, h[:paramB])
+
+ copy(privateKey[:SeedSize], seed)
+ _ = goldilocks.Curve{}.ScalarBaseMult(s).ToBytes(privateKey[SeedSize:])
+}
+
+func signAll(signature []byte, privateKey PrivateKey, message, ctx []byte, preHash bool) {
+ if len(ctx) > ContextMaxSize {
+ panic(fmt.Errorf("ed448: bad context length: %v", len(ctx)))
+ }
+
+ H := sha3.NewShake256()
+ var PHM []byte
+
+ if preHash {
+ var h [64]byte
+ _, _ = H.Write(message)
+ _, _ = H.Read(h[:])
+ PHM = h[:]
+ H.Reset()
+ } else {
+ PHM = message
+ }
+
+ // 1. Hash the 57-byte private key using SHAKE256(x, 114).
+ var h [hashSize]byte
+ _, _ = H.Write(privateKey[:SeedSize])
+ _, _ = H.Read(h[:])
+ s := &goldilocks.Scalar{}
+ deriveSecretScalar(s, h[:paramB])
+ prefix := h[paramB:]
+
+ // 2. Compute SHAKE256(dom4(F, C) || prefix || PH(M), 114).
+ var rPM [hashSize]byte
+ H.Reset()
+
+ writeDom(&H, ctx, preHash)
+
+ _, _ = H.Write(prefix)
+ _, _ = H.Write(PHM)
+ _, _ = H.Read(rPM[:])
+
+ // 3. Compute the point [r]B.
+ r := &goldilocks.Scalar{}
+ r.FromBytes(rPM[:])
+ R := (&[paramB]byte{})[:]
+ if err := (goldilocks.Curve{}.ScalarBaseMult(r).ToBytes(R)); err != nil {
+ panic(err)
+ }
+ // 4. Compute SHAKE256(dom4(F, C) || R || A || PH(M), 114)
+ var hRAM [hashSize]byte
+ H.Reset()
+
+ writeDom(&H, ctx, preHash)
+
+ _, _ = H.Write(R)
+ _, _ = H.Write(privateKey[SeedSize:])
+ _, _ = H.Write(PHM)
+ _, _ = H.Read(hRAM[:])
+
+ // 5. Compute S = (r + k * s) mod order.
+ k := &goldilocks.Scalar{}
+ k.FromBytes(hRAM[:])
+ S := &goldilocks.Scalar{}
+ S.Mul(k, s)
+ S.Add(S, r)
+
+ // 6. The signature is the concatenation of R and S.
+ copy(signature[:paramB], R[:])
+ copy(signature[paramB:], S[:])
+}
+
+// Sign signs the message with privateKey and returns a signature.
+// This function supports the signature variant defined in RFC-8032: Ed448,
+// also known as the pure version of EdDSA.
+// It will panic if len(privateKey) is not PrivateKeySize.
+func Sign(priv PrivateKey, message []byte, ctx string) []byte {
+ signature := make([]byte, SignatureSize)
+ signAll(signature, priv, message, []byte(ctx), false)
+ return signature
+}
+
+// SignPh creates a signature of a message given a keypair.
+// This function supports the signature variant defined in RFC-8032: Ed448ph,
+// meaning it internally hashes the message using SHAKE-256.
+// Context could be passed to this function, which length should be no more than
+// 255. It can be empty.
+func SignPh(priv PrivateKey, message []byte, ctx string) []byte {
+ signature := make([]byte, SignatureSize)
+ signAll(signature, priv, message, []byte(ctx), true)
+ return signature
+}
+
+func verify(public PublicKey, message, signature, ctx []byte, preHash bool) bool {
+ if len(public) != PublicKeySize ||
+ len(signature) != SignatureSize ||
+ len(ctx) > ContextMaxSize ||
+ !isLessThanOrder(signature[paramB:]) {
+ return false
+ }
+
+ P, err := goldilocks.FromBytes(public)
+ if err != nil {
+ return false
+ }
+
+ H := sha3.NewShake256()
+ var PHM []byte
+
+ if preHash {
+ var h [64]byte
+ _, _ = H.Write(message)
+ _, _ = H.Read(h[:])
+ PHM = h[:]
+ H.Reset()
+ } else {
+ PHM = message
+ }
+
+ var hRAM [hashSize]byte
+ R := signature[:paramB]
+
+ writeDom(&H, ctx, preHash)
+
+ _, _ = H.Write(R)
+ _, _ = H.Write(public)
+ _, _ = H.Write(PHM)
+ _, _ = H.Read(hRAM[:])
+
+ k := &goldilocks.Scalar{}
+ k.FromBytes(hRAM[:])
+ S := &goldilocks.Scalar{}
+ S.FromBytes(signature[paramB:])
+
+ encR := (&[paramB]byte{})[:]
+ P.Neg()
+ _ = goldilocks.Curve{}.CombinedMult(S, k, P).ToBytes(encR)
+ return bytes.Equal(R, encR)
+}
+
+// VerifyAny returns true if the signature is valid. Failure cases are invalid
+// signature, or when the public key cannot be decoded.
+// This function supports all the two signature variants defined in RFC-8032,
+// namely Ed448 (or pure EdDSA) and Ed448Ph.
+// The opts.HashFunc() must return zero, this can be achieved by passing
+// crypto.Hash(0) as the value for opts.
+// Use a SignerOptions struct to pass a context string for signing.
+func VerifyAny(public PublicKey, message, signature []byte, opts crypto.SignerOpts) bool {
+ var ctx string
+ var scheme SchemeID
+ if o, ok := opts.(SignerOptions); ok {
+ ctx = o.Context
+ scheme = o.Scheme
+ }
+
+ switch true {
+ case scheme == ED448 && opts.HashFunc() == crypto.Hash(0):
+ return Verify(public, message, signature, ctx)
+ case scheme == ED448Ph && opts.HashFunc() == crypto.Hash(0):
+ return VerifyPh(public, message, signature, ctx)
+ default:
+ return false
+ }
+}
+
+// Verify returns true if the signature is valid. Failure cases are invalid
+// signature, or when the public key cannot be decoded.
+// This function supports the signature variant defined in RFC-8032: Ed448,
+// also known as the pure version of EdDSA.
+func Verify(public PublicKey, message, signature []byte, ctx string) bool {
+ return verify(public, message, signature, []byte(ctx), false)
+}
+
+// VerifyPh returns true if the signature is valid. Failure cases are invalid
+// signature, or when the public key cannot be decoded.
+// This function supports the signature variant defined in RFC-8032: Ed448ph,
+// meaning it internally hashes the message using SHAKE-256.
+// Context could be passed to this function, which length should be no more than
+// 255. It can be empty.
+func VerifyPh(public PublicKey, message, signature []byte, ctx string) bool {
+ return verify(public, message, signature, []byte(ctx), true)
+}
+
+func deriveSecretScalar(s *goldilocks.Scalar, h []byte) {
+ h[0] &= 0xFC // The two least significant bits of the first octet are cleared,
+ h[paramB-1] = 0x00 // all eight bits the last octet are cleared, and
+ h[paramB-2] |= 0x80 // the highest bit of the second to last octet is set.
+ s.FromBytes(h[:paramB])
+}
+
+// isLessThanOrder returns true if 0 <= x < order and if the last byte of x is zero.
+func isLessThanOrder(x []byte) bool {
+ order := goldilocks.Curve{}.Order()
+ i := len(order) - 1
+ for i > 0 && x[i] == order[i] {
+ i--
+ }
+ return x[paramB-1] == 0 && x[i] < order[i]
+}
+
+func writeDom(h io.Writer, ctx []byte, preHash bool) {
+ dom4 := "SigEd448"
+ _, _ = h.Write([]byte(dom4))
+
+ if preHash {
+ _, _ = h.Write([]byte{byte(0x01), byte(len(ctx))})
+ } else {
+ _, _ = h.Write([]byte{byte(0x00), byte(len(ctx))})
+ }
+ _, _ = h.Write(ctx)
+}
diff --git a/vendor/github.com/cloudflare/circl/sign/ed448/signapi.go b/vendor/github.com/cloudflare/circl/sign/ed448/signapi.go
new file mode 100644
index 0000000000..22da8bc0a5
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/sign/ed448/signapi.go
@@ -0,0 +1,87 @@
+package ed448
+
+import (
+ "crypto/rand"
+ "encoding/asn1"
+
+ "github.com/cloudflare/circl/sign"
+)
+
+var sch sign.Scheme = &scheme{}
+
+// Scheme returns a signature interface.
+func Scheme() sign.Scheme { return sch }
+
+type scheme struct{}
+
+func (*scheme) Name() string { return "Ed448" }
+func (*scheme) PublicKeySize() int { return PublicKeySize }
+func (*scheme) PrivateKeySize() int { return PrivateKeySize }
+func (*scheme) SignatureSize() int { return SignatureSize }
+func (*scheme) SeedSize() int { return SeedSize }
+func (*scheme) TLSIdentifier() uint { return 0x0808 }
+func (*scheme) SupportsContext() bool { return true }
+func (*scheme) Oid() asn1.ObjectIdentifier {
+ return asn1.ObjectIdentifier{1, 3, 101, 113}
+}
+
+func (*scheme) GenerateKey() (sign.PublicKey, sign.PrivateKey, error) {
+ return GenerateKey(rand.Reader)
+}
+
+func (*scheme) Sign(
+ sk sign.PrivateKey,
+ message []byte,
+ opts *sign.SignatureOpts,
+) []byte {
+ priv, ok := sk.(PrivateKey)
+ if !ok {
+ panic(sign.ErrTypeMismatch)
+ }
+ ctx := ""
+ if opts != nil {
+ ctx = opts.Context
+ }
+ return Sign(priv, message, ctx)
+}
+
+func (*scheme) Verify(
+ pk sign.PublicKey,
+ message, signature []byte,
+ opts *sign.SignatureOpts,
+) bool {
+ pub, ok := pk.(PublicKey)
+ if !ok {
+ panic(sign.ErrTypeMismatch)
+ }
+ ctx := ""
+ if opts != nil {
+ ctx = opts.Context
+ }
+ return Verify(pub, message, signature, ctx)
+}
+
+func (*scheme) DeriveKey(seed []byte) (sign.PublicKey, sign.PrivateKey) {
+ privateKey := NewKeyFromSeed(seed)
+ publicKey := make(PublicKey, PublicKeySize)
+ copy(publicKey, privateKey[SeedSize:])
+ return publicKey, privateKey
+}
+
+func (*scheme) UnmarshalBinaryPublicKey(buf []byte) (sign.PublicKey, error) {
+ if len(buf) < PublicKeySize {
+ return nil, sign.ErrPubKeySize
+ }
+ pub := make(PublicKey, PublicKeySize)
+ copy(pub, buf[:PublicKeySize])
+ return pub, nil
+}
+
+func (*scheme) UnmarshalBinaryPrivateKey(buf []byte) (sign.PrivateKey, error) {
+ if len(buf) < PrivateKeySize {
+ return nil, sign.ErrPrivKeySize
+ }
+ priv := make(PrivateKey, PrivateKeySize)
+ copy(priv, buf[:PrivateKeySize])
+ return priv, nil
+}
diff --git a/vendor/github.com/cloudflare/circl/sign/sign.go b/vendor/github.com/cloudflare/circl/sign/sign.go
new file mode 100644
index 0000000000..1247f1b626
--- /dev/null
+++ b/vendor/github.com/cloudflare/circl/sign/sign.go
@@ -0,0 +1,119 @@
+// Package sign provides unified interfaces for signature schemes.
+//
+// A register of schemes is available in the package
+//
+// github.com/cloudflare/circl/sign/schemes
+package sign
+
+import (
+ "crypto"
+ "encoding"
+ "errors"
+)
+
+type SignatureOpts struct {
+ // If non-empty, includes the given context in the signature if supported
+ // and will cause an error during signing otherwise.
+ Context string
+}
+
+// A public key is used to verify a signature set by the corresponding private
+// key.
+type PublicKey interface {
+ // Returns the signature scheme for this public key.
+ Scheme() Scheme
+ Equal(crypto.PublicKey) bool
+ encoding.BinaryMarshaler
+ crypto.PublicKey
+}
+
+// A private key allows one to create signatures.
+type PrivateKey interface {
+ // Returns the signature scheme for this private key.
+ Scheme() Scheme
+ Equal(crypto.PrivateKey) bool
+ // For compatibility with Go standard library
+ crypto.Signer
+ crypto.PrivateKey
+ encoding.BinaryMarshaler
+}
+
+// A private key that retains the seed with which it was generated.
+type Seeded interface {
+ // returns the seed if retained, otherwise nil
+ Seed() []byte
+}
+
+// A Scheme represents a specific instance of a signature scheme.
+type Scheme interface {
+ // Name of the scheme.
+ Name() string
+
+ // GenerateKey creates a new key-pair.
+ GenerateKey() (PublicKey, PrivateKey, error)
+
+ // Creates a signature using the PrivateKey on the given message and
+ // returns the signature. opts are additional options which can be nil.
+ //
+ // Panics if key is nil or wrong type or opts context is not supported.
+ Sign(sk PrivateKey, message []byte, opts *SignatureOpts) []byte
+
+ // Checks whether the given signature is a valid signature set by
+ // the private key corresponding to the given public key on the
+ // given message. opts are additional options which can be nil.
+ //
+ // Panics if key is nil or wrong type or opts context is not supported.
+ Verify(pk PublicKey, message []byte, signature []byte, opts *SignatureOpts) bool
+
+ // Deterministically derives a keypair from a seed. If you're unsure,
+ // you're better off using GenerateKey().
+ //
+ // Panics if seed is not of length SeedSize().
+ DeriveKey(seed []byte) (PublicKey, PrivateKey)
+
+ // Unmarshals a PublicKey from the provided buffer.
+ UnmarshalBinaryPublicKey([]byte) (PublicKey, error)
+
+ // Unmarshals a PublicKey from the provided buffer.
+ UnmarshalBinaryPrivateKey([]byte) (PrivateKey, error)
+
+ // Size of binary marshalled public keys.
+ PublicKeySize() int
+
+ // Size of binary marshalled public keys.
+ PrivateKeySize() int
+
+ // Size of signatures.
+ SignatureSize() int
+
+ // Size of seeds.
+ SeedSize() int
+
+ // Returns whether contexts are supported.
+ SupportsContext() bool
+}
+
+var (
+ // ErrTypeMismatch is the error used if types of, for instance, private
+ // and public keys don't match.
+ ErrTypeMismatch = errors.New("types mismatch")
+
+ // ErrSeedSize is the error used if the provided seed is of the wrong
+ // size.
+ ErrSeedSize = errors.New("wrong seed size")
+
+ // ErrPubKeySize is the error used if the provided public key is of
+ // the wrong size.
+ ErrPubKeySize = errors.New("wrong size for public key")
+
+ // ErrPrivKeySize is the error used if the provided private key is of
+ // the wrong size.
+ ErrPrivKeySize = errors.New("wrong size for private key")
+
+ // ErrContextNotSupported is the error used if a context is not
+ // supported.
+ ErrContextNotSupported = errors.New("context not supported")
+
+ // ErrContextTooLong is the error used if the context string is too long.
+ ErrContextTooLong = errors.New("context string too long")
+)
diff --git a/vendor/github.com/go-chi/chi/v5/README.md b/vendor/github.com/go-chi/chi/v5/README.md
index c58a0e20ce..e668e2041d 100644
--- a/vendor/github.com/go-chi/chi/v5/README.md
+++ b/vendor/github.com/go-chi/chi/v5/README.md
@@ -87,7 +87,7 @@ func main() {
// A good base middleware stack
r.Use(middleware.RequestID)
- r.Use(middleware.RealIP)
+ r.Use(middleware.ClientIPFromRemoteAddr) // pick one ClientIPFrom* based on your infra, see below
r.Use(middleware.Logger)
r.Use(middleware.Recoverer)
@@ -221,6 +221,7 @@ type Router interface {
Patch(pattern string, h http.HandlerFunc)
Post(pattern string, h http.HandlerFunc)
Put(pattern string, h http.HandlerFunc)
+ Query(pattern string, h http.HandlerFunc)
Trace(pattern string, h http.HandlerFunc)
// NotFound defines a handler to respond whenever a route could
@@ -349,7 +350,11 @@ with `net/http` can be used with chi's mux.
| [Logger] | Logs the start and end of each request with the elapsed processing time |
| [NoCache] | Sets response headers to prevent clients from caching |
| [Profiler] | Easily attach net/http/pprof to your routers |
-| [RealIP] | Sets a http.Request's RemoteAddr to either X-Real-IP or X-Forwarded-For |
+| [ClientIPFromHeader] | Capture client IP from a trusted single-IP header (X-Real-IP, CF-Connecting-IP, ...) |
+| [ClientIPFromXFF] | Capture client IP from X-Forwarded-For, skipping listed trusted CIDR prefixes |
+| [ClientIPFromXFFTrustedProxies] | Capture client IP from X-Forwarded-For given a fixed number of trusted proxies |
+| [ClientIPFromRemoteAddr] | Capture client IP from the TCP RemoteAddr (server directly on the public internet) |
+| [RealIP] | Deprecated — vulnerable to IP spoofing; use [ClientIPFromXFF] or another ClientIPFrom\* middleware |
| [Recoverer] | Gracefully absorb panics and prints the stack trace |
| [RequestID] | Injects a request ID into the context of each request |
| [RedirectSlashes] | Redirect slashes on routing paths |
@@ -375,6 +380,12 @@ with `net/http` can be used with chi's mux.
[Logger]: https://pkg.go.dev/github.com/go-chi/chi/middleware#Logger
[NoCache]: https://pkg.go.dev/github.com/go-chi/chi/middleware#NoCache
[Profiler]: https://pkg.go.dev/github.com/go-chi/chi/middleware#Profiler
+[ClientIPFromHeader]: https://pkg.go.dev/github.com/go-chi/chi/middleware#ClientIPFromHeader
+[ClientIPFromXFF]: https://pkg.go.dev/github.com/go-chi/chi/middleware#ClientIPFromXFF
+[ClientIPFromXFFTrustedProxies]: https://pkg.go.dev/github.com/go-chi/chi/middleware#ClientIPFromXFFTrustedProxies
+[ClientIPFromRemoteAddr]: https://pkg.go.dev/github.com/go-chi/chi/middleware#ClientIPFromRemoteAddr
+[GetClientIP]: https://pkg.go.dev/github.com/go-chi/chi/middleware#GetClientIP
+[GetClientIPAddr]: https://pkg.go.dev/github.com/go-chi/chi/middleware#GetClientIPAddr
[RealIP]: https://pkg.go.dev/github.com/go-chi/chi/middleware#RealIP
[Recoverer]: https://pkg.go.dev/github.com/go-chi/chi/middleware#Recoverer
[RedirectSlashes]: https://pkg.go.dev/github.com/go-chi/chi/middleware#RedirectSlashes
@@ -402,6 +413,62 @@ with `net/http` can be used with chi's mux.
[ThrottleOpts]: https://pkg.go.dev/github.com/go-chi/chi/middleware#ThrottleOpts
[WrapResponseWriter]: https://pkg.go.dev/github.com/go-chi/chi/middleware#WrapResponseWriter
+### Choosing a ClientIP middleware
+
+The legacy [RealIP] middleware is deprecated — it is vulnerable to IP spoofing
+(GHSA-3fxj-6jh8-hvhx, GHSA-rjr7-jggh-pgcp, GHSA-9g5q-2w5x-hmxf) and mutates
+`r.RemoteAddr`. Use one of the four `ClientIPFrom*` middlewares instead — pick
+exactly one based on your network setup — and read the resulting IP with
+[GetClientIP] (string) or [GetClientIPAddr] (`netip.Addr`):
+
+| Your setup | Use |
+|---|---|
+| Directly on the public internet, no proxy | `middleware.ClientIPFromRemoteAddr` |
+| Behind nginx (`X-Real-IP`), Cloudflare (`CF-Connecting-IP`), Apache (`X-Client-IP`) | `middleware.ClientIPFromHeader("")` |
+| Behind one or more proxies whose IP ranges you can list | `middleware.ClientIPFromXFF("10.0.0.0/8", ...)` |
+| Behind a known, fixed number of proxies with dynamic IPs | `middleware.ClientIPFromXFFTrustedProxies(2)` |
+
+```go
+r := chi.NewRouter()
+r.Use(middleware.RequestID)
+
+// Pick exactly one. Examples for common deployments:
+
+// Direct internet exposure (no proxy):
+// r.Use(middleware.ClientIPFromRemoteAddr)
+
+// Behind Cloudflare:
+// r.Use(middleware.ClientIPFromHeader("CF-Connecting-IP"))
+
+// Behind AWS CloudFront (or any proxy fleet with known CIDRs):
+r.Use(middleware.ClientIPFromXFF(
+ "13.32.0.0/15", // CloudFront IPv4
+ "52.46.0.0/18", // CloudFront IPv4
+ "2600:9000::/28", // CloudFront IPv6
+))
+
+// Behind a known number of proxies with dynamic IPs:
+// r.Use(middleware.ClientIPFromXFFTrustedProxies(2))
+
+r.Use(middleware.Logger)
+r.Use(middleware.Recoverer)
+
+r.Get("/", func(w http.ResponseWriter, r *http.Request) {
+ clientIP := middleware.GetClientIP(r.Context()) // for logs, rate-limit keys, etc.
+ _ = clientIP
+})
+```
+
+These middlewares never mutate `r.RemoteAddr`. They store a normalized
+`netip.Addr` in the request context — IPv4-mapped IPv6 (`::ffff:a.b.c.d`)
+is folded to plain IPv4, and IPv6 zone identifiers carried in headers are
+stripped, so one logical client maps to a single canonical key for logs,
+rate limits, and ACLs.
+
+See the per-function godoc for the full semantics of each middleware, and
+[adam-p's "The perils of the 'real' client IP"](https://adam-p.ca/blog/2022/03/x-forwarded-for/)
+for the underlying threat model.
+
### Extra middlewares & packages
Please see https://github.com/go-chi for additional packages.
diff --git a/vendor/github.com/go-chi/chi/v5/chi.go b/vendor/github.com/go-chi/chi/v5/chi.go
index f650116a87..cb129e3054 100644
--- a/vendor/github.com/go-chi/chi/v5/chi.go
+++ b/vendor/github.com/go-chi/chi/v5/chi.go
@@ -77,7 +77,7 @@ type Router interface {
// path, with a fresh middleware stack for the inline-Router.
Group(fn func(r Router)) Router
- // Route mounts a sub-Router along a `pattern`` string.
+ // Route mounts a sub-Router along a `pattern` string.
Route(pattern string, fn func(r Router)) Router
// Mount attaches another http.Handler along ./pattern/*
@@ -102,6 +102,7 @@ type Router interface {
Patch(pattern string, h http.HandlerFunc)
Post(pattern string, h http.HandlerFunc)
Put(pattern string, h http.HandlerFunc)
+ Query(pattern string, h http.HandlerFunc)
Trace(pattern string, h http.HandlerFunc)
// NotFound defines a handler to respond whenever a route could
diff --git a/vendor/github.com/go-chi/chi/v5/middleware/client_ip.go b/vendor/github.com/go-chi/chi/v5/middleware/client_ip.go
new file mode 100644
index 0000000000..1495a86253
--- /dev/null
+++ b/vendor/github.com/go-chi/chi/v5/middleware/client_ip.go
@@ -0,0 +1,263 @@
+package middleware
+
+import (
+ "context"
+ "net"
+ "net/http"
+ "net/netip"
+ "strings"
+)
+
+// clientIPCtxKey stores the client IP set by any of the ClientIPFrom* middlewares.
+var clientIPCtxKey = &contextKey{"clientIP"}
+
+// xForwardedForHeader is the canonical form of the X-Forwarded-For header
+// name, used by the XFF-based middlewares.
+const xForwardedForHeader = "X-Forwarded-For"
+
+// ClientIPFromHeader stores the client IP from a single-IP header set by
+// your reverse proxy. Read it with [GetClientIP].
+//
+// Only safe with headers your proxy unconditionally OVERWRITES on every
+// request, e.g.:
+//
+// - X-Real-IP — Nginx with ngx_http_realip_module
+// - X-Client-IP — Apache with mod_remoteip
+// - CF-Connecting-IP — Cloudflare
+//
+// True-Client-IP, X-Azure-ClientIP, and Fastly-Client-IP look similar but
+// pass through from the client by default in those products; don't use them
+// unless your edge strips the inbound value.
+//
+// If the header reaches us with multiple values (misconfigured proxy that
+// appends, or a downstream proxy not stripping a client-supplied value),
+// the LAST value wins — that's the one set by the hop closest to us, and
+// therefore the most trusted. Fail-closed if the last value doesn't parse:
+// no client IP is set rather than falling back to earlier (less-trusted)
+// values.
+//
+// v4-mapped IPv6 (::ffff:a.b.c.d) folds to plain v4 and IPv6 zones are
+// stripped before storage.
+func ClientIPFromHeader(trustedHeader string) func(http.Handler) http.Handler {
+ header := http.CanonicalHeaderKey(trustedHeader)
+ return func(h http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ values := r.Header.Values(header)
+ if len(values) > 0 {
+ if ip, ok := parseHeaderAddr(values[len(values)-1]); ok {
+ r = r.WithContext(context.WithValue(r.Context(), clientIPCtxKey, ip))
+ }
+ }
+ h.ServeHTTP(w, r)
+ })
+ }
+}
+
+// ClientIPFromXFF stores the client IP read from the X-Forwarded-For header,
+// walking the chain right-to-left and skipping any IP that falls within one
+// of the given trusted CIDR prefixes. The first IP that is not trusted is
+// the client. Read it with [GetClientIP].
+//
+// An unparseable entry mid-chain aborts the walk and leaves no client IP
+// set (fail-closed) — we can't safely trust anything left of garbage.
+//
+// Use this when you sit behind one or more reverse proxies whose IP ranges
+// you can enumerate as CIDRs:
+//
+// r.Use(middleware.ClientIPFromXFF(
+// "13.32.0.0/15", // CloudFront IPv4
+// "52.46.0.0/18", // CloudFront IPv4
+// "2600:9000::/28", // CloudFront IPv6
+// ))
+//
+// Calling with no arguments returns the rightmost XFF entry, or no IP if
+// that entry doesn't parse (fail-closed) — safe only if you have exactly
+// one trusted hop directly in front of this server (e.g., nginx on localhost).
+//
+// v4-mapped IPv6 (::ffff:a.b.c.d) folds to plain v4 and IPv6 zones are
+// stripped before the prefix check and storage; otherwise an attacker
+// could use either notation to alias a trusted IP past the check.
+//
+// If you know the number of trusted proxies but not their IPs, use
+// [ClientIPFromXFFTrustedProxies] instead.
+//
+// Panics at startup if any prefix is invalid.
+func ClientIPFromXFF(trustedIPPrefixes ...string) func(http.Handler) http.Handler {
+ prefixes := make([]netip.Prefix, len(trustedIPPrefixes))
+ for i, p := range trustedIPPrefixes {
+ prefixes[i] = netip.MustParsePrefix(p)
+ }
+ return func(h http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ var found netip.Addr
+ walkXFF(r.Header[xForwardedForHeader], func(v string) bool {
+ ip, ok := parseHeaderAddr(v)
+ if !ok {
+ return true // fail-closed; leave found unset
+ }
+ if inAnyPrefix(ip, prefixes) {
+ return false // trusted hop; keep walking left
+ }
+ found = ip
+ return true
+ })
+ if found.IsValid() {
+ r = r.WithContext(context.WithValue(r.Context(), clientIPCtxKey, found))
+ }
+ h.ServeHTTP(w, r)
+ })
+ }
+}
+
+// ClientIPFromXFFTrustedProxies stores the client IP read from the
+// X-Forwarded-For header, given the exact number of trusted reverse proxies
+// between this server and the public internet. It returns the IP at position
+// len(xff) - numTrustedProxies in the merged X-Forwarded-For list — the IP
+// added by the outermost of your trusted proxies, the only IP in the chain
+// that none of your proxies have allowed an attacker to forge. Read it with
+// [GetClientIP].
+//
+// Use this when:
+// - You know exactly how many proxies you sit behind, AND
+// - Their IP addresses are dynamic (autoscaling proxy pools, ephemeral
+// containers, dynamic CDN edges) so listing CIDRs with [ClientIPFromXFF]
+// is impractical.
+//
+// WARNING: This variant is brittle to network architecture changes. If you
+// add or remove a proxy level, numTrustedProxies silently becomes wrong and
+// you may start trusting an attacker-supplied IP. Prefer [ClientIPFromXFF]
+// with explicit trusted CIDRs whenever you can.
+//
+// If the XFF chain has fewer than numTrustedProxies entries (header missing
+// or architecture changed), no client IP is set and [GetClientIP] returns "".
+//
+// Like [ClientIPFromXFF], v4-mapped IPv6 folds to plain v4 and IPv6 zones
+// are stripped before storage.
+//
+// Panics at startup if numTrustedProxies < 1.
+func ClientIPFromXFFTrustedProxies(numTrustedProxies int) func(http.Handler) http.Handler {
+ if numTrustedProxies < 1 {
+ panic("middleware.ClientIPFromXFFTrustedProxies: numTrustedProxies must be >= 1")
+ }
+ return func(h http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ n := numTrustedProxies
+ var entry string
+ walkXFF(r.Header[xForwardedForHeader], func(v string) bool {
+ n--
+ if n == 0 {
+ entry = v
+ return true
+ }
+ return false
+ })
+ if entry != "" {
+ if ip, ok := parseHeaderAddr(entry); ok {
+ r = r.WithContext(context.WithValue(r.Context(), clientIPCtxKey, ip))
+ }
+ }
+ h.ServeHTTP(w, r)
+ })
+ }
+}
+
+// ClientIPFromRemoteAddr stores the client IP read from the TCP RemoteAddr
+// of the incoming request — the IP address of whoever opened the connection
+// to this server. Read it with [GetClientIP].
+//
+// Use this when this server is directly connected to the public internet
+// with NO reverse proxy in front of it. Behind a reverse proxy, RemoteAddr
+// is the proxy's IP, not the client's — use [ClientIPFromHeader] or
+// [ClientIPFromXFF] instead.
+//
+// IPv4 clients on a dual-stack listener surface as ::ffff:a.b.c.d; they
+// fold to plain v4 before storage so one logical client maps to one key.
+// IPv6 zones are preserved (link-local connections may legitimately have one).
+func ClientIPFromRemoteAddr(h http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ host, _, err := net.SplitHostPort(r.RemoteAddr)
+ if err != nil {
+ host = r.RemoteAddr // RemoteAddr may already be a bare IP (e.g. in tests).
+ }
+ if ip, err := netip.ParseAddr(host); err == nil {
+ r = r.WithContext(context.WithValue(r.Context(), clientIPCtxKey, ip.Unmap()))
+ }
+ h.ServeHTTP(w, r)
+ })
+}
+
+// GetClientIP returns the client IP as a string, as set by one of the
+// ClientIPFrom* middlewares. Returns "" if no valid IP was set.
+// Convenient for logging, rate-limit keys, etc.
+func GetClientIP(ctx context.Context) string {
+ ip := GetClientIPAddr(ctx)
+ if !ip.IsValid() {
+ return ""
+ }
+ return ip.String()
+}
+
+// GetClientIPAddr returns the client IP as a [netip.Addr], as set by one of
+// the ClientIPFrom* middlewares. The returned Addr is the zero value if not
+// set; use [netip.Addr.IsValid] to check. Useful when you need typed work —
+// prefix containment, Is4/Is6, etc. — without re-parsing the string.
+func GetClientIPAddr(ctx context.Context) netip.Addr {
+ ip, _ := ctx.Value(clientIPCtxKey).(netip.Addr)
+ return ip
+}
+
+// walkXFF walks the entries of the merged X-Forwarded-For chain
+// RIGHT-TO-LEFT, invoking visit on each trimmed non-empty entry. visit
+// returns true to stop the walk. Lazy walk, zero allocations (entries
+// are substrings of the input headers).
+//
+// Multiple XFF headers are merged per RFC 2616 — each header's
+// comma-separated entries in order received — so an attacker cannot pick
+// which value security logic sees by sending a duplicate header.
+func walkXFF(headers []string, visit func(entry string) bool) {
+ for hi := len(headers) - 1; hi >= 0; hi-- {
+ h := headers[hi]
+ for h != "" {
+ var v string
+ if i := strings.LastIndexByte(h, ','); i >= 0 {
+ v, h = h[i+1:], h[:i]
+ } else {
+ v, h = h, ""
+ }
+ v = strings.TrimSpace(v)
+ if v == "" {
+ continue
+ }
+ if visit(v) {
+ return
+ }
+ }
+ }
+}
+
+// inAnyPrefix reports whether ip falls within any of the given prefixes.
+func inAnyPrefix(ip netip.Addr, prefixes []netip.Prefix) bool {
+ for _, p := range prefixes {
+ if p.Contains(ip) {
+ return true
+ }
+ }
+ return false
+}
+
+// parseHeaderAddr parses s and normalizes for storage: v4-mapped IPv6
+// (::ffff:a.b.c.d) folds to plain v4, IPv6 zone is stripped. Both defend the
+// trust-prefix check against attacker-injected aliases — [netip.Prefix.Contains]
+// returns false for v4-mapped addresses vs v4 prefixes and for any zoned
+// address, so without folding/stripping an attacker could escape an
+// otherwise valid trust list.
+//
+// Header-sourced IPs only. [ClientIPFromRemoteAddr] normalizes inline
+// (Unmap, but zone preserved for legitimate link-local connections).
+func parseHeaderAddr(s string) (netip.Addr, bool) {
+ ip, err := netip.ParseAddr(s)
+ if err != nil {
+ return netip.Addr{}, false
+ }
+ return ip.Unmap().WithZone(""), true
+}
diff --git a/vendor/github.com/go-chi/chi/v5/middleware/compress.go b/vendor/github.com/go-chi/chi/v5/middleware/compress.go
index 9c64bd48dc..2c963c5d13 100644
--- a/vendor/github.com/go-chi/chi/v5/middleware/compress.go
+++ b/vendor/github.com/go-chi/chi/v5/middleware/compress.go
@@ -23,6 +23,8 @@ var defaultCompressibleContentTypes = []string{
"application/json",
"application/atom+xml",
"application/rss+xml",
+ "application/xml",
+ "text/xml",
"image/svg+xml",
}
@@ -70,8 +72,8 @@ func NewCompressor(level int, types ...string) *Compressor {
if strings.Contains(strings.TrimSuffix(t, "/*"), "*") {
panic(fmt.Sprintf("middleware/compress: Unsupported content-type wildcard pattern '%s'. Only '/*' supported", t))
}
- if strings.HasSuffix(t, "/*") {
- allowedWildcards[strings.TrimSuffix(t, "/*")] = struct{}{}
+ if before, ok := strings.CutSuffix(t, "/*"); ok {
+ allowedWildcards[before] = struct{}{}
} else {
allowedTypes[t] = struct{}{}
}
diff --git a/vendor/github.com/go-chi/chi/v5/middleware/logger.go b/vendor/github.com/go-chi/chi/v5/middleware/logger.go
index cff9bd2062..ba5391f64a 100644
--- a/vendor/github.com/go-chi/chi/v5/middleware/logger.go
+++ b/vendor/github.com/go-chi/chi/v5/middleware/logger.go
@@ -96,6 +96,8 @@ type DefaultLogFormatter struct {
// NewLogEntry creates a new LogEntry for the request.
func (l *DefaultLogFormatter) NewLogEntry(r *http.Request) LogEntry {
+ ctx := r.Context()
+
useColor := !l.NoColor
entry := &defaultLogEntry{
DefaultLogFormatter: l,
@@ -104,7 +106,7 @@ func (l *DefaultLogFormatter) NewLogEntry(r *http.Request) LogEntry {
useColor: useColor,
}
- reqID := GetReqID(r.Context())
+ reqID := GetReqID(ctx)
if reqID != "" {
cW(entry.buf, useColor, nYellow, "[%s] ", reqID)
}
@@ -118,7 +120,11 @@ func (l *DefaultLogFormatter) NewLogEntry(r *http.Request) LogEntry {
cW(entry.buf, useColor, nCyan, "%s://%s%s %s\" ", scheme, r.Host, r.RequestURI, r.Proto)
entry.buf.WriteString("from ")
- entry.buf.WriteString(r.RemoteAddr)
+ clientIP := GetClientIP(ctx)
+ if clientIP == "" {
+ clientIP = r.RemoteAddr
+ }
+ entry.buf.WriteString(clientIP)
entry.buf.WriteString(" - ")
return entry
@@ -160,7 +166,7 @@ func (l *defaultLogEntry) Write(status, bytes int, header http.Header, elapsed t
}
func (l *defaultLogEntry) Panic(v interface{}, stack []byte) {
- PrintPrettyStack(v)
+ printPrettyStack(v, l.useColor)
}
func init() {
diff --git a/vendor/github.com/go-chi/chi/v5/middleware/profiler.go b/vendor/github.com/go-chi/chi/v5/middleware/profiler.go
index 0ad6a996bc..5784ff68e3 100644
--- a/vendor/github.com/go-chi/chi/v5/middleware/profiler.go
+++ b/vendor/github.com/go-chi/chi/v5/middleware/profiler.go
@@ -1,5 +1,4 @@
//go:build !tinygo
-// +build !tinygo
package middleware
diff --git a/vendor/github.com/go-chi/chi/v5/middleware/realip.go b/vendor/github.com/go-chi/chi/v5/middleware/realip.go
index afcb79e201..349f168218 100644
--- a/vendor/github.com/go-chi/chi/v5/middleware/realip.go
+++ b/vendor/github.com/go-chi/chi/v5/middleware/realip.go
@@ -17,17 +17,14 @@ var xRealIP = http.CanonicalHeaderKey("X-Real-IP")
// of parsing either the True-Client-IP, X-Real-IP or the X-Forwarded-For headers
// (in that order).
//
-// This middleware should be inserted fairly early in the middleware stack to
-// ensure that subsequent layers (e.g., request loggers) which examine the
-// RemoteAddr will see the intended value.
+// Deprecated: RealIP is vulnerable to IP spoofing — it mutates r.RemoteAddr
+// to the leftmost X-Forwarded-For value, or to True-Client-IP / X-Real-IP
+// whether or not your infrastructure actually sets them. See
+// GHSA-3fxj-6jh8-hvhx, GHSA-rjr7-jggh-pgcp, GHSA-9g5q-2w5x-hmxf.
//
-// You should only use this middleware if you can trust the headers passed to
-// you (in particular, the three headers this middleware uses), for example
-// because you have placed a reverse proxy like HAProxy or nginx in front of
-// chi. If your reverse proxies are configured to pass along arbitrary header
-// values from the client, or if you use this middleware without a reverse
-// proxy, malicious clients will be able to make you very sad (or, depending on
-// how you're using RemoteAddr, vulnerable to an attack of some sort).
+// Use [ClientIPFromHeader], [ClientIPFromXFF], [ClientIPFromXFFTrustedProxies]
+// or [ClientIPFromRemoteAddr] and read the IP with [GetClientIP] instead.
+// These never mutate r.RemoteAddr.
func RealIP(h http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
if rip := realIP(r); rip != "" {
diff --git a/vendor/github.com/go-chi/chi/v5/middleware/recoverer.go b/vendor/github.com/go-chi/chi/v5/middleware/recoverer.go
index 81342dfa7d..ba77de74fb 100644
--- a/vendor/github.com/go-chi/chi/v5/middleware/recoverer.go
+++ b/vendor/github.com/go-chi/chi/v5/middleware/recoverer.go
@@ -52,9 +52,16 @@ func Recoverer(next http.Handler) http.Handler {
var recovererErrorWriter io.Writer = os.Stderr
func PrintPrettyStack(rvr interface{}) {
+ printPrettyStack(rvr, true)
+}
+
+// printPrettyStack prints a formatted stack trace to stderr. When useColor is
+// false, ANSI colour codes are suppressed, which is useful for terminals that
+// do not support them (e.g. on Windows) or when output is being captured.
+func printPrettyStack(rvr interface{}, useColor bool) {
debugStack := debug.Stack()
s := prettyStack{}
- out, err := s.parse(debugStack, rvr)
+ out, err := s.parse(debugStack, rvr, useColor)
if err == nil {
recovererErrorWriter.Write(out)
} else {
@@ -66,9 +73,8 @@ func PrintPrettyStack(rvr interface{}) {
type prettyStack struct {
}
-func (s prettyStack) parse(debugStack []byte, rvr interface{}) ([]byte, error) {
+func (s prettyStack) parse(debugStack []byte, rvr interface{}, useColor bool) ([]byte, error) {
var err error
- useColor := true
buf := &bytes.Buffer{}
cW(buf, false, bRed, "\n")
diff --git a/vendor/github.com/go-chi/chi/v5/middleware/wrap_writer.go b/vendor/github.com/go-chi/chi/v5/middleware/wrap_writer.go
index 367e0fcd92..936ce7e803 100644
--- a/vendor/github.com/go-chi/chi/v5/middleware/wrap_writer.go
+++ b/vendor/github.com/go-chi/chi/v5/middleware/wrap_writer.go
@@ -207,9 +207,13 @@ func (f *http2FancyWriter) Push(target string, opts *http.PushOptions) error {
}
func (f *httpFancyWriter) ReadFrom(r io.Reader) (int64, error) {
- if f.basicWriter.tee != nil {
+ if f.basicWriter.tee != nil || f.basicWriter.discard {
+ // Route through basicWriter.Write so that the tee and discard semantics
+ // are honored (the fast ReaderFrom path below would bypass both, writing
+ // straight to the original ResponseWriter). basicWriter.Write already
+ // increments basicWriter.bytes, so we must NOT add n again here (that
+ // would double-count).
n, err := io.Copy(&f.basicWriter, r)
- f.basicWriter.bytes += int(n)
return n, err
}
rf := f.basicWriter.ResponseWriter.(io.ReaderFrom)
diff --git a/vendor/github.com/go-chi/chi/v5/mux.go b/vendor/github.com/go-chi/chi/v5/mux.go
index 71652dd17a..37cd50043f 100644
--- a/vendor/github.com/go-chi/chi/v5/mux.go
+++ b/vendor/github.com/go-chi/chi/v5/mux.go
@@ -186,6 +186,12 @@ func (mx *Mux) Put(pattern string, handlerFn http.HandlerFunc) {
mx.handle(mPUT, pattern, handlerFn)
}
+// Query adds the route `pattern` that matches a QUERY http method to
+// execute the `handlerFn` http.HandlerFunc.
+func (mx *Mux) Query(pattern string, handlerFn http.HandlerFunc) {
+ mx.handle(mQUERY, pattern, handlerFn)
+}
+
// Trace adds the route `pattern` that matches a TRACE http method to
// execute the `handlerFn` http.HandlerFunc.
func (mx *Mux) Trace(pattern string, handlerFn http.HandlerFunc) {
@@ -472,9 +478,7 @@ func (mx *Mux) routeHTTP(w http.ResponseWriter, r *http.Request) {
value := rctx.URLParams.Values[i]
r.SetPathValue(key, value)
}
- if supportsPattern {
- setPattern(rctx, r)
- }
+ r.Pattern = rctx.RoutePattern()
h.ServeHTTP(w, r)
return
diff --git a/vendor/github.com/go-chi/chi/v5/pattern.go b/vendor/github.com/go-chi/chi/v5/pattern.go
deleted file mode 100644
index 890a2c217f..0000000000
--- a/vendor/github.com/go-chi/chi/v5/pattern.go
+++ /dev/null
@@ -1,16 +0,0 @@
-//go:build go1.23 && !tinygo
-// +build go1.23,!tinygo
-
-package chi
-
-import "net/http"
-
-// supportsPattern is true if the Go version is 1.23 and above.
-//
-// If this is true, `net/http.Request` has field `Pattern`.
-const supportsPattern = true
-
-// setPattern sets the mux matched pattern in the http Request.
-func setPattern(rctx *Context, r *http.Request) {
- r.Pattern = rctx.routePattern
-}
diff --git a/vendor/github.com/go-chi/chi/v5/pattern_fallback.go b/vendor/github.com/go-chi/chi/v5/pattern_fallback.go
deleted file mode 100644
index 48a94ef82d..0000000000
--- a/vendor/github.com/go-chi/chi/v5/pattern_fallback.go
+++ /dev/null
@@ -1,17 +0,0 @@
-//go:build !go1.23 || tinygo
-// +build !go1.23 tinygo
-
-package chi
-
-import "net/http"
-
-// supportsPattern is true if the Go version is 1.23 and above.
-//
-// If this is true, `net/http.Request` has field `Pattern`.
-const supportsPattern = false
-
-// setPattern sets the mux matched pattern in the http Request.
-//
-// setPattern is only supported in Go 1.23 and above so
-// this is just a blank function so that it compiles.
-func setPattern(rctx *Context, r *http.Request) {}
diff --git a/vendor/github.com/go-chi/chi/v5/tree.go b/vendor/github.com/go-chi/chi/v5/tree.go
index 8b1ed19958..74ff43db16 100644
--- a/vendor/github.com/go-chi/chi/v5/tree.go
+++ b/vendor/github.com/go-chi/chi/v5/tree.go
@@ -8,6 +8,7 @@ import (
"fmt"
"net/http"
"regexp"
+ "slices"
"sort"
"strconv"
"strings"
@@ -25,11 +26,17 @@ const (
mPATCH
mPOST
mPUT
+ mQUERY
mTRACE
)
var mALL = mCONNECT | mDELETE | mGET | mHEAD |
- mOPTIONS | mPATCH | mPOST | mPUT | mTRACE
+ mOPTIONS | mPATCH | mPOST | mPUT | mQUERY | mTRACE
+
+// methodQuery is the HTTP QUERY method (RFC 10008), a safe, idempotent
+// method that conveys a request body. It is defined here until net/http
+// provides an equivalent constant, at which point this is a 1-1 swap.
+const methodQuery = "QUERY"
var methodMap = map[string]methodTyp{
http.MethodConnect: mCONNECT,
@@ -40,6 +47,7 @@ var methodMap = map[string]methodTyp{
http.MethodPatch: mPATCH,
http.MethodPost: mPOST,
http.MethodPut: mPUT,
+ methodQuery: mQUERY,
http.MethodTrace: mTRACE,
}
@@ -52,6 +60,7 @@ var reverseMethodMap = map[methodTyp]string{
mPATCH: http.MethodPatch,
mPOST: http.MethodPost,
mPUT: http.MethodPut,
+ mQUERY: methodQuery,
mTRACE: http.MethodTrace,
}
@@ -836,11 +845,15 @@ func Walk(r Routes, walkFn WalkFunc) error {
func walk(r Routes, walkFn WalkFunc, parentRoute string, parentMw ...func(http.Handler) http.Handler) error {
for _, route := range r.Routes() {
- mws := make([]func(http.Handler) http.Handler, len(parentMw))
- copy(mws, parentMw)
- mws = append(mws, r.Middlewares()...)
+ mws := slices.Concat(parentMw, r.Middlewares())
if route.SubRoutes != nil {
+ if handler, ok := route.Handlers["*"]; ok {
+ if chain, ok := handler.(*ChainHandler); ok {
+ mws = append(mws, chain.Middlewares...)
+ }
+ }
+
if err := walk(route.SubRoutes, walkFn, parentRoute+route.Pattern, mws...); err != nil {
return err
}
@@ -854,7 +867,7 @@ func walk(r Routes, walkFn WalkFunc, parentRoute string, parentMw ...func(http.H
}
fullRoute := parentRoute + route.Pattern
- fullRoute = strings.Replace(fullRoute, "/*/", "/", -1)
+ fullRoute = strings.ReplaceAll(fullRoute, "/*/", "/")
if chain, ok := handler.(*ChainHandler); ok {
if err := walkFn(method, fullRoute, chain.Endpoint, append(mws, chain.Middlewares...)...); err != nil {
diff --git a/vendor/github.com/go-openapi/analysis/.golangci.yml b/vendor/github.com/go-openapi/analysis/.golangci.yml
index b97d68077f..0d7baa1d7f 100644
--- a/vendor/github.com/go-openapi/analysis/.golangci.yml
+++ b/vendor/github.com/go-openapi/analysis/.golangci.yml
@@ -4,8 +4,11 @@ linters:
disable:
- depguard
- funlen
+ - goconst
- godox
- gomoddirectives
+ - gomodguard
+ - gomodguard_v2
- exhaustruct
- nlreturn
- nonamedreturns
diff --git a/vendor/github.com/go-openapi/analysis/CONTRIBUTORS.md b/vendor/github.com/go-openapi/analysis/CONTRIBUTORS.md
index d86830a0f3..89eb5b0b35 100644
--- a/vendor/github.com/go-openapi/analysis/CONTRIBUTORS.md
+++ b/vendor/github.com/go-openapi/analysis/CONTRIBUTORS.md
@@ -4,11 +4,11 @@
| Total Contributors | Total Contributions |
| --- | --- |
-| 22 | 267 |
+| 22 | 276 |
| Username | All Time Contribution Count | All Commits |
| --- | --- | --- |
-| @fredbi | 127 | |
+| @fredbi | 136 | |
| @casualjim | 91 | |
| @keramix | 9 | |
| @youyuanwu | 8 | |
diff --git a/vendor/github.com/go-openapi/analysis/README.md b/vendor/github.com/go-openapi/analysis/README.md
index e4e3086598..2a90462974 100644
--- a/vendor/github.com/go-openapi/analysis/README.md
+++ b/vendor/github.com/go-openapi/analysis/README.md
@@ -18,12 +18,9 @@ A foundational library to analyze, diff, flatten, merge, and fix OAI specificati
* **2025-12-19** : new community chat on discord
* a new discord community channel is available to be notified of changes and support users
- * our venerable Slack channel remains open, and will be eventually discontinued on **2026-03-31**
You may join the discord community by clicking the invite link on the discord badge (also above). [![Discord Channel][discord-badge]][discord-url]
-Or join our Slack channel: [![Slack Channel][slack-logo]![slack-badge]][slack-url]
-
## Status
API is stable.
@@ -79,9 +76,9 @@ on top of which it has been built.
## Other documentation
* [All-time contributors](./CONTRIBUTORS.md)
-* [Contributing guidelines](.github/CONTRIBUTING.md)
-* [Maintainers documentation](docs/MAINTAINERS.md)
-* [Code style](docs/STYLE.md)
+* [Contributing guidelines][contributing-doc-site]
+* [Maintainers documentation][maintainers-doc-site]
+* [Code style][style-doc-site]
## Cutting a new release
@@ -112,9 +109,6 @@ Maintainers can cut a new release by either:
[godoc-badge]: https://pkg.go.dev/badge/github.com/go-openapi/analysis
[godoc-url]: http://pkg.go.dev/github.com/go-openapi/analysis
-[slack-logo]: https://a.slack-edge.com/e6a93c1/img/icons/favicon-32.png
-[slack-badge]: https://img.shields.io/badge/slack-blue?link=https%3A%2F%2Fgoswagger.slack.com%2Farchives%2FC04R30YM
-[slack-url]: https://goswagger.slack.com/archives/C04R30YMU
[discord-badge]: https://img.shields.io/discord/1446918742398341256?logo=discord&label=discord&color=blue
[discord-url]: https://discord.gg/FfnFYaC3k5
@@ -126,3 +120,7 @@ Maintainers can cut a new release by either:
[goversion-url]: https://github.com/go-openapi/analysis/blob/master/go.mod
[top-badge]: https://img.shields.io/github/languages/top/go-openapi/analysis
[commits-badge]: https://img.shields.io/github/commits-since/go-openapi/analysis/latest
+
+[contributing-doc-site]: https://go-openapi.github.io/doc-site/contributing/contributing/index.html
+[maintainers-doc-site]: https://go-openapi.github.io/doc-site/maintainers/index.html
+[style-doc-site]: https://go-openapi.github.io/doc-site/contributing/style/index.html
diff --git a/vendor/github.com/go-openapi/analysis/analyzer.go b/vendor/github.com/go-openapi/analysis/analyzer.go
index c24811aaeb..9eab8bd370 100644
--- a/vendor/github.com/go-openapi/analysis/analyzer.go
+++ b/vendor/github.com/go-openapi/analysis/analyzer.go
@@ -585,6 +585,20 @@ func (s *Spec) AllRefs() (result []spec.Ref) {
return
}
+// AllRefsByLocation returns all the references found in the document, keyed by
+// where each one is declared.
+//
+// Keys are local JSON references into the analyzed document, with tokens
+// escaped as per RFC 6901, e.g. "#/paths/~1pets/get/responses/200/schema".
+//
+// Unlike [Spec.AllRefs], the result is not deduplicated: the same reference
+// declared in several places appears under each of its locations.
+//
+// The map is cloned to avoid accidental changes.
+func (s *Spec) AllRefsByLocation() map[string]spec.Ref {
+ return cloneRefMap(s.references.allRefs)
+}
+
// ParameterPatterns returns all the patterns found in parameters
// the map is cloned to avoid accidental changes.
func (s *Spec) ParameterPatterns() map[string]string {
@@ -1053,6 +1067,13 @@ func cloneStringMap(source map[string]string) map[string]string {
return res
}
+func cloneRefMap(source map[string]spec.Ref) map[string]spec.Ref {
+ res := make(map[string]spec.Ref, len(source))
+ maps.Copy(res, source)
+
+ return res
+}
+
func cloneEnumMap(source map[string][]any) map[string][]any {
res := make(map[string][]any, len(source))
maps.Copy(res, source)
diff --git a/vendor/github.com/go-openapi/analysis/flatten.go b/vendor/github.com/go-openapi/analysis/flatten.go
index 1e5016664d..c90456f6a0 100644
--- a/vendor/github.com/go-openapi/analysis/flatten.go
+++ b/vendor/github.com/go-openapi/analysis/flatten.go
@@ -243,7 +243,7 @@ func nameInlinedSchemas(opts *FlattenOpts) error {
continue
}
- asch, err := Schema(SchemaOpts{Schema: sch.Schema, Root: opts.Swagger(), BasePath: opts.BasePath})
+ asch, err := Schema(SchemaOpts{Schema: sch.Schema, Root: opts.Swagger(), BasePath: opts.BasePath, PathLoaderWithOptions: opts.PathLoaderWithOptions})
if err != nil {
return ErrAtKey(key, err)
}
@@ -575,7 +575,7 @@ func stripOAIGenForRef(opts *FlattenOpts, k string, r *newRef) (bool, error) {
}
// rewrite other parents to point to first parent
- if len(pr) > 1 {
+ if len(pr) > 1 { //nolint:nestif // should be refactored at a later time
for _, p := range pr[1:] {
replacingRef := spec.MustCreateRef(pr[0])
@@ -657,7 +657,7 @@ func stripOAIGenForRef(opts *FlattenOpts, k string, r *newRef) (bool, error) {
// determine if the previous substitution did inline a complex schema
if r.schema != nil && r.schema.Ref.String() == "" { // inline schema
- asch, err := Schema(SchemaOpts{Schema: r.schema, Root: opts.Swagger(), BasePath: opts.BasePath})
+ asch, err := Schema(SchemaOpts{Schema: r.schema, Root: opts.Swagger(), BasePath: opts.BasePath, PathLoaderWithOptions: opts.PathLoaderWithOptions})
if err != nil {
return false, err
}
@@ -761,7 +761,7 @@ func flattenAnonPointer(key string, v SchemaRef, refsToReplace map[string]Schema
debugLog("namePointers at %s for %s", key, v.Ref.String())
// qualify the expanded schema
- asch, ers := Schema(SchemaOpts{Schema: v.Schema, Root: opts.Swagger(), BasePath: opts.BasePath})
+ asch, ers := Schema(SchemaOpts{Schema: v.Schema, Root: opts.Swagger(), BasePath: opts.BasePath, PathLoaderWithOptions: opts.PathLoaderWithOptions})
if ers != nil {
return ErrAtKey(key, ers)
}
diff --git a/vendor/github.com/go-openapi/analysis/flatten_options.go b/vendor/github.com/go-openapi/analysis/flatten_options.go
index 0984941fde..1e182ad435 100644
--- a/vendor/github.com/go-openapi/analysis/flatten_options.go
+++ b/vendor/github.com/go-openapi/analysis/flatten_options.go
@@ -4,9 +4,11 @@
package analysis
import (
+ "encoding/json"
"log"
"github.com/go-openapi/spec"
+ "github.com/go-openapi/swag/loading"
"github.com/go-openapi/swag/mangling"
)
@@ -31,7 +33,17 @@ type FlattenOpts struct {
RemoveUnused bool // When true, remove unused parameters, responses and definitions after expansion/flattening
ContinueOnError bool // Continue when spec expansion issues are found
KeepNames bool // Do not attempt to jsonify names from references when flattening
- ManglerOpts []mangling.Option // Options for the name mangler used to jsonify names
+ ManglerOpts []mangling.Option `json:"-"` // Options for the name mangler used to jsonify names
+
+ // PathLoaderWithOptions injects the document loader used to resolve remote and relative $ref
+ // while flattening or expanding the specification. It matches the option-aware loader signature
+ // of github.com/go-openapi/swag/loading (and go-openapi/loads).
+ //
+ // Security: when flattening a specification obtained from an untrusted source, set this to a
+ // confined loader — for example one built with loading.WithRoot (to confine local reads) and
+ // loading.WithHTTPClient (to restrict remote fetches), or a restricted loader from
+ // go-openapi/loads. Left nil, the spec package default (unsandboxed) loader is used.
+ PathLoaderWithOptions func(string, ...loading.Option) (json.RawMessage, error) `json:"-"`
/* Extra keys */
_ struct{} // require keys
@@ -40,9 +52,10 @@ type FlattenOpts struct {
// ExpandOpts creates a spec.[spec.ExpandOptions] to configure expanding a specification document.
func (f *FlattenOpts) ExpandOpts(skipSchemas bool) *spec.ExpandOptions {
return &spec.ExpandOptions{
- RelativeBase: f.BasePath,
- SkipSchemas: skipSchemas,
- ContinueOnError: f.ContinueOnError,
+ RelativeBase: f.BasePath,
+ SkipSchemas: skipSchemas,
+ ContinueOnError: f.ContinueOnError,
+ PathLoaderWithOptions: f.PathLoaderWithOptions,
}
}
diff --git a/vendor/github.com/go-openapi/analysis/mixin.go b/vendor/github.com/go-openapi/analysis/mixin.go
index ab15644f68..635b1b0ad4 100644
--- a/vendor/github.com/go-openapi/analysis/mixin.go
+++ b/vendor/github.com/go-openapi/analysis/mixin.go
@@ -130,6 +130,7 @@ func pathItemOps(p spec.PathItem) []*spec.Operation {
rv = appendOp(rv, p.Post)
rv = appendOp(rv, p.Delete)
rv = appendOp(rv, p.Head)
+ rv = appendOp(rv, p.Options)
rv = appendOp(rv, p.Patch)
return rv
@@ -213,9 +214,9 @@ func mergePaths(primary *spec.Swagger, m *spec.Swagger, opIDs map[string]bool, m
// Swagger requires that operationIds be
// unique within a spec. If we find a
// collision we append "Mixin0" to the
- // operatoinId we are adding, where 0 is mixin
+ // operationId we are adding, where 0 is mixin
// index. We assume that operationIds with
- // all the proivded specs are already unique.
+ // all the provided specs are already unique.
piops := pathItemOps(v)
for _, piop := range piops {
if opIDs[piop.ID] {
@@ -358,7 +359,7 @@ func mergeSwaggerProps(primary *spec.Swagger, m *spec.Swagger) []string {
if primary.ExternalDocs == nil {
primary.ExternalDocs = m.ExternalDocs
- } else if m != nil {
+ } else if m.ExternalDocs != nil {
skippedDocs = mergeExternalDocs(primary.ExternalDocs, m.ExternalDocs)
skipped = append(skipped, skippedDocs...)
}
diff --git a/vendor/github.com/go-openapi/analysis/schema.go b/vendor/github.com/go-openapi/analysis/schema.go
index bedea652ac..2c250461eb 100644
--- a/vendor/github.com/go-openapi/analysis/schema.go
+++ b/vendor/github.com/go-openapi/analysis/schema.go
@@ -4,8 +4,11 @@
package analysis
import (
+ "encoding/json"
+
"github.com/go-openapi/spec"
"github.com/go-openapi/strfmt"
+ "github.com/go-openapi/swag/loading"
)
// SchemaOpts configures the schema analyzer.
@@ -13,7 +16,17 @@ type SchemaOpts struct {
Schema *spec.Schema
Root any
BasePath string
- _ struct{}
+
+ // PathLoaderWithOptions injects the document loader (with loading options) used to resolve
+ // remote and relative $ref while analyzing a schema.
+ //
+ // Security: set this to a confined loader — for example one built with loading.WithRoot and
+ // loading.WithHTTPClient, or a restricted loader from go-openapi/loads — when the schema may
+ // derive from an untrusted source. Left nil, the spec package default (unsandboxed) loader is
+ // used.
+ PathLoaderWithOptions func(string, ...loading.Option) (json.RawMessage, error)
+
+ _ struct{}
}
// Schema analysis, will classify the schema according to known
@@ -24,9 +37,10 @@ func Schema(opts SchemaOpts) (*AnalyzedSchema, error) {
}
a := &AnalyzedSchema{
- schema: opts.Schema,
- root: opts.Root,
- basePath: opts.BasePath,
+ schema: opts.Schema,
+ root: opts.Root,
+ basePath: opts.BasePath,
+ pathLoaderWithOptions: opts.PathLoaderWithOptions,
}
a.initializeFlags()
@@ -54,9 +68,10 @@ func Schema(opts SchemaOpts) (*AnalyzedSchema, error) {
// AnalyzedSchema indicates what the schema represents.
type AnalyzedSchema struct {
- schema *spec.Schema
- root any
- basePath string
+ schema *spec.Schema
+ root any
+ basePath string
+ pathLoaderWithOptions func(string, ...loading.Option) (json.RawMessage, error)
hasProps bool
hasAllOf bool
@@ -103,19 +118,32 @@ func (a *AnalyzedSchema) inherits(other *AnalyzedSchema) {
a.IsEnum = other.IsEnum
}
+// subSchemaOpts builds SchemaOpts for a nested schema, propagating the root, base path and the
+// injected document loader so that confinement applies throughout the recursive analysis.
+func (a *AnalyzedSchema) subSchemaOpts(sch *spec.Schema) SchemaOpts {
+ return SchemaOpts{
+ Schema: sch,
+ Root: a.root,
+ BasePath: a.basePath,
+ PathLoaderWithOptions: a.pathLoaderWithOptions,
+ }
+}
+
+// expandOpts builds the spec expand options for this analysis, carrying the injected loader so
+// remote/relative $ref are resolved through it (rather than the unsandboxed package default).
+func (a *AnalyzedSchema) expandOpts() *spec.ExpandOptions {
+ return &spec.ExpandOptions{PathLoaderWithOptions: a.pathLoaderWithOptions}
+}
+
func (a *AnalyzedSchema) inferFromRef() error {
if a.hasRef {
sch := new(spec.Schema)
sch.Ref = a.schema.Ref
- err := spec.ExpandSchema(sch, a.root, nil)
+ err := spec.ExpandSchemaWithOptions(sch, a.root, nil, a.expandOpts())
if err != nil {
return err
}
- rsch, err := Schema(SchemaOpts{
- Schema: sch,
- Root: a.root,
- BasePath: a.basePath,
- })
+ rsch, err := Schema(a.subSchemaOpts(sch))
if err != nil {
// NOTE(fredbi): currently the only cause for errors is
// unresolved ref. Since spec.ExpandSchema() expands the
@@ -159,11 +187,7 @@ func (a *AnalyzedSchema) inferMap() error {
// maps
if a.schema.AdditionalProperties.Schema != nil {
- msch, err := Schema(SchemaOpts{
- Schema: a.schema.AdditionalProperties.Schema,
- Root: a.root,
- BasePath: a.basePath,
- })
+ msch, err := Schema(a.subSchemaOpts(a.schema.AdditionalProperties.Schema))
if err != nil {
return err
}
@@ -186,11 +210,7 @@ func (a *AnalyzedSchema) inferArray() error {
a.IsArray = a.isArrayType() && (a.schema.Items == nil || a.schema.Items.Schemas == nil)
if a.IsArray && a.hasItems {
if a.schema.Items.Schema != nil {
- itsch, err := Schema(SchemaOpts{
- Schema: a.schema.Items.Schema,
- Root: a.root,
- BasePath: a.basePath,
- })
+ itsch, err := Schema(a.subSchemaOpts(a.schema.Items.Schema))
if err != nil {
return err
}
diff --git a/vendor/github.com/go-openapi/jsonpointer/.golangci.yml b/vendor/github.com/go-openapi/jsonpointer/.golangci.yml
index dc7c96053d..9d2733176e 100644
--- a/vendor/github.com/go-openapi/jsonpointer/.golangci.yml
+++ b/vendor/github.com/go-openapi/jsonpointer/.golangci.yml
@@ -4,7 +4,10 @@ linters:
disable:
- depguard
- funlen
+ - goconst
- godox
+ - gomodguard
+ - gomodguard_v2
- exhaustruct
- nlreturn
- nonamedreturns
diff --git a/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md b/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md
index 9990f4a354..de0bf5c04b 100644
--- a/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md
+++ b/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md
@@ -4,21 +4,21 @@
| Total Contributors | Total Contributions |
| --- | --- |
-| 13 | 111 |
+| 13 | 132 |
| Username | All Time Contribution Count | All Commits |
| --- | --- | --- |
-| @fredbi | 63 | |
+| @fredbi | 83 | |
| @casualjim | 33 | |
| @magodo | 3 | |
| @youyuanwu | 3 | |
+| @alexandear | 2 | |
| @gaiaz-iusipov | 1 | |
| @gbjk | 1 | |
| @gordallott | 1 | |
| @ianlancetaylor | 1 | |
| @mfleader | 1 | |
| @Neo2308 | 1 | |
-| @alexandear | 1 | |
| @olivierlemasle | 1 | |
| @testwill | 1 | |
diff --git a/vendor/github.com/go-openapi/jsonpointer/README.md b/vendor/github.com/go-openapi/jsonpointer/README.md
index 24fbe1bf68..6e7929c64b 100644
--- a/vendor/github.com/go-openapi/jsonpointer/README.md
+++ b/vendor/github.com/go-openapi/jsonpointer/README.md
@@ -16,6 +16,14 @@ An implementation of JSON Pointer for golang, which supports go `struct`.
## Announcements
+* **2026-07-07** : landing v1.0.0
+ * stable API pledge
+
+* **2026-06-29** : reinsourced external dependency to swag (v0.24.0)
+ * module `github.com/go-openapi/swag/jsonname` is source directly here, so we no longer have any external dependency
+ * `jsonname` was never really used by any other package, so it makes sense to deprecate it away from the `swag` family
+ and retrofit its functionality here. `jsonpointer` no longer get external dependencies, besides test dependencies.
+
* **2026-04-15** : added support for trailing "-" for arrays (v0.23.0)
* this brings full support of [RFC6901][RFC6901]
* this is supported for types relying on the reflection-based implemented
@@ -30,12 +38,13 @@ An implementation of JSON Pointer for golang, which supports go `struct`.
* the default name provider in use is not fully aligned with go JSON stdlib
* exposed an option (or global setting) to change the provider that resolves a struct into json keys
* the default behavior is not altered
- * a new alternate name provider is added (imported from `go-openapi/swag/jsonname`), aligned with JSON stdlib behavior
## Status
API is stable and feature-complete.
+The project continues to receive regular updates, bug fixes and hygiene maintenance (CI, linting, etc).
+
## Import this library in your project
```cmd
diff --git a/vendor/github.com/go-openapi/jsonpointer/errors.go b/vendor/github.com/go-openapi/jsonpointer/errors.go
index 8813474d44..2ae6e3cfb3 100644
--- a/vendor/github.com/go-openapi/jsonpointer/errors.go
+++ b/vendor/github.com/go-openapi/jsonpointer/errors.go
@@ -21,14 +21,15 @@ const (
// ErrUnsupportedValueType indicates that a value of the wrong type is being set.
ErrUnsupportedValueType pointerError = "only structs, pointers, maps and slices are supported for setting values"
- // ErrDashToken indicates use of the RFC 6901 "-" reference token
- // in a context where it cannot be resolved.
+ // ErrDashToken indicates use of the RFC 6901 "-" reference token in a context where it cannot be
+ // resolved.
//
- // Per RFC 6901 §4 the "-" token refers to the (nonexistent) element
- // after the last array element. It may only be used as the terminal
- // token of a [Pointer.Set] against a slice, where it means "append".
- // Any other use (get, offset, intermediate traversal, non-slice target)
- // is an error condition that wraps this sentinel.
+ // Per RFC 6901 §4 the "-" token refers to the (nonexistent) element after the last array element.
+ // It may only be used as the terminal token of a [Pointer.Set] against a slice, where it means
+ // "append".
+ //
+ // Any other use (get, offset, intermediate traversal, non-slice target) is an error condition that
+ // wraps this sentinel.
ErrDashToken pointerError = `the "-" array token cannot be resolved here` //nolint:gosec // G101 false positive: this is a JSON Pointer reference token, not a credential.
)
diff --git a/vendor/github.com/go-openapi/jsonpointer/ifaces.go b/vendor/github.com/go-openapi/jsonpointer/ifaces.go
index 1e56ac0442..31359c48fa 100644
--- a/vendor/github.com/go-openapi/jsonpointer/ifaces.go
+++ b/vendor/github.com/go-openapi/jsonpointer/ifaces.go
@@ -5,39 +5,42 @@ package jsonpointer
import "reflect"
-// JSONPointable is an interface for structs to implement,
-// when they need to customize the json pointer process or want to avoid the use of reflection.
+// JSONPointable is an interface for structs to implement, when they need to customize the json
+// pointer process or want to avoid the use of reflection.
type JSONPointable interface {
// JSONLookup returns a value pointed at this (unescaped) key.
JSONLookup(key string) (any, error)
}
-// JSONSetable is an interface for structs to implement,
-// when they need to customize the json pointer process or want to avoid the use of reflection.
+// JSONSetable is an interface for structs to implement, when they need to customize the json
+// pointer process or want to avoid the use of reflection.
//
// # Handling of the RFC 6901 "-" token
//
-// When a type implementing JSONSetable is the terminal parent of a [Pointer.Set]
-// call, the library passes the raw reference token to JSONSet without
-// interpretation. In particular, the RFC 6901 "-" token (which conventionally
-// means "append" for arrays, per RFC 6902) is forwarded verbatim as the key
-// argument. Implementations that model an array-like container are expected
-// to give "-" the append semantics; implementations that do not should return
-// an error wrapping [ErrDashToken] (or [ErrPointer]) for clarity.
+// When a type implementing JSONSetable is the terminal parent of a [Pointer.Set] call, the library
+// passes the raw reference token to JSONSet without interpretation.
//
-// Implementations are responsible for any in-place mutation: the library does
-// not attempt to rebind the result of JSONSet into a parent container.
+// In particular, the RFC 6901 "-" token (which conventionally means "append" for arrays, per RFC
+// 6902) is forwarded verbatim as the key argument.
+//
+// Implementations that model an array-like container are expected to give "-" the append semantics;
+// implementations that do not should return an error wrapping [ErrDashToken] (or [ErrPointer]) for
+// clarity.
+//
+// Implementations are responsible for any in-place mutation: the library does not attempt to rebind
+// the result of JSONSet into a parent container.
type JSONSetable interface {
// JSONSet sets the value pointed at the (unescaped) key.
//
- // The key may be the RFC 6901 "-" token when the pointer targets a
- // slice-like member; see the interface documentation for details.
+ // The key may be the RFC 6901 "-" token when the pointer targets a slice-like member; see the
+ // interface documentation for details.
JSONSet(key string, value any) error
}
// NameProvider knows how to resolve go struct fields into json names.
//
-// The default provider is brought by [github.com/go-openapi/swag/jsonname.DefaultJSONNameProvider].
+// The default provider is brought by
+// [github.com/go-openapi/jsonpointer/jsonname.DefaultJSONNameProvider].
type NameProvider interface {
// GetGoName gets the go name for a json property name
GetGoName(subject any, name string) (string, bool)
diff --git a/vendor/github.com/go-openapi/jsonpointer/jsonname/doc.go b/vendor/github.com/go-openapi/jsonpointer/jsonname/doc.go
new file mode 100644
index 0000000000..79232eaca4
--- /dev/null
+++ b/vendor/github.com/go-openapi/jsonpointer/jsonname/doc.go
@@ -0,0 +1,5 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package jsonname is a provider of json property names from go properties.
+package jsonname
diff --git a/vendor/github.com/go-openapi/jsonpointer/jsonname/go_name_provider.go b/vendor/github.com/go-openapi/jsonpointer/jsonname/go_name_provider.go
new file mode 100644
index 0000000000..5eec18fbfd
--- /dev/null
+++ b/vendor/github.com/go-openapi/jsonpointer/jsonname/go_name_provider.go
@@ -0,0 +1,288 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package jsonname
+
+import (
+ "reflect"
+ "strings"
+ "sync"
+)
+
+var _ providerIface = (*GoNameProvider)(nil)
+
+// GoNameProvider resolves json property names to go struct field names following the same rules as
+// the standard library's [encoding/json] package.
+//
+// Contrary to [NameProvider], it considers exported fields without a json tag, and promotes fields
+// from anonymous embedded struct types.
+//
+// Rules (aligned with encoding/json):
+//
+// - unexported fields are ignored;
+// - a field tagged `json:"-"` is ignored;
+// - a field tagged `json:"-,"` is kept under the json name "-" (stdlib quirk);
+// - a field tagged `json:""` or with no json tag at all keeps its Go name as json name;
+// - anonymous struct fields without an explicit json tag have their fields
+// promoted into the parent, following breadth-first depth rules:
+// a shallower field wins over a deeper one; at equal depth, a conflict
+// discards all conflicting fields unless exactly one has an explicit json tag.
+//
+// This type is safe for concurrent use.
+type GoNameProvider struct {
+ lock sync.Mutex
+ index map[reflect.Type]nameIndex
+}
+
+// NewGoNameProvider creates a new [GoNameProvider].
+func NewGoNameProvider() *GoNameProvider {
+ return &GoNameProvider{
+ index: make(map[reflect.Type]nameIndex),
+ }
+}
+
+// GetJSONNames gets all the json property names for a type.
+func (n *GoNameProvider) GetJSONNames(subject any) []string {
+ n.lock.Lock()
+ defer n.lock.Unlock()
+
+ tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
+ names := n.nameIndexFor(tpe)
+
+ res := make([]string, 0, len(names.jsonNames))
+ for k := range names.jsonNames {
+ res = append(res, k)
+ }
+
+ return res
+}
+
+// GetJSONName gets the json name for a go property name.
+func (n *GoNameProvider) GetJSONName(subject any, name string) (string, bool) {
+ tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
+
+ return n.GetJSONNameForType(tpe, name)
+}
+
+// GetJSONNameForType gets the json name for a go property name on a given type.
+func (n *GoNameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) {
+ n.lock.Lock()
+ defer n.lock.Unlock()
+
+ names := n.nameIndexFor(tpe)
+ nme, ok := names.goNames[name]
+
+ return nme, ok
+}
+
+// GetGoName gets the go name for a json property name.
+func (n *GoNameProvider) GetGoName(subject any, name string) (string, bool) {
+ tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
+
+ return n.GetGoNameForType(tpe, name)
+}
+
+// GetGoNameForType gets the go name for a given type for a json property name.
+func (n *GoNameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) {
+ n.lock.Lock()
+ defer n.lock.Unlock()
+
+ names := n.nameIndexFor(tpe)
+ nme, ok := names.jsonNames[name]
+
+ return nme, ok
+}
+
+func (n *GoNameProvider) nameIndexFor(tpe reflect.Type) nameIndex {
+ if names, ok := n.index[tpe]; ok {
+ return names
+ }
+
+ names := buildGoNameIndex(tpe)
+ n.index[tpe] = names
+
+ return names
+}
+
+// fieldEntry captures a candidate field discovered while walking a struct along with the
+// indirection path from the root type (used to resolve conflicts by depth in the same way
+// encoding/json does).
+type fieldEntry struct {
+ goName string
+ jsonName string
+ index []int
+ tagged bool
+}
+
+func buildGoNameIndex(tpe reflect.Type) nameIndex {
+ fields := collectGoFields(tpe)
+
+ idx := make(map[string]string, len(fields))
+ reverseIdx := make(map[string]string, len(fields))
+ for _, f := range fields {
+ idx[f.jsonName] = f.goName
+ reverseIdx[f.goName] = f.jsonName
+ }
+
+ return nameIndex{jsonNames: idx, goNames: reverseIdx}
+}
+
+// collectGoFields walks tpe breadth-first along anonymous struct fields,
+// reproducing the field selection performed by encoding/json.typeFields.
+//
+//nolint:gocognit // everything is inlined to help the compiler determine what escapes and what doesn't
+func collectGoFields(tpe reflect.Type) []fieldEntry {
+ if tpe.Kind() != reflect.Struct {
+ return nil
+ }
+
+ type queued struct {
+ typ reflect.Type
+ index []int
+ }
+
+ current := []queued{}
+ next := []queued{{typ: tpe}}
+ visited := map[reflect.Type]bool{tpe: true}
+
+ var (
+ candidates []fieldEntry
+ count = map[string]int{}
+ nextCount = map[string]int{}
+ )
+
+ for len(next) > 0 {
+ current, next = next, current[:0]
+ count, nextCount = nextCount, count
+ for k := range nextCount {
+ delete(nextCount, k)
+ }
+
+ for _, q := range current {
+ for i := range q.typ.NumField() {
+ sf := q.typ.Field(i)
+
+ if sf.Anonymous {
+ ft := sf.Type
+ if ft.Kind() == reflect.Pointer {
+ ft = ft.Elem()
+ }
+ if !sf.IsExported() && ft.Kind() != reflect.Struct {
+ continue
+ }
+ } else if !sf.IsExported() {
+ continue
+ }
+
+ tag := sf.Tag.Get("json")
+ if tag == "-" {
+ continue
+ }
+ jsonName, _ := parseJSONTag(tag)
+ tagged := jsonName != ""
+
+ ft := sf.Type
+ if ft.Kind() == reflect.Pointer {
+ ft = ft.Elem()
+ }
+
+ if sf.Anonymous && ft.Kind() == reflect.Struct && !tagged {
+ if visited[ft] {
+ continue
+ }
+ visited[ft] = true
+
+ index := make([]int, len(q.index)+1)
+ copy(index, q.index)
+ index[len(q.index)] = i
+ next = append(next, queued{typ: ft, index: index})
+
+ continue
+ }
+
+ name := jsonName
+ if name == "" {
+ name = sf.Name
+ }
+
+ index := make([]int, len(q.index)+1)
+ copy(index, q.index)
+ index[len(q.index)] = i
+
+ candidates = append(candidates, fieldEntry{
+ goName: sf.Name,
+ jsonName: name,
+ index: index,
+ tagged: tagged,
+ })
+ nextCount[name]++
+ }
+ }
+ }
+
+ return dominantFields(candidates)
+}
+
+// dominantFields applies the Go encoding/json conflict resolution rules: at each JSON name, the
+// shallowest field wins; at equal depth, a uniquely tagged candidate wins; otherwise all candidates
+// for that name are dropped.
+func dominantFields(candidates []fieldEntry) []fieldEntry {
+ byName := make(map[string][]fieldEntry, len(candidates))
+ for _, c := range candidates {
+ byName[c.jsonName] = append(byName[c.jsonName], c)
+ }
+
+ out := make([]fieldEntry, 0, len(byName))
+ for _, group := range byName {
+ if len(group) == 1 {
+ out = append(out, group[0])
+
+ continue
+ }
+
+ minDepth := len(group[0].index)
+ for _, c := range group[1:] {
+ if len(c.index) < minDepth {
+ minDepth = len(c.index)
+ }
+ }
+
+ var shallow []fieldEntry
+ for _, c := range group {
+ if len(c.index) == minDepth {
+ shallow = append(shallow, c)
+ }
+ }
+
+ if len(shallow) == 1 {
+ out = append(out, shallow[0])
+
+ continue
+ }
+
+ var tagged []fieldEntry
+ for _, c := range shallow {
+ if c.tagged {
+ tagged = append(tagged, c)
+ }
+ }
+ if len(tagged) == 1 {
+ out = append(out, tagged[0])
+ }
+ }
+
+ return out
+}
+
+// parseJSONTag returns the name component of a json struct tag and whether it carried any non-name
+// option (kept for future-proofing, e.g. "omitempty").
+func parseJSONTag(tag string) (string, string) {
+ if tag == "" {
+ return "", ""
+ }
+ if before, after, ok := strings.Cut(tag, ","); ok {
+ return before, after
+ }
+
+ return tag, ""
+}
diff --git a/vendor/github.com/go-openapi/jsonpointer/jsonname/ifaces.go b/vendor/github.com/go-openapi/jsonpointer/jsonname/ifaces.go
new file mode 100644
index 0000000000..64871f0d27
--- /dev/null
+++ b/vendor/github.com/go-openapi/jsonpointer/jsonname/ifaces.go
@@ -0,0 +1,16 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package jsonname
+
+import "reflect"
+
+// providerIface is an unexported compile-time contract that every name provider in this package is
+// expected to satisfy.
+//
+// It mirrors the interface declared by the main consumer of this module:
+// [github.com/go-openapi/jsonpointer.NameProvider].
+type providerIface interface {
+ GetGoName(subject any, name string) (string, bool)
+ GetGoNameForType(tpe reflect.Type, name string) (string, bool)
+}
diff --git a/vendor/github.com/go-openapi/jsonpointer/jsonname/name_provider.go b/vendor/github.com/go-openapi/jsonpointer/jsonname/name_provider.go
new file mode 100644
index 0000000000..1bec2406b5
--- /dev/null
+++ b/vendor/github.com/go-openapi/jsonpointer/jsonname/name_provider.go
@@ -0,0 +1,140 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package jsonname
+
+import (
+ "reflect"
+ "strings"
+ "sync"
+)
+
+// DefaultJSONNameProvider is the default cache for types.
+var DefaultJSONNameProvider = NewNameProvider() //nolint:gochecknoglobals // default settings, for backward compatible package-level settings
+
+var _ providerIface = (*NameProvider)(nil)
+
+// NameProvider represents an object capable of translating from go property names to json property
+// names.
+//
+// This type is thread-safe.
+//
+// See [github.com/go-openapi/jsonpointer.Pointer] for an example.
+type NameProvider struct {
+ lock *sync.Mutex
+ index map[reflect.Type]nameIndex
+}
+
+type nameIndex struct {
+ jsonNames map[string]string
+ goNames map[string]string
+}
+
+// NewNameProvider creates a new name provider.
+func NewNameProvider() *NameProvider {
+ return &NameProvider{
+ lock: &sync.Mutex{},
+ index: make(map[reflect.Type]nameIndex),
+ }
+}
+
+func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) {
+ for i := range tpe.NumField() {
+ targetDes := tpe.Field(i)
+
+ if targetDes.PkgPath != "" { // unexported
+ continue
+ }
+
+ if targetDes.Anonymous { // walk embedded structures tree down first
+ buildnameIndex(targetDes.Type, idx, reverseIdx)
+ continue
+ }
+
+ if tag := targetDes.Tag.Get("json"); tag != "" {
+
+ parts := strings.Split(tag, ",")
+ if len(parts) == 0 {
+ continue
+ }
+
+ nm := parts[0]
+ if nm == "-" {
+ continue
+ }
+ if nm == "" { // empty string means we want to use the Go name
+ nm = targetDes.Name
+ }
+
+ idx[nm] = targetDes.Name
+ reverseIdx[targetDes.Name] = nm
+ }
+ }
+}
+
+func newNameIndex(tpe reflect.Type) nameIndex {
+ idx := make(map[string]string, tpe.NumField())
+ reverseIdx := make(map[string]string, tpe.NumField())
+
+ buildnameIndex(tpe, idx, reverseIdx)
+ return nameIndex{jsonNames: idx, goNames: reverseIdx}
+}
+
+// GetJSONNames gets all the json property names for a type.
+func (n *NameProvider) GetJSONNames(subject any) []string {
+ n.lock.Lock()
+ defer n.lock.Unlock()
+ tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
+ names, ok := n.index[tpe]
+ if !ok {
+ names = n.makeNameIndex(tpe)
+ }
+
+ res := make([]string, 0, len(names.jsonNames))
+ for k := range names.jsonNames {
+ res = append(res, k)
+ }
+ return res
+}
+
+// GetJSONName gets the json name for a go property name.
+func (n *NameProvider) GetJSONName(subject any, name string) (string, bool) {
+ tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
+ return n.GetJSONNameForType(tpe, name)
+}
+
+// GetJSONNameForType gets the json name for a go property name on a given type.
+func (n *NameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) {
+ n.lock.Lock()
+ defer n.lock.Unlock()
+ names, ok := n.index[tpe]
+ if !ok {
+ names = n.makeNameIndex(tpe)
+ }
+ nme, ok := names.goNames[name]
+ return nme, ok
+}
+
+// GetGoName gets the go name for a json property name.
+func (n *NameProvider) GetGoName(subject any, name string) (string, bool) {
+ tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
+ return n.GetGoNameForType(tpe, name)
+}
+
+// GetGoNameForType gets the go name for a given type for a json property name.
+func (n *NameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) {
+ n.lock.Lock()
+ defer n.lock.Unlock()
+ names, ok := n.index[tpe]
+ if !ok {
+ names = n.makeNameIndex(tpe)
+ }
+ nme, ok := names.jsonNames[name]
+ return nme, ok
+}
+
+func (n *NameProvider) makeNameIndex(tpe reflect.Type) nameIndex {
+ names := newNameIndex(tpe)
+ n.index[tpe] = names
+ return names
+}
diff --git a/vendor/github.com/go-openapi/jsonpointer/options.go b/vendor/github.com/go-openapi/jsonpointer/options.go
index d52caab222..223c1e5ff0 100644
--- a/vendor/github.com/go-openapi/jsonpointer/options.go
+++ b/vendor/github.com/go-openapi/jsonpointer/options.go
@@ -6,7 +6,7 @@ package jsonpointer
import (
"sync"
- "github.com/go-openapi/swag/jsonname"
+ "github.com/go-openapi/jsonpointer/jsonname"
)
// Option to tune the behavior of a JSON [Pointer].
@@ -25,9 +25,9 @@ var (
//
// By default, the default provider is [jsonname.DefaultJSONNameProvider].
//
-// It is safe to call concurrently with [Pointer.Get], [Pointer.Set],
-// [GetForToken] and [SetForToken]. The typical usage is to call it once
-// at initialization time.
+// It is safe to call concurrently with [Pointer.Get], [Pointer.Set], [GetForToken] and
+// [SetForToken].
+// The typical usage is to call it once at initialization time.
//
// A nil provider is ignored.
func SetDefaultNameProvider(provider NameProvider) {
@@ -41,16 +41,15 @@ func SetDefaultNameProvider(provider NameProvider) {
defaultOptions.provider = provider
}
-// UseGoNameProvider sets the [NameProvider] as a package-level default
-// to the alternative provider [jsonname.GoNameProvider], that covers a few areas
-// not supported by the default name provider.
+// UseGoNameProvider sets the [NameProvider] as a package-level default to the alternative provider
+// [jsonname.GoNameProvider], that covers a few areas not supported by the default name provider.
//
// This implementation supports untagged exported fields and embedded types in go struct.
// It follows strictly the behavior of the JSON standard library regarding field naming conventions.
//
-// It is safe to call concurrently with [Pointer.Get], [Pointer.Set],
-// [GetForToken] and [SetForToken]. The typical usage is to call it once
-// at initialization time.
+// It is safe to call concurrently with [Pointer.Get], [Pointer.Set], [GetForToken] and
+// [SetForToken].
+// The typical usage is to call it once at initialization time.
func UseGoNameProvider() {
SetDefaultNameProvider(jsonname.NewGoNameProvider())
}
diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer.go b/vendor/github.com/go-openapi/jsonpointer/pointer.go
index 2369c1827e..05fc863ee6 100644
--- a/vendor/github.com/go-openapi/jsonpointer/pointer.go
+++ b/vendor/github.com/go-openapi/jsonpointer/pointer.go
@@ -34,7 +34,8 @@ const (
//
// For struct s resolved by reflection, key mappings honor the conventional struct tag `json`.
//
-// Fields that do not specify a `json` tag, or specify an empty one, or are tagged as `json:"-"` are ignored.
+// Fields that do not specify a `json` tag, or specify an empty one, or are tagged as `json:"-"` are
+// ignored.
//
// # Limitations
//
@@ -61,23 +62,24 @@ func (p *Pointer) Get(document any, opts ...Option) (any, reflect.Kind, error) {
return p.get(document, o.provider)
}
-// Set uses the pointer to set a value from a data type
-// that represent a JSON document.
+// Set uses the pointer to set a value from a data type that represent a JSON document.
//
// # Mutation contract
//
-// Set mutates the provided document in place whenever Go's type system allows
-// it: when document is a map, a pointer, or when the targeted value is reached
-// through an addressable ancestor (e.g. a struct field traversed via a pointer,
-// a slice element). Callers that rely on this in-place behavior may continue
-// to ignore the returned document.
+// Set mutates the provided document in place whenever Go's type system allows it: when document is
+// a map, a pointer, or when the targeted value is reached through an addressable ancestor (e.g. a
+// struct field traversed via a pointer, a slice element).
+//
+// Callers that rely on this in-place behavior may continue to ignore the returned document.
//
// The returned document is only load-bearing when Set cannot mutate in place.
-// This happens in one specific case: appending to a top-level slice passed by
-// value (e.g. document of type []T rather than *[]T) via the RFC 6901 "-"
-// terminal token. reflect.Append produces a new slice header that the library
-// cannot rebind into the caller's variable; the updated document is returned
-// instead. Pass *[]T if you want in-place rebind for that case as well.
+//
+// This happens in one specific case: appending to a top-level slice passed by value (e.g. document
+// of type []T rather than *[]T) via the RFC 6901 "-" terminal token. reflect.Append produces a new
+// slice header that the library cannot rebind into the caller's variable; the updated document is
+// returned instead.
+//
+// Pass *[]T if you want in-place rebind for that case as well.
//
// See [ErrDashToken] for the semantics of the "-" token.
func (p *Pointer) Set(document any, value any, opts ...Option) (any, error) {
@@ -112,23 +114,23 @@ func (p *Pointer) String() string {
return pointerSeparator + strings.Join(p.referenceTokens, pointerSeparator)
}
-// Offset returns the byte offset, in the raw JSON text of document, of the
-// location referenced by this pointer's terminal token.
+// Offset returns the byte offset, in the raw JSON text of document, of the location referenced by
+// this pointer's terminal token.
+//
+// Unlike [Pointer.Get] and [Pointer.Set], which operate on a decoded Go value, Offset operates
+// directly on the textual JSON source.
//
-// Unlike [Pointer.Get] and [Pointer.Set], which operate on a decoded Go value,
-// Offset operates directly on the textual JSON source. It drives an
-// [encoding/json.Decoder] over the string and stops at the terminal token,
-// returning the position at which the decoder was about to read that token.
+// It drives an [encoding/json.Decoder] over the string and stops at the terminal token, returning
+// the position at which the decoder was about to read that token.
//
-// It is primarily intended for tooling that needs to map a pointer back to a
-// region of the original source: reporting line/column for validation or
-// parse diagnostics, extracting a sub-document by slicing the raw bytes, or
-// highlighting the referenced span in an editor.
+// It is primarily intended for tooling that needs to map a pointer back to a region of the original
+// source: reporting line/column for validation or parse diagnostics, extracting a sub-document by
+// slicing the raw bytes, or highlighting the referenced span in an editor.
//
// # Offset semantics
//
-// The meaning of the returned offset depends on whether the terminal token
-// addresses an object property or an array element:
+// The meaning of the returned offset depends on whether the terminal token addresses an object
+// property or an array element:
//
// - Object property: the offset points to the first byte of the key (its
// opening quote character), not to the associated value. For example,
@@ -183,16 +185,15 @@ func (p *Pointer) Offset(document string) (int64, error) {
return skipJSONSeparator(document, offset), nil
}
-// skipJSONSeparator advances offset past trailing JSON whitespace and at most
-// one value separator (comma) in document, so the result points at the first
-// byte of the next JSON token.
+// skipJSONSeparator advances offset past trailing JSON whitespace and at most one value separator
+// (comma) in document, so the result points at the first byte of the next JSON token.
//
-// The streaming decoder's InputOffset sits right after the most recently
-// consumed token, which between values is the comma (or whitespace) — not
-// the following token. Normalizing here keeps Offset's contract uniform:
-// for both object keys and array elements, and regardless of position within
-// the parent container, the returned offset always points at the first byte
-// of the addressed token.
+// The streaming decoder's InputOffset sits right after the most recently consumed token, which
+// between values is the comma (or whitespace) — not the following token.
+//
+// Normalizing here keeps Offset's contract uniform: for both object keys and array elements, and
+// regardless of position within the parent container, the returned offset always points at the
+// first byte of the addressed token.
func skipJSONSeparator(document string, offset int64) int64 {
n := int64(len(document))
for offset < n && isJSONWhitespace(document[offset]) {
@@ -279,14 +280,13 @@ func (p *Pointer) set(node, data any, nameProvider NameProvider) (any, error) {
return p.setAt(node, p.referenceTokens, data, nameProvider)
}
-// setAt recursively walks the token list, setting the data at the terminal
-// token and rebinding any new child reference (e.g. a slice header returned
-// by an "-" append) into its parent on the way back up.
+// setAt recursively walks the token list, setting the data at the terminal token and rebinding any
+// new child reference (e.g. a slice header returned by an "-" append) into its parent on the way
+// back up.
//
-// Returning the (possibly new) node at each level is what makes append work
-// at any depth without requiring the caller to pass a pointer to the
-// containing slice: the new slice header propagates up and each parent
-// rebinds it via the appropriate kind-specific setter.
+// Returning the (possibly new) node at each level is what makes append work at any depth without
+// requiring the caller to pass a pointer to the containing slice: the new slice header propagates
+// up and each parent rebinds it via the appropriate kind-specific setter.
func (p *Pointer) setAt(node any, tokens []string, data any, nameProvider NameProvider) (any, error) {
decodedToken := Unescape(tokens[0])
@@ -309,15 +309,14 @@ func (p *Pointer) setAt(node any, tokens []string, data any, nameProvider NamePr
// rebindChild writes newChild back into node at decodedToken.
//
-// For cases where the child was already mutated in place (pointer aliasing,
-// addressable slice elements) the rebind is a safe no-op. For cases where
-// the child was returned by value (map entries holding a slice, slices
-// reached through a non-addressable ancestor), the rebind propagates the
-// new value into the parent.
+// For cases where the child was already mutated in place (pointer aliasing, addressable slice
+// elements) the rebind is a safe no-op.
+//
+// For cases where the child was returned by value (map entries holding a slice, slices reached
+// through a non-addressable ancestor), the rebind propagates the new value into the parent.
//
-// Parents implementing [JSONPointable] are left alone: they took ownership
-// of the child via JSONLookup and did not opt into a JSONSet-based rebind
-// on intermediate tokens.
+// Parents implementing [JSONPointable] are left alone: they took ownership of the child via
+// JSONLookup and did not opt into a JSONSet-based rebind on intermediate tokens.
func rebindChild(node any, decodedToken string, newChild any, nameProvider NameProvider) (any, error) {
if _, ok := node.(JSONPointable); ok {
return node, nil
@@ -362,9 +361,9 @@ func rebindChild(node any, decodedToken string, newChild any, nameProvider NameP
}
}
-// assignReflectValue assigns src into dst, unwrapping a pointer when dst
-// expects the pointee type. This tolerates the pointer-wrapping performed
-// by [typeFromValue] for addressable fields.
+// assignReflectValue assigns src into dst, unwrapping a pointer when dst expects the pointee type.
+//
+// This tolerates the pointer-wrapping performed by [typeFromValue] for addressable fields.
func assignReflectValue(dst reflect.Value, src any) {
nv := reflect.ValueOf(src)
if !nv.IsValid() {
@@ -474,8 +473,8 @@ func GetForToken(document any, decodedToken string, opts ...Option) (any, reflec
// SetForToken sets a value for a json pointer token 1 level deep.
//
-// See [Pointer.Set] for the mutation contract, in particular the handling of
-// the RFC 6901 "-" token on slices.
+// See [Pointer.Set] for the mutation contract, in particular the handling of the RFC 6901 "-" token
+// on slices.
func SetForToken(document any, decodedToken string, value any, opts ...Option) (any, error) {
o := optionsWithDefaults(opts)
@@ -586,10 +585,10 @@ func setSingleImpl(node, data any, decodedToken string, nameProvider NameProvide
case reflect.Slice:
if decodedToken == dashToken {
- // RFC 6901 §4 / RFC 6902 append semantics: terminal "-" appends
- // the value to the slice. We rebind in place when the slice is
- // reachable via an addressable ancestor; otherwise we return the
- // new slice header for the parent (or the public Set) to rebind.
+ // RFC 6901 §4 / RFC 6902 append semantics: terminal "-" appends the value to the slice.
+ //
+ // We rebind in place when the slice is reachable via an addressable ancestor; otherwise we
+ // return the new slice header for the parent (or the public Set) to rebind.
value := reflect.ValueOf(data)
elemType := rValue.Type().Elem()
if !value.Type().AssignableTo(elemType) {
@@ -650,8 +649,8 @@ func offsetSingleObject(dec *json.Decoder, decodedToken string) (int64, error) {
return offset, nil
}
- // Consume the associated value. Scalars are fully read by a single
- // Token() call; composite values must be drained.
+ // Consume the associated value.
+ // Scalars are fully read by a single Token() call; composite values must be drained.
tk, err = dec.Token()
if err != nil {
return 0, err
@@ -736,10 +735,7 @@ func drainSingle(dec *json.Decoder) error {
return nil
}
-// JSON pointer encoding:
-// ~0 => ~
-// ~1 => /
-// ... and vice versa
+// JSON pointer encoding: ~0 => ~ ~1 => / ... and vice versa.
const (
encRefTok0 = `~0`
diff --git a/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md b/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md
index 3cfbca6a6a..d20737c946 100644
--- a/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md
+++ b/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md
@@ -4,11 +4,11 @@
| Total Contributors | Total Contributions |
| --- | --- |
-| 9 | 79 |
+| 9 | 83 |
| Username | All Time Contribution Count | All Commits |
| --- | --- | --- |
-| @fredbi | 42 | |
+| @fredbi | 46 | |
| @casualjim | 25 | |
| @youyuanwu | 5 | |
| @olivierlemasle | 2 | |
diff --git a/vendor/github.com/go-openapi/jsonreference/README.md b/vendor/github.com/go-openapi/jsonreference/README.md
index 43d05b0506..fbd16cf892 100644
--- a/vendor/github.com/go-openapi/jsonreference/README.md
+++ b/vendor/github.com/go-openapi/jsonreference/README.md
@@ -14,9 +14,10 @@
An implementation of JSON Reference for golang.
-
+
+* **2026-07-07** : landing v1.0.0
+ * stable API pledge
## Status
@@ -105,9 +106,6 @@ Maintainers can cut a new release by either:
[doc-url]: https://goswagger.io/go-openapi
[godoc-badge]: https://pkg.go.dev/badge/github.com/go-openapi/jsonreference
[godoc-url]: http://pkg.go.dev/github.com/go-openapi/jsonreference
-[slack-logo]: https://a.slack-edge.com/e6a93c1/img/icons/favicon-32.png
-[slack-badge]: https://img.shields.io/badge/slack-blue?link=https%3A%2F%2Fgoswagger.slack.com%2Farchives%2FC04R30YM
-[slack-url]: https://goswagger.slack.com/archives/C04R30YMU
[discord-badge]: https://img.shields.io/discord/1446918742398341256?logo=discord&label=discord&color=blue
[discord-url]: https://discord.gg/FfnFYaC3k5
diff --git a/vendor/github.com/go-openapi/loads/CONTRIBUTORS.md b/vendor/github.com/go-openapi/loads/CONTRIBUTORS.md
index 6ab26b8dd7..b13f2b8d22 100644
--- a/vendor/github.com/go-openapi/loads/CONTRIBUTORS.md
+++ b/vendor/github.com/go-openapi/loads/CONTRIBUTORS.md
@@ -4,11 +4,11 @@
| Total Contributors | Total Contributions |
| --- | --- |
-| 14 | 133 |
+| 14 | 139 |
| Username | All Time Contribution Count | All Commits |
| --- | --- | --- |
-| @fredbi | 55 | |
+| @fredbi | 61 | |
| @casualjim | 48 | |
| @youyuanwu | 6 | |
| @vburenin | 4 | |
diff --git a/vendor/github.com/go-openapi/loads/errors.go b/vendor/github.com/go-openapi/loads/errors.go
index e94f038f94..f1df4e38ae 100644
--- a/vendor/github.com/go-openapi/loads/errors.go
+++ b/vendor/github.com/go-openapi/loads/errors.go
@@ -3,6 +3,11 @@
package loads
+import (
+ "errors"
+ "fmt"
+)
+
type loaderError string
func (e loaderError) Error() string {
@@ -11,7 +16,7 @@ func (e loaderError) Error() string {
const (
// ErrLoads is an error returned by the loads package.
- ErrLoads loaderError = "loaderrs error"
+ ErrLoads loaderError = "cannot load spec"
// ErrNoLoader indicates that no configured loader matched the input.
ErrNoLoader loaderError = "no loader matched"
@@ -20,3 +25,17 @@ const (
// to a non-public address (loopback, private, link-local, or unspecified).
ErrForbiddenAddress loaderError = "blocked dial to a non-public address"
)
+
+// errLoads marks err as an error from this package, so callers may test it with
+// [errors.Is] against [ErrLoads].
+//
+// The cause is reported on a single line, after the sentinel. An error that already
+// carries the sentinel is returned unchanged: loaders are chained, and reporting
+// "cannot load spec" once per link in the chain would tell the caller nothing.
+func errLoads(err error) error {
+ if err == nil || errors.Is(err, ErrLoads) {
+ return err
+ }
+
+ return fmt.Errorf("%w: %w", ErrLoads, err)
+}
diff --git a/vendor/github.com/go-openapi/loads/loaders.go b/vendor/github.com/go-openapi/loads/loaders.go
index f8a2a9438d..dc5f22fe1b 100644
--- a/vendor/github.com/go-openapi/loads/loaders.go
+++ b/vendor/github.com/go-openapi/loads/loaders.go
@@ -5,7 +5,6 @@ package loads
import (
"encoding/json"
- "errors"
"net/url"
"slices"
@@ -47,6 +46,31 @@ func defaultLoaders() *loader {
})
}
+// LoaderChain links a list of [DocLoaderWithMatch] into a single [DocLoader], preserving order.
+// Entries with a nil Fn are skipped. Loading options passed at call time are forwarded to the
+// matched loader.
+//
+// Combined with [LoaderWithOptions], it composes a self-contained loader (for example a
+// format-dispatching YAML/JSON chain, each entry carrying its own options) that a caller can inject
+// through [WithDocLoader] instead of relying on the package-level global loaders.
+//
+// The returned DocLoader is never nil: when no usable loader is provided, it yields [ErrNoLoader]
+// on every call. This fails closed rather than returning nil (which every caller would have to
+// guard against, at the risk of a nil-func panic) or silently falling back to an unconfined
+// loader.
+func LoaderChain(ldrs ...DocLoaderWithMatch) DocLoader {
+ loader := buildLoaderChain(ldrs...)
+
+ return func(pth string, opts ...loading.Option) (json.RawMessage, error) {
+ l := loader.clone()
+ if l != nil {
+ l.loadingOptions = opts
+ }
+
+ return l.Load(pth) // nil-safe: yields ErrNoLoader when the chain is empty
+ }
+}
+
// buildLoaderChain links a list of [DocLoaderWithMatch] into a loader chain, preserving order.
// Entries with a nil Fn are skipped. Returns nil when no usable loader is provided.
func buildLoaderChain(ldrs ...DocLoaderWithMatch) *loader {
@@ -73,6 +97,26 @@ func buildLoaderChain(ldrs ...DocLoaderWithMatch) *loader {
// DocLoader represents a doc loader type.
type DocLoader func(string, ...loading.Option) (json.RawMessage, error)
+// LoaderWithOptions returns a [DocLoader] that always applies opts.
+//
+// Use it to bind a set of [loading.Option] to a loader so they apply to every load — for example a
+// custom HTTP client or timeout, authentication or custom headers, an embedded or rooted file
+// system, or a remote-address restriction. This is the building block for a document loader that
+// carries its own options, avoiding reliance on the package-level global loaders.
+//
+// opts are appended after any options passed at call time, so they take precedence (loading
+// options are last-wins). This also makes confinement options (e.g. [loading.WithRoot]) win over
+// any caller-supplied options.
+func LoaderWithOptions(fn DocLoader, opts ...loading.Option) DocLoader {
+ return func(path string, callOpts ...loading.Option) (json.RawMessage, error) {
+ all := make([]loading.Option, 0, len(callOpts)+len(opts))
+ all = append(all, callOpts...)
+ all = append(all, opts...)
+
+ return fn(path, all...)
+ }
+}
+
// DocMatcher represents a predicate to check if a loader matches.
type DocMatcher func(string) bool
@@ -117,7 +161,7 @@ func (l *loader) WithNext(next *loader) *loader {
func (l *loader) Load(path string) (json.RawMessage, error) {
_, erp := url.Parse(path)
if erp != nil {
- return nil, errors.Join(erp, ErrLoads)
+ return nil, errLoads(erp)
}
var lastErr error = ErrNoLoader // default error if no match was found
@@ -135,7 +179,7 @@ func (l *loader) Load(path string) (json.RawMessage, error) {
lastErr = err
}
- return nil, errors.Join(lastErr, ErrLoads)
+ return nil, errLoads(lastErr)
}
func (l *loader) clone() *loader {
@@ -157,7 +201,7 @@ func (l *loader) clone() *loader {
func JSONDoc(path string, opts ...loading.Option) (json.RawMessage, error) {
data, err := loading.LoadFromFileOrHTTP(path, opts...)
if err != nil {
- return nil, errors.Join(err, ErrLoads)
+ return nil, errLoads(err)
}
return json.RawMessage(data), nil
}
diff --git a/vendor/github.com/go-openapi/loads/options.go b/vendor/github.com/go-openapi/loads/options.go
index fec20520b4..6a4bc6983b 100644
--- a/vendor/github.com/go-openapi/loads/options.go
+++ b/vendor/github.com/go-openapi/loads/options.go
@@ -58,8 +58,9 @@ func WithDocLoaderMatches(l ...DocLoaderWithMatch) LoaderOption {
// WithLoadingOptions adds some [loading.Option] to be added when calling a registered loader.
//
// The options are attached to the document's loader, so they apply both to the initial load
-// and to every "$ref" resolved during [Document.Expanded]. This is the recommended place to
-// confine loading of untrusted input, for example with [loading.WithRoot] (local) and
+// and to every "$ref" resolved during [Document.Expanded].
+//
+// This is the recommended place to confine loading of untrusted input, for example with [loading.WithRoot] (local) and
// [loading.WithHTTPClient] (remote). See the package documentation on Security.
func WithLoadingOptions(loadingOptions ...loading.Option) LoaderOption {
return func(opt *options) {
diff --git a/vendor/github.com/go-openapi/loads/spec.go b/vendor/github.com/go-openapi/loads/spec.go
index 40eaff2c73..e9e4b57b78 100644
--- a/vendor/github.com/go-openapi/loads/spec.go
+++ b/vendor/github.com/go-openapi/loads/spec.go
@@ -7,7 +7,6 @@ import (
"bytes"
"encoding/gob"
"encoding/json"
- "errors"
"fmt"
"maps"
@@ -110,7 +109,7 @@ func Analyzed(data json.RawMessage, version string, options ...LoaderOption) (*D
version = "2.0"
}
if version != "2.0" {
- return nil, fmt.Errorf("spec version %q is not supported: %w", version, ErrLoads)
+ return nil, fmt.Errorf("%w: spec version %q is not supported", ErrLoads, version)
}
raw, err := trimData(data) // trim blanks, then convert yaml docs into json
@@ -120,12 +119,12 @@ func Analyzed(data json.RawMessage, version string, options ...LoaderOption) (*D
swspec := new(spec.Swagger)
if err = json.Unmarshal(raw, swspec); err != nil {
- return nil, errors.Join(err, ErrLoads)
+ return nil, errLoads(err)
}
origsqspec, err := cloneSpec(swspec)
if err != nil {
- return nil, errors.Join(err, ErrLoads)
+ return nil, errLoads(err)
}
d := &Document{
@@ -153,12 +152,12 @@ func trimData(in json.RawMessage) (json.RawMessage, error) {
// assume yaml doc: convert it to json
yml, err := yamlutils.BytesToYAMLDoc(trimmed)
if err != nil {
- return nil, fmt.Errorf("analyzed: %w: %w", err, ErrLoads)
+ return nil, fmt.Errorf("analyzed: %w", errLoads(err))
}
d, err := yamlutils.YAMLToJSON(yml)
if err != nil {
- return nil, fmt.Errorf("analyzed: %w: %w", err, ErrLoads)
+ return nil, fmt.Errorf("analyzed: %w", errLoads(err))
}
return d, nil
diff --git a/vendor/github.com/go-openapi/runtime/CONTRIBUTORS.md b/vendor/github.com/go-openapi/runtime/CONTRIBUTORS.md
index c632d75c4a..9c959ef482 100644
--- a/vendor/github.com/go-openapi/runtime/CONTRIBUTORS.md
+++ b/vendor/github.com/go-openapi/runtime/CONTRIBUTORS.md
@@ -4,12 +4,12 @@
| Total Contributors | Total Contributions |
| --- | --- |
-| 71 | 567 |
+| 71 | 570 |
| Username | All Time Contribution Count | All Commits |
| --- | --- | --- |
| @casualjim | 268 | |
-| @fredbi | 142 | |
+| @fredbi | 144 | |
| @youyuanwu | 19 | |
| @josephwoodward | 13 | |
| @kenjones-cisco | 12 | |
@@ -18,8 +18,8 @@
| @mstoykov | 6 | |
| @elakito | 6 | |
| @ifraixedes | 5 | |
+| @Copilot | 4 | |
| @zeitlinger | 4 | |
-| @Copilot | 3 | |
| @jkawamoto | 3 | |
| @stoyanr | 3 | |
| @keramix | 2 | |
diff --git a/vendor/github.com/go-openapi/runtime/middleware/context.go b/vendor/github.com/go-openapi/runtime/middleware/context.go
index 8291f63a72..12abfd4829 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/context.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/context.go
@@ -442,6 +442,7 @@ func (c *Context) RouteInfo(request *http.Request) (*MatchedRoute, *http.Request
if route, ok := c.LookupRoute(request); ok {
rCtx = stdContext.WithValue(rCtx, ctxMatchedRoute, route)
+ request.Pattern = route.BasePath + route.PathPattern
return route, request.WithContext(rCtx), ok
}
diff --git a/vendor/github.com/go-openapi/spec/CONTRIBUTORS.md b/vendor/github.com/go-openapi/spec/CONTRIBUTORS.md
index 2fd257bbee..12fd069b0f 100644
--- a/vendor/github.com/go-openapi/spec/CONTRIBUTORS.md
+++ b/vendor/github.com/go-openapi/spec/CONTRIBUTORS.md
@@ -4,12 +4,12 @@
| Total Contributors | Total Contributions |
| --- | --- |
-| 38 | 398 |
+| 38 | 403 |
| Username | All Time Contribution Count | All Commits |
| --- | --- | --- |
| @casualjim | 191 | |
-| @fredbi | 96 | |
+| @fredbi | 101 | |
| @pytlesk4 | 26 | |
| @kul-amr | 10 | |
| @keramix | 10 | |
diff --git a/vendor/github.com/go-openapi/spec/doc.go b/vendor/github.com/go-openapi/spec/doc.go
index 04eea35758..8b589781a6 100644
--- a/vendor/github.com/go-openapi/spec/doc.go
+++ b/vendor/github.com/go-openapi/spec/doc.go
@@ -4,4 +4,33 @@
// Package spec exposes an object model for OpenAPIv2 specifications (swagger).
//
// The exposed data structures know how to serialize to and deserialize from JSON.
+//
+// # Security
+//
+// Resolving and expanding "$ref" pointers loads documents through a pluggable loader (see
+// [ExpandOptions.PathLoader] and [ExpandOptions.PathLoaderWithOptions]). By default, that
+// loader is NOT sandboxed, so a specification obtained from an untrusted source can abuse it:
+//
+// - A local "$ref" such as "file:///etc/passwd" or a relative "../../secret.json" is read
+// straight off disk. A malicious specification can therefore read any file the process can
+// access (arbitrary file read / path traversal, CWE-22).
+// - A remote "$ref" such as "http://169.254.169.254/..." is fetched with no restriction. A
+// malicious specification can therefore probe or reach internal addresses (SSRF, CWE-918).
+//
+// Do NOT expand or resolve an untrusted specification with the default options. To process
+// untrusted specifications safely, inject a confined loader:
+//
+// - Recommended: use the restricted loaders from github.com/go-openapi/loads, for example
+// loads.SpecRestricted(path, root) or loads.SetRestrictedLoaders(root). They confine local
+// reads to root and route remote fetches through a client that rejects loopback, private and
+// link-local addresses, and the confinement applies to every "$ref" resolved during
+// expansion.
+// - Or directly: set [ExpandOptions.PathLoaderWithOptions] to a loader built with
+// github.com/go-openapi/swag/loading options such as loading.WithRoot (to confine local
+// reads to a directory) and loading.WithHTTPClient (to restrict remote fetches). A "$ref"
+// that resolves outside root is then rejected, including one reached through a "file://"
+// URI or a "../" traversal.
+//
+// Expanding an untrusted specification also has a resource-exhaustion vector ("$ref"
+// amplification); see [ExpandOptions.MaxExpansionNodes], which is bounded by default.
package spec
diff --git a/vendor/github.com/go-openapi/spec/errors.go b/vendor/github.com/go-openapi/spec/errors.go
index eaca01cc83..740b773c2c 100644
--- a/vendor/github.com/go-openapi/spec/errors.go
+++ b/vendor/github.com/go-openapi/spec/errors.go
@@ -20,6 +20,13 @@ var (
// ErrExpandUnsupportedType indicates that $ref expansion is attempted on some invalid type.
ErrExpandUnsupportedType = errors.New("expand: unsupported type. Input should be of type *Parameter or *Response")
+ // ErrExpandTooManyNodes indicates that $ref expansion exceeded the maximum number of schema nodes
+ // allowed for a single expansion (see ExpandOptions.MaxExpansionNodes).
+ //
+ // This is a safeguard against maliciously crafted specifications that expand to an exponential
+ // number of nodes from a small input (a $ref amplification / "billion laughs" style attack).
+ ErrExpandTooManyNodes = errors.New("expand: too many schema nodes: expansion budget exceeded (see ExpandOptions.MaxExpansionNodes)")
+
// ErrSpec is an error raised by the spec package.
ErrSpec = errors.New("spec error")
)
diff --git a/vendor/github.com/go-openapi/spec/expander.go b/vendor/github.com/go-openapi/spec/expander.go
index f9c2fa327a..00eb5b53a8 100644
--- a/vendor/github.com/go-openapi/spec/expander.go
+++ b/vendor/github.com/go-openapi/spec/expander.go
@@ -6,10 +6,23 @@ package spec
import (
"encoding/json"
"fmt"
+
+ "github.com/go-openapi/swag/loading"
)
const smallPrealloc = 10
+// DefaultMaxExpansionNodes is the default upper bound on the number of schema nodes
+// expanded during a single ExpandSpec / ExpandSchema* call.
+//
+// It guards against maliciously crafted specifications whose $ref graph expands to an
+// exponential number of nodes from a few kilobytes of input. For reference, expanding the
+// full Kubernetes API specification (the largest real-world spec we test against) visits
+// roughly 47,000 nodes, so this default leaves ample headroom for legitimate documents.
+//
+// See ExpandOptions.MaxExpansionNodes to tune or disable this budget.
+const DefaultMaxExpansionNodes = 500_000
+
// ExpandOptions provides options for the spec expander.
//
// RelativeBase is the path to the root document. This can be a remote URL or a path to a local file.
@@ -17,13 +30,59 @@ const smallPrealloc = 10
// If left empty, the root document is assumed to be located in the current working directory:
// all relative $ref's will be resolved from there.
//
-// PathLoader injects a document loading method. By default, this resolves to the function provided by the SpecLoader package variable.
+// PathLoader injects a document loading method. By default, this resolves to the function provided by the PathLoader package variable.
+//
+// PathLoaderWithOptions is an alternative document loader that accepts [loading.Option] values, matching the
+// signature used by the go-openapi/swag/loading and go-openapi/loads loaders. When set, it takes precedence over
+// PathLoader. This lets a caller inject an options-aware (e.g. path-confined) loader without an adapter closure.
+//
+// Security: the default loader is not sandboxed. When expanding an untrusted specification, inject a confined
+// loader (for example one built with loading.WithRoot) — see the package "Security" section.
type ExpandOptions struct {
RelativeBase string // the path to the root document to expand. This is a file, not a directory
SkipSchemas bool // do not expand schemas, just paths, parameters and responses
ContinueOnError bool // continue expanding even after and error is found
PathLoader func(string) (json.RawMessage, error) `json:"-"` // the document loading method that takes a path as input and yields a json document
AbsoluteCircularRef bool // circular $ref remaining after expansion remain absolute URLs
+
+ // PathLoaderWithOptions injects a document loading method that accepts loading options.
+ //
+ // It has the same role as PathLoader but matches the option-aware loader signature exposed by
+ // github.com/go-openapi/swag/loading (and github.com/go-openapi/loads), so such a loader can be
+ // injected directly, without wrapping it in an adapter closure.
+ //
+ // When set, PathLoaderWithOptions takes precedence over PathLoader. The provided loader is expected
+ // to carry its own loading options (for example a path confinement built with loading.WithRoot);
+ // the expander itself invokes it without adding options.
+ PathLoaderWithOptions func(string, ...loading.Option) (json.RawMessage, error) `json:"-"`
+
+ // MaxExpansionNodes caps the number of schema nodes expanded during a single expansion call,
+ // as a safeguard against $ref amplification attacks (see ErrExpandTooManyNodes).
+ //
+ // The value is interpreted as follows:
+ //
+ // 0 (the zero value): use DefaultMaxExpansionNodes. Every caller is protected by default.
+ // <0: no limit (unbounded expansion). Use only with fully trusted specifications.
+ // >0: cap the expansion at this number of nodes.
+ //
+ // When the budget is exceeded, expansion stops and ErrExpandTooManyNodes is returned.
+ // Because this is a resource-exhaustion safeguard, the error is always returned, even when
+ // ContinueOnError is set.
+ MaxExpansionNodes int
+}
+
+// maxExpansionNodes resolves the tri-state MaxExpansionNodes option into an effective budget.
+//
+// A returned value of 0 means "unbounded".
+func (o *ExpandOptions) maxExpansionNodes() int {
+ switch {
+ case o.MaxExpansionNodes == 0:
+ return DefaultMaxExpansionNodes
+ case o.MaxExpansionNodes < 0:
+ return 0 // unbounded
+ default:
+ return o.MaxExpansionNodes
+ }
}
func optionsOrDefault(opts *ExpandOptions) *ExpandOptions {
@@ -39,6 +98,10 @@ func optionsOrDefault(opts *ExpandOptions) *ExpandOptions {
}
// ExpandSpec expands the references in a swagger spec.
+//
+// Security: with default options the document loader is not sandboxed, so a "$ref" in an
+// untrusted spec can read local files or reach internal addresses. See the package "Security"
+// section before expanding untrusted input.
func ExpandSpec(spec *Swagger, options *ExpandOptions) error {
options = optionsOrDefault(options)
resolver := defaultSchemaLoader(spec, options, nil, nil)
@@ -121,25 +184,50 @@ func baseForRoot(root any, cache ResolutionCache) string {
// (use ExpandSchemaWithBasePath to resolve external references).
//
// Setting the cache is optional and this parameter may safely be left to nil.
+//
+// ExpandSchema uses the package default document loader, which is not sandboxed. To expand a
+// schema whose $ref may derive from untrusted input, use [ExpandSchemaWithOptions] with a confined
+// loader — see the package "Security" section.
func ExpandSchema(schema *Schema, root any, cache ResolutionCache) error {
+ return ExpandSchemaWithOptions(schema, root, cache, nil)
+}
+
+// ExpandSchemaWithOptions expands the refs in the schema object with reference to the root object,
+// honoring the provided expand options. It is the option-aware form of [ExpandSchema].
+//
+// In particular, set opts.PathLoaderWithOptions (or opts.PathLoader) to inject a confined document
+// loader when expanding a schema whose $ref may derive from an untrusted source (see the package
+// "Security" section). opts.ContinueOnError, opts.AbsoluteCircularRef and opts.MaxExpansionNodes
+// are honored as well.
+//
+// The base path is always derived from root (as with [ExpandSchema]), so opts.RelativeBase and
+// opts.SkipSchemas are ignored. Passing nil opts is equivalent to [ExpandSchema].
+//
+// Setting the cache is optional and this parameter may safely be left to nil.
+func ExpandSchemaWithOptions(schema *Schema, root any, cache ResolutionCache, opts *ExpandOptions) error {
cache = cacheOrDefault(cache)
if root == nil {
root = schema
}
- opts := &ExpandOptions{
- // when a root is specified, cache the root as an in-memory document for $ref retrieval
- RelativeBase: baseForRoot(root, cache),
- SkipSchemas: false,
- ContinueOnError: false,
+ effective := ExpandOptions{}
+ if opts != nil {
+ effective = *opts // preserve caller options (loader, ContinueOnError, budget, ...)
}
+ // when a root is specified, cache the root as an in-memory document for $ref retrieval
+ effective.RelativeBase = baseForRoot(root, cache)
+ effective.SkipSchemas = false
- return ExpandSchemaWithBasePath(schema, cache, opts)
+ return ExpandSchemaWithBasePath(schema, cache, &effective)
}
// ExpandSchemaWithBasePath expands the refs in the schema object, base path configured through expand options.
//
// Setting the cache is optional and this parameter may safely be left to nil.
+//
+// Security: with default options the document loader is not sandboxed, so a "$ref" in an
+// untrusted schema can read local files or reach internal addresses. See the package "Security"
+// section before expanding untrusted input.
func ExpandSchemaWithBasePath(schema *Schema, cache ResolutionCache, opts *ExpandOptions) error {
if schema == nil {
return nil
@@ -192,6 +280,10 @@ func expandItems(target Schema, parentRefs []string, resolver *schemaLoader, bas
//nolint:gocognit,gocyclo,cyclop // complex but well-tested $ref expansion logic; refactoring deferred to dedicated PR
func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) {
+ if err := resolver.context.countNode(); err != nil {
+ return &target, err
+ }
+
if target.Ref.String() == "" && target.Ref.IsRoot() {
newRef := normalizeRef(&target.Ref, basePath)
target.Ref = *newRef
@@ -454,25 +546,28 @@ func expandOperation(op *Operation, resolver *schemaLoader, basePath string) err
//
// Setting the cache is optional and this parameter may safely be left to nil.
func ExpandResponseWithRoot(response *Response, root any, cache ResolutionCache) error {
- cache = cacheOrDefault(cache)
- opts := &ExpandOptions{
- RelativeBase: baseForRoot(root, cache),
- }
- resolver := defaultSchemaLoader(root, opts, cache, nil)
-
- return expandParameterOrResponse(response, resolver, opts.RelativeBase)
+ return ExpandResponseWithOptions(response, root, cache, nil)
}
// ExpandResponse expands a response based on a basepath
//
// All refs inside response will be resolved relative to basePath.
func ExpandResponse(response *Response, basePath string) error {
- opts := optionsOrDefault(&ExpandOptions{
- RelativeBase: basePath,
- })
- resolver := defaultSchemaLoader(nil, opts, nil, nil)
+ return ExpandResponseWithOptions(response, nil, nil, &ExpandOptions{RelativeBase: basePath})
+}
- return expandParameterOrResponse(response, resolver, opts.RelativeBase)
+// ExpandResponseWithOptions expands a response, honoring the provided expand options.
+//
+// It is the option-aware form of [ExpandResponse] and [ExpandResponseWithRoot]. When root is
+// non-nil, refs resolve against the in-memory root document; otherwise they resolve relative to
+// opts.RelativeBase.
+//
+// Set opts.PathLoaderWithOptions (or opts.PathLoader) to inject a confined document loader when
+// the response's $ref may derive from an untrusted source — see the package "Security" section.
+//
+// Setting the cache is optional and this parameter may safely be left to nil.
+func ExpandResponseWithOptions(response *Response, root any, cache ResolutionCache, opts *ExpandOptions) error {
+ return expandRefableWithOptions(response, root, cache, opts)
}
// ExpandParameterWithRoot expands a parameter based on a root document, not a fetchable document.
@@ -480,26 +575,43 @@ func ExpandResponse(response *Response, basePath string) error {
// Notice that it is impossible to reference a json schema in a different document other than root
// (use ExpandParameter to resolve external references).
func ExpandParameterWithRoot(parameter *Parameter, root any, cache ResolutionCache) error {
- cache = cacheOrDefault(cache)
-
- opts := &ExpandOptions{
- RelativeBase: baseForRoot(root, cache),
- }
- resolver := defaultSchemaLoader(root, opts, cache, nil)
-
- return expandParameterOrResponse(parameter, resolver, opts.RelativeBase)
+ return ExpandParameterWithOptions(parameter, root, cache, nil)
}
// ExpandParameter expands a parameter based on a basepath.
// This is the exported version of expandParameter
// all refs inside parameter will be resolved relative to basePath.
func ExpandParameter(parameter *Parameter, basePath string) error {
- opts := optionsOrDefault(&ExpandOptions{
- RelativeBase: basePath,
- })
- resolver := defaultSchemaLoader(nil, opts, nil, nil)
+ return ExpandParameterWithOptions(parameter, nil, nil, &ExpandOptions{RelativeBase: basePath})
+}
+
+// ExpandParameterWithOptions expands a parameter, honoring the provided expand options.
+//
+// It is the option-aware form of [ExpandParameter] and [ExpandParameterWithRoot]. When root is
+// non-nil, refs resolve against the in-memory root document; otherwise they resolve relative to
+// opts.RelativeBase.
+//
+// Set opts.PathLoaderWithOptions (or opts.PathLoader) to inject a confined document loader when
+// the parameter's $ref may derive from an untrusted source — see the package "Security" section.
+//
+// Setting the cache is optional and this parameter may safely be left to nil.
+func ExpandParameterWithOptions(parameter *Parameter, root any, cache ResolutionCache, opts *ExpandOptions) error {
+ return expandRefableWithOptions(parameter, root, cache, opts)
+}
+
+// expandRefableWithOptions is the shared implementation for the option-aware parameter/response
+// expanders. When root is non-nil, refs resolve against the in-memory root (base derived from
+// root); otherwise they resolve relative to opts.RelativeBase. opts carries the loader and other
+// expand options.
+func expandRefableWithOptions(input any, root any, cache ResolutionCache, opts *ExpandOptions) error {
+ cache = cacheOrDefault(cache)
+ effective := optionsOrDefault(opts) // clones and normalizes RelativeBase; preserves the loader
+ if root != nil {
+ effective.RelativeBase = baseForRoot(root, cache)
+ }
+ resolver := defaultSchemaLoader(root, effective, cache, nil)
- return expandParameterOrResponse(parameter, resolver, opts.RelativeBase)
+ return expandParameterOrResponse(input, resolver, effective.RelativeBase)
}
func getRefAndSchema(input any) (*Ref, *Schema, error) {
diff --git a/vendor/github.com/go-openapi/spec/ref.go b/vendor/github.com/go-openapi/spec/ref.go
index 40b7d486c9..d1a7ab9b94 100644
--- a/vendor/github.com/go-openapi/spec/ref.go
+++ b/vendor/github.com/go-openapi/spec/ref.go
@@ -7,7 +7,6 @@ import (
"bytes"
"encoding/gob"
"encoding/json"
- "net/http"
"os"
"path/filepath"
@@ -62,7 +61,15 @@ func (r *Ref) RemoteURI() string {
return u.String()
}
-// IsValidURI returns true when the url the ref points to can be found.
+// IsValidURI returns true when the ref points to a valid URI.
+//
+// For an absolute URL, it only checks that the reference is a well-formed URI. It deliberately
+// does NOT perform a network request to verify that the remote target is reachable: doing so
+// would make validation depend on network availability and expose callers to denial-of-service
+// and SSRF when processing untrusted specifications. Resolving and fetching remote references is
+// the responsibility of the expander, through its configurable (and confinable) document loader.
+//
+// For a local file reference, it checks that the file exists.
func (r *Ref) IsValidURI(basepaths ...string) bool {
if r.String() == "" {
return true
@@ -74,15 +81,8 @@ func (r *Ref) IsValidURI(basepaths ...string) bool {
}
if r.HasFullURL {
- //nolint:noctx,gosec
- rr, err := http.Get(v)
- if err != nil {
- return false
- }
- defer rr.Body.Close()
-
- // true if the response is >= 200 and < 300
- return rr.StatusCode/100 == 2 //nolint:mnd
+ // a well-formed absolute URL is a valid URI; remote reachability is not checked here (see above).
+ return true
}
if !r.HasFileScheme && !r.HasFullFilePath && !r.HasURLPathOnly {
diff --git a/vendor/github.com/go-openapi/spec/schema.go b/vendor/github.com/go-openapi/spec/schema.go
index d7a481bf1a..c71a2e5c5a 100644
--- a/vendor/github.com/go-openapi/spec/schema.go
+++ b/vendor/github.com/go-openapi/spec/schema.go
@@ -9,7 +9,7 @@ import (
"strings"
"github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/swag/jsonname"
+ "github.com/go-openapi/jsonpointer/jsonname"
"github.com/go-openapi/swag/jsonutils"
)
diff --git a/vendor/github.com/go-openapi/spec/schema_loader.go b/vendor/github.com/go-openapi/spec/schema_loader.go
index 1e346069e2..491ed020fd 100644
--- a/vendor/github.com/go-openapi/spec/schema_loader.go
+++ b/vendor/github.com/go-openapi/spec/schema_loader.go
@@ -5,6 +5,7 @@ package spec
import (
"encoding/json"
+ "errors"
"fmt"
"log"
"net/url"
@@ -43,24 +44,48 @@ type resolverContext struct {
basePath string
loadDoc func(string) (json.RawMessage, error)
rootID string
+
+ // nodes counts the schema nodes expanded so far, capped by maxNodes to guard against
+ // $ref amplification. maxNodes == 0 means unbounded. Shared, single-threaded: no locking needed.
+ nodes int
+ maxNodes int
}
func newResolverContext(options *ExpandOptions) *resolverContext {
expandOptions := optionsOrDefault(options)
- // path loader may be overridden by options
+ // path loader may be overridden by options. An option-aware loader takes precedence over a
+ // plain one, which in turn takes precedence over the package-level default.
var loader func(string) (json.RawMessage, error)
- if expandOptions.PathLoader == nil {
- loader = PathLoader
- } else {
+ switch {
+ case expandOptions.PathLoaderWithOptions != nil:
+ withOptions := expandOptions.PathLoaderWithOptions
+ loader = func(pth string) (json.RawMessage, error) {
+ // the injected loader carries its own loading options: none are added here.
+ return withOptions(pth)
+ }
+ case expandOptions.PathLoader != nil:
loader = expandOptions.PathLoader
+ default:
+ loader = PathLoader
}
return &resolverContext{
circulars: make(map[string]bool),
basePath: expandOptions.RelativeBase, // keep the root base path in context
loadDoc: loader,
+ maxNodes: expandOptions.maxExpansionNodes(),
+ }
+}
+
+// countNode accounts for one expanded schema node and reports whether the expansion budget
+// has been exceeded. A maxNodes of 0 disables the budget (unbounded expansion).
+func (c *resolverContext) countNode() error {
+ c.nodes++
+ if c.maxNodes > 0 && c.nodes > c.maxNodes {
+ return ErrExpandTooManyNodes
}
+ return nil
}
type schemaLoader struct {
@@ -246,14 +271,22 @@ func (r *schemaLoader) deref(input any, parentRefs []string, basePath string) er
}
func (r *schemaLoader) shouldStopOnError(err error) bool {
- if err != nil && !r.options.ContinueOnError {
+ if err == nil {
+ return false
+ }
+
+ if errors.Is(err, ErrExpandTooManyNodes) {
+ // a blown expansion budget is a hard, document-level failure: it is a safeguard against
+ // resource exhaustion and is never suppressed by ContinueOnError.
return true
}
- if err != nil {
- log.Println(err)
+ if !r.options.ContinueOnError {
+ return true
}
+ log.Println(err)
+
return false
}
diff --git a/vendor/github.com/go-openapi/strfmt/.gitignore b/vendor/github.com/go-openapi/strfmt/.gitignore
index bbdffea78a..20c4e0fa04 100644
--- a/vendor/github.com/go-openapi/strfmt/.gitignore
+++ b/vendor/github.com/go-openapi/strfmt/.gitignore
@@ -4,3 +4,4 @@
.env
.mcp.json
go.work.sum
+.worktrees
diff --git a/vendor/github.com/go-openapi/strfmt/.golangci.yml b/vendor/github.com/go-openapi/strfmt/.golangci.yml
index 8a3b3bff7c..31480c7138 100644
--- a/vendor/github.com/go-openapi/strfmt/.golangci.yml
+++ b/vendor/github.com/go-openapi/strfmt/.golangci.yml
@@ -6,6 +6,8 @@ linters:
- depguard
- funlen
- gomoddirectives
+ - gomodguard
+ - gomodguard_v2
- godox
- exhaustruct
- nlreturn
diff --git a/vendor/github.com/go-openapi/strfmt/CONTRIBUTORS.md b/vendor/github.com/go-openapi/strfmt/CONTRIBUTORS.md
index 4aa4fcb54f..fa17ff3111 100644
--- a/vendor/github.com/go-openapi/strfmt/CONTRIBUTORS.md
+++ b/vendor/github.com/go-openapi/strfmt/CONTRIBUTORS.md
@@ -4,12 +4,12 @@
| Total Contributors | Total Contributions |
| --- | --- |
-| 40 | 239 |
+| 41 | 243 |
| Username | All Time Contribution Count | All Commits |
| --- | --- | --- |
| @casualjim | 88 | |
-| @fredbi | 71 | |
+| @fredbi | 74 | |
| @youyuanwu | 13 | |
| @jlambatl | 9 | |
| @GlenDC | 5 | |
@@ -26,6 +26,7 @@
| @bg451 | 2 | |
| @aleksandr-vin | 2 | |
| @ujjwalsh | 1 | |
+| @patchwright | 1 | |
| @kenjones-cisco | 1 | |
| @jwalter1-quest | 1 | |
| @ccoVeille | 1 | |
diff --git a/vendor/github.com/go-openapi/strfmt/README.md b/vendor/github.com/go-openapi/strfmt/README.md
index 4afef43733..15ee0e5826 100644
--- a/vendor/github.com/go-openapi/strfmt/README.md
+++ b/vendor/github.com/go-openapi/strfmt/README.md
@@ -67,7 +67,7 @@ It also provides convenient extensions to go-openapi users.
- [x] go-openapi custom format extensions
- bsonobjectid (BSON objectID)
- creditcard
- - duration (e.g. "3 weeks", "1ms")
+ - duration (e.g. "3 weeks", "1ms") (aka "duration-human")
- hexcolor (e.g. "#FFFFFF")
- isbn, isbn10, isbn13
- mac (e.g "01:02:03:04:05:06")
@@ -76,11 +76,26 @@ It also provides convenient extensions to go-openapi users.
- uuid, uuid3, uuid4, uuid5, uuid7
- cidr (e.g. "192.0.2.1/24", "2001:db8:a0b:12f0::1/32")
- ulid (e.g. "00000PP9HGSBSSDZ1JTEXBJ0PW", [spec](https://github.com/ulid/spec))
+- [x] JSON-schema draft 2020 formats
+ - duration-iso8601 B(e.g. "P2W")
> NOTE: as the name stands for, this package is intended to support string formatting only.
> It does not provide validation for numerical values with swagger format extension for JSON types "number" or
> "integer" (e.g. float, double, int32...).
+## Durations
+
+We have 2 very different definitions of the "duration" format: the "human-readable" duration that used to be just "duration",
+and the new "duration-iso8601". There is no "dual" parser that accepts both formats: types are specialized.
+
+To clarify the situation, a new alias for the duration format is introduced "duration-human" (e.g. "1 ms"), as opposed to
+"duration-iso8601".
+
+The `Default` format registry wires "duration-human" as the default mapping for "duration"
+(preexisting behavior, no breaking change - aligned with Swagger 2.0 which did not define "duration").
+
+A new `JSONSchema2020` registry wires "duration-iso8601" as the default mapping for "duration".
+
### Type conversion
All types defined here are stringers and may be converted to strings with `.String()`.
@@ -104,6 +119,7 @@ List of defined types:
- Date
- DateTime
- Duration
+- DurationISO8601 and `ISODuration[P ISODurationPolicy]` (for optional behavior)
- Email
- HexColor
- Hostname
diff --git a/vendor/github.com/go-openapi/strfmt/bson.go b/vendor/github.com/go-openapi/strfmt/bson.go
index 16a83f6408..b0c05d83bc 100644
--- a/vendor/github.com/go-openapi/strfmt/bson.go
+++ b/vendor/github.com/go-openapi/strfmt/bson.go
@@ -10,11 +10,6 @@ import (
"fmt"
)
-func init() { //nolint:gochecknoinits // registers bsonobjectid format in the default registry
- var id ObjectId
- Default.Add("bsonobjectid", &id, IsBSONObjectID)
-}
-
// IsBSONObjectID returns true when the string is a valid BSON [ObjectId].
func IsBSONObjectID(str string) bool {
_, err := objectIDFromHex(str)
diff --git a/vendor/github.com/go-openapi/strfmt/country.go b/vendor/github.com/go-openapi/strfmt/country.go
new file mode 100644
index 0000000000..39aeb3d786
--- /dev/null
+++ b/vendor/github.com/go-openapi/strfmt/country.go
@@ -0,0 +1,173 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package strfmt
+
+import (
+ "database/sql/driver"
+ "encoding/json"
+ "fmt"
+
+ "github.com/go-openapi/strfmt/internal/countries"
+)
+
+// Country represents an ISO 3166 country alpha-3 or alpha-2 code as a string format.
+//
+// swagger:strfmt country.
+type Country struct {
+ countries.Country
+
+ l int
+}
+
+const (
+ alpha2Len = 2
+ alpha3Len = 3
+)
+
+// IsCountry checks if a string is a valid ISO 3166 country format.
+func IsCountry(str string) bool {
+ _, err := ParseCountry(str)
+
+ return err == nil
+}
+
+// ParseCountry parses a string that represents a valid [Country].
+func ParseCountry(str string) (Country, error) {
+ l := len(str)
+ switch l {
+ case alpha3Len:
+ c, ok := countries.CountriesISO3[str]
+ if !ok {
+ return Country{}, fmt.Errorf("unrecognized strfmt.Country %q: %w", str, ErrFormat)
+ }
+
+ return Country{Country: c, l: alpha3Len}, nil
+ case alpha2Len:
+ c, ok := countries.CountriesISO2[str]
+ if !ok {
+ return Country{}, fmt.Errorf("unrecognized strfmt.Country %q: %w", str, ErrFormat)
+ }
+
+ return Country{Country: c, l: alpha2Len}, nil
+ default:
+ return Country{}, fmt.Errorf("invalid length for strfmt.Country in: %q: %w", str, ErrFormat)
+ }
+}
+
+// MarshalText returns this instance into text.
+func (u Country) MarshalText() ([]byte, error) {
+ return []byte(u.String()), nil
+}
+
+// UnmarshalText hydrates this instance from text.
+func (u *Country) UnmarshalText(data []byte) error { // validation is performed later on
+ c, err := ParseCountry(string(data))
+ if err != nil {
+ return err
+ }
+
+ *u = c
+
+ return nil
+}
+
+// Scan read a value from a database driver.
+func (u *Country) Scan(raw any) error {
+ switch v := raw.(type) {
+ case []byte:
+ c, err := ParseCountry(string(v))
+ if err != nil {
+ return err
+ }
+ *u = c
+ case string:
+ c, err := ParseCountry(v)
+ if err != nil {
+ return err
+ }
+ *u = c
+ default:
+ return fmt.Errorf("cannot sql.Scan() strfmt.Country from: %#v: %w", v, ErrFormat)
+ }
+
+ return nil
+}
+
+// Value converts a value to a database driver value.
+func (u Country) Value() (driver.Value, error) {
+ return driver.Value(u.String()), nil
+}
+
+func (u Country) String() string {
+ switch u.l {
+ case alpha3Len:
+ return u.ISOAlpha3
+ case alpha2Len:
+ return u.ISOAlpha2
+ default:
+ return ""
+ }
+}
+
+// MarshalJSON returns the [Country] as JSON.
+func (u Country) MarshalJSON() ([]byte, error) {
+ return json.Marshal(u.String())
+}
+
+// UnmarshalJSON sets the [Country] from JSON.
+func (u *Country) UnmarshalJSON(data []byte) error {
+ if string(data) == jsonNull {
+ return nil
+ }
+ var ustr string
+ if err := json.Unmarshal(data, &ustr); err != nil {
+ return err
+ }
+
+ c, err := ParseCountry(ustr)
+ if err != nil {
+ return err
+ }
+
+ *u = c
+
+ return nil
+}
+
+// DeepCopyInto copies the receiver and writes its value into out.
+func (u *Country) DeepCopyInto(out *Country) {
+ *out = *u
+}
+
+// DeepCopy copies the receiver into a new [Country].
+func (u *Country) DeepCopy() *Country {
+ if u == nil {
+ return nil
+ }
+
+ out := new(Country)
+ u.DeepCopyInto(out)
+
+ return out
+}
+
+// GobEncode implements the gob.GobEncoder interface.
+func (u Country) GobEncode() ([]byte, error) {
+ return u.MarshalText()
+}
+
+// GobDecode implements the gob.GobDecoder interface.
+func (u *Country) GobDecode(data []byte) error {
+ return u.UnmarshalText(data)
+}
+
+// MarshalBinary implements the encoding.[encoding.BinaryMarshaler] interface.
+func (u Country) MarshalBinary() ([]byte, error) {
+ return u.MarshalText()
+}
+
+// UnmarshalBinary implements the encoding.[encoding.BinaryUnmarshaler] interface.
+func (u *Country) UnmarshalBinary(data []byte) error {
+ return u.UnmarshalText(data)
+}
diff --git a/vendor/github.com/go-openapi/strfmt/currency.go b/vendor/github.com/go-openapi/strfmt/currency.go
new file mode 100644
index 0000000000..7af115663f
--- /dev/null
+++ b/vendor/github.com/go-openapi/strfmt/currency.go
@@ -0,0 +1,146 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package strfmt
+
+import (
+ "database/sql/driver"
+ "encoding/json"
+ "fmt"
+
+ "golang.org/x/text/currency"
+)
+
+// Currency represents an ISO 4217 currency alpha-3 code as a string format.
+//
+// # Implementation
+//
+// golang.org/x/text/currency
+//
+// swagger:strfmt currency.
+type Currency struct {
+ currency.Unit
+}
+
+// IsCurrency checks if a string is a valid currency format.
+func IsCurrency(str string) bool {
+ _, err := ParseCurrency(str)
+
+ return err == nil
+}
+
+// ParseCurrency parses a string that represents a valid [Currency].
+func ParseCurrency(str string) (Currency, error) {
+ cur, err := currency.ParseISO(str)
+
+ return Currency{Unit: cur}, err
+}
+
+// MarshalText returns this instance into text.
+func (u Currency) MarshalText() ([]byte, error) {
+ return []byte(u.Unit.String()), nil
+}
+
+// UnmarshalText hydrates this instance from text.
+func (u *Currency) UnmarshalText(data []byte) error { // validation is performed later on
+ cur, err := ParseCurrency(string(data))
+ if err != nil {
+ return err
+ }
+ *u = cur
+
+ return nil
+}
+
+// Scan read a value from a database driver.
+func (u *Currency) Scan(raw any) error {
+ switch v := raw.(type) {
+ case []byte:
+ cur, err := ParseCurrency(string(v))
+ if err != nil {
+ return err
+ }
+ *u = cur
+ case string:
+ cur, err := ParseCurrency(v)
+ if err != nil {
+ return err
+ }
+ *u = cur
+ default:
+ return fmt.Errorf("cannot sql.Scan() strfmt.Currency from: %#v: %w", v, ErrFormat)
+ }
+
+ return nil
+}
+
+// Value converts a value to a database driver value.
+func (u Currency) Value() (driver.Value, error) {
+ return driver.Value(u.String()), nil
+}
+
+func (u Currency) String() string {
+ return u.Unit.String()
+}
+
+// MarshalJSON returns the [Currency] as JSON.
+func (u Currency) MarshalJSON() ([]byte, error) {
+ return json.Marshal(u.String())
+}
+
+// UnmarshalJSON sets the [Currency] from JSON.
+func (u *Currency) UnmarshalJSON(data []byte) error {
+ if string(data) == jsonNull {
+ return nil
+ }
+ var ustr string
+ if err := json.Unmarshal(data, &ustr); err != nil {
+ return err
+ }
+
+ cur, err := ParseCurrency(ustr)
+ if err != nil {
+ return err
+ }
+
+ *u = cur
+
+ return nil
+}
+
+// DeepCopyInto copies the receiver and writes its value into out.
+func (u *Currency) DeepCopyInto(out *Currency) {
+ *out = *u
+}
+
+// DeepCopy copies the receiver into a new [Currency].
+func (u *Currency) DeepCopy() *Currency {
+ if u == nil {
+ return nil
+ }
+
+ out := new(Currency)
+ u.DeepCopyInto(out)
+
+ return out
+}
+
+// GobEncode implements the gob.GobEncoder interface.
+func (u Currency) GobEncode() ([]byte, error) {
+ return u.MarshalText()
+}
+
+// GobDecode implements the gob.GobDecoder interface.
+func (u *Currency) GobDecode(data []byte) error {
+ return u.UnmarshalText(data)
+}
+
+// MarshalBinary implements the encoding.[encoding.BinaryMarshaler] interface.
+func (u Currency) MarshalBinary() ([]byte, error) {
+ return u.MarshalText()
+}
+
+// UnmarshalBinary implements the encoding.[encoding.BinaryUnmarshaler] interface.
+func (u *Currency) UnmarshalBinary(data []byte) error {
+ return u.UnmarshalText(data)
+}
diff --git a/vendor/github.com/go-openapi/strfmt/date.go b/vendor/github.com/go-openapi/strfmt/date.go
index 59ee1f1121..6d0e8a01ac 100644
--- a/vendor/github.com/go-openapi/strfmt/date.go
+++ b/vendor/github.com/go-openapi/strfmt/date.go
@@ -10,11 +10,6 @@ import (
"time"
)
-func init() { //nolint:gochecknoinits // registers date format in the default registry
- d := Date{}
- Default.Add("date", &d, IsDate)
-}
-
// IsDate returns true when the string is a valid date.
func IsDate(str string) bool {
_, err := time.Parse(RFC3339FullDate, str)
diff --git a/vendor/github.com/go-openapi/strfmt/default.go b/vendor/github.com/go-openapi/strfmt/default.go
index 725cc0e1a6..bcc57e6fad 100644
--- a/vendor/github.com/go-openapi/strfmt/default.go
+++ b/vendor/github.com/go-openapi/strfmt/default.go
@@ -32,22 +32,22 @@ const (
)
const (
- // UUIDPattern Regex for [UUID] that allows uppercase
+ // UUIDPattern Regex for [UUID] that allows uppercase.
//
// Deprecated: [strfmt] no longer uses regular expressions to validate UUIDs.
UUIDPattern = `(?i)(^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)|(^[0-9a-f]{32}$)`
- // UUID3Pattern Regex for [UUID3] that allows uppercase
+ // UUID3Pattern Regex for [UUID3] that allows uppercase.
//
// Deprecated: [strfmt] no longer uses regular expressions to validate UUIDs.
UUID3Pattern = `(?i)(^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$)|(^[0-9a-f]{12}3[0-9a-f]{3}?[0-9a-f]{16}$)`
- // UUID4Pattern Regex for [UUID4] that allows uppercase
+ // UUID4Pattern Regex for [UUID4] that allows uppercase.
//
// Deprecated: [strfmt] no longer uses regular expressions to validate UUIDs.
UUID4Pattern = `(?i)(^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$)|(^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$)`
- // UUID5Pattern Regex for [UUID]5 that allows uppercase
+ // UUID5Pattern Regex for [UUID]5 that allows uppercase.
//
// Deprecated: [strfmt] no longer uses regular expressions to validate UUIDs.
UUID5Pattern = `(?i)(^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$)|(^[0-9a-f]{12}5[0-9a-f]{3}[89ab][0-9a-f]{15}$)`
@@ -88,8 +88,8 @@ var (
// IsHostname returns true when the string is a valid hostname.
//
-// It follows the rules detailed at https://url.spec.whatwg.org/#concept-host-parser
-// and implemented by most modern web browsers.
+// It follows the rules detailed at https://url.spec.whatwg.org/#concept-host-parser and implemented by most modern web
+// browsers.
//
// It supports IDNA rules regarding internationalized names with unicode.
//
@@ -142,13 +142,13 @@ func IsHostname(str string) bool {
return true
}
-// domainEndsAsNumber determines if a domain name ends with a decimal, octal or hex digit,
-// accounting for a possible trailing dot (the last part being empty in that case).
+// domainEndsAsNumber determines if a domain name ends with a decimal, octal or hex digit, accounting for a possible
+// trailing dot (the last part being empty in that case).
//
// It returns the last non-trailing dot part and if that part consists only of (dec/hex/oct) digits.
func domainEndsAsNumber(parts []string) (lastPart string, lastIndex int, ok bool) {
- // NOTE: using ParseUint(x, 0, 32) is not an option, as the IPv4 format supported why WHATWG
- // doesn't support notations such as "0b1001" (binary digits) or "0o666" (alternate notation for octal digits).
+ // NOTE: using ParseUint(x, 0, 32) is not an option, as the IPv4 format supported why WHATWG doesn't support notations
+ // such as "0b1001" (binary digits) or "0o666" (alternate notation for octal digits).
lastIndex = len(parts) - 1
lastPart = parts[lastIndex]
if len(lastPart) == 0 {
@@ -233,8 +233,9 @@ func isValidIPv6(str string) bool {
// "0o07.2.3.4"
func isValidIPv4(parts []string) bool {
// NOTE: using ParseUint(x, 0, 32) is not an option, even though it would simplify this code a lot.
- // The IPv4 format supported why WHATWG doesn't support notations such as "0b1001" (binary digits)
- // or "0o666" (alternate notation for octal digits).
+ //
+ // The IPv4 format supported why WHATWG doesn't support notations such as "0b1001" (binary digits) or "0o666"
+ // (alternate notation for octal digits).
const (
maxPartsInIPv4 = 4
maxDigitsInPart = 11 // max size of a 4-bytes hex or octal digit
@@ -376,101 +377,22 @@ func IsEmail(str string) bool {
return e == nil && addr.Address != ""
}
-func init() { //nolint:gochecknoinits // registers all default string formats in the registry
- // register formats in the default registry:
- // - byte
- // - creditcard
- // - email
- // - hexcolor
- // - hostname
- // - ipv4
- // - ipv6
- // - cidr
- // - isbn
- // - isbn10
- // - isbn13
- // - mac
- // - password
- // - rgbcolor
- // - ssn
- // - uri
- // - uuid
- // - uuid3
- // - uuid4
- // - uuid5
- // - uuid7
- u := URI("")
- Default.Add("uri", &u, isRequestURI)
-
- eml := Email("")
- Default.Add("email", &eml, IsEmail)
-
- hn := Hostname("")
- Default.Add("hostname", &hn, IsHostname)
-
- ip4 := IPv4("")
- Default.Add("ipv4", &ip4, isIPv4)
-
- ip6 := IPv6("")
- Default.Add("ipv6", &ip6, isIPv6)
-
- cidr := CIDR("")
- Default.Add("cidr", &cidr, isCIDR)
-
- mac := MAC("")
- Default.Add("mac", &mac, isMAC)
-
- uid := UUID("")
- Default.Add("uuid", &uid, IsUUID)
-
- uid3 := UUID3("")
- Default.Add("uuid3", &uid3, IsUUID3)
-
- uid4 := UUID4("")
- Default.Add("uuid4", &uid4, IsUUID4)
-
- uid5 := UUID5("")
- Default.Add("uuid5", &uid5, IsUUID5)
-
- uid7 := UUID7("")
- Default.Add("uuid7", &uid7, IsUUID7)
-
- isbn := ISBN("")
- Default.Add("isbn", &isbn, func(str string) bool { return isISBN10(str) || isISBN13(str) })
-
- isbn10 := ISBN10("")
- Default.Add("isbn10", &isbn10, isISBN10)
-
- isbn13 := ISBN13("")
- Default.Add("isbn13", &isbn13, isISBN13)
-
- cc := CreditCard("")
- Default.Add("creditcard", &cc, isCreditCard)
-
- ssn := SSN("")
- Default.Add("ssn", &ssn, isSSN)
-
- hc := HexColor("")
- Default.Add("hexcolor", &hc, isHexcolor)
-
- rc := RGBColor("")
- Default.Add("rgbcolor", &rc, isRGBcolor)
-
- b64 := Base64([]byte(nil))
- Default.Add("byte", &b64, isBase64)
-
- pw := Password("")
- Default.Add("password", &pw, func(_ string) bool { return true })
-}
+// base64Encoding is the canonical alphabet for the [Base64] format.
+//
+// OpenAPI `format: byte` means standard base64 (RFC 4648 §4, the `+/` alphabet), not base64url.
+// This is the single seam every [Base64] path encodes and decodes through, so a future URL-safe variant only swaps the
+// encoding here.
+// See go-openapi/strfmt#87.
+var base64Encoding = base64.StdEncoding //nolint:gochecknoglobals // canonical alphabet seam for the Base64 format
-// Base64 represents a base64 encoded string, using URLEncoding alphabet.
+// Base64 represents a base64 encoded string, using the standard RFC 4648 alphabet.
//
// swagger:strfmt byte.
type Base64 []byte
// MarshalText turns this instance into text.
func (b Base64) MarshalText() ([]byte, error) {
- enc := base64.URLEncoding
+ enc := base64Encoding
src := []byte(b)
buf := make([]byte, enc.EncodedLen(len(src)))
enc.Encode(buf, src)
@@ -479,7 +401,7 @@ func (b Base64) MarshalText() ([]byte, error) {
// UnmarshalText hydrates this instance from text.
func (b *Base64) UnmarshalText(data []byte) error { // validation is performed later on
- enc := base64.URLEncoding
+ enc := base64Encoding
dbuf := make([]byte, enc.DecodedLen(len(data)))
n, err := enc.Decode(dbuf, data)
@@ -495,14 +417,14 @@ func (b *Base64) UnmarshalText(data []byte) error { // validation is performed l
func (b *Base64) Scan(raw any) error {
switch v := raw.(type) {
case []byte:
- dbuf := make([]byte, base64.StdEncoding.DecodedLen(len(v)))
- n, err := base64.StdEncoding.Decode(dbuf, v)
+ dbuf := make([]byte, base64Encoding.DecodedLen(len(v)))
+ n, err := base64Encoding.Decode(dbuf, v)
if err != nil {
return err
}
*b = dbuf[:n]
case string:
- vv, err := base64.StdEncoding.DecodeString(v)
+ vv, err := base64Encoding.DecodeString(v)
if err != nil {
return err
}
@@ -520,7 +442,7 @@ func (b Base64) Value() (driver.Value, error) {
}
func (b Base64) String() string {
- return base64.StdEncoding.EncodeToString([]byte(b))
+ return base64Encoding.EncodeToString([]byte(b))
}
// MarshalJSON returns the Base64 as JSON.
@@ -534,7 +456,7 @@ func (b *Base64) UnmarshalJSON(data []byte) error {
if err := json.Unmarshal(data, &b64str); err != nil {
return err
}
- vb, err := base64.StdEncoding.DecodeString(b64str)
+ vb, err := base64Encoding.DecodeString(b64str)
if err != nil {
return err
}
@@ -1040,7 +962,7 @@ func (u *MAC) DeepCopy() *MAC {
return out
}
-// UUID represents a [uuid] string format
+// UUID represents a [uuid] string format.
//
// swagger:strfmt uuid.
type UUID string
@@ -1905,6 +1827,7 @@ func (r *RGBColor) DeepCopy() *RGBColor {
}
// Password represents a password.
+//
// This has no validations and is mainly used as a marker for UI components.
//
// swagger:strfmt password.
@@ -1978,11 +1901,10 @@ func (r *Password) DeepCopy() *Password {
}
func isRequestURI(rawurl string) bool {
- // url.ParseRequestURI assumes the input contains no "#fragment"
- // (RFC 3986 §3.5). A URI with a fragment and an empty path, such as
- // "https://host#@frag", is therefore misread as userinfo and rejected
- // as "invalid userinfo". Strip the fragment first so the absolute
- // request URI validates, matching url.Parse's RFC 3986 handling.
+ // url.ParseRequestURI assumes the input contains no "#fragment" (RFC 3986 §3.5).
+ // A URI with a fragment and an empty path, such as "https://host#@frag", is therefore misread as userinfo and rejected
+ // as "invalid userinfo".
+ // Strip the fragment first so the absolute request URI validates, matching url.Parse's RFC 3986 handling.
if i := strings.IndexByte(rawurl, '#'); i >= 0 {
rawurl = rawurl[:i]
}
@@ -2009,19 +1931,20 @@ func isCIDR(str string) bool {
}
// isMAC checks if a string is valid MAC address.
+//
// Possible MAC formats:
-// 01:23:45:67:89:ab
-// 01:23:45:67:89:ab:cd:ef
-// 01-23-45-67-89-ab
-// 01-23-45-67-89-ab-cd-ef
-// 0123.4567.89ab
-// 0123.4567.89ab.cdef.
+// - 01:23:45:67:89:ab
+// - 01:23:45:67:89:ab:cd:ef
+// - 01-23-45-67-89-ab
+// - 01-23-45-67-89-ab-cd-ef
+// - 0123.4567.89ab 0123.4567.89ab.cdef
func isMAC(str string) bool {
_, err := net.ParseMAC(str)
return err == nil
}
// isISBN checks if the string is an ISBN (version 10 or 13).
+//
// If version value is not equal to 10 or 13, it will be checks both variants.
func isISBN(str string, version int) bool {
sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "")
@@ -2120,7 +2043,7 @@ func isRGBcolor(str string) bool {
// isBase64 checks if a string is base64 encoded.
func isBase64(str string) bool {
- _, err := base64.StdEncoding.DecodeString(str)
+ _, err := base64Encoding.DecodeString(str)
return err == nil
}
diff --git a/vendor/github.com/go-openapi/strfmt/duration.go b/vendor/github.com/go-openapi/strfmt/duration.go
index f2ab7ff834..fc4de0d14c 100644
--- a/vendor/github.com/go-openapi/strfmt/duration.go
+++ b/vendor/github.com/go-openapi/strfmt/duration.go
@@ -12,11 +12,6 @@ import (
"unicode"
)
-func init() { //nolint:gochecknoinits // registers duration format in the default registry
- d := Duration(0)
- Default.Add("duration", &d, IsDuration)
-}
-
const (
hoursInDay = 24
daysInWeek = 7
@@ -174,6 +169,9 @@ func ParseDuration(s string) (time.Duration, error) {
scale float64 = 1 // value = v + f/scale
)
s = strings.TrimLeftFunc(s, unicode.IsSpace)
+ if s == "" {
+ break
+ }
// The next character must be 0-9.]
if s[0] != '.' && ('0' > s[0] || s[0] > '9') {
diff --git a/vendor/github.com/go-openapi/strfmt/duration_iso8601.go b/vendor/github.com/go-openapi/strfmt/duration_iso8601.go
new file mode 100644
index 0000000000..9fded035ae
--- /dev/null
+++ b/vendor/github.com/go-openapi/strfmt/duration_iso8601.go
@@ -0,0 +1,583 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package strfmt
+
+import (
+ "database/sql/driver"
+ "encoding/json"
+ "fmt"
+ "math"
+ "strconv"
+ "strings"
+ "time"
+)
+
+// ISO 8601 duration unit lengths, expressed in nanoseconds.
+//
+// Calendar units are collapsed to fixed lengths (a year is 365 days, a month is 30 days): a [time.Duration] cannot
+// carry calendar context, so this conversion is inherently lossy and not calendar-correct.
+// It matches the historical behaviour of ISO duration libraries in this space.
+const (
+ isoSecond = uint64(time.Second)
+ isoMinute = uint64(time.Minute)
+ isoHour = uint64(time.Hour)
+ isoDay = 24 * isoHour
+ isoWeek = 7 * isoDay
+ isoMonth = 30 * isoDay
+ isoYear = 365 * isoDay
+
+ // maxDurationMagnitude is 1<<63: the magnitude of [math.MinInt64], and one more than [math.MaxInt64].
+ //
+ // A parsed magnitude may reach exactly this value only for a negative duration (yielding [math.MinInt64]).
+ maxDurationMagnitude = uint64(1) << 63
+)
+
+// Base-10 parsing / formatting constants (decimalBase lives in default.go).
+const (
+ // decimalAccMax bounds a uint64 accumulator so that acc*decimalBase + 9 cannot overflow.
+ decimalAccMax = (math.MaxUint64 - (decimalBase - 1)) / decimalBase
+ // nanoDigits is the number of fractional digits in one whole second (nanosecond precision).
+ nanoDigits = 9
+)
+
+// ISODuration is an ISO 8601 / RFC 3339 duration (e.g. "P1Y2M3DT4H5M6S", "P2W").
+//
+// The type parameter P selects the parsing policy at compile time (see [ISODurationPolicy]).
+// Every instantiation is a distinct type that round-trips through JSON, text, SQL and BSON.
+// Use the [DurationISO8601] alias for the strict, spec-compliant default.
+//
+// Like [time.Duration], it stores a nanosecond count; the largest representable duration is approximately 290 years.
+// Calendar units are collapsed to fixed lengths (year = 365 days, month = 30 days), which is lossy by nature.
+//
+// This generic type carries no swagger:strfmt annotation: go-swagger binds a concrete format name to the
+// [DurationISO8601] alias, not to a generic declaration.
+type ISODuration[P ISODurationPolicy] time.Duration
+
+// DurationISO8601 is the strict, spec-compliant ISO 8601 duration: the JSON Schema draft 2020 "duration" format
+// (RFC 3339 Appendix A).
+//
+// It binds to the explicit, unambiguous "duration-iso8601" handle. Plain "duration" is a context-dependent
+// default resolved by the registry ([Default] → human, [JSONSchema2020Registry] → ISO), not by this static type.
+//
+// swagger:strfmt duration-iso8601.
+type DurationISO8601 = ISODuration[DurationStrict]
+
+// ParseISO8601Duration parses an ISO 8601 / RFC 3339 duration string.
+//
+// With no options it enforces the strict RFC 3339 Appendix A grammar.
+// Options relax individual rules for programmatic callers.
+func ParseISO8601Duration(s string, opts ...ISODurationOption) (time.Duration, error) {
+ cfg := DurationStrict{}.isoDurationConfig()
+ for _, o := range opts {
+ o(&cfg)
+ }
+ return parseISO8601Duration(s, cfg)
+}
+
+// --- Format / encoding methods ---
+
+// String renders the duration in canonical ISO 8601 form.
+//
+// Unlike [ISODuration.MarshalText], String is a best-effort display form: it always renders the true value (lossless),
+// even under a strict policy that could not serialize it (e.g. a sign or sub-second precision).
+func (d ISODuration[P]) String() string { return isoFormat(time.Duration(d)) }
+
+// MarshalText implements [encoding.TextMarshaler], applying the policy P: a strict policy errors on a value it cannot
+// represent (see [isoEmit]).
+func (d ISODuration[P]) MarshalText() ([]byte, error) {
+ var p P
+ s, err := isoEmit(time.Duration(d), p.isoDurationConfig())
+ if err != nil {
+ return nil, err
+ }
+ return []byte(s), nil
+}
+
+// UnmarshalText implements [encoding.TextUnmarshaler], applying the policy P.
+func (d *ISODuration[P]) UnmarshalText(text []byte) error {
+ var p P
+ dd, err := parseISO8601Duration(string(text), p.isoDurationConfig())
+ if err != nil {
+ return err
+ }
+ *d = ISODuration[P](dd)
+ return nil
+}
+
+// MarshalJSON returns the duration as a JSON string, applying the policy P.
+func (d ISODuration[P]) MarshalJSON() ([]byte, error) {
+ var p P
+ s, err := isoEmit(time.Duration(d), p.isoDurationConfig())
+ if err != nil {
+ return nil, err
+ }
+ return json.Marshal(s)
+}
+
+// UnmarshalJSON sets the duration from a JSON string, applying the policy P.
+func (d *ISODuration[P]) UnmarshalJSON(data []byte) error {
+ if string(data) == jsonNull {
+ return nil
+ }
+ var str string
+ if err := json.Unmarshal(data, &str); err != nil {
+ return err
+ }
+ var p P
+ dd, err := parseISO8601Duration(str, p.isoDurationConfig())
+ if err != nil {
+ return err
+ }
+ *d = ISODuration[P](dd)
+ return nil
+}
+
+// Scan reads a duration (nanoseconds) from a database driver value.
+func (d *ISODuration[P]) Scan(raw any) error {
+ switch v := raw.(type) {
+ case int64:
+ *d = ISODuration[P](v)
+ case float64:
+ *d = ISODuration[P](int64(v))
+ case nil:
+ *d = ISODuration[P](0)
+ default:
+ return fmt.Errorf("cannot sql.Scan() strfmt.ISODuration from: %#v: %w", v, ErrFormat)
+ }
+ return nil
+}
+
+// Value writes the duration as a nanosecond count.
+func (d ISODuration[P]) Value() (driver.Value, error) {
+ return driver.Value(int64(d)), nil
+}
+
+// Equal reports whether two durations are equal.
+func (d ISODuration[P]) Equal(other ISODuration[P]) bool { return d == other }
+
+// DeepCopyInto copies the receiver into out.
+func (d *ISODuration[P]) DeepCopyInto(out *ISODuration[P]) { *out = *d }
+
+// DeepCopy copies the receiver into a new value.
+func (d *ISODuration[P]) DeepCopy() *ISODuration[P] {
+ if d == nil {
+ return nil
+ }
+ out := new(ISODuration[P])
+ d.DeepCopyInto(out)
+ return out
+}
+
+// IsDurationISO8601 returns true if the string is a valid strict ISO 8601 duration.
+func IsDurationISO8601(s string) bool {
+ _, err := parseISO8601Duration(s, DurationStrict{}.isoDurationConfig())
+ return err == nil
+}
+
+func isoDurationError(input, msg string) error {
+ return fmt.Errorf("invalid ISO 8601 duration %q: %s: %w", input, msg, ErrFormat)
+}
+
+// section positions used to enforce component ordering (strictly increasing).
+//
+//nolint:gochecknoglobals,mnd // immutable ordinal lookup tables; the integers are sequence positions, not magic constants
+var (
+ isoDatePos = map[byte]int{'Y': 1, 'M': 2, 'W': 3, 'D': 4}
+ isoTimePos = map[byte]int{'H': 1, 'M': 2, 'S': 3}
+)
+
+// isoDateSlot maps the year/month/day designators to contiguous slots for the strict anchoring (gap) check.
+//
+// 'W' is deliberately excluded: in strict mode it is exclusive, so it never coexists with Y/M/D.
+func isoDateSlot(des byte) (int, bool) {
+ switch des {
+ case 'Y':
+ return 0, true
+ case 'M':
+ return 1, true
+ case 'D':
+ return 2, true //nolint:mnd // contiguous slot index (Y=0, M=1, D=2), not a magic constant
+ default:
+ return 0, false
+ }
+}
+
+//nolint:gocognit,gocyclo,cyclop // a single-pass grammar scanner; the branches mirror the ABNF.
+func parseISO8601Duration(input string, cfg isoDurationConfig) (time.Duration, error) {
+ s := input
+ if cfg.allowSpace {
+ s = strings.TrimSpace(s)
+ }
+
+ neg := false
+ if cfg.allowSign && s != "" && (s[0] == '+' || s[0] == '-') {
+ neg = s[0] == '-'
+ s = s[1:]
+ }
+
+ if s == "" || s[0] != 'P' {
+ return 0, isoDurationError(input, `must start with "P"`)
+ }
+ s = s[1:]
+ if s == "" {
+ return 0, isoDurationError(input, "no components after P")
+ }
+
+ var (
+ total uint64
+ inTime bool
+ seenAny bool
+ weekSeen bool
+ fractionUsed bool
+ lastDatePos int
+ lastTimePos int
+ datePresent [3]bool // Y, M, D — for the anchoring (gap) check
+ timePresent [3]bool // H, M, S
+ )
+
+ for s != "" {
+ c := s[0]
+
+ if c == 'T' {
+ if inTime {
+ return 0, isoDurationError(input, `duplicate "T" separator`)
+ }
+ if weekSeen && !cfg.weekCombinable {
+ return 0, isoDurationError(input, `"W" cannot be combined with other components`)
+ }
+ inTime = true
+ s = s[1:]
+ if s == "" {
+ return 0, isoDurationError(input, `no components after "T"`)
+ }
+ continue
+ }
+
+ // A fraction, if any, must be on the least significant component: nothing may follow it.
+ if fractionUsed {
+ return 0, isoDurationError(input, "a fraction is only allowed on the least significant component")
+ }
+
+ // Scan the integer part (ASCII digits only).
+ i := 0
+ for i < len(s) && s[i] >= '0' && s[i] <= '9' {
+ i++
+ }
+ if i == 0 {
+ return 0, isoDurationError(input, fmt.Sprintf("expected a digit, got %q", s[0]))
+ }
+ intPart := s[:i]
+
+ // Optional decimal fraction.
+ var fracPart string
+ hasFrac := false
+ if i < len(s) && (s[i] == '.' || s[i] == ',') {
+ if !cfg.allowFraction {
+ return 0, isoDurationError(input, "decimal fraction is not allowed")
+ }
+ hasFrac = true
+ j := i + 1
+ for j < len(s) && s[j] >= '0' && s[j] <= '9' {
+ j++
+ }
+ fracPart = s[i+1 : j]
+ i = j
+ }
+
+ if i >= len(s) {
+ return 0, isoDurationError(input, "value without a unit designator")
+ }
+ des := s[i]
+ s = s[i+1:]
+
+ unit, err := isoResolveUnit(input, des, inTime, cfg,
+ &lastDatePos, &lastTimePos, &weekSeen, seenAny, &datePresent, &timePresent)
+ if err != nil {
+ return 0, err
+ }
+ seenAny = true
+ if hasFrac {
+ fractionUsed = true
+ }
+
+ val, err := isoScaleValue(input, intPart, fracPart, unit)
+ if err != nil {
+ return 0, err
+ }
+
+ // Accumulate with the stdlib overflow discipline: the magnitude may reach 1<<63 only for a negative duration.
+ if total > maxDurationMagnitude-val {
+ return 0, isoDurationError(input, "value out of range")
+ }
+ total += val
+ }
+
+ if inTime && !timePresent[0] && !timePresent[1] && !timePresent[2] {
+ return 0, isoDurationError(input, `no components after "T"`)
+ }
+ if !seenAny {
+ return 0, isoDurationError(input, "no components")
+ }
+
+ // Strict anchoring: the present Y/M/D and H/M/S components must each form a contiguous run (e.g. P1Y2D and PT1H2S are
+ // rejected).
+ if !cfg.relaxAnchoring {
+ if err := isoCheckContiguous(input, datePresent, "date"); err != nil {
+ return 0, err
+ }
+ if err := isoCheckContiguous(input, timePresent, "time"); err != nil {
+ return 0, err
+ }
+ }
+
+ if total > maxDurationMagnitude-1 {
+ if neg && total == maxDurationMagnitude {
+ return math.MinInt64, nil
+ }
+ return 0, isoDurationError(input, "value out of range")
+ }
+ if neg {
+ return -time.Duration(total), nil
+ }
+ return time.Duration(total), nil
+}
+
+// isoResolveUnit validates a designator in context (section, ordering, week
+// exclusivity) and returns its unit length in nanoseconds.
+func isoResolveUnit(
+ input string, des byte, inTime bool, cfg isoDurationConfig,
+ lastDatePos, lastTimePos *int, weekSeen *bool, seenAny bool,
+ datePresent, timePresent *[3]bool,
+) (uint64, error) {
+ if inTime {
+ pos, ok := isoTimePos[des]
+ if !ok {
+ return 0, isoDurationError(input, fmt.Sprintf("%q is not a valid time-section designator", des))
+ }
+ if pos <= *lastTimePos {
+ return 0, isoDurationError(input, fmt.Sprintf("designator %q is out of order", des))
+ }
+ *lastTimePos = pos
+ timePresent[pos-1] = true
+ switch des {
+ case 'H':
+ return isoHour, nil
+ case 'M':
+ return isoMinute, nil
+ default: // 'S'
+ return isoSecond, nil
+ }
+ }
+
+ pos, ok := isoDatePos[des]
+ if !ok {
+ return 0, isoDurationError(input, fmt.Sprintf("%q is not a valid date-section designator", des))
+ }
+ if pos <= *lastDatePos {
+ return 0, isoDurationError(input, fmt.Sprintf("designator %q is out of order", des))
+ }
+
+ if des == 'W' {
+ if !cfg.weekCombinable && seenAny {
+ return 0, isoDurationError(input, `"W" cannot be combined with other components`)
+ }
+ *lastDatePos = pos
+ *weekSeen = true
+ return isoWeek, nil
+ }
+
+ if *weekSeen && !cfg.weekCombinable {
+ return 0, isoDurationError(input, `"W" cannot be combined with other components`)
+ }
+ *lastDatePos = pos
+ if slot, ok := isoDateSlot(des); ok {
+ datePresent[slot] = true
+ }
+ switch des {
+ case 'Y':
+ return isoYear, nil
+ case 'M':
+ return isoMonth, nil
+ default: // 'D'
+ return isoDay, nil
+ }
+}
+
+// isoCheckContiguous rejects gaps in a section's component chain.
+func isoCheckContiguous(input string, present [3]bool, section string) error {
+ first, last := -1, -1
+ for i, p := range present {
+ if p {
+ if first < 0 {
+ first = i
+ }
+ last = i
+ }
+ }
+ if first < 0 {
+ return nil
+ }
+ for i := first; i <= last; i++ {
+ if !present[i] {
+ return isoDurationError(input, "non-contiguous "+section+" components (a gap in the unit chain)")
+ }
+ }
+ return nil
+}
+
+// isoScaleValue converts an integer (and optional fractional) component to nanoseconds, checking every overflow
+// boundary.
+func isoScaleValue(input, intPart, fracPart string, unit uint64) (uint64, error) {
+ v, ok := isoParseUint(intPart)
+ if !ok {
+ return 0, isoDurationError(input, "value out of range")
+ }
+ // Bound v*unit to the duration magnitude *before* multiplying, so the later fractional addition cannot wrap a uint64.
+ if v > maxDurationMagnitude/unit {
+ return 0, isoDurationError(input, "value out of range")
+ }
+ val := v * unit
+
+ if fracPart != "" {
+ f, scale := isoParseFraction(fracPart)
+ if f > 0 {
+ // float64 is accurate enough for a sub-unit fraction (matches the standard library technique); the magnitude stays
+ // below the uint64 ceiling because val <= 1<<63 and the addend is < unit.
+ val += uint64(float64(f) * (float64(unit) / float64(scale)))
+ if val > maxDurationMagnitude {
+ return 0, isoDurationError(input, "value out of range")
+ }
+ }
+ }
+
+ return val, nil
+}
+
+// isoParseUint parses digits into a uint64, reporting overflow.
+func isoParseUint(s string) (uint64, bool) {
+ var v uint64
+ for i := range len(s) {
+ if v > decimalAccMax {
+ return 0, false
+ }
+ v = v*decimalBase + uint64(s[i]-'0')
+ }
+
+ return v, true
+}
+
+// isoParseFraction parses fractional digits into (value, scale=10^len), capping precision at 18 digits so the value
+// stays exact in the subsequent float maths.
+func isoParseFraction(s string) (uint64, uint64) {
+ const maxFracDigits = 18
+ if len(s) > maxFracDigits {
+ s = s[:maxFracDigits]
+ }
+ var f, scale uint64 = 0, 1
+ for i := range len(s) {
+ f = f*decimalBase + uint64(s[i]-'0')
+ scale *= decimalBase
+ }
+
+ return f, scale
+}
+
+// isoFormat renders a duration in canonical ISO 8601 form (P[n]DT[n]H[n]M[n]S).
+//
+// Intermediate zero time components are emitted when needed to keep the output contiguous (e.g. 1h5s → "PT1H0M5S"),
+// so the structure is always syntactically valid ISO 8601. Years, months and weeks are not reconstructed (a
+// [time.Duration] does not carry calendar context); a fractional second is emitted losslessly, and a negative duration
+// is prefixed with "-".
+func isoFormat(d time.Duration) string {
+ if d == 0 {
+ return "PT0S"
+ }
+ neg := d < 0
+ var u uint64
+ if neg {
+ u = uint64(-d)
+ } else {
+ u = uint64(d)
+ }
+
+ days := u / isoDay
+ u %= isoDay
+ hours := u / isoHour
+ u %= isoHour
+ minutes := u / isoMinute
+ u %= isoMinute
+ seconds := u / isoSecond
+ frac := u % isoSecond
+
+ var b strings.Builder
+ if neg {
+ b.WriteByte('-')
+ }
+
+ b.WriteByte('P')
+ if days > 0 {
+ b.WriteString(strconv.FormatUint(days, decimalBase))
+ b.WriteByte('D')
+ }
+ isoWriteTimeSection(&b, hours, minutes, seconds, frac)
+
+ return b.String()
+}
+
+// isoWriteTimeSection appends the "T…" part of a canonical ISO 8601 duration, emitting a zero-minute filler when it
+// must bridge hours and seconds so the output stays contiguous (e.g. 1h5s → "T1H0M5S").
+func isoWriteTimeSection(b *strings.Builder, hours, minutes, seconds, frac uint64) {
+ hasH := hours > 0
+ hasM := minutes > 0
+ hasS := seconds > 0 || frac > 0
+ if !hasH && !hasM && !hasS {
+ return
+ }
+
+ b.WriteByte('T')
+ if hasH {
+ b.WriteString(strconv.FormatUint(hours, decimalBase))
+ b.WriteByte('H')
+ }
+
+ // Emit minutes if non-zero, or as a zero filler bridging hours and seconds.
+ if hasM || (hasH && hasS) {
+ b.WriteString(strconv.FormatUint(minutes, decimalBase))
+ b.WriteByte('M')
+ }
+
+ if hasS {
+ b.WriteString(strconv.FormatUint(seconds, decimalBase))
+ if frac > 0 {
+ b.WriteByte('.')
+ b.WriteString(isoFormatFraction(frac))
+ }
+ b.WriteByte('S')
+ }
+}
+
+// isoEmit renders d under the given policy.
+//
+// A policy that forbids a feature the value requires (a sign, or sub-second precision) cannot represent it, and returns
+// an error rather than emitting output a matching parser would reject.
+func isoEmit(d time.Duration, cfg isoDurationConfig) (string, error) {
+ if !cfg.allowSign && d < 0 {
+ return "", fmt.Errorf("a negative duration cannot be represented under this ISO 8601 policy: %w", ErrFormat)
+ }
+
+ if !cfg.allowFraction && d%time.Second != 0 {
+ return "", fmt.Errorf("sub-second precision cannot be represented under this ISO 8601 policy: %w", ErrFormat)
+ }
+
+ return isoFormat(d), nil
+}
+
+// isoFormatFraction renders a nanosecond remainder (0..1e9) as its 9-digit fractional part with trailing zeros trimmed.
+func isoFormatFraction(frac uint64) string {
+ s := strconv.FormatUint(frac, decimalBase)
+ if len(s) < nanoDigits {
+ s = strings.Repeat("0", nanoDigits-len(s)) + s
+ }
+ return strings.TrimRight(s, "0")
+}
diff --git a/vendor/github.com/go-openapi/strfmt/duration_iso8601_options.go b/vendor/github.com/go-openapi/strfmt/duration_iso8601_options.go
new file mode 100644
index 0000000000..4f90a5c5a5
--- /dev/null
+++ b/vendor/github.com/go-openapi/strfmt/duration_iso8601_options.go
@@ -0,0 +1,80 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package strfmt
+
+// ISODurationPolicy is a compile-time policy selecting the parsing behaviour of an [ISODuration].
+//
+// It is a phantom type parameter: a zero-size value whose single method yields the parser configuration.
+// See [DurationStrict] and [DurationLenient].
+type ISODurationPolicy interface {
+ isoDurationConfig() isoDurationConfig
+}
+
+// isoDurationConfig holds the leniency knobs of the ISO 8601 duration parser.
+//
+// The zero value is the strict RFC 3339 Appendix A grammar (the JSON Schema "duration" format): every field false.
+type isoDurationConfig struct {
+ allowFraction bool // accept a decimal fraction on the least significant component
+ allowSign bool // accept a leading '+' or '-'
+ allowSpace bool // tolerate surrounding whitespace
+ weekCombinable bool // allow the 'W' designator to combine with other components
+ relaxAnchoring bool // allow gaps in the component chain (e.g. P1Y2D, PT1H2S)
+}
+
+// DurationStrict is the strict RFC 3339 Appendix A policy.
+//
+// This is the grammar that the JSON Schema "duration" format is defined against (draft 2020):
+// no fraction, no sign, no whitespace, strict ordering and anchoring, and an exclusive 'W' designator.
+type DurationStrict struct{}
+
+func (DurationStrict) isoDurationConfig() isoDurationConfig { return isoDurationConfig{} }
+
+// DurationLenient relaxes every strictness knob.
+//
+// It accepts a decimal fraction on the least significant component, a leading sign, surrounding whitespace,
+// component chains with gaps (e.g. P1Y2D), and a 'W' designator combined with other components.
+//
+// It remains ordered (P2D1Y is still rejected).
+type DurationLenient struct{}
+
+func (DurationLenient) isoDurationConfig() isoDurationConfig {
+ return isoDurationConfig{
+ allowFraction: true,
+ allowSign: true,
+ allowSpace: true,
+ weekCombinable: true,
+ relaxAnchoring: true,
+ }
+}
+
+// ISODurationOption relaxes the strict parser on the explicit [ParseISO8601Duration] path, for programmatic callers.
+//
+// It has no effect on the registry / struct-field decode path, which is governed by the type's policy.
+type ISODurationOption func(*isoDurationConfig)
+
+// WithISOFractions accepts a decimal fraction on the least significant component.
+func WithISOFractions() ISODurationOption {
+ return func(c *isoDurationConfig) { c.allowFraction = true }
+}
+
+// WithISOSign accepts a leading '+' or '-'.
+func WithISOSign() ISODurationOption { return func(c *isoDurationConfig) { c.allowSign = true } }
+
+// WithISOSpace tolerates surrounding whitespace.
+func WithISOSpace() ISODurationOption { return func(c *isoDurationConfig) { c.allowSpace = true } }
+
+// WithISOWeekCombinable allows the 'W' designator to combine with other components.
+func WithISOWeekCombinable() ISODurationOption {
+ return func(c *isoDurationConfig) { c.weekCombinable = true }
+}
+
+// WithISORelaxedAnchoring allows gaps in the component chain (e.g. P1Y2D, PT1H2S).
+func WithISORelaxedAnchoring() ISODurationOption {
+ return func(c *isoDurationConfig) { c.relaxAnchoring = true }
+}
+
+// WithISOLenient relaxes every strictness knob (see [DurationLenient]).
+func WithISOLenient() ISODurationOption {
+ return func(c *isoDurationConfig) { *c = DurationLenient{}.isoDurationConfig() }
+}
diff --git a/vendor/github.com/go-openapi/strfmt/format.go b/vendor/github.com/go-openapi/strfmt/format.go
index e494dd7b83..09c3754254 100644
--- a/vendor/github.com/go-openapi/strfmt/format.go
+++ b/vendor/github.com/go-openapi/strfmt/format.go
@@ -10,15 +10,11 @@ import (
"slices"
"strings"
"sync"
- "time"
"github.com/go-openapi/errors"
"github.com/go-viper/mapstructure/v2"
)
-// Default is the default formats registry.
-var Default = NewSeededFormats(nil, nil) //nolint:gochecknoglobals // package-level default registry, by design
-
// Validator represents a validator for a string format.
type Validator func(string) bool
@@ -48,11 +44,28 @@ type knownFormat struct {
}
// NameNormalizer is a function that normalizes a format name.
+//
+// The default duration format corresponds to "duration-human".
type NameNormalizer func(string) string
+var dashReplacer = strings.NewReplacer("-", "") //nolint:gochecknoglobals // it's okay to use a global private replacer
+
// DefaultNameNormalizer removes all dashes.
func DefaultNameNormalizer(name string) string {
- return strings.ReplaceAll(name, "-", "")
+ if name == "duration" {
+ name = "duration-human"
+ }
+
+ return dashReplacer.Replace(name)
+}
+
+// JSONSchema2020Normalizer is like [NameNormalizer] but adopts "duration-iso8601" as the default "duration" format.
+func JSONSchema2020Normalizer(name string) string {
+ if name == "duration" {
+ name = "duration-iso8601"
+ }
+
+ return dashReplacer.Replace(name)
}
type defaultFormats struct {
@@ -63,6 +76,11 @@ type defaultFormats struct {
}
// MapStructureHookFunc is a decode hook function for mapstructure.
+//
+// A registered format is decoded by delegating to the destination type's own
+// [encoding.TextUnmarshaler], so the mapstructure path is identical to the JSON
+// and [defaultFormats.Parse] paths. New formats are picked up automatically as
+// soon as they are registered — no per-type wiring here.
func (f *defaultFormats) MapStructureHookFunc() mapstructure.DecodeHookFunc { //nolint:ireturn // returns interface required by mapstructure
return func(from reflect.Type, to reflect.Type, obj any) (any, error) {
if from.Kind() != reflect.String {
@@ -74,85 +92,25 @@ func (f *defaultFormats) MapStructureHookFunc() mapstructure.DecodeHookFunc { //
}
for _, v := range f.data {
- tpe, _ := f.GetType(v.Name)
- if to == tpe {
- return decodeFormatFromString(v.Name, data)
+ if to != v.Type {
+ continue
}
- }
- return data, nil
- }
-}
-// decodeFormatFromString decodes a string into the appropriate format type by name.
-func decodeFormatFromString(name, data string) (any, error) { //nolint:gocyclo,cyclop // flat switch over format names, no real complexity
- switch name {
- case "date":
- d, err := time.ParseInLocation(RFC3339FullDate, data, DefaultTimeLocation)
- if err != nil {
- return nil, err
- }
- return Date(d), nil
- case "datetime":
- if len(data) == 0 {
- return nil, fmt.Errorf("empty string is an invalid datetime format: %w", ErrFormat)
- }
- return ParseDateTime(data)
- case "duration":
- dur, err := ParseDuration(data)
- if err != nil {
- return nil, err
- }
- return Duration(dur), nil
- case "uri":
- return URI(data), nil
- case "email":
- return Email(data), nil
- case "uuid":
- return UUID(data), nil
- case "uuid3":
- return UUID3(data), nil
- case "uuid4":
- return UUID4(data), nil
- case "uuid5":
- return UUID5(data), nil
- case "uuid7":
- return UUID7(data), nil
- case "hostname":
- return Hostname(data), nil
- case "ipv4":
- return IPv4(data), nil
- case "ipv6":
- return IPv6(data), nil
- case "cidr":
- return CIDR(data), nil
- case "mac":
- return MAC(data), nil
- case "isbn":
- return ISBN(data), nil
- case "isbn10":
- return ISBN10(data), nil
- case "isbn13":
- return ISBN13(data), nil
- case "creditcard":
- return CreditCard(data), nil
- case "ssn":
- return SSN(data), nil
- case "hexcolor":
- return HexColor(data), nil
- case "rgbcolor":
- return RGBColor(data), nil
- case "byte":
- return Base64(data), nil
- case "password":
- return Password(data), nil
- case "ulid":
- ulid, err := ParseULID(data)
- if err != nil {
- return nil, err
+ // reflect.New yields an addressable *T so the (pointer-receiver)
+ // TextUnmarshaler can hydrate it; we hand back the dereferenced
+ // value to match the destination field's (value) type.
+ nw := reflect.New(v.Type).Interface()
+ dec, isText := nw.(encoding.TextUnmarshaler)
+ if !isText {
+ return nil, errors.InvalidTypeName(v.Name)
+ }
+ if err := dec.UnmarshalText([]byte(data)); err != nil {
+ return nil, err
+ }
+ return reflect.ValueOf(nw).Elem().Interface(), nil
}
- return ulid, nil
- default:
- return nil, errors.InvalidTypeName(name)
+
+ return data, nil
}
}
diff --git a/vendor/github.com/go-openapi/strfmt/internal/countries/countries.go b/vendor/github.com/go-openapi/strfmt/internal/countries/countries.go
new file mode 100644
index 0000000000..7f13c0cfe3
--- /dev/null
+++ b/vendor/github.com/go-openapi/strfmt/internal/countries/countries.go
@@ -0,0 +1,512 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated by gen.go; DO NOT EDIT.
+
+package countries
+
+// CountriesISO3 indexes ISO3166 countries by their alpha-3 code.
+var CountriesISO3 = map[string]Country{
+ "ABW": {Name: "Aruba", ISOAlpha3: "ABW", ISOAlpha2: "AW", Code: "533"},
+ "AFG": {Name: "Afghanistan", ISOAlpha3: "AFG", ISOAlpha2: "AF", Code: "004"},
+ "AGO": {Name: "Angola", ISOAlpha3: "AGO", ISOAlpha2: "AO", Code: "024"},
+ "AIA": {Name: "Anguilla", ISOAlpha3: "AIA", ISOAlpha2: "AI", Code: "660"},
+ "ALA": {Name: "Åland Islands", ISOAlpha3: "ALA", ISOAlpha2: "AX", Code: "248"},
+ "ALB": {Name: "Albania", ISOAlpha3: "ALB", ISOAlpha2: "AL", Code: "008"},
+ "AND": {Name: "Andorra", ISOAlpha3: "AND", ISOAlpha2: "AD", Code: "020"},
+ "ARE": {Name: "United Arab Emirates", ISOAlpha3: "ARE", ISOAlpha2: "AE", Code: "784"},
+ "ARG": {Name: "Argentina", ISOAlpha3: "ARG", ISOAlpha2: "AR", Code: "032"},
+ "ARM": {Name: "Armenia", ISOAlpha3: "ARM", ISOAlpha2: "AM", Code: "051"},
+ "ASM": {Name: "American Samoa", ISOAlpha3: "ASM", ISOAlpha2: "AS", Code: "016"},
+ "ATA": {Name: "Antarctica", ISOAlpha3: "ATA", ISOAlpha2: "AQ", Code: "010"},
+ "ATF": {Name: "French Southern Territories", ISOAlpha3: "ATF", ISOAlpha2: "TF", Code: "260"},
+ "ATG": {Name: "Antigua and Barbuda", ISOAlpha3: "ATG", ISOAlpha2: "AG", Code: "028"},
+ "AUS": {Name: "Australia", ISOAlpha3: "AUS", ISOAlpha2: "AU", Code: "036"},
+ "AUT": {Name: "Austria", ISOAlpha3: "AUT", ISOAlpha2: "AT", Code: "040"},
+ "AZE": {Name: "Azerbaijan", ISOAlpha3: "AZE", ISOAlpha2: "AZ", Code: "031"},
+ "BDI": {Name: "Burundi", ISOAlpha3: "BDI", ISOAlpha2: "BI", Code: "108"},
+ "BEL": {Name: "Belgium", ISOAlpha3: "BEL", ISOAlpha2: "BE", Code: "056"},
+ "BEN": {Name: "Benin", ISOAlpha3: "BEN", ISOAlpha2: "BJ", Code: "204"},
+ "BES": {Name: "Bonaire, Sint Eustatius and Saba", ISOAlpha3: "BES", ISOAlpha2: "BQ", Code: "535"},
+ "BFA": {Name: "Burkina Faso", ISOAlpha3: "BFA", ISOAlpha2: "BF", Code: "854"},
+ "BGD": {Name: "Bangladesh", ISOAlpha3: "BGD", ISOAlpha2: "BD", Code: "050"},
+ "BGR": {Name: "Bulgaria", ISOAlpha3: "BGR", ISOAlpha2: "BG", Code: "100"},
+ "BHR": {Name: "Bahrain", ISOAlpha3: "BHR", ISOAlpha2: "BH", Code: "048"},
+ "BHS": {Name: "Bahamas", ISOAlpha3: "BHS", ISOAlpha2: "BS", Code: "044"},
+ "BIH": {Name: "Bosnia and Herzegovina", ISOAlpha3: "BIH", ISOAlpha2: "BA", Code: "070"},
+ "BLM": {Name: "Saint Barthélemy", ISOAlpha3: "BLM", ISOAlpha2: "BL", Code: "652"},
+ "BLR": {Name: "Belarus", ISOAlpha3: "BLR", ISOAlpha2: "BY", Code: "112"},
+ "BLZ": {Name: "Belize", ISOAlpha3: "BLZ", ISOAlpha2: "BZ", Code: "084"},
+ "BMU": {Name: "Bermuda", ISOAlpha3: "BMU", ISOAlpha2: "BM", Code: "060"},
+ "BOL": {Name: "Bolivia (Plurinational State of)", ISOAlpha3: "BOL", ISOAlpha2: "BO", Code: "068"},
+ "BRA": {Name: "Brazil", ISOAlpha3: "BRA", ISOAlpha2: "BR", Code: "076"},
+ "BRB": {Name: "Barbados", ISOAlpha3: "BRB", ISOAlpha2: "BB", Code: "052"},
+ "BRN": {Name: "Brunei Darussalam", ISOAlpha3: "BRN", ISOAlpha2: "BN", Code: "096"},
+ "BTN": {Name: "Bhutan", ISOAlpha3: "BTN", ISOAlpha2: "BT", Code: "064"},
+ "BVT": {Name: "Bouvet Island", ISOAlpha3: "BVT", ISOAlpha2: "BV", Code: "074"},
+ "BWA": {Name: "Botswana", ISOAlpha3: "BWA", ISOAlpha2: "BW", Code: "072"},
+ "CAF": {Name: "Central African Republic", ISOAlpha3: "CAF", ISOAlpha2: "CF", Code: "140"},
+ "CAN": {Name: "Canada", ISOAlpha3: "CAN", ISOAlpha2: "CA", Code: "124"},
+ "CCK": {Name: "Cocos (Keeling) Islands", ISOAlpha3: "CCK", ISOAlpha2: "CC", Code: "166"},
+ "CHE": {Name: "Switzerland", ISOAlpha3: "CHE", ISOAlpha2: "CH", Code: "756"},
+ "CHL": {Name: "Chile", ISOAlpha3: "CHL", ISOAlpha2: "CL", Code: "152"},
+ "CHN": {Name: "China", ISOAlpha3: "CHN", ISOAlpha2: "CN", Code: "156"},
+ "CIV": {Name: "Côte d'Ivoire", ISOAlpha3: "CIV", ISOAlpha2: "CI", Code: "384"},
+ "CMR": {Name: "Cameroon", ISOAlpha3: "CMR", ISOAlpha2: "CM", Code: "120"},
+ "COD": {Name: "Congo, Democratic Republic of the", ISOAlpha3: "COD", ISOAlpha2: "CD", Code: "180"},
+ "COG": {Name: "Congo", ISOAlpha3: "COG", ISOAlpha2: "CG", Code: "178"},
+ "COK": {Name: "Cook Islands", ISOAlpha3: "COK", ISOAlpha2: "CK", Code: "184"},
+ "COL": {Name: "Colombia", ISOAlpha3: "COL", ISOAlpha2: "CO", Code: "170"},
+ "COM": {Name: "Comoros", ISOAlpha3: "COM", ISOAlpha2: "KM", Code: "174"},
+ "CPV": {Name: "Cabo Verde", ISOAlpha3: "CPV", ISOAlpha2: "CV", Code: "132"},
+ "CRI": {Name: "Costa Rica", ISOAlpha3: "CRI", ISOAlpha2: "CR", Code: "188"},
+ "CUB": {Name: "Cuba", ISOAlpha3: "CUB", ISOAlpha2: "CU", Code: "192"},
+ "CUW": {Name: "Curaçao", ISOAlpha3: "CUW", ISOAlpha2: "CW", Code: "531"},
+ "CXR": {Name: "Christmas Island", ISOAlpha3: "CXR", ISOAlpha2: "CX", Code: "162"},
+ "CYM": {Name: "Cayman Islands", ISOAlpha3: "CYM", ISOAlpha2: "KY", Code: "136"},
+ "CYP": {Name: "Cyprus", ISOAlpha3: "CYP", ISOAlpha2: "CY", Code: "196"},
+ "CZE": {Name: "Czechia", ISOAlpha3: "CZE", ISOAlpha2: "CZ", Code: "203"},
+ "DEU": {Name: "Germany", ISOAlpha3: "DEU", ISOAlpha2: "DE", Code: "276"},
+ "DJI": {Name: "Djibouti", ISOAlpha3: "DJI", ISOAlpha2: "DJ", Code: "262"},
+ "DMA": {Name: "Dominica", ISOAlpha3: "DMA", ISOAlpha2: "DM", Code: "212"},
+ "DNK": {Name: "Denmark", ISOAlpha3: "DNK", ISOAlpha2: "DK", Code: "208"},
+ "DOM": {Name: "Dominican Republic", ISOAlpha3: "DOM", ISOAlpha2: "DO", Code: "214"},
+ "DZA": {Name: "Algeria", ISOAlpha3: "DZA", ISOAlpha2: "DZ", Code: "012"},
+ "ECU": {Name: "Ecuador", ISOAlpha3: "ECU", ISOAlpha2: "EC", Code: "218"},
+ "EGY": {Name: "Egypt", ISOAlpha3: "EGY", ISOAlpha2: "EG", Code: "818"},
+ "ERI": {Name: "Eritrea", ISOAlpha3: "ERI", ISOAlpha2: "ER", Code: "232"},
+ "ESH": {Name: "Western Sahara", ISOAlpha3: "ESH", ISOAlpha2: "EH", Code: "732"},
+ "ESP": {Name: "Spain", ISOAlpha3: "ESP", ISOAlpha2: "ES", Code: "724"},
+ "EST": {Name: "Estonia", ISOAlpha3: "EST", ISOAlpha2: "EE", Code: "233"},
+ "ETH": {Name: "Ethiopia", ISOAlpha3: "ETH", ISOAlpha2: "ET", Code: "231"},
+ "FIN": {Name: "Finland", ISOAlpha3: "FIN", ISOAlpha2: "FI", Code: "246"},
+ "FJI": {Name: "Fiji", ISOAlpha3: "FJI", ISOAlpha2: "FJ", Code: "242"},
+ "FLK": {Name: "Falkland Islands (Malvinas)", ISOAlpha3: "FLK", ISOAlpha2: "FK", Code: "238"},
+ "FRA": {Name: "France", ISOAlpha3: "FRA", ISOAlpha2: "FR", Code: "250"},
+ "FRO": {Name: "Faroe Islands", ISOAlpha3: "FRO", ISOAlpha2: "FO", Code: "234"},
+ "FSM": {Name: "Micronesia (Federated States of)", ISOAlpha3: "FSM", ISOAlpha2: "FM", Code: "583"},
+ "GAB": {Name: "Gabon", ISOAlpha3: "GAB", ISOAlpha2: "GA", Code: "266"},
+ "GBR": {Name: "United Kingdom of Great Britain and Northern Ireland", ISOAlpha3: "GBR", ISOAlpha2: "GB", Code: "826"},
+ "GEO": {Name: "Georgia", ISOAlpha3: "GEO", ISOAlpha2: "GE", Code: "268"},
+ "GGY": {Name: "Guernsey", ISOAlpha3: "GGY", ISOAlpha2: "GG", Code: "831"},
+ "GHA": {Name: "Ghana", ISOAlpha3: "GHA", ISOAlpha2: "GH", Code: "288"},
+ "GIB": {Name: "Gibraltar", ISOAlpha3: "GIB", ISOAlpha2: "GI", Code: "292"},
+ "GIN": {Name: "Guinea", ISOAlpha3: "GIN", ISOAlpha2: "GN", Code: "324"},
+ "GLP": {Name: "Guadeloupe", ISOAlpha3: "GLP", ISOAlpha2: "GP", Code: "312"},
+ "GMB": {Name: "Gambia", ISOAlpha3: "GMB", ISOAlpha2: "GM", Code: "270"},
+ "GNB": {Name: "Guinea-Bissau", ISOAlpha3: "GNB", ISOAlpha2: "GW", Code: "624"},
+ "GNQ": {Name: "Equatorial Guinea", ISOAlpha3: "GNQ", ISOAlpha2: "GQ", Code: "226"},
+ "GRC": {Name: "Greece", ISOAlpha3: "GRC", ISOAlpha2: "GR", Code: "300"},
+ "GRD": {Name: "Grenada", ISOAlpha3: "GRD", ISOAlpha2: "GD", Code: "308"},
+ "GRL": {Name: "Greenland", ISOAlpha3: "GRL", ISOAlpha2: "GL", Code: "304"},
+ "GTM": {Name: "Guatemala", ISOAlpha3: "GTM", ISOAlpha2: "GT", Code: "320"},
+ "GUF": {Name: "French Guiana", ISOAlpha3: "GUF", ISOAlpha2: "GF", Code: "254"},
+ "GUM": {Name: "Guam", ISOAlpha3: "GUM", ISOAlpha2: "GU", Code: "316"},
+ "GUY": {Name: "Guyana", ISOAlpha3: "GUY", ISOAlpha2: "GY", Code: "328"},
+ "HKG": {Name: "Hong Kong", ISOAlpha3: "HKG", ISOAlpha2: "HK", Code: "344"},
+ "HMD": {Name: "Heard Island and McDonald Islands", ISOAlpha3: "HMD", ISOAlpha2: "HM", Code: "334"},
+ "HND": {Name: "Honduras", ISOAlpha3: "HND", ISOAlpha2: "HN", Code: "340"},
+ "HRV": {Name: "Croatia", ISOAlpha3: "HRV", ISOAlpha2: "HR", Code: "191"},
+ "HTI": {Name: "Haiti", ISOAlpha3: "HTI", ISOAlpha2: "HT", Code: "332"},
+ "HUN": {Name: "Hungary", ISOAlpha3: "HUN", ISOAlpha2: "HU", Code: "348"},
+ "IDN": {Name: "Indonesia", ISOAlpha3: "IDN", ISOAlpha2: "ID", Code: "360"},
+ "IMN": {Name: "Isle of Man", ISOAlpha3: "IMN", ISOAlpha2: "IM", Code: "833"},
+ "IND": {Name: "India", ISOAlpha3: "IND", ISOAlpha2: "IN", Code: "356"},
+ "IOT": {Name: "British Indian Ocean Territory", ISOAlpha3: "IOT", ISOAlpha2: "IO", Code: "086"},
+ "IRL": {Name: "Ireland", ISOAlpha3: "IRL", ISOAlpha2: "IE", Code: "372"},
+ "IRN": {Name: "Iran (Islamic Republic of)", ISOAlpha3: "IRN", ISOAlpha2: "IR", Code: "364"},
+ "IRQ": {Name: "Iraq", ISOAlpha3: "IRQ", ISOAlpha2: "IQ", Code: "368"},
+ "ISL": {Name: "Iceland", ISOAlpha3: "ISL", ISOAlpha2: "IS", Code: "352"},
+ "ISR": {Name: "Israel", ISOAlpha3: "ISR", ISOAlpha2: "IL", Code: "376"},
+ "ITA": {Name: "Italy", ISOAlpha3: "ITA", ISOAlpha2: "IT", Code: "380"},
+ "JAM": {Name: "Jamaica", ISOAlpha3: "JAM", ISOAlpha2: "JM", Code: "388"},
+ "JEY": {Name: "Jersey", ISOAlpha3: "JEY", ISOAlpha2: "JE", Code: "832"},
+ "JOR": {Name: "Jordan", ISOAlpha3: "JOR", ISOAlpha2: "JO", Code: "400"},
+ "JPN": {Name: "Japan", ISOAlpha3: "JPN", ISOAlpha2: "JP", Code: "392"},
+ "KAZ": {Name: "Kazakhstan", ISOAlpha3: "KAZ", ISOAlpha2: "KZ", Code: "398"},
+ "KEN": {Name: "Kenya", ISOAlpha3: "KEN", ISOAlpha2: "KE", Code: "404"},
+ "KGZ": {Name: "Kyrgyzstan", ISOAlpha3: "KGZ", ISOAlpha2: "KG", Code: "417"},
+ "KHM": {Name: "Cambodia", ISOAlpha3: "KHM", ISOAlpha2: "KH", Code: "116"},
+ "KIR": {Name: "Kiribati", ISOAlpha3: "KIR", ISOAlpha2: "KI", Code: "296"},
+ "KNA": {Name: "Saint Kitts and Nevis", ISOAlpha3: "KNA", ISOAlpha2: "KN", Code: "659"},
+ "KOR": {Name: "Korea, Republic of", ISOAlpha3: "KOR", ISOAlpha2: "KR", Code: "410"},
+ "KWT": {Name: "Kuwait", ISOAlpha3: "KWT", ISOAlpha2: "KW", Code: "414"},
+ "LAO": {Name: "Lao People's Democratic Republic", ISOAlpha3: "LAO", ISOAlpha2: "LA", Code: "418"},
+ "LBN": {Name: "Lebanon", ISOAlpha3: "LBN", ISOAlpha2: "LB", Code: "422"},
+ "LBR": {Name: "Liberia", ISOAlpha3: "LBR", ISOAlpha2: "LR", Code: "430"},
+ "LBY": {Name: "Libya", ISOAlpha3: "LBY", ISOAlpha2: "LY", Code: "434"},
+ "LCA": {Name: "Saint Lucia", ISOAlpha3: "LCA", ISOAlpha2: "LC", Code: "662"},
+ "LIE": {Name: "Liechtenstein", ISOAlpha3: "LIE", ISOAlpha2: "LI", Code: "438"},
+ "LKA": {Name: "Sri Lanka", ISOAlpha3: "LKA", ISOAlpha2: "LK", Code: "144"},
+ "LSO": {Name: "Lesotho", ISOAlpha3: "LSO", ISOAlpha2: "LS", Code: "426"},
+ "LTU": {Name: "Lithuania", ISOAlpha3: "LTU", ISOAlpha2: "LT", Code: "440"},
+ "LUX": {Name: "Luxembourg", ISOAlpha3: "LUX", ISOAlpha2: "LU", Code: "442"},
+ "LVA": {Name: "Latvia", ISOAlpha3: "LVA", ISOAlpha2: "LV", Code: "428"},
+ "MAC": {Name: "Macao", ISOAlpha3: "MAC", ISOAlpha2: "MO", Code: "446"},
+ "MAF": {Name: "Saint Martin (French part)", ISOAlpha3: "MAF", ISOAlpha2: "MF", Code: "663"},
+ "MAR": {Name: "Morocco", ISOAlpha3: "MAR", ISOAlpha2: "MA", Code: "504"},
+ "MCO": {Name: "Monaco", ISOAlpha3: "MCO", ISOAlpha2: "MC", Code: "492"},
+ "MDA": {Name: "Moldova, Republic of", ISOAlpha3: "MDA", ISOAlpha2: "MD", Code: "498"},
+ "MDG": {Name: "Madagascar", ISOAlpha3: "MDG", ISOAlpha2: "MG", Code: "450"},
+ "MDV": {Name: "Maldives", ISOAlpha3: "MDV", ISOAlpha2: "MV", Code: "462"},
+ "MEX": {Name: "Mexico", ISOAlpha3: "MEX", ISOAlpha2: "MX", Code: "484"},
+ "MHL": {Name: "Marshall Islands", ISOAlpha3: "MHL", ISOAlpha2: "MH", Code: "584"},
+ "MKD": {Name: "North Macedonia", ISOAlpha3: "MKD", ISOAlpha2: "MK", Code: "807"},
+ "MLI": {Name: "Mali", ISOAlpha3: "MLI", ISOAlpha2: "ML", Code: "466"},
+ "MLT": {Name: "Malta", ISOAlpha3: "MLT", ISOAlpha2: "MT", Code: "470"},
+ "MMR": {Name: "Myanmar", ISOAlpha3: "MMR", ISOAlpha2: "MM", Code: "104"},
+ "MNE": {Name: "Montenegro", ISOAlpha3: "MNE", ISOAlpha2: "ME", Code: "499"},
+ "MNG": {Name: "Mongolia", ISOAlpha3: "MNG", ISOAlpha2: "MN", Code: "496"},
+ "MNP": {Name: "Northern Mariana Islands", ISOAlpha3: "MNP", ISOAlpha2: "MP", Code: "580"},
+ "MOZ": {Name: "Mozambique", ISOAlpha3: "MOZ", ISOAlpha2: "MZ", Code: "508"},
+ "MRT": {Name: "Mauritania", ISOAlpha3: "MRT", ISOAlpha2: "MR", Code: "478"},
+ "MSR": {Name: "Montserrat", ISOAlpha3: "MSR", ISOAlpha2: "MS", Code: "500"},
+ "MTQ": {Name: "Martinique", ISOAlpha3: "MTQ", ISOAlpha2: "MQ", Code: "474"},
+ "MUS": {Name: "Mauritius", ISOAlpha3: "MUS", ISOAlpha2: "MU", Code: "480"},
+ "MWI": {Name: "Malawi", ISOAlpha3: "MWI", ISOAlpha2: "MW", Code: "454"},
+ "MYS": {Name: "Malaysia", ISOAlpha3: "MYS", ISOAlpha2: "MY", Code: "458"},
+ "MYT": {Name: "Mayotte", ISOAlpha3: "MYT", ISOAlpha2: "YT", Code: "175"},
+ "NAM": {Name: "Namibia", ISOAlpha3: "NAM", ISOAlpha2: "NA", Code: "516"},
+ "NCL": {Name: "New Caledonia", ISOAlpha3: "NCL", ISOAlpha2: "NC", Code: "540"},
+ "NER": {Name: "Niger", ISOAlpha3: "NER", ISOAlpha2: "NE", Code: "562"},
+ "NFK": {Name: "Norfolk Island", ISOAlpha3: "NFK", ISOAlpha2: "NF", Code: "574"},
+ "NGA": {Name: "Nigeria", ISOAlpha3: "NGA", ISOAlpha2: "NG", Code: "566"},
+ "NIC": {Name: "Nicaragua", ISOAlpha3: "NIC", ISOAlpha2: "NI", Code: "558"},
+ "NIU": {Name: "Niue", ISOAlpha3: "NIU", ISOAlpha2: "NU", Code: "570"},
+ "NLD": {Name: "Netherlands", ISOAlpha3: "NLD", ISOAlpha2: "NL", Code: "528"},
+ "NOR": {Name: "Norway", ISOAlpha3: "NOR", ISOAlpha2: "NO", Code: "578"},
+ "NPL": {Name: "Nepal", ISOAlpha3: "NPL", ISOAlpha2: "NP", Code: "524"},
+ "NRU": {Name: "Nauru", ISOAlpha3: "NRU", ISOAlpha2: "NR", Code: "520"},
+ "NZL": {Name: "New Zealand", ISOAlpha3: "NZL", ISOAlpha2: "NZ", Code: "554"},
+ "OMN": {Name: "Oman", ISOAlpha3: "OMN", ISOAlpha2: "OM", Code: "512"},
+ "PAK": {Name: "Pakistan", ISOAlpha3: "PAK", ISOAlpha2: "PK", Code: "586"},
+ "PAN": {Name: "Panama", ISOAlpha3: "PAN", ISOAlpha2: "PA", Code: "591"},
+ "PCN": {Name: "Pitcairn", ISOAlpha3: "PCN", ISOAlpha2: "PN", Code: "612"},
+ "PER": {Name: "Peru", ISOAlpha3: "PER", ISOAlpha2: "PE", Code: "604"},
+ "PHL": {Name: "Philippines", ISOAlpha3: "PHL", ISOAlpha2: "PH", Code: "608"},
+ "PLW": {Name: "Palau", ISOAlpha3: "PLW", ISOAlpha2: "PW", Code: "585"},
+ "PNG": {Name: "Papua New Guinea", ISOAlpha3: "PNG", ISOAlpha2: "PG", Code: "598"},
+ "POL": {Name: "Poland", ISOAlpha3: "POL", ISOAlpha2: "PL", Code: "616"},
+ "PRI": {Name: "Puerto Rico", ISOAlpha3: "PRI", ISOAlpha2: "PR", Code: "630"},
+ "PRK": {Name: "Korea (Democratic People's Republic of)", ISOAlpha3: "PRK", ISOAlpha2: "KP", Code: "408"},
+ "PRT": {Name: "Portugal", ISOAlpha3: "PRT", ISOAlpha2: "PT", Code: "620"},
+ "PRY": {Name: "Paraguay", ISOAlpha3: "PRY", ISOAlpha2: "PY", Code: "600"},
+ "PSE": {Name: "Palestine, State of", ISOAlpha3: "PSE", ISOAlpha2: "PS", Code: "275"},
+ "PYF": {Name: "French Polynesia", ISOAlpha3: "PYF", ISOAlpha2: "PF", Code: "258"},
+ "QAT": {Name: "Qatar", ISOAlpha3: "QAT", ISOAlpha2: "QA", Code: "634"},
+ "REU": {Name: "Réunion", ISOAlpha3: "REU", ISOAlpha2: "RE", Code: "638"},
+ "ROU": {Name: "Romania", ISOAlpha3: "ROU", ISOAlpha2: "RO", Code: "642"},
+ "RUS": {Name: "Russian Federation", ISOAlpha3: "RUS", ISOAlpha2: "RU", Code: "643"},
+ "RWA": {Name: "Rwanda", ISOAlpha3: "RWA", ISOAlpha2: "RW", Code: "646"},
+ "SAU": {Name: "Saudi Arabia", ISOAlpha3: "SAU", ISOAlpha2: "SA", Code: "682"},
+ "SDN": {Name: "Sudan", ISOAlpha3: "SDN", ISOAlpha2: "SD", Code: "729"},
+ "SEN": {Name: "Senegal", ISOAlpha3: "SEN", ISOAlpha2: "SN", Code: "686"},
+ "SGP": {Name: "Singapore", ISOAlpha3: "SGP", ISOAlpha2: "SG", Code: "702"},
+ "SGS": {Name: "South Georgia and the South Sandwich Islands", ISOAlpha3: "SGS", ISOAlpha2: "GS", Code: "239"},
+ "SHN": {Name: "Saint Helena, Ascension and Tristan da Cunha", ISOAlpha3: "SHN", ISOAlpha2: "SH", Code: "654"},
+ "SJM": {Name: "Svalbard and Jan Mayen", ISOAlpha3: "SJM", ISOAlpha2: "SJ", Code: "744"},
+ "SLB": {Name: "Solomon Islands", ISOAlpha3: "SLB", ISOAlpha2: "SB", Code: "090"},
+ "SLE": {Name: "Sierra Leone", ISOAlpha3: "SLE", ISOAlpha2: "SL", Code: "694"},
+ "SLV": {Name: "El Salvador", ISOAlpha3: "SLV", ISOAlpha2: "SV", Code: "222"},
+ "SMR": {Name: "San Marino", ISOAlpha3: "SMR", ISOAlpha2: "SM", Code: "674"},
+ "SOM": {Name: "Somalia", ISOAlpha3: "SOM", ISOAlpha2: "SO", Code: "706"},
+ "SPM": {Name: "Saint Pierre and Miquelon", ISOAlpha3: "SPM", ISOAlpha2: "PM", Code: "666"},
+ "SRB": {Name: "Serbia", ISOAlpha3: "SRB", ISOAlpha2: "RS", Code: "688"},
+ "SSD": {Name: "South Sudan", ISOAlpha3: "SSD", ISOAlpha2: "SS", Code: "728"},
+ "STP": {Name: "Sao Tome and Principe", ISOAlpha3: "STP", ISOAlpha2: "ST", Code: "678"},
+ "SUR": {Name: "Suriname", ISOAlpha3: "SUR", ISOAlpha2: "SR", Code: "740"},
+ "SVK": {Name: "Slovakia", ISOAlpha3: "SVK", ISOAlpha2: "SK", Code: "703"},
+ "SVN": {Name: "Slovenia", ISOAlpha3: "SVN", ISOAlpha2: "SI", Code: "705"},
+ "SWE": {Name: "Sweden", ISOAlpha3: "SWE", ISOAlpha2: "SE", Code: "752"},
+ "SWZ": {Name: "Eswatini", ISOAlpha3: "SWZ", ISOAlpha2: "SZ", Code: "748"},
+ "SXM": {Name: "Sint Maarten (Dutch part)", ISOAlpha3: "SXM", ISOAlpha2: "SX", Code: "534"},
+ "SYC": {Name: "Seychelles", ISOAlpha3: "SYC", ISOAlpha2: "SC", Code: "690"},
+ "SYR": {Name: "Syrian Arab Republic", ISOAlpha3: "SYR", ISOAlpha2: "SY", Code: "760"},
+ "TCA": {Name: "Turks and Caicos Islands", ISOAlpha3: "TCA", ISOAlpha2: "TC", Code: "796"},
+ "TCD": {Name: "Chad", ISOAlpha3: "TCD", ISOAlpha2: "TD", Code: "148"},
+ "TGO": {Name: "Togo", ISOAlpha3: "TGO", ISOAlpha2: "TG", Code: "768"},
+ "THA": {Name: "Thailand", ISOAlpha3: "THA", ISOAlpha2: "TH", Code: "764"},
+ "TJK": {Name: "Tajikistan", ISOAlpha3: "TJK", ISOAlpha2: "TJ", Code: "762"},
+ "TKL": {Name: "Tokelau", ISOAlpha3: "TKL", ISOAlpha2: "TK", Code: "772"},
+ "TKM": {Name: "Turkmenistan", ISOAlpha3: "TKM", ISOAlpha2: "TM", Code: "795"},
+ "TLS": {Name: "Timor-Leste", ISOAlpha3: "TLS", ISOAlpha2: "TL", Code: "626"},
+ "TON": {Name: "Tonga", ISOAlpha3: "TON", ISOAlpha2: "TO", Code: "776"},
+ "TTO": {Name: "Trinidad and Tobago", ISOAlpha3: "TTO", ISOAlpha2: "TT", Code: "780"},
+ "TUN": {Name: "Tunisia", ISOAlpha3: "TUN", ISOAlpha2: "TN", Code: "788"},
+ "TUR": {Name: "Turkey", ISOAlpha3: "TUR", ISOAlpha2: "TR", Code: "792"},
+ "TUV": {Name: "Tuvalu", ISOAlpha3: "TUV", ISOAlpha2: "TV", Code: "798"},
+ "TWN": {Name: "Taiwan, Province of China", ISOAlpha3: "TWN", ISOAlpha2: "TW", Code: "158"},
+ "TZA": {Name: "Tanzania, United Republic of", ISOAlpha3: "TZA", ISOAlpha2: "TZ", Code: "834"},
+ "UGA": {Name: "Uganda", ISOAlpha3: "UGA", ISOAlpha2: "UG", Code: "800"},
+ "UKR": {Name: "Ukraine", ISOAlpha3: "UKR", ISOAlpha2: "UA", Code: "804"},
+ "UMI": {Name: "United States Minor Outlying Islands", ISOAlpha3: "UMI", ISOAlpha2: "UM", Code: "581"},
+ "URY": {Name: "Uruguay", ISOAlpha3: "URY", ISOAlpha2: "UY", Code: "858"},
+ "USA": {Name: "United States of America", ISOAlpha3: "USA", ISOAlpha2: "US", Code: "840"},
+ "UZB": {Name: "Uzbekistan", ISOAlpha3: "UZB", ISOAlpha2: "UZ", Code: "860"},
+ "VAT": {Name: "Holy See", ISOAlpha3: "VAT", ISOAlpha2: "VA", Code: "336"},
+ "VCT": {Name: "Saint Vincent and the Grenadines", ISOAlpha3: "VCT", ISOAlpha2: "VC", Code: "670"},
+ "VEN": {Name: "Venezuela (Bolivarian Republic of)", ISOAlpha3: "VEN", ISOAlpha2: "VE", Code: "862"},
+ "VGB": {Name: "Virgin Islands (British)", ISOAlpha3: "VGB", ISOAlpha2: "VG", Code: "092"},
+ "VIR": {Name: "Virgin Islands (U.S.)", ISOAlpha3: "VIR", ISOAlpha2: "VI", Code: "850"},
+ "VNM": {Name: "Viet Nam", ISOAlpha3: "VNM", ISOAlpha2: "VN", Code: "704"},
+ "VUT": {Name: "Vanuatu", ISOAlpha3: "VUT", ISOAlpha2: "VU", Code: "548"},
+ "WLF": {Name: "Wallis and Futuna", ISOAlpha3: "WLF", ISOAlpha2: "WF", Code: "876"},
+ "WSM": {Name: "Samoa", ISOAlpha3: "WSM", ISOAlpha2: "WS", Code: "882"},
+ "YEM": {Name: "Yemen", ISOAlpha3: "YEM", ISOAlpha2: "YE", Code: "887"},
+ "ZAF": {Name: "South Africa", ISOAlpha3: "ZAF", ISOAlpha2: "ZA", Code: "710"},
+ "ZMB": {Name: "Zambia", ISOAlpha3: "ZMB", ISOAlpha2: "ZM", Code: "894"},
+ "ZWE": {Name: "Zimbabwe", ISOAlpha3: "ZWE", ISOAlpha2: "ZW", Code: "716"},
+}
+
+// CountriesISO2 indexes ISO3166 countries by their alpha-2 code.
+var CountriesISO2 = map[string]Country{
+ "AD": {Name: "Andorra", ISOAlpha3: "AND", ISOAlpha2: "AD", Code: "020"},
+ "AE": {Name: "United Arab Emirates", ISOAlpha3: "ARE", ISOAlpha2: "AE", Code: "784"},
+ "AF": {Name: "Afghanistan", ISOAlpha3: "AFG", ISOAlpha2: "AF", Code: "004"},
+ "AG": {Name: "Antigua and Barbuda", ISOAlpha3: "ATG", ISOAlpha2: "AG", Code: "028"},
+ "AI": {Name: "Anguilla", ISOAlpha3: "AIA", ISOAlpha2: "AI", Code: "660"},
+ "AL": {Name: "Albania", ISOAlpha3: "ALB", ISOAlpha2: "AL", Code: "008"},
+ "AM": {Name: "Armenia", ISOAlpha3: "ARM", ISOAlpha2: "AM", Code: "051"},
+ "AO": {Name: "Angola", ISOAlpha3: "AGO", ISOAlpha2: "AO", Code: "024"},
+ "AQ": {Name: "Antarctica", ISOAlpha3: "ATA", ISOAlpha2: "AQ", Code: "010"},
+ "AR": {Name: "Argentina", ISOAlpha3: "ARG", ISOAlpha2: "AR", Code: "032"},
+ "AS": {Name: "American Samoa", ISOAlpha3: "ASM", ISOAlpha2: "AS", Code: "016"},
+ "AT": {Name: "Austria", ISOAlpha3: "AUT", ISOAlpha2: "AT", Code: "040"},
+ "AU": {Name: "Australia", ISOAlpha3: "AUS", ISOAlpha2: "AU", Code: "036"},
+ "AW": {Name: "Aruba", ISOAlpha3: "ABW", ISOAlpha2: "AW", Code: "533"},
+ "AX": {Name: "Åland Islands", ISOAlpha3: "ALA", ISOAlpha2: "AX", Code: "248"},
+ "AZ": {Name: "Azerbaijan", ISOAlpha3: "AZE", ISOAlpha2: "AZ", Code: "031"},
+ "BA": {Name: "Bosnia and Herzegovina", ISOAlpha3: "BIH", ISOAlpha2: "BA", Code: "070"},
+ "BB": {Name: "Barbados", ISOAlpha3: "BRB", ISOAlpha2: "BB", Code: "052"},
+ "BD": {Name: "Bangladesh", ISOAlpha3: "BGD", ISOAlpha2: "BD", Code: "050"},
+ "BE": {Name: "Belgium", ISOAlpha3: "BEL", ISOAlpha2: "BE", Code: "056"},
+ "BF": {Name: "Burkina Faso", ISOAlpha3: "BFA", ISOAlpha2: "BF", Code: "854"},
+ "BG": {Name: "Bulgaria", ISOAlpha3: "BGR", ISOAlpha2: "BG", Code: "100"},
+ "BH": {Name: "Bahrain", ISOAlpha3: "BHR", ISOAlpha2: "BH", Code: "048"},
+ "BI": {Name: "Burundi", ISOAlpha3: "BDI", ISOAlpha2: "BI", Code: "108"},
+ "BJ": {Name: "Benin", ISOAlpha3: "BEN", ISOAlpha2: "BJ", Code: "204"},
+ "BL": {Name: "Saint Barthélemy", ISOAlpha3: "BLM", ISOAlpha2: "BL", Code: "652"},
+ "BM": {Name: "Bermuda", ISOAlpha3: "BMU", ISOAlpha2: "BM", Code: "060"},
+ "BN": {Name: "Brunei Darussalam", ISOAlpha3: "BRN", ISOAlpha2: "BN", Code: "096"},
+ "BO": {Name: "Bolivia (Plurinational State of)", ISOAlpha3: "BOL", ISOAlpha2: "BO", Code: "068"},
+ "BQ": {Name: "Bonaire, Sint Eustatius and Saba", ISOAlpha3: "BES", ISOAlpha2: "BQ", Code: "535"},
+ "BR": {Name: "Brazil", ISOAlpha3: "BRA", ISOAlpha2: "BR", Code: "076"},
+ "BS": {Name: "Bahamas", ISOAlpha3: "BHS", ISOAlpha2: "BS", Code: "044"},
+ "BT": {Name: "Bhutan", ISOAlpha3: "BTN", ISOAlpha2: "BT", Code: "064"},
+ "BV": {Name: "Bouvet Island", ISOAlpha3: "BVT", ISOAlpha2: "BV", Code: "074"},
+ "BW": {Name: "Botswana", ISOAlpha3: "BWA", ISOAlpha2: "BW", Code: "072"},
+ "BY": {Name: "Belarus", ISOAlpha3: "BLR", ISOAlpha2: "BY", Code: "112"},
+ "BZ": {Name: "Belize", ISOAlpha3: "BLZ", ISOAlpha2: "BZ", Code: "084"},
+ "CA": {Name: "Canada", ISOAlpha3: "CAN", ISOAlpha2: "CA", Code: "124"},
+ "CC": {Name: "Cocos (Keeling) Islands", ISOAlpha3: "CCK", ISOAlpha2: "CC", Code: "166"},
+ "CD": {Name: "Congo, Democratic Republic of the", ISOAlpha3: "COD", ISOAlpha2: "CD", Code: "180"},
+ "CF": {Name: "Central African Republic", ISOAlpha3: "CAF", ISOAlpha2: "CF", Code: "140"},
+ "CG": {Name: "Congo", ISOAlpha3: "COG", ISOAlpha2: "CG", Code: "178"},
+ "CH": {Name: "Switzerland", ISOAlpha3: "CHE", ISOAlpha2: "CH", Code: "756"},
+ "CI": {Name: "Côte d'Ivoire", ISOAlpha3: "CIV", ISOAlpha2: "CI", Code: "384"},
+ "CK": {Name: "Cook Islands", ISOAlpha3: "COK", ISOAlpha2: "CK", Code: "184"},
+ "CL": {Name: "Chile", ISOAlpha3: "CHL", ISOAlpha2: "CL", Code: "152"},
+ "CM": {Name: "Cameroon", ISOAlpha3: "CMR", ISOAlpha2: "CM", Code: "120"},
+ "CN": {Name: "China", ISOAlpha3: "CHN", ISOAlpha2: "CN", Code: "156"},
+ "CO": {Name: "Colombia", ISOAlpha3: "COL", ISOAlpha2: "CO", Code: "170"},
+ "CR": {Name: "Costa Rica", ISOAlpha3: "CRI", ISOAlpha2: "CR", Code: "188"},
+ "CU": {Name: "Cuba", ISOAlpha3: "CUB", ISOAlpha2: "CU", Code: "192"},
+ "CV": {Name: "Cabo Verde", ISOAlpha3: "CPV", ISOAlpha2: "CV", Code: "132"},
+ "CW": {Name: "Curaçao", ISOAlpha3: "CUW", ISOAlpha2: "CW", Code: "531"},
+ "CX": {Name: "Christmas Island", ISOAlpha3: "CXR", ISOAlpha2: "CX", Code: "162"},
+ "CY": {Name: "Cyprus", ISOAlpha3: "CYP", ISOAlpha2: "CY", Code: "196"},
+ "CZ": {Name: "Czechia", ISOAlpha3: "CZE", ISOAlpha2: "CZ", Code: "203"},
+ "DE": {Name: "Germany", ISOAlpha3: "DEU", ISOAlpha2: "DE", Code: "276"},
+ "DJ": {Name: "Djibouti", ISOAlpha3: "DJI", ISOAlpha2: "DJ", Code: "262"},
+ "DK": {Name: "Denmark", ISOAlpha3: "DNK", ISOAlpha2: "DK", Code: "208"},
+ "DM": {Name: "Dominica", ISOAlpha3: "DMA", ISOAlpha2: "DM", Code: "212"},
+ "DO": {Name: "Dominican Republic", ISOAlpha3: "DOM", ISOAlpha2: "DO", Code: "214"},
+ "DZ": {Name: "Algeria", ISOAlpha3: "DZA", ISOAlpha2: "DZ", Code: "012"},
+ "EC": {Name: "Ecuador", ISOAlpha3: "ECU", ISOAlpha2: "EC", Code: "218"},
+ "EE": {Name: "Estonia", ISOAlpha3: "EST", ISOAlpha2: "EE", Code: "233"},
+ "EG": {Name: "Egypt", ISOAlpha3: "EGY", ISOAlpha2: "EG", Code: "818"},
+ "EH": {Name: "Western Sahara", ISOAlpha3: "ESH", ISOAlpha2: "EH", Code: "732"},
+ "ER": {Name: "Eritrea", ISOAlpha3: "ERI", ISOAlpha2: "ER", Code: "232"},
+ "ES": {Name: "Spain", ISOAlpha3: "ESP", ISOAlpha2: "ES", Code: "724"},
+ "ET": {Name: "Ethiopia", ISOAlpha3: "ETH", ISOAlpha2: "ET", Code: "231"},
+ "FI": {Name: "Finland", ISOAlpha3: "FIN", ISOAlpha2: "FI", Code: "246"},
+ "FJ": {Name: "Fiji", ISOAlpha3: "FJI", ISOAlpha2: "FJ", Code: "242"},
+ "FK": {Name: "Falkland Islands (Malvinas)", ISOAlpha3: "FLK", ISOAlpha2: "FK", Code: "238"},
+ "FM": {Name: "Micronesia (Federated States of)", ISOAlpha3: "FSM", ISOAlpha2: "FM", Code: "583"},
+ "FO": {Name: "Faroe Islands", ISOAlpha3: "FRO", ISOAlpha2: "FO", Code: "234"},
+ "FR": {Name: "France", ISOAlpha3: "FRA", ISOAlpha2: "FR", Code: "250"},
+ "GA": {Name: "Gabon", ISOAlpha3: "GAB", ISOAlpha2: "GA", Code: "266"},
+ "GB": {Name: "United Kingdom of Great Britain and Northern Ireland", ISOAlpha3: "GBR", ISOAlpha2: "GB", Code: "826"},
+ "GD": {Name: "Grenada", ISOAlpha3: "GRD", ISOAlpha2: "GD", Code: "308"},
+ "GE": {Name: "Georgia", ISOAlpha3: "GEO", ISOAlpha2: "GE", Code: "268"},
+ "GF": {Name: "French Guiana", ISOAlpha3: "GUF", ISOAlpha2: "GF", Code: "254"},
+ "GG": {Name: "Guernsey", ISOAlpha3: "GGY", ISOAlpha2: "GG", Code: "831"},
+ "GH": {Name: "Ghana", ISOAlpha3: "GHA", ISOAlpha2: "GH", Code: "288"},
+ "GI": {Name: "Gibraltar", ISOAlpha3: "GIB", ISOAlpha2: "GI", Code: "292"},
+ "GL": {Name: "Greenland", ISOAlpha3: "GRL", ISOAlpha2: "GL", Code: "304"},
+ "GM": {Name: "Gambia", ISOAlpha3: "GMB", ISOAlpha2: "GM", Code: "270"},
+ "GN": {Name: "Guinea", ISOAlpha3: "GIN", ISOAlpha2: "GN", Code: "324"},
+ "GP": {Name: "Guadeloupe", ISOAlpha3: "GLP", ISOAlpha2: "GP", Code: "312"},
+ "GQ": {Name: "Equatorial Guinea", ISOAlpha3: "GNQ", ISOAlpha2: "GQ", Code: "226"},
+ "GR": {Name: "Greece", ISOAlpha3: "GRC", ISOAlpha2: "GR", Code: "300"},
+ "GS": {Name: "South Georgia and the South Sandwich Islands", ISOAlpha3: "SGS", ISOAlpha2: "GS", Code: "239"},
+ "GT": {Name: "Guatemala", ISOAlpha3: "GTM", ISOAlpha2: "GT", Code: "320"},
+ "GU": {Name: "Guam", ISOAlpha3: "GUM", ISOAlpha2: "GU", Code: "316"},
+ "GW": {Name: "Guinea-Bissau", ISOAlpha3: "GNB", ISOAlpha2: "GW", Code: "624"},
+ "GY": {Name: "Guyana", ISOAlpha3: "GUY", ISOAlpha2: "GY", Code: "328"},
+ "HK": {Name: "Hong Kong", ISOAlpha3: "HKG", ISOAlpha2: "HK", Code: "344"},
+ "HM": {Name: "Heard Island and McDonald Islands", ISOAlpha3: "HMD", ISOAlpha2: "HM", Code: "334"},
+ "HN": {Name: "Honduras", ISOAlpha3: "HND", ISOAlpha2: "HN", Code: "340"},
+ "HR": {Name: "Croatia", ISOAlpha3: "HRV", ISOAlpha2: "HR", Code: "191"},
+ "HT": {Name: "Haiti", ISOAlpha3: "HTI", ISOAlpha2: "HT", Code: "332"},
+ "HU": {Name: "Hungary", ISOAlpha3: "HUN", ISOAlpha2: "HU", Code: "348"},
+ "ID": {Name: "Indonesia", ISOAlpha3: "IDN", ISOAlpha2: "ID", Code: "360"},
+ "IE": {Name: "Ireland", ISOAlpha3: "IRL", ISOAlpha2: "IE", Code: "372"},
+ "IL": {Name: "Israel", ISOAlpha3: "ISR", ISOAlpha2: "IL", Code: "376"},
+ "IM": {Name: "Isle of Man", ISOAlpha3: "IMN", ISOAlpha2: "IM", Code: "833"},
+ "IN": {Name: "India", ISOAlpha3: "IND", ISOAlpha2: "IN", Code: "356"},
+ "IO": {Name: "British Indian Ocean Territory", ISOAlpha3: "IOT", ISOAlpha2: "IO", Code: "086"},
+ "IQ": {Name: "Iraq", ISOAlpha3: "IRQ", ISOAlpha2: "IQ", Code: "368"},
+ "IR": {Name: "Iran (Islamic Republic of)", ISOAlpha3: "IRN", ISOAlpha2: "IR", Code: "364"},
+ "IS": {Name: "Iceland", ISOAlpha3: "ISL", ISOAlpha2: "IS", Code: "352"},
+ "IT": {Name: "Italy", ISOAlpha3: "ITA", ISOAlpha2: "IT", Code: "380"},
+ "JE": {Name: "Jersey", ISOAlpha3: "JEY", ISOAlpha2: "JE", Code: "832"},
+ "JM": {Name: "Jamaica", ISOAlpha3: "JAM", ISOAlpha2: "JM", Code: "388"},
+ "JO": {Name: "Jordan", ISOAlpha3: "JOR", ISOAlpha2: "JO", Code: "400"},
+ "JP": {Name: "Japan", ISOAlpha3: "JPN", ISOAlpha2: "JP", Code: "392"},
+ "KE": {Name: "Kenya", ISOAlpha3: "KEN", ISOAlpha2: "KE", Code: "404"},
+ "KG": {Name: "Kyrgyzstan", ISOAlpha3: "KGZ", ISOAlpha2: "KG", Code: "417"},
+ "KH": {Name: "Cambodia", ISOAlpha3: "KHM", ISOAlpha2: "KH", Code: "116"},
+ "KI": {Name: "Kiribati", ISOAlpha3: "KIR", ISOAlpha2: "KI", Code: "296"},
+ "KM": {Name: "Comoros", ISOAlpha3: "COM", ISOAlpha2: "KM", Code: "174"},
+ "KN": {Name: "Saint Kitts and Nevis", ISOAlpha3: "KNA", ISOAlpha2: "KN", Code: "659"},
+ "KP": {Name: "Korea (Democratic People's Republic of)", ISOAlpha3: "PRK", ISOAlpha2: "KP", Code: "408"},
+ "KR": {Name: "Korea, Republic of", ISOAlpha3: "KOR", ISOAlpha2: "KR", Code: "410"},
+ "KW": {Name: "Kuwait", ISOAlpha3: "KWT", ISOAlpha2: "KW", Code: "414"},
+ "KY": {Name: "Cayman Islands", ISOAlpha3: "CYM", ISOAlpha2: "KY", Code: "136"},
+ "KZ": {Name: "Kazakhstan", ISOAlpha3: "KAZ", ISOAlpha2: "KZ", Code: "398"},
+ "LA": {Name: "Lao People's Democratic Republic", ISOAlpha3: "LAO", ISOAlpha2: "LA", Code: "418"},
+ "LB": {Name: "Lebanon", ISOAlpha3: "LBN", ISOAlpha2: "LB", Code: "422"},
+ "LC": {Name: "Saint Lucia", ISOAlpha3: "LCA", ISOAlpha2: "LC", Code: "662"},
+ "LI": {Name: "Liechtenstein", ISOAlpha3: "LIE", ISOAlpha2: "LI", Code: "438"},
+ "LK": {Name: "Sri Lanka", ISOAlpha3: "LKA", ISOAlpha2: "LK", Code: "144"},
+ "LR": {Name: "Liberia", ISOAlpha3: "LBR", ISOAlpha2: "LR", Code: "430"},
+ "LS": {Name: "Lesotho", ISOAlpha3: "LSO", ISOAlpha2: "LS", Code: "426"},
+ "LT": {Name: "Lithuania", ISOAlpha3: "LTU", ISOAlpha2: "LT", Code: "440"},
+ "LU": {Name: "Luxembourg", ISOAlpha3: "LUX", ISOAlpha2: "LU", Code: "442"},
+ "LV": {Name: "Latvia", ISOAlpha3: "LVA", ISOAlpha2: "LV", Code: "428"},
+ "LY": {Name: "Libya", ISOAlpha3: "LBY", ISOAlpha2: "LY", Code: "434"},
+ "MA": {Name: "Morocco", ISOAlpha3: "MAR", ISOAlpha2: "MA", Code: "504"},
+ "MC": {Name: "Monaco", ISOAlpha3: "MCO", ISOAlpha2: "MC", Code: "492"},
+ "MD": {Name: "Moldova, Republic of", ISOAlpha3: "MDA", ISOAlpha2: "MD", Code: "498"},
+ "ME": {Name: "Montenegro", ISOAlpha3: "MNE", ISOAlpha2: "ME", Code: "499"},
+ "MF": {Name: "Saint Martin (French part)", ISOAlpha3: "MAF", ISOAlpha2: "MF", Code: "663"},
+ "MG": {Name: "Madagascar", ISOAlpha3: "MDG", ISOAlpha2: "MG", Code: "450"},
+ "MH": {Name: "Marshall Islands", ISOAlpha3: "MHL", ISOAlpha2: "MH", Code: "584"},
+ "MK": {Name: "North Macedonia", ISOAlpha3: "MKD", ISOAlpha2: "MK", Code: "807"},
+ "ML": {Name: "Mali", ISOAlpha3: "MLI", ISOAlpha2: "ML", Code: "466"},
+ "MM": {Name: "Myanmar", ISOAlpha3: "MMR", ISOAlpha2: "MM", Code: "104"},
+ "MN": {Name: "Mongolia", ISOAlpha3: "MNG", ISOAlpha2: "MN", Code: "496"},
+ "MO": {Name: "Macao", ISOAlpha3: "MAC", ISOAlpha2: "MO", Code: "446"},
+ "MP": {Name: "Northern Mariana Islands", ISOAlpha3: "MNP", ISOAlpha2: "MP", Code: "580"},
+ "MQ": {Name: "Martinique", ISOAlpha3: "MTQ", ISOAlpha2: "MQ", Code: "474"},
+ "MR": {Name: "Mauritania", ISOAlpha3: "MRT", ISOAlpha2: "MR", Code: "478"},
+ "MS": {Name: "Montserrat", ISOAlpha3: "MSR", ISOAlpha2: "MS", Code: "500"},
+ "MT": {Name: "Malta", ISOAlpha3: "MLT", ISOAlpha2: "MT", Code: "470"},
+ "MU": {Name: "Mauritius", ISOAlpha3: "MUS", ISOAlpha2: "MU", Code: "480"},
+ "MV": {Name: "Maldives", ISOAlpha3: "MDV", ISOAlpha2: "MV", Code: "462"},
+ "MW": {Name: "Malawi", ISOAlpha3: "MWI", ISOAlpha2: "MW", Code: "454"},
+ "MX": {Name: "Mexico", ISOAlpha3: "MEX", ISOAlpha2: "MX", Code: "484"},
+ "MY": {Name: "Malaysia", ISOAlpha3: "MYS", ISOAlpha2: "MY", Code: "458"},
+ "MZ": {Name: "Mozambique", ISOAlpha3: "MOZ", ISOAlpha2: "MZ", Code: "508"},
+ "NA": {Name: "Namibia", ISOAlpha3: "NAM", ISOAlpha2: "NA", Code: "516"},
+ "NC": {Name: "New Caledonia", ISOAlpha3: "NCL", ISOAlpha2: "NC", Code: "540"},
+ "NE": {Name: "Niger", ISOAlpha3: "NER", ISOAlpha2: "NE", Code: "562"},
+ "NF": {Name: "Norfolk Island", ISOAlpha3: "NFK", ISOAlpha2: "NF", Code: "574"},
+ "NG": {Name: "Nigeria", ISOAlpha3: "NGA", ISOAlpha2: "NG", Code: "566"},
+ "NI": {Name: "Nicaragua", ISOAlpha3: "NIC", ISOAlpha2: "NI", Code: "558"},
+ "NL": {Name: "Netherlands", ISOAlpha3: "NLD", ISOAlpha2: "NL", Code: "528"},
+ "NO": {Name: "Norway", ISOAlpha3: "NOR", ISOAlpha2: "NO", Code: "578"},
+ "NP": {Name: "Nepal", ISOAlpha3: "NPL", ISOAlpha2: "NP", Code: "524"},
+ "NR": {Name: "Nauru", ISOAlpha3: "NRU", ISOAlpha2: "NR", Code: "520"},
+ "NU": {Name: "Niue", ISOAlpha3: "NIU", ISOAlpha2: "NU", Code: "570"},
+ "NZ": {Name: "New Zealand", ISOAlpha3: "NZL", ISOAlpha2: "NZ", Code: "554"},
+ "OM": {Name: "Oman", ISOAlpha3: "OMN", ISOAlpha2: "OM", Code: "512"},
+ "PA": {Name: "Panama", ISOAlpha3: "PAN", ISOAlpha2: "PA", Code: "591"},
+ "PE": {Name: "Peru", ISOAlpha3: "PER", ISOAlpha2: "PE", Code: "604"},
+ "PF": {Name: "French Polynesia", ISOAlpha3: "PYF", ISOAlpha2: "PF", Code: "258"},
+ "PG": {Name: "Papua New Guinea", ISOAlpha3: "PNG", ISOAlpha2: "PG", Code: "598"},
+ "PH": {Name: "Philippines", ISOAlpha3: "PHL", ISOAlpha2: "PH", Code: "608"},
+ "PK": {Name: "Pakistan", ISOAlpha3: "PAK", ISOAlpha2: "PK", Code: "586"},
+ "PL": {Name: "Poland", ISOAlpha3: "POL", ISOAlpha2: "PL", Code: "616"},
+ "PM": {Name: "Saint Pierre and Miquelon", ISOAlpha3: "SPM", ISOAlpha2: "PM", Code: "666"},
+ "PN": {Name: "Pitcairn", ISOAlpha3: "PCN", ISOAlpha2: "PN", Code: "612"},
+ "PR": {Name: "Puerto Rico", ISOAlpha3: "PRI", ISOAlpha2: "PR", Code: "630"},
+ "PS": {Name: "Palestine, State of", ISOAlpha3: "PSE", ISOAlpha2: "PS", Code: "275"},
+ "PT": {Name: "Portugal", ISOAlpha3: "PRT", ISOAlpha2: "PT", Code: "620"},
+ "PW": {Name: "Palau", ISOAlpha3: "PLW", ISOAlpha2: "PW", Code: "585"},
+ "PY": {Name: "Paraguay", ISOAlpha3: "PRY", ISOAlpha2: "PY", Code: "600"},
+ "QA": {Name: "Qatar", ISOAlpha3: "QAT", ISOAlpha2: "QA", Code: "634"},
+ "RE": {Name: "Réunion", ISOAlpha3: "REU", ISOAlpha2: "RE", Code: "638"},
+ "RO": {Name: "Romania", ISOAlpha3: "ROU", ISOAlpha2: "RO", Code: "642"},
+ "RS": {Name: "Serbia", ISOAlpha3: "SRB", ISOAlpha2: "RS", Code: "688"},
+ "RU": {Name: "Russian Federation", ISOAlpha3: "RUS", ISOAlpha2: "RU", Code: "643"},
+ "RW": {Name: "Rwanda", ISOAlpha3: "RWA", ISOAlpha2: "RW", Code: "646"},
+ "SA": {Name: "Saudi Arabia", ISOAlpha3: "SAU", ISOAlpha2: "SA", Code: "682"},
+ "SB": {Name: "Solomon Islands", ISOAlpha3: "SLB", ISOAlpha2: "SB", Code: "090"},
+ "SC": {Name: "Seychelles", ISOAlpha3: "SYC", ISOAlpha2: "SC", Code: "690"},
+ "SD": {Name: "Sudan", ISOAlpha3: "SDN", ISOAlpha2: "SD", Code: "729"},
+ "SE": {Name: "Sweden", ISOAlpha3: "SWE", ISOAlpha2: "SE", Code: "752"},
+ "SG": {Name: "Singapore", ISOAlpha3: "SGP", ISOAlpha2: "SG", Code: "702"},
+ "SH": {Name: "Saint Helena, Ascension and Tristan da Cunha", ISOAlpha3: "SHN", ISOAlpha2: "SH", Code: "654"},
+ "SI": {Name: "Slovenia", ISOAlpha3: "SVN", ISOAlpha2: "SI", Code: "705"},
+ "SJ": {Name: "Svalbard and Jan Mayen", ISOAlpha3: "SJM", ISOAlpha2: "SJ", Code: "744"},
+ "SK": {Name: "Slovakia", ISOAlpha3: "SVK", ISOAlpha2: "SK", Code: "703"},
+ "SL": {Name: "Sierra Leone", ISOAlpha3: "SLE", ISOAlpha2: "SL", Code: "694"},
+ "SM": {Name: "San Marino", ISOAlpha3: "SMR", ISOAlpha2: "SM", Code: "674"},
+ "SN": {Name: "Senegal", ISOAlpha3: "SEN", ISOAlpha2: "SN", Code: "686"},
+ "SO": {Name: "Somalia", ISOAlpha3: "SOM", ISOAlpha2: "SO", Code: "706"},
+ "SR": {Name: "Suriname", ISOAlpha3: "SUR", ISOAlpha2: "SR", Code: "740"},
+ "SS": {Name: "South Sudan", ISOAlpha3: "SSD", ISOAlpha2: "SS", Code: "728"},
+ "ST": {Name: "Sao Tome and Principe", ISOAlpha3: "STP", ISOAlpha2: "ST", Code: "678"},
+ "SV": {Name: "El Salvador", ISOAlpha3: "SLV", ISOAlpha2: "SV", Code: "222"},
+ "SX": {Name: "Sint Maarten (Dutch part)", ISOAlpha3: "SXM", ISOAlpha2: "SX", Code: "534"},
+ "SY": {Name: "Syrian Arab Republic", ISOAlpha3: "SYR", ISOAlpha2: "SY", Code: "760"},
+ "SZ": {Name: "Eswatini", ISOAlpha3: "SWZ", ISOAlpha2: "SZ", Code: "748"},
+ "TC": {Name: "Turks and Caicos Islands", ISOAlpha3: "TCA", ISOAlpha2: "TC", Code: "796"},
+ "TD": {Name: "Chad", ISOAlpha3: "TCD", ISOAlpha2: "TD", Code: "148"},
+ "TF": {Name: "French Southern Territories", ISOAlpha3: "ATF", ISOAlpha2: "TF", Code: "260"},
+ "TG": {Name: "Togo", ISOAlpha3: "TGO", ISOAlpha2: "TG", Code: "768"},
+ "TH": {Name: "Thailand", ISOAlpha3: "THA", ISOAlpha2: "TH", Code: "764"},
+ "TJ": {Name: "Tajikistan", ISOAlpha3: "TJK", ISOAlpha2: "TJ", Code: "762"},
+ "TK": {Name: "Tokelau", ISOAlpha3: "TKL", ISOAlpha2: "TK", Code: "772"},
+ "TL": {Name: "Timor-Leste", ISOAlpha3: "TLS", ISOAlpha2: "TL", Code: "626"},
+ "TM": {Name: "Turkmenistan", ISOAlpha3: "TKM", ISOAlpha2: "TM", Code: "795"},
+ "TN": {Name: "Tunisia", ISOAlpha3: "TUN", ISOAlpha2: "TN", Code: "788"},
+ "TO": {Name: "Tonga", ISOAlpha3: "TON", ISOAlpha2: "TO", Code: "776"},
+ "TR": {Name: "Turkey", ISOAlpha3: "TUR", ISOAlpha2: "TR", Code: "792"},
+ "TT": {Name: "Trinidad and Tobago", ISOAlpha3: "TTO", ISOAlpha2: "TT", Code: "780"},
+ "TV": {Name: "Tuvalu", ISOAlpha3: "TUV", ISOAlpha2: "TV", Code: "798"},
+ "TW": {Name: "Taiwan, Province of China", ISOAlpha3: "TWN", ISOAlpha2: "TW", Code: "158"},
+ "TZ": {Name: "Tanzania, United Republic of", ISOAlpha3: "TZA", ISOAlpha2: "TZ", Code: "834"},
+ "UA": {Name: "Ukraine", ISOAlpha3: "UKR", ISOAlpha2: "UA", Code: "804"},
+ "UG": {Name: "Uganda", ISOAlpha3: "UGA", ISOAlpha2: "UG", Code: "800"},
+ "UM": {Name: "United States Minor Outlying Islands", ISOAlpha3: "UMI", ISOAlpha2: "UM", Code: "581"},
+ "US": {Name: "United States of America", ISOAlpha3: "USA", ISOAlpha2: "US", Code: "840"},
+ "UY": {Name: "Uruguay", ISOAlpha3: "URY", ISOAlpha2: "UY", Code: "858"},
+ "UZ": {Name: "Uzbekistan", ISOAlpha3: "UZB", ISOAlpha2: "UZ", Code: "860"},
+ "VA": {Name: "Holy See", ISOAlpha3: "VAT", ISOAlpha2: "VA", Code: "336"},
+ "VC": {Name: "Saint Vincent and the Grenadines", ISOAlpha3: "VCT", ISOAlpha2: "VC", Code: "670"},
+ "VE": {Name: "Venezuela (Bolivarian Republic of)", ISOAlpha3: "VEN", ISOAlpha2: "VE", Code: "862"},
+ "VG": {Name: "Virgin Islands (British)", ISOAlpha3: "VGB", ISOAlpha2: "VG", Code: "092"},
+ "VI": {Name: "Virgin Islands (U.S.)", ISOAlpha3: "VIR", ISOAlpha2: "VI", Code: "850"},
+ "VN": {Name: "Viet Nam", ISOAlpha3: "VNM", ISOAlpha2: "VN", Code: "704"},
+ "VU": {Name: "Vanuatu", ISOAlpha3: "VUT", ISOAlpha2: "VU", Code: "548"},
+ "WF": {Name: "Wallis and Futuna", ISOAlpha3: "WLF", ISOAlpha2: "WF", Code: "876"},
+ "WS": {Name: "Samoa", ISOAlpha3: "WSM", ISOAlpha2: "WS", Code: "882"},
+ "YE": {Name: "Yemen", ISOAlpha3: "YEM", ISOAlpha2: "YE", Code: "887"},
+ "YT": {Name: "Mayotte", ISOAlpha3: "MYT", ISOAlpha2: "YT", Code: "175"},
+ "ZA": {Name: "South Africa", ISOAlpha3: "ZAF", ISOAlpha2: "ZA", Code: "710"},
+ "ZM": {Name: "Zambia", ISOAlpha3: "ZMB", ISOAlpha2: "ZM", Code: "894"},
+ "ZW": {Name: "Zimbabwe", ISOAlpha3: "ZWE", ISOAlpha2: "ZW", Code: "716"},
+}
diff --git a/vendor/github.com/go-openapi/strfmt/internal/countries/country.go b/vendor/github.com/go-openapi/strfmt/internal/countries/country.go
new file mode 100644
index 0000000000..774051430e
--- /dev/null
+++ b/vendor/github.com/go-openapi/strfmt/internal/countries/country.go
@@ -0,0 +1,15 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+//go:generate go run gen.go -- countries.go
+package countries
+
+// Country identifies a country with its english name, and ISO3166 codes.
+//
+//nolint:tagliatelle // JSON tags mirror the iso3166.json source keys (alpha-3, alpha-2, country-code); renaming them breaks the embedded-JSON unmarshal.
+type Country struct {
+ Name string `json:"name"`
+ ISOAlpha3 string `json:"alpha-3"`
+ ISOAlpha2 string `json:"alpha-2"`
+ Code string `json:"country-code"`
+}
diff --git a/vendor/github.com/go-openapi/strfmt/internal/countries/iso3166.json b/vendor/github.com/go-openapi/strfmt/internal/countries/iso3166.json
new file mode 100644
index 0000000000..b2c0b5c501
--- /dev/null
+++ b/vendor/github.com/go-openapi/strfmt/internal/countries/iso3166.json
@@ -0,0 +1,251 @@
+[
+{"name":"Afghanistan","alpha-2":"AF","alpha-3":"AFG","country-code":"004","iso_3166-2":"ISO 3166-2:AF","region":"Asia","sub-region":"Southern Asia","intermediate-region":"","region-code":"142","sub-region-code":"034","intermediate-region-code":""},
+{"name":"Åland Islands","alpha-2":"AX","alpha-3":"ALA","country-code":"248","iso_3166-2":"ISO 3166-2:AX","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"Albania","alpha-2":"AL","alpha-3":"ALB","country-code":"008","iso_3166-2":"ISO 3166-2:AL","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Algeria","alpha-2":"DZ","alpha-3":"DZA","country-code":"012","iso_3166-2":"ISO 3166-2:DZ","region":"Africa","sub-region":"Northern Africa","intermediate-region":"","region-code":"002","sub-region-code":"015","intermediate-region-code":""},
+{"name":"American Samoa","alpha-2":"AS","alpha-3":"ASM","country-code":"016","iso_3166-2":"ISO 3166-2:AS","region":"Oceania","sub-region":"Polynesia","intermediate-region":"","region-code":"009","sub-region-code":"061","intermediate-region-code":""},
+{"name":"Andorra","alpha-2":"AD","alpha-3":"AND","country-code":"020","iso_3166-2":"ISO 3166-2:AD","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Angola","alpha-2":"AO","alpha-3":"AGO","country-code":"024","iso_3166-2":"ISO 3166-2:AO","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Middle Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"017"},
+{"name":"Anguilla","alpha-2":"AI","alpha-3":"AIA","country-code":"660","iso_3166-2":"ISO 3166-2:AI","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Antarctica","alpha-2":"AQ","alpha-3":"ATA","country-code":"010","iso_3166-2":"ISO 3166-2:AQ","region":"","sub-region":"","intermediate-region":"","region-code":"","sub-region-code":"","intermediate-region-code":""},
+{"name":"Antigua and Barbuda","alpha-2":"AG","alpha-3":"ATG","country-code":"028","iso_3166-2":"ISO 3166-2:AG","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Argentina","alpha-2":"AR","alpha-3":"ARG","country-code":"032","iso_3166-2":"ISO 3166-2:AR","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"Armenia","alpha-2":"AM","alpha-3":"ARM","country-code":"051","iso_3166-2":"ISO 3166-2:AM","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Aruba","alpha-2":"AW","alpha-3":"ABW","country-code":"533","iso_3166-2":"ISO 3166-2:AW","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Australia","alpha-2":"AU","alpha-3":"AUS","country-code":"036","iso_3166-2":"ISO 3166-2:AU","region":"Oceania","sub-region":"Australia and New Zealand","intermediate-region":"","region-code":"009","sub-region-code":"053","intermediate-region-code":""},
+{"name":"Austria","alpha-2":"AT","alpha-3":"AUT","country-code":"040","iso_3166-2":"ISO 3166-2:AT","region":"Europe","sub-region":"Western Europe","intermediate-region":"","region-code":"150","sub-region-code":"155","intermediate-region-code":""},
+{"name":"Azerbaijan","alpha-2":"AZ","alpha-3":"AZE","country-code":"031","iso_3166-2":"ISO 3166-2:AZ","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Bahamas","alpha-2":"BS","alpha-3":"BHS","country-code":"044","iso_3166-2":"ISO 3166-2:BS","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Bahrain","alpha-2":"BH","alpha-3":"BHR","country-code":"048","iso_3166-2":"ISO 3166-2:BH","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Bangladesh","alpha-2":"BD","alpha-3":"BGD","country-code":"050","iso_3166-2":"ISO 3166-2:BD","region":"Asia","sub-region":"Southern Asia","intermediate-region":"","region-code":"142","sub-region-code":"034","intermediate-region-code":""},
+{"name":"Barbados","alpha-2":"BB","alpha-3":"BRB","country-code":"052","iso_3166-2":"ISO 3166-2:BB","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Belarus","alpha-2":"BY","alpha-3":"BLR","country-code":"112","iso_3166-2":"ISO 3166-2:BY","region":"Europe","sub-region":"Eastern Europe","intermediate-region":"","region-code":"150","sub-region-code":"151","intermediate-region-code":""},
+{"name":"Belgium","alpha-2":"BE","alpha-3":"BEL","country-code":"056","iso_3166-2":"ISO 3166-2:BE","region":"Europe","sub-region":"Western Europe","intermediate-region":"","region-code":"150","sub-region-code":"155","intermediate-region-code":""},
+{"name":"Belize","alpha-2":"BZ","alpha-3":"BLZ","country-code":"084","iso_3166-2":"ISO 3166-2:BZ","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Central America","region-code":"019","sub-region-code":"419","intermediate-region-code":"013"},
+{"name":"Benin","alpha-2":"BJ","alpha-3":"BEN","country-code":"204","iso_3166-2":"ISO 3166-2:BJ","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Bermuda","alpha-2":"BM","alpha-3":"BMU","country-code":"060","iso_3166-2":"ISO 3166-2:BM","region":"Americas","sub-region":"Northern America","intermediate-region":"","region-code":"019","sub-region-code":"021","intermediate-region-code":""},
+{"name":"Bhutan","alpha-2":"BT","alpha-3":"BTN","country-code":"064","iso_3166-2":"ISO 3166-2:BT","region":"Asia","sub-region":"Southern Asia","intermediate-region":"","region-code":"142","sub-region-code":"034","intermediate-region-code":""},
+{"name":"Bolivia (Plurinational State of)","alpha-2":"BO","alpha-3":"BOL","country-code":"068","iso_3166-2":"ISO 3166-2:BO","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"Bonaire, Sint Eustatius and Saba","alpha-2":"BQ","alpha-3":"BES","country-code":"535","iso_3166-2":"ISO 3166-2:BQ","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Bosnia and Herzegovina","alpha-2":"BA","alpha-3":"BIH","country-code":"070","iso_3166-2":"ISO 3166-2:BA","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Botswana","alpha-2":"BW","alpha-3":"BWA","country-code":"072","iso_3166-2":"ISO 3166-2:BW","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Southern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"018"},
+{"name":"Bouvet Island","alpha-2":"BV","alpha-3":"BVT","country-code":"074","iso_3166-2":"ISO 3166-2:BV","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"Brazil","alpha-2":"BR","alpha-3":"BRA","country-code":"076","iso_3166-2":"ISO 3166-2:BR","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"British Indian Ocean Territory","alpha-2":"IO","alpha-3":"IOT","country-code":"086","iso_3166-2":"ISO 3166-2:IO","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Brunei Darussalam","alpha-2":"BN","alpha-3":"BRN","country-code":"096","iso_3166-2":"ISO 3166-2:BN","region":"Asia","sub-region":"South-eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"035","intermediate-region-code":""},
+{"name":"Bulgaria","alpha-2":"BG","alpha-3":"BGR","country-code":"100","iso_3166-2":"ISO 3166-2:BG","region":"Europe","sub-region":"Eastern Europe","intermediate-region":"","region-code":"150","sub-region-code":"151","intermediate-region-code":""},
+{"name":"Burkina Faso","alpha-2":"BF","alpha-3":"BFA","country-code":"854","iso_3166-2":"ISO 3166-2:BF","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Burundi","alpha-2":"BI","alpha-3":"BDI","country-code":"108","iso_3166-2":"ISO 3166-2:BI","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Cabo Verde","alpha-2":"CV","alpha-3":"CPV","country-code":"132","iso_3166-2":"ISO 3166-2:CV","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Cambodia","alpha-2":"KH","alpha-3":"KHM","country-code":"116","iso_3166-2":"ISO 3166-2:KH","region":"Asia","sub-region":"South-eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"035","intermediate-region-code":""},
+{"name":"Cameroon","alpha-2":"CM","alpha-3":"CMR","country-code":"120","iso_3166-2":"ISO 3166-2:CM","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Middle Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"017"},
+{"name":"Canada","alpha-2":"CA","alpha-3":"CAN","country-code":"124","iso_3166-2":"ISO 3166-2:CA","region":"Americas","sub-region":"Northern America","intermediate-region":"","region-code":"019","sub-region-code":"021","intermediate-region-code":""},
+{"name":"Cayman Islands","alpha-2":"KY","alpha-3":"CYM","country-code":"136","iso_3166-2":"ISO 3166-2:KY","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Central African Republic","alpha-2":"CF","alpha-3":"CAF","country-code":"140","iso_3166-2":"ISO 3166-2:CF","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Middle Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"017"},
+{"name":"Chad","alpha-2":"TD","alpha-3":"TCD","country-code":"148","iso_3166-2":"ISO 3166-2:TD","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Middle Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"017"},
+{"name":"Chile","alpha-2":"CL","alpha-3":"CHL","country-code":"152","iso_3166-2":"ISO 3166-2:CL","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"China","alpha-2":"CN","alpha-3":"CHN","country-code":"156","iso_3166-2":"ISO 3166-2:CN","region":"Asia","sub-region":"Eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"030","intermediate-region-code":""},
+{"name":"Christmas Island","alpha-2":"CX","alpha-3":"CXR","country-code":"162","iso_3166-2":"ISO 3166-2:CX","region":"Oceania","sub-region":"Australia and New Zealand","intermediate-region":"","region-code":"009","sub-region-code":"053","intermediate-region-code":""},
+{"name":"Cocos (Keeling) Islands","alpha-2":"CC","alpha-3":"CCK","country-code":"166","iso_3166-2":"ISO 3166-2:CC","region":"Oceania","sub-region":"Australia and New Zealand","intermediate-region":"","region-code":"009","sub-region-code":"053","intermediate-region-code":""},
+{"name":"Colombia","alpha-2":"CO","alpha-3":"COL","country-code":"170","iso_3166-2":"ISO 3166-2:CO","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"Comoros","alpha-2":"KM","alpha-3":"COM","country-code":"174","iso_3166-2":"ISO 3166-2:KM","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Congo","alpha-2":"CG","alpha-3":"COG","country-code":"178","iso_3166-2":"ISO 3166-2:CG","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Middle Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"017"},
+{"name":"Congo, Democratic Republic of the","alpha-2":"CD","alpha-3":"COD","country-code":"180","iso_3166-2":"ISO 3166-2:CD","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Middle Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"017"},
+{"name":"Cook Islands","alpha-2":"CK","alpha-3":"COK","country-code":"184","iso_3166-2":"ISO 3166-2:CK","region":"Oceania","sub-region":"Polynesia","intermediate-region":"","region-code":"009","sub-region-code":"061","intermediate-region-code":""},
+{"name":"Costa Rica","alpha-2":"CR","alpha-3":"CRI","country-code":"188","iso_3166-2":"ISO 3166-2:CR","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Central America","region-code":"019","sub-region-code":"419","intermediate-region-code":"013"},
+{"name":"Côte d'Ivoire","alpha-2":"CI","alpha-3":"CIV","country-code":"384","iso_3166-2":"ISO 3166-2:CI","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Croatia","alpha-2":"HR","alpha-3":"HRV","country-code":"191","iso_3166-2":"ISO 3166-2:HR","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Cuba","alpha-2":"CU","alpha-3":"CUB","country-code":"192","iso_3166-2":"ISO 3166-2:CU","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Curaçao","alpha-2":"CW","alpha-3":"CUW","country-code":"531","iso_3166-2":"ISO 3166-2:CW","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Cyprus","alpha-2":"CY","alpha-3":"CYP","country-code":"196","iso_3166-2":"ISO 3166-2:CY","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Czechia","alpha-2":"CZ","alpha-3":"CZE","country-code":"203","iso_3166-2":"ISO 3166-2:CZ","region":"Europe","sub-region":"Eastern Europe","intermediate-region":"","region-code":"150","sub-region-code":"151","intermediate-region-code":""},
+{"name":"Denmark","alpha-2":"DK","alpha-3":"DNK","country-code":"208","iso_3166-2":"ISO 3166-2:DK","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"Djibouti","alpha-2":"DJ","alpha-3":"DJI","country-code":"262","iso_3166-2":"ISO 3166-2:DJ","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Dominica","alpha-2":"DM","alpha-3":"DMA","country-code":"212","iso_3166-2":"ISO 3166-2:DM","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Dominican Republic","alpha-2":"DO","alpha-3":"DOM","country-code":"214","iso_3166-2":"ISO 3166-2:DO","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Ecuador","alpha-2":"EC","alpha-3":"ECU","country-code":"218","iso_3166-2":"ISO 3166-2:EC","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"Egypt","alpha-2":"EG","alpha-3":"EGY","country-code":"818","iso_3166-2":"ISO 3166-2:EG","region":"Africa","sub-region":"Northern Africa","intermediate-region":"","region-code":"002","sub-region-code":"015","intermediate-region-code":""},
+{"name":"El Salvador","alpha-2":"SV","alpha-3":"SLV","country-code":"222","iso_3166-2":"ISO 3166-2:SV","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Central America","region-code":"019","sub-region-code":"419","intermediate-region-code":"013"},
+{"name":"Equatorial Guinea","alpha-2":"GQ","alpha-3":"GNQ","country-code":"226","iso_3166-2":"ISO 3166-2:GQ","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Middle Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"017"},
+{"name":"Eritrea","alpha-2":"ER","alpha-3":"ERI","country-code":"232","iso_3166-2":"ISO 3166-2:ER","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Estonia","alpha-2":"EE","alpha-3":"EST","country-code":"233","iso_3166-2":"ISO 3166-2:EE","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"Eswatini","alpha-2":"SZ","alpha-3":"SWZ","country-code":"748","iso_3166-2":"ISO 3166-2:SZ","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Southern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"018"},
+{"name":"Ethiopia","alpha-2":"ET","alpha-3":"ETH","country-code":"231","iso_3166-2":"ISO 3166-2:ET","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Falkland Islands (Malvinas)","alpha-2":"FK","alpha-3":"FLK","country-code":"238","iso_3166-2":"ISO 3166-2:FK","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"Faroe Islands","alpha-2":"FO","alpha-3":"FRO","country-code":"234","iso_3166-2":"ISO 3166-2:FO","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"Fiji","alpha-2":"FJ","alpha-3":"FJI","country-code":"242","iso_3166-2":"ISO 3166-2:FJ","region":"Oceania","sub-region":"Melanesia","intermediate-region":"","region-code":"009","sub-region-code":"054","intermediate-region-code":""},
+{"name":"Finland","alpha-2":"FI","alpha-3":"FIN","country-code":"246","iso_3166-2":"ISO 3166-2:FI","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"France","alpha-2":"FR","alpha-3":"FRA","country-code":"250","iso_3166-2":"ISO 3166-2:FR","region":"Europe","sub-region":"Western Europe","intermediate-region":"","region-code":"150","sub-region-code":"155","intermediate-region-code":""},
+{"name":"French Guiana","alpha-2":"GF","alpha-3":"GUF","country-code":"254","iso_3166-2":"ISO 3166-2:GF","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"French Polynesia","alpha-2":"PF","alpha-3":"PYF","country-code":"258","iso_3166-2":"ISO 3166-2:PF","region":"Oceania","sub-region":"Polynesia","intermediate-region":"","region-code":"009","sub-region-code":"061","intermediate-region-code":""},
+{"name":"French Southern Territories","alpha-2":"TF","alpha-3":"ATF","country-code":"260","iso_3166-2":"ISO 3166-2:TF","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Gabon","alpha-2":"GA","alpha-3":"GAB","country-code":"266","iso_3166-2":"ISO 3166-2:GA","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Middle Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"017"},
+{"name":"Gambia","alpha-2":"GM","alpha-3":"GMB","country-code":"270","iso_3166-2":"ISO 3166-2:GM","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Georgia","alpha-2":"GE","alpha-3":"GEO","country-code":"268","iso_3166-2":"ISO 3166-2:GE","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Germany","alpha-2":"DE","alpha-3":"DEU","country-code":"276","iso_3166-2":"ISO 3166-2:DE","region":"Europe","sub-region":"Western Europe","intermediate-region":"","region-code":"150","sub-region-code":"155","intermediate-region-code":""},
+{"name":"Ghana","alpha-2":"GH","alpha-3":"GHA","country-code":"288","iso_3166-2":"ISO 3166-2:GH","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Gibraltar","alpha-2":"GI","alpha-3":"GIB","country-code":"292","iso_3166-2":"ISO 3166-2:GI","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Greece","alpha-2":"GR","alpha-3":"GRC","country-code":"300","iso_3166-2":"ISO 3166-2:GR","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Greenland","alpha-2":"GL","alpha-3":"GRL","country-code":"304","iso_3166-2":"ISO 3166-2:GL","region":"Americas","sub-region":"Northern America","intermediate-region":"","region-code":"019","sub-region-code":"021","intermediate-region-code":""},
+{"name":"Grenada","alpha-2":"GD","alpha-3":"GRD","country-code":"308","iso_3166-2":"ISO 3166-2:GD","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Guadeloupe","alpha-2":"GP","alpha-3":"GLP","country-code":"312","iso_3166-2":"ISO 3166-2:GP","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Guam","alpha-2":"GU","alpha-3":"GUM","country-code":"316","iso_3166-2":"ISO 3166-2:GU","region":"Oceania","sub-region":"Micronesia","intermediate-region":"","region-code":"009","sub-region-code":"057","intermediate-region-code":""},
+{"name":"Guatemala","alpha-2":"GT","alpha-3":"GTM","country-code":"320","iso_3166-2":"ISO 3166-2:GT","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Central America","region-code":"019","sub-region-code":"419","intermediate-region-code":"013"},
+{"name":"Guernsey","alpha-2":"GG","alpha-3":"GGY","country-code":"831","iso_3166-2":"ISO 3166-2:GG","region":"Europe","sub-region":"Northern Europe","intermediate-region":"Channel Islands","region-code":"150","sub-region-code":"154","intermediate-region-code":"830"},
+{"name":"Guinea","alpha-2":"GN","alpha-3":"GIN","country-code":"324","iso_3166-2":"ISO 3166-2:GN","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Guinea-Bissau","alpha-2":"GW","alpha-3":"GNB","country-code":"624","iso_3166-2":"ISO 3166-2:GW","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Guyana","alpha-2":"GY","alpha-3":"GUY","country-code":"328","iso_3166-2":"ISO 3166-2:GY","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"Haiti","alpha-2":"HT","alpha-3":"HTI","country-code":"332","iso_3166-2":"ISO 3166-2:HT","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Heard Island and McDonald Islands","alpha-2":"HM","alpha-3":"HMD","country-code":"334","iso_3166-2":"ISO 3166-2:HM","region":"Oceania","sub-region":"Australia and New Zealand","intermediate-region":"","region-code":"009","sub-region-code":"053","intermediate-region-code":""},
+{"name":"Holy See","alpha-2":"VA","alpha-3":"VAT","country-code":"336","iso_3166-2":"ISO 3166-2:VA","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Honduras","alpha-2":"HN","alpha-3":"HND","country-code":"340","iso_3166-2":"ISO 3166-2:HN","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Central America","region-code":"019","sub-region-code":"419","intermediate-region-code":"013"},
+{"name":"Hong Kong","alpha-2":"HK","alpha-3":"HKG","country-code":"344","iso_3166-2":"ISO 3166-2:HK","region":"Asia","sub-region":"Eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"030","intermediate-region-code":""},
+{"name":"Hungary","alpha-2":"HU","alpha-3":"HUN","country-code":"348","iso_3166-2":"ISO 3166-2:HU","region":"Europe","sub-region":"Eastern Europe","intermediate-region":"","region-code":"150","sub-region-code":"151","intermediate-region-code":""},
+{"name":"Iceland","alpha-2":"IS","alpha-3":"ISL","country-code":"352","iso_3166-2":"ISO 3166-2:IS","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"India","alpha-2":"IN","alpha-3":"IND","country-code":"356","iso_3166-2":"ISO 3166-2:IN","region":"Asia","sub-region":"Southern Asia","intermediate-region":"","region-code":"142","sub-region-code":"034","intermediate-region-code":""},
+{"name":"Indonesia","alpha-2":"ID","alpha-3":"IDN","country-code":"360","iso_3166-2":"ISO 3166-2:ID","region":"Asia","sub-region":"South-eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"035","intermediate-region-code":""},
+{"name":"Iran (Islamic Republic of)","alpha-2":"IR","alpha-3":"IRN","country-code":"364","iso_3166-2":"ISO 3166-2:IR","region":"Asia","sub-region":"Southern Asia","intermediate-region":"","region-code":"142","sub-region-code":"034","intermediate-region-code":""},
+{"name":"Iraq","alpha-2":"IQ","alpha-3":"IRQ","country-code":"368","iso_3166-2":"ISO 3166-2:IQ","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Ireland","alpha-2":"IE","alpha-3":"IRL","country-code":"372","iso_3166-2":"ISO 3166-2:IE","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"Isle of Man","alpha-2":"IM","alpha-3":"IMN","country-code":"833","iso_3166-2":"ISO 3166-2:IM","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"Israel","alpha-2":"IL","alpha-3":"ISR","country-code":"376","iso_3166-2":"ISO 3166-2:IL","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Italy","alpha-2":"IT","alpha-3":"ITA","country-code":"380","iso_3166-2":"ISO 3166-2:IT","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Jamaica","alpha-2":"JM","alpha-3":"JAM","country-code":"388","iso_3166-2":"ISO 3166-2:JM","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Japan","alpha-2":"JP","alpha-3":"JPN","country-code":"392","iso_3166-2":"ISO 3166-2:JP","region":"Asia","sub-region":"Eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"030","intermediate-region-code":""},
+{"name":"Jersey","alpha-2":"JE","alpha-3":"JEY","country-code":"832","iso_3166-2":"ISO 3166-2:JE","region":"Europe","sub-region":"Northern Europe","intermediate-region":"Channel Islands","region-code":"150","sub-region-code":"154","intermediate-region-code":"830"},
+{"name":"Jordan","alpha-2":"JO","alpha-3":"JOR","country-code":"400","iso_3166-2":"ISO 3166-2:JO","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Kazakhstan","alpha-2":"KZ","alpha-3":"KAZ","country-code":"398","iso_3166-2":"ISO 3166-2:KZ","region":"Asia","sub-region":"Central Asia","intermediate-region":"","region-code":"142","sub-region-code":"143","intermediate-region-code":""},
+{"name":"Kenya","alpha-2":"KE","alpha-3":"KEN","country-code":"404","iso_3166-2":"ISO 3166-2:KE","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Kiribati","alpha-2":"KI","alpha-3":"KIR","country-code":"296","iso_3166-2":"ISO 3166-2:KI","region":"Oceania","sub-region":"Micronesia","intermediate-region":"","region-code":"009","sub-region-code":"057","intermediate-region-code":""},
+{"name":"Korea (Democratic People's Republic of)","alpha-2":"KP","alpha-3":"PRK","country-code":"408","iso_3166-2":"ISO 3166-2:KP","region":"Asia","sub-region":"Eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"030","intermediate-region-code":""},
+{"name":"Korea, Republic of","alpha-2":"KR","alpha-3":"KOR","country-code":"410","iso_3166-2":"ISO 3166-2:KR","region":"Asia","sub-region":"Eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"030","intermediate-region-code":""},
+{"name":"Kuwait","alpha-2":"KW","alpha-3":"KWT","country-code":"414","iso_3166-2":"ISO 3166-2:KW","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Kyrgyzstan","alpha-2":"KG","alpha-3":"KGZ","country-code":"417","iso_3166-2":"ISO 3166-2:KG","region":"Asia","sub-region":"Central Asia","intermediate-region":"","region-code":"142","sub-region-code":"143","intermediate-region-code":""},
+{"name":"Lao People's Democratic Republic","alpha-2":"LA","alpha-3":"LAO","country-code":"418","iso_3166-2":"ISO 3166-2:LA","region":"Asia","sub-region":"South-eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"035","intermediate-region-code":""},
+{"name":"Latvia","alpha-2":"LV","alpha-3":"LVA","country-code":"428","iso_3166-2":"ISO 3166-2:LV","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"Lebanon","alpha-2":"LB","alpha-3":"LBN","country-code":"422","iso_3166-2":"ISO 3166-2:LB","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Lesotho","alpha-2":"LS","alpha-3":"LSO","country-code":"426","iso_3166-2":"ISO 3166-2:LS","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Southern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"018"},
+{"name":"Liberia","alpha-2":"LR","alpha-3":"LBR","country-code":"430","iso_3166-2":"ISO 3166-2:LR","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Libya","alpha-2":"LY","alpha-3":"LBY","country-code":"434","iso_3166-2":"ISO 3166-2:LY","region":"Africa","sub-region":"Northern Africa","intermediate-region":"","region-code":"002","sub-region-code":"015","intermediate-region-code":""},
+{"name":"Liechtenstein","alpha-2":"LI","alpha-3":"LIE","country-code":"438","iso_3166-2":"ISO 3166-2:LI","region":"Europe","sub-region":"Western Europe","intermediate-region":"","region-code":"150","sub-region-code":"155","intermediate-region-code":""},
+{"name":"Lithuania","alpha-2":"LT","alpha-3":"LTU","country-code":"440","iso_3166-2":"ISO 3166-2:LT","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"Luxembourg","alpha-2":"LU","alpha-3":"LUX","country-code":"442","iso_3166-2":"ISO 3166-2:LU","region":"Europe","sub-region":"Western Europe","intermediate-region":"","region-code":"150","sub-region-code":"155","intermediate-region-code":""},
+{"name":"Macao","alpha-2":"MO","alpha-3":"MAC","country-code":"446","iso_3166-2":"ISO 3166-2:MO","region":"Asia","sub-region":"Eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"030","intermediate-region-code":""},
+{"name":"Madagascar","alpha-2":"MG","alpha-3":"MDG","country-code":"450","iso_3166-2":"ISO 3166-2:MG","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Malawi","alpha-2":"MW","alpha-3":"MWI","country-code":"454","iso_3166-2":"ISO 3166-2:MW","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Malaysia","alpha-2":"MY","alpha-3":"MYS","country-code":"458","iso_3166-2":"ISO 3166-2:MY","region":"Asia","sub-region":"South-eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"035","intermediate-region-code":""},
+{"name":"Maldives","alpha-2":"MV","alpha-3":"MDV","country-code":"462","iso_3166-2":"ISO 3166-2:MV","region":"Asia","sub-region":"Southern Asia","intermediate-region":"","region-code":"142","sub-region-code":"034","intermediate-region-code":""},
+{"name":"Mali","alpha-2":"ML","alpha-3":"MLI","country-code":"466","iso_3166-2":"ISO 3166-2:ML","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Malta","alpha-2":"MT","alpha-3":"MLT","country-code":"470","iso_3166-2":"ISO 3166-2:MT","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Marshall Islands","alpha-2":"MH","alpha-3":"MHL","country-code":"584","iso_3166-2":"ISO 3166-2:MH","region":"Oceania","sub-region":"Micronesia","intermediate-region":"","region-code":"009","sub-region-code":"057","intermediate-region-code":""},
+{"name":"Martinique","alpha-2":"MQ","alpha-3":"MTQ","country-code":"474","iso_3166-2":"ISO 3166-2:MQ","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Mauritania","alpha-2":"MR","alpha-3":"MRT","country-code":"478","iso_3166-2":"ISO 3166-2:MR","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Mauritius","alpha-2":"MU","alpha-3":"MUS","country-code":"480","iso_3166-2":"ISO 3166-2:MU","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Mayotte","alpha-2":"YT","alpha-3":"MYT","country-code":"175","iso_3166-2":"ISO 3166-2:YT","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Mexico","alpha-2":"MX","alpha-3":"MEX","country-code":"484","iso_3166-2":"ISO 3166-2:MX","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Central America","region-code":"019","sub-region-code":"419","intermediate-region-code":"013"},
+{"name":"Micronesia (Federated States of)","alpha-2":"FM","alpha-3":"FSM","country-code":"583","iso_3166-2":"ISO 3166-2:FM","region":"Oceania","sub-region":"Micronesia","intermediate-region":"","region-code":"009","sub-region-code":"057","intermediate-region-code":""},
+{"name":"Moldova, Republic of","alpha-2":"MD","alpha-3":"MDA","country-code":"498","iso_3166-2":"ISO 3166-2:MD","region":"Europe","sub-region":"Eastern Europe","intermediate-region":"","region-code":"150","sub-region-code":"151","intermediate-region-code":""},
+{"name":"Monaco","alpha-2":"MC","alpha-3":"MCO","country-code":"492","iso_3166-2":"ISO 3166-2:MC","region":"Europe","sub-region":"Western Europe","intermediate-region":"","region-code":"150","sub-region-code":"155","intermediate-region-code":""},
+{"name":"Mongolia","alpha-2":"MN","alpha-3":"MNG","country-code":"496","iso_3166-2":"ISO 3166-2:MN","region":"Asia","sub-region":"Eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"030","intermediate-region-code":""},
+{"name":"Montenegro","alpha-2":"ME","alpha-3":"MNE","country-code":"499","iso_3166-2":"ISO 3166-2:ME","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Montserrat","alpha-2":"MS","alpha-3":"MSR","country-code":"500","iso_3166-2":"ISO 3166-2:MS","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Morocco","alpha-2":"MA","alpha-3":"MAR","country-code":"504","iso_3166-2":"ISO 3166-2:MA","region":"Africa","sub-region":"Northern Africa","intermediate-region":"","region-code":"002","sub-region-code":"015","intermediate-region-code":""},
+{"name":"Mozambique","alpha-2":"MZ","alpha-3":"MOZ","country-code":"508","iso_3166-2":"ISO 3166-2:MZ","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Myanmar","alpha-2":"MM","alpha-3":"MMR","country-code":"104","iso_3166-2":"ISO 3166-2:MM","region":"Asia","sub-region":"South-eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"035","intermediate-region-code":""},
+{"name":"Namibia","alpha-2":"NA","alpha-3":"NAM","country-code":"516","iso_3166-2":"ISO 3166-2:NA","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Southern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"018"},
+{"name":"Nauru","alpha-2":"NR","alpha-3":"NRU","country-code":"520","iso_3166-2":"ISO 3166-2:NR","region":"Oceania","sub-region":"Micronesia","intermediate-region":"","region-code":"009","sub-region-code":"057","intermediate-region-code":""},
+{"name":"Nepal","alpha-2":"NP","alpha-3":"NPL","country-code":"524","iso_3166-2":"ISO 3166-2:NP","region":"Asia","sub-region":"Southern Asia","intermediate-region":"","region-code":"142","sub-region-code":"034","intermediate-region-code":""},
+{"name":"Netherlands","alpha-2":"NL","alpha-3":"NLD","country-code":"528","iso_3166-2":"ISO 3166-2:NL","region":"Europe","sub-region":"Western Europe","intermediate-region":"","region-code":"150","sub-region-code":"155","intermediate-region-code":""},
+{"name":"New Caledonia","alpha-2":"NC","alpha-3":"NCL","country-code":"540","iso_3166-2":"ISO 3166-2:NC","region":"Oceania","sub-region":"Melanesia","intermediate-region":"","region-code":"009","sub-region-code":"054","intermediate-region-code":""},
+{"name":"New Zealand","alpha-2":"NZ","alpha-3":"NZL","country-code":"554","iso_3166-2":"ISO 3166-2:NZ","region":"Oceania","sub-region":"Australia and New Zealand","intermediate-region":"","region-code":"009","sub-region-code":"053","intermediate-region-code":""},
+{"name":"Nicaragua","alpha-2":"NI","alpha-3":"NIC","country-code":"558","iso_3166-2":"ISO 3166-2:NI","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Central America","region-code":"019","sub-region-code":"419","intermediate-region-code":"013"},
+{"name":"Niger","alpha-2":"NE","alpha-3":"NER","country-code":"562","iso_3166-2":"ISO 3166-2:NE","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Nigeria","alpha-2":"NG","alpha-3":"NGA","country-code":"566","iso_3166-2":"ISO 3166-2:NG","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Niue","alpha-2":"NU","alpha-3":"NIU","country-code":"570","iso_3166-2":"ISO 3166-2:NU","region":"Oceania","sub-region":"Polynesia","intermediate-region":"","region-code":"009","sub-region-code":"061","intermediate-region-code":""},
+{"name":"Norfolk Island","alpha-2":"NF","alpha-3":"NFK","country-code":"574","iso_3166-2":"ISO 3166-2:NF","region":"Oceania","sub-region":"Australia and New Zealand","intermediate-region":"","region-code":"009","sub-region-code":"053","intermediate-region-code":""},
+{"name":"North Macedonia","alpha-2":"MK","alpha-3":"MKD","country-code":"807","iso_3166-2":"ISO 3166-2:MK","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Northern Mariana Islands","alpha-2":"MP","alpha-3":"MNP","country-code":"580","iso_3166-2":"ISO 3166-2:MP","region":"Oceania","sub-region":"Micronesia","intermediate-region":"","region-code":"009","sub-region-code":"057","intermediate-region-code":""},
+{"name":"Norway","alpha-2":"NO","alpha-3":"NOR","country-code":"578","iso_3166-2":"ISO 3166-2:NO","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"Oman","alpha-2":"OM","alpha-3":"OMN","country-code":"512","iso_3166-2":"ISO 3166-2:OM","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Pakistan","alpha-2":"PK","alpha-3":"PAK","country-code":"586","iso_3166-2":"ISO 3166-2:PK","region":"Asia","sub-region":"Southern Asia","intermediate-region":"","region-code":"142","sub-region-code":"034","intermediate-region-code":""},
+{"name":"Palau","alpha-2":"PW","alpha-3":"PLW","country-code":"585","iso_3166-2":"ISO 3166-2:PW","region":"Oceania","sub-region":"Micronesia","intermediate-region":"","region-code":"009","sub-region-code":"057","intermediate-region-code":""},
+{"name":"Palestine, State of","alpha-2":"PS","alpha-3":"PSE","country-code":"275","iso_3166-2":"ISO 3166-2:PS","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Panama","alpha-2":"PA","alpha-3":"PAN","country-code":"591","iso_3166-2":"ISO 3166-2:PA","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Central America","region-code":"019","sub-region-code":"419","intermediate-region-code":"013"},
+{"name":"Papua New Guinea","alpha-2":"PG","alpha-3":"PNG","country-code":"598","iso_3166-2":"ISO 3166-2:PG","region":"Oceania","sub-region":"Melanesia","intermediate-region":"","region-code":"009","sub-region-code":"054","intermediate-region-code":""},
+{"name":"Paraguay","alpha-2":"PY","alpha-3":"PRY","country-code":"600","iso_3166-2":"ISO 3166-2:PY","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"Peru","alpha-2":"PE","alpha-3":"PER","country-code":"604","iso_3166-2":"ISO 3166-2:PE","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"Philippines","alpha-2":"PH","alpha-3":"PHL","country-code":"608","iso_3166-2":"ISO 3166-2:PH","region":"Asia","sub-region":"South-eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"035","intermediate-region-code":""},
+{"name":"Pitcairn","alpha-2":"PN","alpha-3":"PCN","country-code":"612","iso_3166-2":"ISO 3166-2:PN","region":"Oceania","sub-region":"Polynesia","intermediate-region":"","region-code":"009","sub-region-code":"061","intermediate-region-code":""},
+{"name":"Poland","alpha-2":"PL","alpha-3":"POL","country-code":"616","iso_3166-2":"ISO 3166-2:PL","region":"Europe","sub-region":"Eastern Europe","intermediate-region":"","region-code":"150","sub-region-code":"151","intermediate-region-code":""},
+{"name":"Portugal","alpha-2":"PT","alpha-3":"PRT","country-code":"620","iso_3166-2":"ISO 3166-2:PT","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Puerto Rico","alpha-2":"PR","alpha-3":"PRI","country-code":"630","iso_3166-2":"ISO 3166-2:PR","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Qatar","alpha-2":"QA","alpha-3":"QAT","country-code":"634","iso_3166-2":"ISO 3166-2:QA","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Réunion","alpha-2":"RE","alpha-3":"REU","country-code":"638","iso_3166-2":"ISO 3166-2:RE","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Romania","alpha-2":"RO","alpha-3":"ROU","country-code":"642","iso_3166-2":"ISO 3166-2:RO","region":"Europe","sub-region":"Eastern Europe","intermediate-region":"","region-code":"150","sub-region-code":"151","intermediate-region-code":""},
+{"name":"Russian Federation","alpha-2":"RU","alpha-3":"RUS","country-code":"643","iso_3166-2":"ISO 3166-2:RU","region":"Europe","sub-region":"Eastern Europe","intermediate-region":"","region-code":"150","sub-region-code":"151","intermediate-region-code":""},
+{"name":"Rwanda","alpha-2":"RW","alpha-3":"RWA","country-code":"646","iso_3166-2":"ISO 3166-2:RW","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Saint Barthélemy","alpha-2":"BL","alpha-3":"BLM","country-code":"652","iso_3166-2":"ISO 3166-2:BL","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Saint Helena, Ascension and Tristan da Cunha","alpha-2":"SH","alpha-3":"SHN","country-code":"654","iso_3166-2":"ISO 3166-2:SH","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Saint Kitts and Nevis","alpha-2":"KN","alpha-3":"KNA","country-code":"659","iso_3166-2":"ISO 3166-2:KN","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Saint Lucia","alpha-2":"LC","alpha-3":"LCA","country-code":"662","iso_3166-2":"ISO 3166-2:LC","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Saint Martin (French part)","alpha-2":"MF","alpha-3":"MAF","country-code":"663","iso_3166-2":"ISO 3166-2:MF","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Saint Pierre and Miquelon","alpha-2":"PM","alpha-3":"SPM","country-code":"666","iso_3166-2":"ISO 3166-2:PM","region":"Americas","sub-region":"Northern America","intermediate-region":"","region-code":"019","sub-region-code":"021","intermediate-region-code":""},
+{"name":"Saint Vincent and the Grenadines","alpha-2":"VC","alpha-3":"VCT","country-code":"670","iso_3166-2":"ISO 3166-2:VC","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Samoa","alpha-2":"WS","alpha-3":"WSM","country-code":"882","iso_3166-2":"ISO 3166-2:WS","region":"Oceania","sub-region":"Polynesia","intermediate-region":"","region-code":"009","sub-region-code":"061","intermediate-region-code":""},
+{"name":"San Marino","alpha-2":"SM","alpha-3":"SMR","country-code":"674","iso_3166-2":"ISO 3166-2:SM","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Sao Tome and Principe","alpha-2":"ST","alpha-3":"STP","country-code":"678","iso_3166-2":"ISO 3166-2:ST","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Middle Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"017"},
+{"name":"Saudi Arabia","alpha-2":"SA","alpha-3":"SAU","country-code":"682","iso_3166-2":"ISO 3166-2:SA","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Senegal","alpha-2":"SN","alpha-3":"SEN","country-code":"686","iso_3166-2":"ISO 3166-2:SN","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Serbia","alpha-2":"RS","alpha-3":"SRB","country-code":"688","iso_3166-2":"ISO 3166-2:RS","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Seychelles","alpha-2":"SC","alpha-3":"SYC","country-code":"690","iso_3166-2":"ISO 3166-2:SC","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Sierra Leone","alpha-2":"SL","alpha-3":"SLE","country-code":"694","iso_3166-2":"ISO 3166-2:SL","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Singapore","alpha-2":"SG","alpha-3":"SGP","country-code":"702","iso_3166-2":"ISO 3166-2:SG","region":"Asia","sub-region":"South-eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"035","intermediate-region-code":""},
+{"name":"Sint Maarten (Dutch part)","alpha-2":"SX","alpha-3":"SXM","country-code":"534","iso_3166-2":"ISO 3166-2:SX","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Slovakia","alpha-2":"SK","alpha-3":"SVK","country-code":"703","iso_3166-2":"ISO 3166-2:SK","region":"Europe","sub-region":"Eastern Europe","intermediate-region":"","region-code":"150","sub-region-code":"151","intermediate-region-code":""},
+{"name":"Slovenia","alpha-2":"SI","alpha-3":"SVN","country-code":"705","iso_3166-2":"ISO 3166-2:SI","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Solomon Islands","alpha-2":"SB","alpha-3":"SLB","country-code":"090","iso_3166-2":"ISO 3166-2:SB","region":"Oceania","sub-region":"Melanesia","intermediate-region":"","region-code":"009","sub-region-code":"054","intermediate-region-code":""},
+{"name":"Somalia","alpha-2":"SO","alpha-3":"SOM","country-code":"706","iso_3166-2":"ISO 3166-2:SO","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"South Africa","alpha-2":"ZA","alpha-3":"ZAF","country-code":"710","iso_3166-2":"ISO 3166-2:ZA","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Southern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"018"},
+{"name":"South Georgia and the South Sandwich Islands","alpha-2":"GS","alpha-3":"SGS","country-code":"239","iso_3166-2":"ISO 3166-2:GS","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"South Sudan","alpha-2":"SS","alpha-3":"SSD","country-code":"728","iso_3166-2":"ISO 3166-2:SS","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Spain","alpha-2":"ES","alpha-3":"ESP","country-code":"724","iso_3166-2":"ISO 3166-2:ES","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},
+{"name":"Sri Lanka","alpha-2":"LK","alpha-3":"LKA","country-code":"144","iso_3166-2":"ISO 3166-2:LK","region":"Asia","sub-region":"Southern Asia","intermediate-region":"","region-code":"142","sub-region-code":"034","intermediate-region-code":""},
+{"name":"Sudan","alpha-2":"SD","alpha-3":"SDN","country-code":"729","iso_3166-2":"ISO 3166-2:SD","region":"Africa","sub-region":"Northern Africa","intermediate-region":"","region-code":"002","sub-region-code":"015","intermediate-region-code":""},
+{"name":"Suriname","alpha-2":"SR","alpha-3":"SUR","country-code":"740","iso_3166-2":"ISO 3166-2:SR","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"Svalbard and Jan Mayen","alpha-2":"SJ","alpha-3":"SJM","country-code":"744","iso_3166-2":"ISO 3166-2:SJ","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"Sweden","alpha-2":"SE","alpha-3":"SWE","country-code":"752","iso_3166-2":"ISO 3166-2:SE","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"Switzerland","alpha-2":"CH","alpha-3":"CHE","country-code":"756","iso_3166-2":"ISO 3166-2:CH","region":"Europe","sub-region":"Western Europe","intermediate-region":"","region-code":"150","sub-region-code":"155","intermediate-region-code":""},
+{"name":"Syrian Arab Republic","alpha-2":"SY","alpha-3":"SYR","country-code":"760","iso_3166-2":"ISO 3166-2:SY","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Taiwan, Province of China","alpha-2":"TW","alpha-3":"TWN","country-code":"158","iso_3166-2":"ISO 3166-2:TW","region":"Asia","sub-region":"Eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"030","intermediate-region-code":""},
+{"name":"Tajikistan","alpha-2":"TJ","alpha-3":"TJK","country-code":"762","iso_3166-2":"ISO 3166-2:TJ","region":"Asia","sub-region":"Central Asia","intermediate-region":"","region-code":"142","sub-region-code":"143","intermediate-region-code":""},
+{"name":"Tanzania, United Republic of","alpha-2":"TZ","alpha-3":"TZA","country-code":"834","iso_3166-2":"ISO 3166-2:TZ","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Thailand","alpha-2":"TH","alpha-3":"THA","country-code":"764","iso_3166-2":"ISO 3166-2:TH","region":"Asia","sub-region":"South-eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"035","intermediate-region-code":""},
+{"name":"Timor-Leste","alpha-2":"TL","alpha-3":"TLS","country-code":"626","iso_3166-2":"ISO 3166-2:TL","region":"Asia","sub-region":"South-eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"035","intermediate-region-code":""},
+{"name":"Togo","alpha-2":"TG","alpha-3":"TGO","country-code":"768","iso_3166-2":"ISO 3166-2:TG","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Western Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"011"},
+{"name":"Tokelau","alpha-2":"TK","alpha-3":"TKL","country-code":"772","iso_3166-2":"ISO 3166-2:TK","region":"Oceania","sub-region":"Polynesia","intermediate-region":"","region-code":"009","sub-region-code":"061","intermediate-region-code":""},
+{"name":"Tonga","alpha-2":"TO","alpha-3":"TON","country-code":"776","iso_3166-2":"ISO 3166-2:TO","region":"Oceania","sub-region":"Polynesia","intermediate-region":"","region-code":"009","sub-region-code":"061","intermediate-region-code":""},
+{"name":"Trinidad and Tobago","alpha-2":"TT","alpha-3":"TTO","country-code":"780","iso_3166-2":"ISO 3166-2:TT","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Tunisia","alpha-2":"TN","alpha-3":"TUN","country-code":"788","iso_3166-2":"ISO 3166-2:TN","region":"Africa","sub-region":"Northern Africa","intermediate-region":"","region-code":"002","sub-region-code":"015","intermediate-region-code":""},
+{"name":"Turkey","alpha-2":"TR","alpha-3":"TUR","country-code":"792","iso_3166-2":"ISO 3166-2:TR","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Turkmenistan","alpha-2":"TM","alpha-3":"TKM","country-code":"795","iso_3166-2":"ISO 3166-2:TM","region":"Asia","sub-region":"Central Asia","intermediate-region":"","region-code":"142","sub-region-code":"143","intermediate-region-code":""},
+{"name":"Turks and Caicos Islands","alpha-2":"TC","alpha-3":"TCA","country-code":"796","iso_3166-2":"ISO 3166-2:TC","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Tuvalu","alpha-2":"TV","alpha-3":"TUV","country-code":"798","iso_3166-2":"ISO 3166-2:TV","region":"Oceania","sub-region":"Polynesia","intermediate-region":"","region-code":"009","sub-region-code":"061","intermediate-region-code":""},
+{"name":"Uganda","alpha-2":"UG","alpha-3":"UGA","country-code":"800","iso_3166-2":"ISO 3166-2:UG","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Ukraine","alpha-2":"UA","alpha-3":"UKR","country-code":"804","iso_3166-2":"ISO 3166-2:UA","region":"Europe","sub-region":"Eastern Europe","intermediate-region":"","region-code":"150","sub-region-code":"151","intermediate-region-code":""},
+{"name":"United Arab Emirates","alpha-2":"AE","alpha-3":"ARE","country-code":"784","iso_3166-2":"ISO 3166-2:AE","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"United Kingdom of Great Britain and Northern Ireland","alpha-2":"GB","alpha-3":"GBR","country-code":"826","iso_3166-2":"ISO 3166-2:GB","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},
+{"name":"United States of America","alpha-2":"US","alpha-3":"USA","country-code":"840","iso_3166-2":"ISO 3166-2:US","region":"Americas","sub-region":"Northern America","intermediate-region":"","region-code":"019","sub-region-code":"021","intermediate-region-code":""},
+{"name":"United States Minor Outlying Islands","alpha-2":"UM","alpha-3":"UMI","country-code":"581","iso_3166-2":"ISO 3166-2:UM","region":"Oceania","sub-region":"Micronesia","intermediate-region":"","region-code":"009","sub-region-code":"057","intermediate-region-code":""},
+{"name":"Uruguay","alpha-2":"UY","alpha-3":"URY","country-code":"858","iso_3166-2":"ISO 3166-2:UY","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"Uzbekistan","alpha-2":"UZ","alpha-3":"UZB","country-code":"860","iso_3166-2":"ISO 3166-2:UZ","region":"Asia","sub-region":"Central Asia","intermediate-region":"","region-code":"142","sub-region-code":"143","intermediate-region-code":""},
+{"name":"Vanuatu","alpha-2":"VU","alpha-3":"VUT","country-code":"548","iso_3166-2":"ISO 3166-2:VU","region":"Oceania","sub-region":"Melanesia","intermediate-region":"","region-code":"009","sub-region-code":"054","intermediate-region-code":""},
+{"name":"Venezuela (Bolivarian Republic of)","alpha-2":"VE","alpha-3":"VEN","country-code":"862","iso_3166-2":"ISO 3166-2:VE","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"South America","region-code":"019","sub-region-code":"419","intermediate-region-code":"005"},
+{"name":"Viet Nam","alpha-2":"VN","alpha-3":"VNM","country-code":"704","iso_3166-2":"ISO 3166-2:VN","region":"Asia","sub-region":"South-eastern Asia","intermediate-region":"","region-code":"142","sub-region-code":"035","intermediate-region-code":""},
+{"name":"Virgin Islands (British)","alpha-2":"VG","alpha-3":"VGB","country-code":"092","iso_3166-2":"ISO 3166-2:VG","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Virgin Islands (U.S.)","alpha-2":"VI","alpha-3":"VIR","country-code":"850","iso_3166-2":"ISO 3166-2:VI","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},
+{"name":"Wallis and Futuna","alpha-2":"WF","alpha-3":"WLF","country-code":"876","iso_3166-2":"ISO 3166-2:WF","region":"Oceania","sub-region":"Polynesia","intermediate-region":"","region-code":"009","sub-region-code":"061","intermediate-region-code":""},
+{"name":"Western Sahara","alpha-2":"EH","alpha-3":"ESH","country-code":"732","iso_3166-2":"ISO 3166-2:EH","region":"Africa","sub-region":"Northern Africa","intermediate-region":"","region-code":"002","sub-region-code":"015","intermediate-region-code":""},
+{"name":"Yemen","alpha-2":"YE","alpha-3":"YEM","country-code":"887","iso_3166-2":"ISO 3166-2:YE","region":"Asia","sub-region":"Western Asia","intermediate-region":"","region-code":"142","sub-region-code":"145","intermediate-region-code":""},
+{"name":"Zambia","alpha-2":"ZM","alpha-3":"ZMB","country-code":"894","iso_3166-2":"ISO 3166-2:ZM","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"},
+{"name":"Zimbabwe","alpha-2":"ZW","alpha-3":"ZWE","country-code":"716","iso_3166-2":"ISO 3166-2:ZW","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Eastern Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"014"}
+]
diff --git a/vendor/github.com/go-openapi/strfmt/mongo.go b/vendor/github.com/go-openapi/strfmt/mongo.go
index be904ffa5d..15bfbed192 100644
--- a/vendor/github.com/go-openapi/strfmt/mongo.go
+++ b/vendor/github.com/go-openapi/strfmt/mongo.go
@@ -4,7 +4,6 @@
package strfmt
import (
- "encoding/base64"
"encoding/binary"
"fmt"
"time"
@@ -41,6 +40,8 @@ var (
_ bsonUnmarshaler = &Base64{}
_ bsonMarshaler = Duration(0)
_ bsonUnmarshaler = (*Duration)(nil)
+ _ bsonMarshaler = DurationISO8601(0)
+ _ bsonUnmarshaler = (*DurationISO8601)(nil)
_ bsonMarshaler = DateTime{}
_ bsonUnmarshaler = &DateTime{}
_ bsonMarshaler = ULID{}
@@ -92,6 +93,10 @@ var (
_ bsonValueUnmarshaler = &DateTime{}
_ bsonValueMarshaler = ObjectId{}
_ bsonValueUnmarshaler = &ObjectId{}
+ _ bsonMarshaler = Currency{}
+ _ bsonUnmarshaler = (*Currency)(nil)
+ _ bsonMarshaler = Country{}
+ _ bsonUnmarshaler = (*Country)(nil)
)
const (
@@ -140,7 +145,7 @@ func (b *Base64) UnmarshalBSON(data []byte) error {
return fmt.Errorf("couldn't unmarshal bson bytes as base64: %w", ErrFormat)
}
- vb, err := base64.StdEncoding.DecodeString(s)
+ vb, err := base64Encoding.DecodeString(s)
if err != nil {
return err
}
@@ -171,6 +176,38 @@ func (d *Duration) UnmarshalBSON(data []byte) error {
return nil
}
+// MarshalBSON renders the [ISODuration] as a BSON document.
+//
+// BSON is a storage boundary (like SQL): the value is emitted losslessly with [ISODuration.String], regardless of the
+// policy P — a strict policy that could not serialize a sign or sub-second precision on the interchange path must still
+// be persistable.
+func (d ISODuration[P]) MarshalBSON() ([]byte, error) {
+ return bsonlite.C.MarshalDoc(d.String())
+}
+
+// UnmarshalBSON reads an [ISODuration] from a BSON document.
+//
+// The stored value is our own canonical output, so it is parsed leniently: BSON is trusted storage, not external
+// interchange, and must round-trip whatever [ISODuration.MarshalBSON] emitted even under a strict policy P.
+func (d *ISODuration[P]) UnmarshalBSON(data []byte) error {
+ v, err := bsonlite.C.UnmarshalDoc(data)
+ if err != nil {
+ return err
+ }
+
+ s, ok := v.(string)
+ if !ok {
+ return fmt.Errorf("couldn't unmarshal bson bytes value as ISODuration: %w", ErrFormat)
+ }
+
+ rd, err := parseISO8601Duration(s, DurationLenient{}.isoDurationConfig())
+ if err != nil {
+ return err
+ }
+ *d = ISODuration[P](rd)
+ return nil
+}
+
// MarshalBSON renders the [DateTime] as a BSON document.
func (t DateTime) MarshalBSON() ([]byte, error) {
tNorm := NormalizeTimeForMarshal(time.Time(t))
@@ -599,3 +636,47 @@ func (id *ObjectId) UnmarshalBSONValue(_ byte, data []byte) error {
*id = ObjectId(oid)
return nil
}
+
+// MarshalBSON document from this value.
+func (u Currency) MarshalBSON() ([]byte, error) {
+ return bsonlite.C.MarshalDoc(u.String())
+}
+
+// UnmarshalBSON document into this value.
+func (u *Currency) UnmarshalBSON(data []byte) error {
+ s, err := unmarshalBSONString(data, "Currency")
+ if err != nil {
+ return err
+ }
+
+ cur, err := ParseCurrency(s)
+ if err != nil {
+ return err
+ }
+
+ *u = cur
+
+ return nil
+}
+
+// MarshalBSON document from this value.
+func (u Country) MarshalBSON() ([]byte, error) {
+ return bsonlite.C.MarshalDoc(u.String())
+}
+
+// UnmarshalBSON document into this value.
+func (u *Country) UnmarshalBSON(data []byte) error {
+ s, err := unmarshalBSONString(data, "Country")
+ if err != nil {
+ return err
+ }
+
+ cur, err := ParseCountry(s)
+ if err != nil {
+ return err
+ }
+
+ *u = cur
+
+ return nil
+}
diff --git a/vendor/github.com/go-openapi/strfmt/register.go b/vendor/github.com/go-openapi/strfmt/register.go
new file mode 100644
index 0000000000..4a4c185b53
--- /dev/null
+++ b/vendor/github.com/go-openapi/strfmt/register.go
@@ -0,0 +1,138 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package strfmt
+
+// Default is the default formats registry.
+//
+// NOTE: format "duration" is wire by default onto "duration-human".
+var Default Registry //nolint:gochecknoglobals // package-level default registry, by design
+
+// JSONSchema2020Registry is the format registry with JSONSchema draft 2020 formats (e.g. duration is an iso8601 duration).
+var JSONSchema2020Registry Registry //nolint:gochecknoglobals // package-level default registry, by design
+
+func init() { //nolint:gochecknoinits // registers all default string formats in the registry
+ // register formats in the default registry:
+ // - byte
+ // - creditcard
+ // - email
+ // - hexcolor
+ // - hostname
+ // - ipv4
+ // - ipv6
+ // - cidr
+ // - isbn
+ // - isbn10
+ // - isbn13
+ // - mac
+ // - password
+ // - rgbcolor
+ // - ssn
+ // - uri
+ // - uuid
+ // - uuid3
+ // - uuid4
+ // - uuid5
+ // - uuid7
+ // - ulid
+ // - date, date-time
+ // - duration, duration-human, duration-iso8601
+ // - objectid
+ // - currency, country
+ Default = NewSeededFormats(nil, nil)
+
+ u := URI("")
+ Default.Add("uri", &u, isRequestURI)
+
+ eml := Email("")
+ Default.Add("email", &eml, IsEmail)
+
+ hn := Hostname("")
+ Default.Add("hostname", &hn, IsHostname)
+
+ ip4 := IPv4("")
+ Default.Add("ipv4", &ip4, isIPv4)
+
+ ip6 := IPv6("")
+ Default.Add("ipv6", &ip6, isIPv6)
+
+ cidr := CIDR("")
+ Default.Add("cidr", &cidr, isCIDR)
+
+ mac := MAC("")
+ Default.Add("mac", &mac, isMAC)
+
+ uid := UUID("")
+ Default.Add("uuid", &uid, IsUUID)
+
+ uid3 := UUID3("")
+ Default.Add("uuid3", &uid3, IsUUID3)
+
+ uid4 := UUID4("")
+ Default.Add("uuid4", &uid4, IsUUID4)
+
+ uid5 := UUID5("")
+ Default.Add("uuid5", &uid5, IsUUID5)
+
+ uid7 := UUID7("")
+ Default.Add("uuid7", &uid7, IsUUID7)
+
+ isbn := ISBN("")
+ Default.Add("isbn", &isbn, func(str string) bool { return isISBN10(str) || isISBN13(str) })
+
+ isbn10 := ISBN10("")
+ Default.Add("isbn10", &isbn10, isISBN10)
+
+ isbn13 := ISBN13("")
+ Default.Add("isbn13", &isbn13, isISBN13)
+
+ cc := CreditCard("")
+ Default.Add("creditcard", &cc, isCreditCard)
+
+ ssn := SSN("")
+ Default.Add("ssn", &ssn, isSSN)
+
+ hc := HexColor("")
+ Default.Add("hexcolor", &hc, isHexcolor)
+
+ rc := RGBColor("")
+ Default.Add("rgbcolor", &rc, isRGBcolor)
+
+ b64 := Base64([]byte(nil))
+ Default.Add("byte", &b64, isBase64)
+
+ pw := Password("")
+ Default.Add("password", &pw, func(_ string) bool { return true })
+
+ d := Date{}
+ Default.Add("date", &d, IsDate)
+
+ dt := DateTime{}
+ Default.Add("datetime", &dt, IsDateTime)
+
+ du := Duration(0)
+ Default.Add("duration", &du, IsDuration)
+ Default.Add("duration-human", &du, IsDuration)
+
+ di := DurationISO8601(0)
+ Default.Add("duration-iso8601", &di, IsDurationISO8601)
+
+ var id ObjectId
+ Default.Add("bsonobjectid", &id, IsBSONObjectID)
+
+ ulid := ULID{}
+ Default.Add("ulid", &ulid, IsULID)
+
+ cur := Currency{}
+ Default.Add("currency", &cur, IsCurrency)
+
+ co := Country{}
+ Default.Add("country", &co, IsCountry)
+
+ def, ok := Default.(*defaultFormats)
+ if !ok {
+ panic("internal error: can't initialize")
+ }
+
+ JSONSchema2020Registry = NewSeededFormats(def.data, JSONSchema2020Normalizer)
+}
diff --git a/vendor/github.com/go-openapi/strfmt/time.go b/vendor/github.com/go-openapi/strfmt/time.go
index 1fde8c6b11..94e409e063 100644
--- a/vendor/github.com/go-openapi/strfmt/time.go
+++ b/vendor/github.com/go-openapi/strfmt/time.go
@@ -17,11 +17,6 @@ import (
// Unix 0 for an EST timezone is not equivalent to a UTC timezone.
var UnixZero = time.Unix(0, 0).UTC() //nolint:gochecknoglobals // package-level sentinel value for unix epoch
-func init() { //nolint:gochecknoinits // registers datetime format in the default registry
- dt := DateTime{}
- Default.Add("datetime", &dt, IsDateTime)
-}
-
// IsDateTime returns true when the string is a valid date-time.
//
// JSON datetime format consist of a date and a time separated by a "T", e.g. 2012-04-23T18:25:43.511Z.
diff --git a/vendor/github.com/go-openapi/strfmt/ulid.go b/vendor/github.com/go-openapi/strfmt/ulid.go
index f05d22c518..38809adba4 100644
--- a/vendor/github.com/go-openapi/strfmt/ulid.go
+++ b/vendor/github.com/go-openapi/strfmt/ulid.go
@@ -69,11 +69,6 @@ var (
ULIDValueOverrideFunc = ULIDValueDefaultFunc
)
-func init() { //nolint:gochecknoinits // registers ulid format in the default registry
- ulid := ULID{}
- Default.Add("ulid", &ulid, IsULID)
-}
-
// IsULID checks if provided string is [ULID] format
// Be noticed that this function considers overflowed [ULID] as non-[ulid].
// For more details see https://github.com/[ulid]/spec
diff --git a/vendor/github.com/go-openapi/swag/conv/format.go b/vendor/github.com/go-openapi/swag/conv/format.go
index 5b87b8e146..e14e5bfcfb 100644
--- a/vendor/github.com/go-openapi/swag/conv/format.go
+++ b/vendor/github.com/go-openapi/swag/conv/format.go
@@ -7,14 +7,16 @@ import (
"strconv"
)
+const baseDecimal = 10
+
// FormatInteger turns an integer type into a string.
func FormatInteger[T Signed](value T) string {
- return strconv.FormatInt(int64(value), 10)
+ return strconv.FormatInt(int64(value), baseDecimal)
}
// FormatUinteger turns an unsigned integer type into a string.
func FormatUinteger[T Unsigned](value T) string {
- return strconv.FormatUint(uint64(value), 10)
+ return strconv.FormatUint(uint64(value), baseDecimal)
}
// FormatFloat turns a floating point numerical value into a string.
@@ -26,3 +28,23 @@ func FormatFloat[T Float](value T) string {
func FormatBool(value bool) string {
return strconv.FormatBool(value)
}
+
+// AppendInteger appends the decimal representation of an integer to a slice of bytes.
+func AppendInteger[T Signed](dst []byte, value T) []byte {
+ return strconv.AppendInt(dst, int64(value), baseDecimal)
+}
+
+// AppendUinteger appends the decimal representation of an unsigned integer to a slice of bytes.
+func AppendUinteger[T Unsigned](dst []byte, value T) []byte {
+ return strconv.AppendUint(dst, uint64(value), baseDecimal)
+}
+
+// AppendFloat appends the decimal representation of a floating point number to a slice of bytes.
+func AppendFloat[T Float](dst []byte, value T) []byte {
+ return strconv.AppendFloat(dst, float64(value), 'g', -1, bitsize(value))
+}
+
+// AppendBool appends the text representation of a boolean to a slice of bytes.
+func AppendBool(dst []byte, value bool) []byte {
+ return strconv.AppendBool(dst, value)
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go
index 0213ff5c29..94185f79c1 100644
--- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go
@@ -5,6 +5,7 @@ package json
import (
stdjson "encoding/json"
+ "fmt"
"github.com/go-openapi/swag/jsonutils/adapters/ifaces"
"github.com/go-openapi/swag/typeutils"
@@ -24,11 +25,16 @@ var ErrStdlib jsonError = "error from the JSON adapter stdlib"
var _ ifaces.Adapter = &Adapter{}
type Adapter struct {
+ options
}
// NewAdapter yields an [ifaces.Adapter] using the standard library.
-func NewAdapter() *Adapter {
- return &Adapter{}
+func NewAdapter(opts ...Option) *Adapter {
+ var o options
+
+ return &Adapter{
+ options: buildOptions(o, opts),
+ }
}
func (a *Adapter) Marshal(value any) ([]byte, error) {
@@ -40,45 +46,18 @@ func (a *Adapter) Unmarshal(data []byte, value any) error {
}
func (a *Adapter) OrderedMarshal(value ifaces.Ordered) ([]byte, error) {
- w := poolOfWriters.Borrow()
- defer func() {
- poolOfWriters.Redeem(w)
- }()
-
- if typeutils.IsNil(value) {
- w.RawString("null")
-
- return w.BuildBytes()
- }
-
- w.RawByte('{')
- first := true
- for k, v := range value.OrderedItems() {
- if first {
- first = false
- } else {
- w.RawByte(',')
- }
+ w, redeem := poolOfWriters.BorrowWithRedeem()
+ defer redeem()
+ w.setBuf()
- w.String(k)
- w.RawByte(':')
-
- switch val := v.(type) {
- case ifaces.Ordered:
- w.Raw(a.OrderedMarshal(val))
- default:
- w.Raw(stdjson.Marshal(v))
- }
- }
-
- w.RawByte('}')
+ a.orderedMarshal(w, value, 1)
return w.BuildBytes()
}
func (a *Adapter) OrderedUnmarshal(data []byte, value ifaces.SetOrdered) error {
var m MapSlice
- if err := m.OrderedUnmarshalJSON(data); err != nil {
+ if err := m.orderedUnmarshalJSON(data, a.maxDepth()); err != nil {
return err
}
@@ -112,4 +91,43 @@ func (a *Adapter) Redeem() {
}
func (a *Adapter) Reset() {
+ a.options = options{}
+}
+
+// orderedMarshal writes value to w, tracking the container nesting depth to guard
+// against stack overflow on deeply nested structures.
+func (a *Adapter) orderedMarshal(w *jwriter, value ifaces.Ordered, depth int) {
+ if typeutils.IsNil(value) {
+ w.RawString("null")
+
+ return
+ }
+
+ if maxDepth := a.maxDepth(); depth > maxDepth {
+ w.SetErr(fmt.Errorf("maximum nesting depth of %d exceeded: %w", maxDepth, ErrStdlib))
+
+ return
+ }
+
+ w.RawByte('{')
+ first := true
+ for k, v := range value.OrderedItems() {
+ if first {
+ first = false
+ } else {
+ w.RawByte(',')
+ }
+
+ w.String(k)
+ w.RawByte(':')
+
+ switch val := v.(type) {
+ case ifaces.Ordered:
+ a.orderedMarshal(w, val, depth+1)
+ default:
+ w.Raw(stdjson.Marshal(v))
+ }
+ }
+
+ w.RawByte('}')
}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go
index b5aa1c7972..ac81cbc75f 100644
--- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go
@@ -54,7 +54,7 @@ func (t token) Delim() byte {
return 0
}
- return byte(r)
+ return byte(r) //nolint:gosec // delimiter runes are single byte
}
type tokenKind uint8
@@ -91,6 +91,13 @@ type jlexer struct {
// current token
next token
// started bool
+
+ // depth tracks the current JSON container nesting level, and maxDepth caps it
+ // to guard against stack-overflow on adversarially deep documents. The standard
+ // library's streaming [encoding/json.Decoder.Token] API (used here) does not
+ // enforce the max-depth guard that [encoding/json.Unmarshal] provides, so we do.
+ depth int
+ maxDepth int
}
type bytesReader struct {
@@ -130,7 +137,8 @@ var _ io.Reader = &bytesReader{}
func newLexer(data []byte) *jlexer {
l := &jlexer{
// current: undefToken,
- next: undefToken,
+ next: undefToken,
+ maxDepth: defaultMaxNestingDepth,
}
l.buf = &bytesReader{
buf: data,
@@ -143,7 +151,11 @@ func newLexer(data []byte) *jlexer {
func (l *jlexer) Reset() {
l.err = nil
l.next = undefToken
- // leave l.dec and l.buf alone, since they are replaced at every Borrow
+ l.depth = 0
+ l.maxDepth = defaultMaxNestingDepth
+ l.dec = nil
+ // leave l.buf alone, since they are replaced at every Borrow
+ l.buf = nil
}
func (l *jlexer) Error() error {
@@ -228,6 +240,21 @@ func (l *jlexer) Delim(c byte) {
if tok.Delim() != c {
l.err = fmt.Errorf("expected delimiter '%q' but got '%q': %w", c, tok.Delim(), ErrStdlib)
+
+ return
+ }
+
+ // Track container nesting depth centrally: every '{' or '[' opens a level and
+ // every '}' or ']' closes one. This guards the mutually-recursive unmarshal
+ // routines (unmarshalObject/unmarshalArray/asInterface) against stack overflow.
+ switch c {
+ case '{', '[':
+ l.depth++
+ if l.maxDepth > 0 && l.depth > l.maxDepth {
+ l.err = fmt.Errorf("maximum nesting depth of %d exceeded: %w", l.maxDepth, ErrStdlib)
+ }
+ case '}', ']':
+ l.depth--
}
}
@@ -318,3 +345,12 @@ func (l *jlexer) fetchToken() token {
return token{Token: jtok}
}
+
+func (l *jlexer) setBuf(data []byte) func() {
+ rdr, redeemBuf := poolOfReaders.BorrowWithRedeem()
+ l.buf = rdr
+ l.buf.buf = data
+ l.dec = stdjson.NewDecoder(l.buf) // cannot pool, not exposed by the encoding/json API
+
+ return redeemBuf
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go
new file mode 100644
index 0000000000..f114f1f1a1
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go
@@ -0,0 +1,52 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package json
+
+// defaultMaxNestingDepth is the default maximum number of nested JSON containers
+// ('{' or '[') that the ordered-JSON marshaler and unmarshaler will process before
+// returning an error.
+//
+// It mirrors the limit enforced by the standard library's [encoding/json] decoder
+// (see encoding/json's internal maxNestingDepth), which this adapter would otherwise
+// not benefit from since it drives [encoding/json.Decoder.Token] directly.
+const defaultMaxNestingDepth = 10000
+
+// Option selects options for the stdlib adapter.
+type Option func(o options) options
+
+type options struct {
+ maxNestingDepth int
+}
+
+func buildOptions(o options, opts []Option) options {
+ for _, apply := range opts {
+ o = apply(o)
+ }
+
+ return o
+}
+
+// maxDepth returns the configured maximum nesting depth, or the default when unset.
+func (o options) maxDepth() int {
+ if o.maxNestingDepth <= 0 {
+ return defaultMaxNestingDepth
+ }
+
+ return o.maxNestingDepth
+}
+
+// WithMaxNestingDepth sets the maximum number of nested JSON containers accepted
+// when marshaling or unmarshaling ordered JSON.
+//
+// A value <= 0 selects the default (10,000).
+//
+// This guards against stack-overflow crashes on deeply nested (possibly adversarial)
+// JSON documents or in-memory structures.
+func WithMaxNestingDepth(depth int) Option {
+ return func(o options) options {
+ o.maxNestingDepth = depth
+
+ return o
+ }
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go
index 54deef406f..a5a8f4b631 100644
--- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go
@@ -70,12 +70,11 @@ func (s MapSlice) MarshalJSON() ([]byte, error) {
}
func (s MapSlice) OrderedMarshalJSON() ([]byte, error) {
- w := poolOfWriters.Borrow()
- defer func() {
- poolOfWriters.Redeem(w)
- }()
+ w, redeem := poolOfWriters.BorrowWithRedeem()
+ defer redeem()
+ w.setBuf()
- s.marshalObject(w)
+ s.marshalObject(w, 1)
return w.BuildBytes() // this clones data, so it's okay to redeem the writer and its buffer
}
@@ -88,23 +87,38 @@ func (s *MapSlice) UnmarshalJSON(data []byte) error {
}
func (s *MapSlice) OrderedUnmarshalJSON(data []byte) error {
- l := poolOfLexers.Borrow(data)
- defer func() {
- poolOfLexers.Redeem(l)
- }()
+ return s.orderedUnmarshalJSON(data, defaultMaxNestingDepth)
+}
+
+func (s *MapSlice) orderedUnmarshalJSON(data []byte, maxDepth int) error {
+ l, redeem := poolOfLexers.BorrowWithRedeem()
+ defer redeem()
+
+ redeemBuf := l.setBuf(data)
+ defer redeemBuf()
+
+ if maxDepth > 0 {
+ l.maxDepth = maxDepth
+ }
s.unmarshalObject(l)
return l.Error()
}
-func (s MapSlice) marshalObject(w *jwriter) {
+func (s MapSlice) marshalObject(w *jwriter, depth int) {
if s == nil {
w.RawString("null")
return
}
+ if depth > defaultMaxNestingDepth {
+ w.SetErr(fmt.Errorf("maximum nesting depth of %d exceeded: %w", defaultMaxNestingDepth, ErrStdlib))
+
+ return
+ }
+
w.RawByte('{')
if len(s) == 0 {
@@ -113,11 +127,11 @@ func (s MapSlice) marshalObject(w *jwriter) {
return
}
- s[0].marshalJSON(w)
+ s[0].marshalJSON(w, depth)
for i := 1; i < len(s); i++ {
w.RawByte(',')
- s[i].marshalJSON(w)
+ s[i].marshalJSON(w, depth)
}
w.RawByte('}')
@@ -162,9 +176,18 @@ type MapItem struct {
Value any
}
-func (s MapItem) marshalJSON(w *jwriter) {
+func (s MapItem) marshalJSON(w *jwriter, depth int) {
w.String(s.Key)
w.RawByte(':')
+
+ // Recurse internally for nested ordered maps so the depth guard is not lost across
+ // the stdjson.Marshal boundary (which would reset it and re-enable stack overflow).
+ if nested, ok := s.Value.(MapSlice); ok {
+ nested.marshalObject(w, depth+1)
+
+ return
+ }
+
w.Raw(stdjson.Marshal(s.Value))
}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go
index 709b97c304..2f06b88e80 100644
--- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go
@@ -4,118 +4,15 @@
package json
import (
- "encoding/json"
- "sync"
-
"github.com/go-openapi/swag/jsonutils/adapters/ifaces"
+ "github.com/go-openapi/swag/pools"
)
-type adaptersPool struct {
- sync.Pool
-}
-
-func (p *adaptersPool) Borrow() *Adapter {
- return p.Get().(*Adapter)
-}
-
-func (p *adaptersPool) BorrowIface() ifaces.Adapter {
- return p.Get().(*Adapter)
-}
-
-func (p *adaptersPool) Redeem(a *Adapter) {
- p.Put(a)
-}
-
-type writersPool struct {
- sync.Pool
-}
-
-func (p *writersPool) Borrow() *jwriter {
- ptr := p.Get()
-
- jw := ptr.(*jwriter)
- jw.Reset()
-
- return jw
-}
-
-func (p *writersPool) Redeem(w *jwriter) {
- p.Put(w)
-}
-
-type lexersPool struct {
- sync.Pool
-}
-
-func (p *lexersPool) Borrow(data []byte) *jlexer {
- ptr := p.Get()
-
- l := ptr.(*jlexer)
- l.buf = poolOfReaders.Borrow(data)
- l.dec = json.NewDecoder(l.buf) // cannot pool, not exposed by the encoding/json API
- l.Reset()
-
- return l
-}
-
-func (p *lexersPool) Redeem(l *jlexer) {
- l.dec = nil
- discard := l.buf
- l.buf = nil
- poolOfReaders.Redeem(discard)
- p.Put(l)
-}
-
-type readersPool struct {
- sync.Pool
-}
-
-func (p *readersPool) Borrow(data []byte) *bytesReader {
- ptr := p.Get()
-
- b := ptr.(*bytesReader)
- b.Reset()
- b.buf = data
-
- return b
-}
-
-func (p *readersPool) Redeem(b *bytesReader) {
- p.Put(b)
-}
-
var (
- poolOfAdapters = &adaptersPool{
- Pool: sync.Pool{
- New: func() any {
- return NewAdapter()
- },
- },
- }
-
- poolOfWriters = &writersPool{
- Pool: sync.Pool{
- New: func() any {
- return newJWriter()
- },
- },
- }
-
- poolOfLexers = &lexersPool{
- Pool: sync.Pool{
- New: func() any {
- return newLexer(nil)
- },
- },
- }
-
- poolOfReaders = &readersPool{
- Pool: sync.Pool{
- New: func() any {
- return &bytesReader{}
- },
- },
- }
+ poolOfAdapters = pools.New[Adapter]()
+ poolOfWriters = pools.NewRedeemable[jwriter]()
+ poolOfLexers = pools.NewRedeemable[jlexer]()
+ poolOfReaders = pools.NewRedeemable[bytesReader]()
)
// BorrowAdapter borrows an [Adapter] from the pool, recycling already allocated instances.
@@ -124,10 +21,12 @@ func BorrowAdapter() *Adapter {
}
// BorrowAdapterIface borrows a stdlib [Adapter] and converts it directly
-// to [ifaces.Adapter]. This is useful to avoid further allocations when
-// translating the concrete type into an interface.
+// to [ifaces.Adapter].
+//
+// This is useful to avoid further allocations when translating the concrete type into
+// an interface.
func BorrowAdapterIface() ifaces.Adapter {
- return poolOfAdapters.BorrowIface()
+ return poolOfAdapters.Borrow()
}
// RedeemAdapter redeems an [Adapter] to the pool, so it may be recycled.
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go
index fc8818694e..0dec85425b 100644
--- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go
@@ -10,14 +10,22 @@ import (
"github.com/go-openapi/swag/jsonutils/adapters/ifaces"
)
-func Register(dispatcher ifaces.Registrar) {
+func Register(dispatcher ifaces.Registrar, opts ...Option) {
t := reflect.TypeOf(Adapter{})
+ var o options
+ o = buildOptions(o, opts)
+
dispatcher.RegisterFor(
ifaces.RegistryEntry{
- Who: fmt.Sprintf("%s.%s", t.PkgPath(), t.Name()),
- What: ifaces.AllCapabilities,
- Constructor: BorrowAdapterIface,
- Support: support,
+ Who: fmt.Sprintf("%s.%s", t.PkgPath(), t.Name()),
+ What: ifaces.AllCapabilities,
+ Constructor: func() ifaces.Adapter {
+ a := BorrowAdapter()
+ a.options = o
+
+ return a
+ },
+ Support: support,
})
}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go
index dc2325c1a3..c84e02cd83 100644
--- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go
@@ -14,17 +14,21 @@ type jwriter struct {
err error
}
-func newJWriter() *jwriter {
- buf := make([]byte, 0, sensibleBufferSize)
-
- return &jwriter{buf: bytes.NewBuffer(buf)}
-}
-
func (w *jwriter) Reset() {
- w.buf.Reset()
+ if w.buf != nil {
+ w.buf.Reset()
+ }
w.err = nil
}
+// SetErr records the first error encountered while building the JSON output.
+func (w *jwriter) SetErr(err error) {
+ if w.err != nil {
+ return
+ }
+ w.err = err
+}
+
func (w *jwriter) RawString(s string) {
if w.err != nil {
return
@@ -73,3 +77,12 @@ func (w *jwriter) BuildBytes() ([]byte, error) {
return bytes.Clone(w.buf.Bytes()), nil
}
+
+func (w *jwriter) setBuf() {
+ if w.buf != nil {
+ return
+ }
+
+ buf := make([]byte, 0, sensibleBufferSize)
+ w.buf = bytes.NewBuffer(buf)
+}
diff --git a/vendor/github.com/go-openapi/swag/loading/loading.go b/vendor/github.com/go-openapi/swag/loading/loading.go
index 0b38ac1e38..b06450c64d 100644
--- a/vendor/github.com/go-openapi/swag/loading/loading.go
+++ b/vendor/github.com/go-openapi/swag/loading/loading.go
@@ -84,7 +84,9 @@ func LoadStrategy(pth string, local, remote func(string) ([]byte, error), opts .
if isFSBacked {
// other fs.FS (e.g. os.DirFS) and os.Root loaders also use "/" on every platform.
- // Escaping paths (absolute, "..", escaping symlinks) are rejected by the loader, not rewritten here.
+ // Path confinement is enforced by the loader, not here: the os.Root loader rebases
+ // absolute in-root paths and rejects escaping paths ("..", out-of-root absolute,
+ // escaping symlinks); an fs.FS loader rejects what its file system does not allow.
return local(filepath.ToSlash(cpth))
}
diff --git a/vendor/github.com/go-openapi/swag/loading/options.go b/vendor/github.com/go-openapi/swag/loading/options.go
index 2c12823172..539987547d 100644
--- a/vendor/github.com/go-openapi/swag/loading/options.go
+++ b/vendor/github.com/go-openapi/swag/loading/options.go
@@ -8,6 +8,8 @@ import (
"io/fs"
"net/http"
"os"
+ "path/filepath"
+ "runtime"
"time"
)
@@ -39,13 +41,21 @@ func (fo fileOptions) ReadFileFunc() func(string) ([]byte, error) {
root := fo.root
return func(name string) ([]byte, error) {
+ // os.Root only accepts paths relative to the root, but callers (and this package's
+ // own file:// handling) routinely produce absolute paths. Rebase an absolute path
+ // onto the root before handing it to os.Root.
+ rel, err := rootRelative(root, name)
+ if err != nil {
+ return nil, errors.Join(err, ErrLoader)
+ }
+
r, err := os.OpenRoot(root)
if err != nil {
return nil, errors.Join(err, ErrLoader)
}
defer func() { _ = r.Close() }()
- return r.ReadFile(name)
+ return r.ReadFile(rel)
}
}
@@ -56,6 +66,61 @@ func (fo fileOptions) ReadFileFunc() func(string) ([]byte, error) {
return fo.fs.ReadFile
}
+// rootRelative expresses name as a path relative to root, so that it can be resolved by os.Root.
+//
+// A relative name is returned unchanged: os.Root confines it directly (including "../" traversal
+// and symlink escapes, which it rejects at open time).
+//
+// An absolute name is rebased onto root. If it cannot be expressed relative to root — for
+// example because it lives on a different volume on Windows — filepath.Rel returns an error,
+// which is propagated so the read is rejected rather than silently escaping the root. An
+// absolute path that lexically escapes root yields a "../" prefix here and is then rejected by
+// os.Root.
+func rootRelative(root, name string) (string, error) {
+ osName := toOSPath(name)
+ if !filepath.IsAbs(osName) {
+ return name, nil
+ }
+
+ absRoot, err := filepath.Abs(toOSPath(root))
+ if err != nil {
+ return "", err
+ }
+
+ return filepath.Rel(absRoot, osName)
+}
+
+// toOSPath converts a slash-separated path to an OS-native path.
+//
+// On Windows it additionally normalizes the "/C:/dir" form — a leading separator before a drive
+// letter — that file URIs and URL-style path normalization (as performed by
+// github.com/go-openapi/spec) produce. Without this, filepath.IsAbs does not recognize such a
+// path as absolute and os.Root rejects an otherwise in-root target. This mirrors the file://
+// drive-letter handling in LoadStrategy, which the os.Root loader bypasses.
+func toOSPath(p string) string {
+ p = filepath.FromSlash(p)
+ if runtime.GOOS == "windows" {
+ p = stripLeadingDriveSlash(p)
+ }
+
+ return p
+}
+
+// stripLeadingDriveSlash removes a leading separator that precedes a Windows drive letter,
+// turning "\C:\dir" (from a "/C:/dir" URL path) into "C:\dir". Any other path is returned
+// unchanged. It is pure (no OS dependency) so that its logic can be tested on any platform.
+func stripLeadingDriveSlash(p string) string {
+ if len(p) >= 3 && (p[0] == '/' || p[0] == '\\') && p[2] == ':' && isASCIILetter(p[1]) {
+ return p[1:]
+ }
+
+ return p
+}
+
+func isASCIILetter(b byte) bool {
+ return ('a' <= b && b <= 'z') || ('A' <= b && b <= 'Z')
+}
+
// WithTimeout sets a timeout for the remote file loader.
//
// The default timeout is 30s.
@@ -123,10 +188,12 @@ func WithFS(filesystem fs.FS) Option {
// WithRoot confines local file loading to dir.
//
-// Every requested path is resolved relative to dir, and any path that would escape dir —
-// whether through an absolute path, ".." traversal, or a symlink pointing outside dir — is
-// rejected. This is built on [os.Root] and is therefore resistant to the symlink escapes
-// that a plain [os.DirFS] does not prevent.
+// Every requested path is resolved within dir. A relative path is resolved against dir; an
+// absolute path is rebased onto dir (so a caller that normalizes references to absolute paths,
+// such as github.com/go-openapi/spec, still resolves correctly). Any path that would escape dir
+// — through ".." traversal, an absolute path pointing outside dir, or a symlink pointing outside
+// dir — is rejected. This is built on [os.Root] and is therefore resistant to the symlink
+// escapes that a plain [os.DirFS] does not prevent.
//
// WithRoot is the recommended option when loading specs from a location derived from
// untrusted input. It applies to local loading only and has no effect on remote
diff --git a/vendor/github.com/sassoftware/relic/LICENSE b/vendor/github.com/go-openapi/swag/pools/LICENSE
similarity index 100%
rename from vendor/github.com/sassoftware/relic/LICENSE
rename to vendor/github.com/go-openapi/swag/pools/LICENSE
diff --git a/vendor/github.com/go-openapi/swag/pools/README.md b/vendor/github.com/go-openapi/swag/pools/README.md
new file mode 100644
index 0000000000..1966461cb5
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/pools/README.md
@@ -0,0 +1 @@
+# pools
diff --git a/vendor/github.com/go-openapi/swag/pools/debug.go b/vendor/github.com/go-openapi/swag/pools/debug.go
new file mode 100644
index 0000000000..94415e989e
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/pools/debug.go
@@ -0,0 +1,17 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package pools
+
+// TB is the subset of [testing.TB] used by [AssertNoLeaks].
+//
+// It is satisfied by *[testing.T] and *[testing.B].
+//
+// A local interface is used (rather than importing "testing") so that the
+// release build does not pull the testing package — and its flags — into
+// production binaries.
+type TB interface {
+ Helper()
+ Errorf(format string, args ...any)
+ Logf(format string, args ...any)
+}
diff --git a/vendor/github.com/go-openapi/swag/pools/debug_off.go b/vendor/github.com/go-openapi/swag/pools/debug_off.go
new file mode 100644
index 0000000000..9163d6d60e
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/pools/debug_off.go
@@ -0,0 +1,51 @@
+//go:build !poolsdebug
+
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package pools
+
+// This is the release implementation of the pool instrumentation: it does
+// nothing.
+//
+// tracker is an empty struct, so it adds no field to the pool types and its
+// methods inline away to nothing.
+//
+// Build with -tags poolsdebug to get the instrumented variant (see
+// debug_on.go).
+
+// debugBuild reports whether the pool instrumentation is compiled in (the
+// poolsdebug tag).
+const debugBuild = false
+
+// DebugBuild reports whether the pool instrumentation is compiled in (the
+// poolsdebug build tag).
+//
+// It lets a test that must run in both modes skip the parts that are invalid
+// under instrumentation — e.g. an allocation-count assertion, since the
+// instrumented build allocates a per-borrow tracker.
+const DebugBuild = debugBuild
+
+type tracker[T any] struct{}
+
+func (tracker[T]) register() {}
+
+func (tracker[T]) onBorrow(*T) {}
+
+func (tracker[T]) onRedeem(*T) {}
+
+func (tracker[T]) borrowRedeemer(_ *T, cached func()) func() { return cached }
+
+// AssertNoLeaks reports whether every borrowed object has been redeemed across
+// all pools.
+//
+// It is only meaningful in the instrumented build (-tags poolsdebug).
+//
+// In a release build it is a no-op that always reports true, so the same test
+// can run in both modes.
+func AssertNoLeaks(TB) bool { return true }
+
+// ResetTracking clears all recorded borrow/redeem tracking.
+//
+// This is a no-op in a release build.
+func ResetTracking() {}
diff --git a/vendor/github.com/go-openapi/swag/pools/debug_on.go b/vendor/github.com/go-openapi/swag/pools/debug_on.go
new file mode 100644
index 0000000000..64ccc57d38
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/pools/debug_on.go
@@ -0,0 +1,237 @@
+//go:build poolsdebug
+
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package pools
+
+import (
+ "fmt"
+ "runtime"
+ "sync"
+)
+
+// This is the instrumented implementation of the pool tracking, enabled with
+// -tags poolsdebug.
+//
+// Each pool carries a tracker that records, per recycled pointer, whether it is
+// currently borrowed or redeemed, together with the call sites of the last
+// borrow and redeem.
+// It panics loudly (with those call sites) when it detects misuse:
+//
+// - a double redeem (the same object returned to the pool twice — corrupts sync.Pool);
+// - for the redeemable pools, a redeem of a stale borrow (the slot was re-borrowed since — the
+// ABA case the production atomic guard cannot catch), thanks to a per-borrow generation;
+// - a redeem of an object the pool never handed out;
+// - a borrow of an object still checked out (a symptom of an earlier double-Put).
+//
+// Borrowed-but-never-redeemed objects (leaks) are reported by [AssertNoLeaks].
+
+// debugBuild reports whether the pool instrumentation is compiled in (the
+// poolsdebug tag).
+const debugBuild = true
+
+// DebugBuild reports whether the pool instrumentation is compiled in (the
+// poolsdebug build tag).
+//
+// See the release-build doc for usage.
+const DebugBuild = debugBuild
+
+type trackStatus uint8
+
+const (
+ trackBorrowed trackStatus = iota + 1
+ trackRedeemed
+)
+
+type trackEntry struct {
+ status trackStatus
+ gen uint64 // identifies the current borrow, to detect a redeem racing a re-borrow (ABA)
+ borrowedAt string
+ redeemedAt string
+}
+
+type tracker[T any] struct {
+ mu sync.Mutex
+ entries map[*T]*trackEntry
+ nextGen uint64
+}
+
+func (t *tracker[T]) register() {
+ t.mu.Lock()
+ if t.entries == nil {
+ t.entries = make(map[*T]*trackEntry)
+ }
+ t.mu.Unlock()
+
+ registerLeakChecker(t)
+}
+
+// markBorrow records a borrow of ptr and returns its generation.
+//
+// Caller must hold no lock.
+func (t *tracker[T]) markBorrow(ptr *T, site string) uint64 {
+ t.mu.Lock()
+ defer t.mu.Unlock()
+
+ e := t.entries[ptr]
+ if e == nil {
+ e = &trackEntry{}
+ t.entries[ptr] = e
+ } else if e.status == trackBorrowed {
+ panic(fmt.Sprintf(
+ "pools: borrow of an object still checked out (borrowed at %s); "+
+ "this usually means it was redeemed twice earlier", e.borrowedAt))
+ }
+
+ t.nextGen++
+ e.status = trackBorrowed
+ e.gen = t.nextGen
+ e.borrowedAt = site
+
+ return t.nextGen
+}
+
+// markRedeem validates and records a redeem of ptr. gen is the borrow
+// generation the caller is redeeming, or 0 to skip the ABA check (plain
+// Pool[T], which has no per-borrow token).
+func (t *tracker[T]) markRedeem(ptr *T, gen uint64, site string) {
+ t.mu.Lock()
+ defer t.mu.Unlock()
+
+ e := t.entries[ptr]
+ switch {
+ case e == nil:
+ panic("pools: redeem of an object this pool never handed out")
+ case e.status != trackBorrowed:
+ panic(fmt.Sprintf("pools: double redeem (first redeemed at %s)", e.redeemedAt))
+ case gen != 0 && e.gen != gen:
+ panic(fmt.Sprintf(
+ "pools: redeem of a stale borrow (the slot was re-borrowed at %s since this borrow); "+
+ "a redeem is racing a re-borrow of the same slot (ABA)", e.borrowedAt))
+ }
+
+ e.status = trackRedeemed
+ e.redeemedAt = site
+}
+
+const stackOffset = 3
+
+func (t *tracker[T]) onBorrow(ptr *T) {
+ t.markBorrow(ptr, caller(stackOffset))
+}
+
+func (t *tracker[T]) onRedeem(ptr *T) {
+ t.markRedeem(ptr, 0, caller(stackOffset))
+}
+
+// borrowRedeemer records the borrow and returns a generation-stamped redeemer
+// that validates the redeem (catching double-redeem and ABA) before delegating
+// to the cached redeemer.
+func (t *tracker[T]) borrowRedeemer(ptr *T, cached func()) func() {
+ gen := t.markBorrow(ptr, caller(stackOffset))
+
+ return func() {
+ t.markRedeem(ptr, gen, caller(stackOffset-1))
+ cached()
+ }
+}
+
+func (t *tracker[T]) checkLeaks(tb TB) bool {
+ t.mu.Lock()
+ defer t.mu.Unlock()
+
+ ok := true
+ for _, e := range t.entries {
+ if e.status != trackRedeemed {
+ tb.Logf("pools: object borrowed but never redeemed (borrowed at %s)", e.borrowedAt)
+ ok = false
+ }
+ }
+
+ return ok
+}
+
+func (t *tracker[T]) resetTracking() {
+ t.mu.Lock()
+ t.entries = make(map[*T]*trackEntry)
+ t.nextGen = 0
+ t.mu.Unlock()
+}
+
+// leakChecker is the build-erased view of a tracker that the global registry
+// holds, so trackers of different element types can be checked uniformly.
+type leakChecker interface {
+ checkLeaks(tb TB) bool
+ resetTracking()
+}
+
+var (
+ registryMu sync.Mutex
+ registry []leakChecker
+)
+
+func registerLeakChecker(c leakChecker) {
+ registryMu.Lock()
+ registry = append(registry, c)
+ registryMu.Unlock()
+}
+
+// AssertNoLeaks reports whether every borrowed object has been redeemed across
+// all pools created so far.
+//
+// It logs the borrow call site of each leaked object and fails tb when any are
+// found.
+//
+// Typical use, with [ResetTracking] to isolate the test from earlier ones:
+//
+// func TestX(t *testing.T) {
+// pools.ResetTracking()
+// t.Cleanup(func() { pools.AssertNoLeaks(t) })
+// // ... exercise code that borrows/redeems ...
+// }
+func AssertNoLeaks(tb TB) bool {
+ tb.Helper()
+ registryMu.Lock()
+ defer registryMu.Unlock()
+
+ ok := true
+ for _, c := range registry {
+ if !c.checkLeaks(tb) {
+ ok = false
+ }
+ }
+ if !ok {
+ tb.Errorf("pools: leaked pooled objects detected (borrowed but never redeemed)")
+ }
+
+ return ok
+}
+
+// ResetTracking clears all recorded borrow/redeem tracking across every pool.
+//
+// Call it at the start of a test so leaks from earlier tests are not attributed
+// to it.
+func ResetTracking() {
+ registryMu.Lock()
+ defer registryMu.Unlock()
+
+ for _, c := range registry {
+ c.resetTracking()
+ }
+}
+
+// caller returns "file:line" of the frame skip levels above caller itself.
+func caller(skip int) string {
+ pc, _, _, ok := runtime.Caller(skip)
+ if !ok {
+ return "unknown"
+ }
+ fn := runtime.FuncForPC(pc)
+ if fn == nil {
+ return "unknown"
+ }
+ file, line := fn.FileLine(pc)
+
+ return fmt.Sprintf("%s:%d", file, line)
+}
diff --git a/vendor/github.com/go-openapi/swag/pools/doc.go b/vendor/github.com/go-openapi/swag/pools/doc.go
new file mode 100644
index 0000000000..395c24d29a
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/pools/doc.go
@@ -0,0 +1,26 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package pools provide utilities to recycle allocated objects.
+//
+// This package provides:
+//
+// - a generic [Pool] type that wraps [sync.Pool],
+// - a [PoolRedeemable] variant that hands out a cached redeem closure,
+// - a [PoolSlice] for recycling slices without juggling pointers.
+//
+// # Debug build
+//
+// Building with the "poolsdebug" tag (go test -tags poolsdebug ./...) turns on
+// instrumentation that tracks every borrow and redeem and panics on misuse:
+//
+// - double redeem (including the A -> B -> A case for the redeemable pools),
+// - redeem of a foreign object,
+// - borrow of an object still checked out
+//
+// It reports the offending call sites.
+//
+// [AssertNoLeaks] then reports any object borrowed but never redeemed.
+//
+// The instrumentation is a no-op with zero overhead when the tag is absent.
+package pools
diff --git a/vendor/github.com/go-openapi/swag/pools/pools.go b/vendor/github.com/go-openapi/swag/pools/pools.go
new file mode 100644
index 0000000000..d78ea5790a
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/pools/pools.go
@@ -0,0 +1,410 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package pools
+
+import (
+ "iter"
+ "slices"
+ "sync"
+ "sync/atomic"
+)
+
+// Resettable is an interface for types that want to recycle a clean instance
+// from a [Pool].
+//
+// When T (or rather *T) implements [Resettable], the pool calls Reset on an
+// instance both when it is redeemed and when it is borrowed:
+//
+// - on redeem, so that no references held by the instance are retained while it sits idle in the
+// pool (which would pin a reference graph alive across a GC cycle);
+// - on borrow, so that the next borrower receives a clean object regardless of how the instance
+// reached the pool.
+//
+// Reset must be safe to call more than once on the same instance (it runs at
+// least twice per cycle).
+type Resettable interface {
+ Reset()
+}
+
+// resetIfResettable calls Reset on v when *T implements [Resettable].
+func resetIfResettable[T any](v *T) {
+ if r, ok := any(v).(Resettable); ok {
+ r.Reset()
+ }
+}
+
+// borrow state of a [redeemable] wrapper, used to detect double-redeem.
+const (
+ stateIdle uint32 = iota // sitting in the pool (or freshly created), not checked out
+ stateBorrowed // checked out by a borrower
+)
+
+type redeemable[T any] struct {
+ inner *T
+ redeemer func()
+ // state guards against a double-redeem (the same wrapper Put into the pool
+ // twice, which would let one object be handed to two borrowers).
+ //
+ // It is set to stateBorrowed on borrow and atomically flipped back to
+ // stateIdle on redeem; a redeem that finds it already idle panics.
+ state atomic.Uint32
+}
+
+// redeemPanic is the message raised when a slot is redeemed while already idle.
+const redeemPanic = "pools: " +
+ "double redeem detected (object already returned to the pool); " +
+ "a borrowed object must be redeemed exactly once"
+
+// Pool wraps a [sync.Pool] to make it available for any type.
+//
+// T must be the value type of the pooled object (e.g. Pool[bytes.Buffer]):
+// [Pool.Borrow] returns a *T. Using a pointer type as T (e.g.
+// Pool[*bytes.Buffer]) would yield a **T and is almost certainly a mistake.
+type Pool[T any] struct {
+ pool sync.Pool
+ tracker tracker[T] // empty (zero-cost) unless built with the poolsdebug tag
+}
+
+// PoolRedeemable wraps a [sync.Pool] to make it available for any type.
+//
+// It differs from [Pool] in the way objects are redeemed to the pool: borrowing
+// also yields a cached redeem closure, so no closure is allocated at redeem
+// time.
+type PoolRedeemable[T any] struct {
+ pool sync.Pool
+ tracker tracker[redeemable[T]] // empty (zero-cost) unless built with the poolsdebug tag
+}
+
+// New builds a new [Pool] to recycle allocations of type T explicitly using
+// [Pool.Redeem] and the allocated pointer.
+//
+// Freshly allocated instances of type T are set to their zero value; like
+// recycled instances they are reset (if [Resettable]) when borrowed, so
+// [Pool.Borrow] always yields a clean object.
+func New[T any]() *Pool[T] {
+ p := &Pool[T]{}
+ p.pool = sync.Pool{
+ New: func() any {
+ return new(T)
+ },
+ }
+ p.tracker.register()
+
+ return p
+}
+
+// NewRedeemable builds a new redeemable [Pool] to recycle allocations of type
+// T, and use the inner redeemer to relinquish objects to the pool.
+func NewRedeemable[T any]() *PoolRedeemable[T] {
+ p := &PoolRedeemable[T]{}
+ p.pool = sync.Pool{
+ New: func() any {
+ r := &redeemable[T]{inner: new(T)}
+ r.redeemer = func() {
+ if !r.state.CompareAndSwap(stateBorrowed, stateIdle) {
+ panic(redeemPanic)
+ }
+ resetIfResettable(r.inner)
+ p.pool.Put(r)
+ }
+
+ return r
+ },
+ }
+ p.tracker.register()
+
+ return p
+}
+
+// Borrow an instance from the pool.
+//
+// If the type implements [Resettable], the returned instance is reset before
+// being handed out, so it is always clean.
+func (p *Pool[T]) Borrow() *T {
+ target := p.pool.Get().(*T)
+ resetIfResettable(target)
+ p.tracker.onBorrow(target)
+
+ return target
+}
+
+// Redeem a borrowed instance to the pool.
+//
+// A nil pointer is ignored (it would otherwise corrupt the pool: a typed-nil
+// boxed into an interface is not the nil interface that [sync.Pool.Put] skips).
+//
+// The instance is reset (if it implements [Resettable]) before being returned
+// to the pool.
+// After calling Redeem, the caller must drop its reference to ptr: continuing
+// to use it is a use-after-redeem bug.
+//
+// Unlike [PoolRedeemable], this plain pool holds no per-object state, so it
+// cannot detect a double-redeem of the same pointer (which corrupts the pool).
+//
+// Prefer [PoolRedeemable] when you want that guard, or the debug build for full
+// tracking.
+func (p *Pool[T]) Redeem(ptr *T) {
+ if ptr == nil {
+ return
+ }
+ p.tracker.onRedeem(ptr)
+ resetIfResettable(ptr)
+ p.pool.Put(ptr)
+}
+
+// BorrowWithRedeem borrows an instance from the pool and provides the
+// corresponding redeem function.
+//
+// This is useful for instance to use with defer.
+//
+// The instance is reset (if it implements [Resettable]) both when borrowed and
+// when the returned redeem closure is called.
+// After calling the redeem closure, the caller must drop its reference to the
+// returned instance.
+//
+// Calling the redeem closure more than once panics (see [redeemable.state]): a
+// borrowed instance must be redeemed exactly once.
+func (p *PoolRedeemable[T]) BorrowWithRedeem() (*T, func()) {
+ container := p.pool.Get().(*redeemable[T])
+ container.state.Store(stateBorrowed)
+ resetIfResettable(container.inner)
+
+ // In release builds borrowRedeemer returns container.redeemer unchanged (zero
+ // cost).
+ // Under the poolsdebug tag it returns a generation-stamped wrapper that tracks
+ // the borrow and detects double-redeem (incl.
+ //
+ // ABA), foreign-redeem and leaks.
+ return container.inner, p.tracker.borrowRedeemer(container, container.redeemer)
+}
+
+// Slice is a struct that wraps a slice []T.
+//
+// This is useful to borrow and redeem slices from a pool, without having to
+// constantly manipulate pointers to the slice.
+//
+// The wrapper holds the authoritative slice header.
+//
+// Its mutating methods ([Slice.Append], [Slice.Concat], [Slice.Grow]) return
+// the current backing slice for convenience, so it reads as an idiomatic []T.
+//
+// But the returned slice is only a snapshot of the wrapper's state at that
+// moment: if you keep it and grow it yourself with the builtin append and it
+// reallocates, the new backing array lives only in your local copy and is NOT
+// tracked by the wrapper — it will not be recycled when the wrapper is
+// redeemed (and a later borrower would get the old, smaller array).
+//
+// Rule of thumb: it is fine to read or pass the returned []T to a consumer; but
+// if you plan to grow the slice, keep calling the wrapper's methods so the
+// growth is tracked and recycled.
+type Slice[T any] struct {
+ length int
+ inner []T
+}
+
+// Slice returns the inner slice.
+//
+// Treat the result as a read-only view (for ranging or passing to a consumer),
+// valid until the next mutation or redeem.
+// To grow or append, use the wrapper methods so the new backing array is
+// tracked and recycled (see [Slice]).
+func (s *Slice[T]) Slice() []T {
+ return s.inner
+}
+
+// Grow the inner slice so it can accommodate at least size more elements
+// without reallocating, and return the current backing slice.
+//
+// Growth is tracked by the wrapper, so the enlarged backing array is recycled
+// on redeem.
+// See [Slice] for the caveat about growing the returned slice yourself.
+func (s *Slice[T]) Grow(size int) []T {
+ s.inner = slices.Grow(s.inner, size)
+
+ return s.inner
+}
+
+func (s *Slice[T]) Len() int {
+ return len(s.inner)
+}
+
+func (s *Slice[T]) Cap() int {
+ return cap(s.inner)
+}
+
+// Append elements to the inner slice and return the current backing slice.
+//
+// This should be preferred to the append builtin if you plan that the slice will
+// grow and you want the newly allocated space to be tracked and recycled.
+// See [Slice] for the caveat about growing the returned slice yourself.
+func (s *Slice[T]) Append(elems ...T) []T {
+ s.inner = append(s.inner, elems...)
+
+ return s.inner
+}
+
+// Concat another slice to the inner slice and return the current backing slice.
+//
+// Unlike [slices.Concat], this reuses the inner slice's capacity instead of
+// always allocating a fresh backing array.
+// See [Slice] for the caveat about growing the returned slice yourself.
+func (s *Slice[T]) Concat(slice []T) []T {
+ s.inner = append(s.inner, slice...)
+
+ return s.inner
+}
+
+// IndexedElems iterates over the inner slice.
+func (s *Slice[T]) IndexedElems() iter.Seq2[int, T] {
+ return func(yield func(int, T) bool) {
+ for i, elem := range s.inner {
+ if !yield(i, elem) {
+ return
+ }
+ }
+ }
+}
+
+// Reset the inner slice to its configured initial length, keeping allocated
+// capacity.
+//
+// All elements are zeroed, so the pool never retains stale element references
+// (which would keep a referenced graph alive for slices of pointers) and so a
+// [WithLength] slice is handed out clean rather than carrying data from a
+// previous borrower.
+func (s *Slice[T]) Reset() {
+ clear(s.inner)
+ if s.length > cap(s.inner) {
+ s.inner = slices.Grow(s.inner[:0], s.length)
+ }
+ s.inner = s.inner[:s.length]
+}
+
+// Clip removes unused capacity from the inner slice.
+func (s *Slice[T]) Clip() {
+ s.inner = slices.Clip(s.inner)
+}
+
+// resetWithCapacity discards the current backing array and replaces it with a
+// fresh one of the configured length and the given capacity.
+//
+// It is used by a capacity-capped pool to stop recycling an oversized backing
+// array (the old array is left for the GC).
+func (s *Slice[T]) resetWithCapacity(capacity int) {
+ s.inner = make([]T, s.length, max(s.length, capacity))
+}
+
+// PoolSlice is a pool of [Slice[T]].
+//
+// [PoolSlice.BorrowWithRedeem] will return an empty inner slice by default.
+// This default may be altered using [WithMinimumCapacity].
+//
+// Use [PoolSlice.BorrowWithSizeAndRedeem] or [Slice.Grow] to grow the capacity
+// of the inner slice.
+type PoolSlice[T any] struct {
+ // redeemable is held as an unexported field rather than embedded, so the
+ // underlying [PoolRedeemable] and its [sync.Pool] are not part of PoolSlice's
+ // public surface.
+ redeemable *PoolRedeemable[Slice[T]]
+}
+
+// PoolSliceOption alters the default settings to allocate new pooled slices
+type PoolSliceOption func(*poolSliceOptions)
+
+type poolSliceOptions struct {
+ minCapacity int
+ length int
+ maxCapacity int
+}
+
+func WithMinimumCapacity(size int) PoolSliceOption {
+ return func(o *poolSliceOptions) {
+ o.minCapacity = size
+ }
+}
+
+// WithMaxCapacity bounds the capacity of recycled slices.
+//
+// When a borrowed slice has grown past size at redeem time, its (oversized)
+// backing array is discarded and replaced with a fresh one sized to the minimum
+// capacity, instead of being recycled.
+//
+// This stops the pool from accumulating large backing arrays after an
+// occasional large request, keeping the steady-state memory bounded.
+//
+// The trade-off: a workload that genuinely needs slices larger than size will
+// reallocate on every cycle.
+// Set size from the high-water mark you actually expect, not below it.
+// A size of 0 (the default) means no cap: grown slices are recycled as-is.
+func WithMaxCapacity(size int) PoolSliceOption {
+ return func(o *poolSliceOptions) {
+ o.maxCapacity = size
+ }
+}
+
+// WithLength ensures that the borrowed slices have a fixed given initial
+// length.
+//
+// By default, the borrowed slices are reset to length 0.
+func WithLength(size int) PoolSliceOption {
+ return func(o *poolSliceOptions) {
+ o.length = size
+ }
+}
+
+// NewPoolSlice builds a pool to recycle slices of type []T.
+func NewPoolSlice[T any](opts ...PoolSliceOption) *PoolSlice[T] {
+ var o poolSliceOptions
+ for _, apply := range opts {
+ apply(&o)
+ }
+
+ rp := &PoolRedeemable[Slice[T]]{}
+ rp.pool = sync.Pool{
+ New: func() any {
+ s := &redeemable[Slice[T]]{
+ inner: &Slice[T]{
+ length: o.length,
+ inner: make([]T, o.length, max(o.length, o.minCapacity)),
+ },
+ }
+
+ s.redeemer = func() {
+ if !s.state.CompareAndSwap(stateBorrowed, stateIdle) {
+ panic(redeemPanic)
+ }
+ if o.maxCapacity > 0 && s.inner.Cap() > o.maxCapacity {
+ s.inner.resetWithCapacity(o.minCapacity)
+ } else {
+ s.inner.Reset()
+ }
+ rp.pool.Put(s)
+ }
+
+ return s
+ },
+ }
+ rp.tracker.register()
+
+ return &PoolSlice[T]{redeemable: rp}
+}
+
+// BorrowWithRedeem returns the slice wrapper and the redeem closure to
+// relinquish the allocated wrapper.
+//
+// The wrapper is reset (elements zeroed, length restored) both on borrow and
+// when the redeem closure is called.
+// Calling the redeem closure more than once panics.
+func (p *PoolSlice[T]) BorrowWithRedeem() (*Slice[T], func()) {
+ return p.redeemable.BorrowWithRedeem()
+}
+
+// BorrowWithSizeAndRedeem borrows a slice []T from the pool and ensures that
+// its capacity is at least the provided size.
+func (p *PoolSlice[T]) BorrowWithSizeAndRedeem(size int) (*Slice[T], func()) {
+ s, redeem := p.BorrowWithRedeem()
+ s.Grow(size)
+
+ return s, redeem
+}
diff --git a/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go b/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go
index 3daf68dbba..24d951f8de 100644
--- a/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go
+++ b/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go
@@ -123,7 +123,7 @@ func (s YAMLMapSlice) MarshalYAML() (any, error) {
var nodes []*yaml.Node
for _, item := range s {
- nn, err := json2yaml(item.Value)
+ nn, err := json2yaml(item.Value, 1)
if err != nil {
return nil, err
}
@@ -153,6 +153,17 @@ func (s YAMLMapSlice) MarshalYAML() (any, error) {
//
// It implements [yaml.Unmarshaler].
func (s *YAMLMapSlice) UnmarshalYAML(node *yaml.Node) error {
+ return s.unmarshalYAML(newYAMLWalker(), node, 0)
+}
+
+// unmarshalYAML builds the slice from a [yaml.Node], tracking the recursion depth (against
+// stack-overflow) and threading the [yamlWalker] so anchor/alias expansion stays bounded
+// across the whole document.
+func (s *YAMLMapSlice) unmarshalYAML(w *yamlWalker, node *yaml.Node, depth int) error {
+ if depth > defaultMaxNestingDepth {
+ return errMaxNestingDepth
+ }
+
if typeutils.IsNil(*s) {
// allow to unmarshal with a simple var declaration (nil slice)
*s = YAMLMapSlice{}
@@ -167,13 +178,17 @@ func (s *YAMLMapSlice) UnmarshalYAML(node *yaml.Node) error {
m = m[:0]
for i := 0; i < len(node.Content); i += 2 {
+ if err := w.account(); err != nil { // account the key node
+ return err
+ }
+
var nmi YAMLMapItem
k, err := yamlStringScalarC(node.Content[i])
if err != nil {
return fmt.Errorf("unable to decode YAML map key: %w: %w", err, ErrYAML)
}
nmi.Key = k
- v, err := yamlNode(node.Content[i+1])
+ v, err := w.node(node.Content[i+1], depth+1)
if err != nil {
return fmt.Errorf("unable to process YAML map value for key %q: %w: %w", k, err, ErrYAML)
}
@@ -186,7 +201,11 @@ func (s *YAMLMapSlice) UnmarshalYAML(node *yaml.Node) error {
return nil
}
-func json2yaml(item any) (*yaml.Node, error) {
+func json2yaml(item any, depth int) (*yaml.Node, error) {
+ if depth > defaultMaxNestingDepth {
+ return nil, errMaxNestingDepth
+ }
+
if typeutils.IsNil(item) {
return &yaml.Node{
Kind: yaml.ScalarNode,
@@ -196,7 +215,7 @@ func json2yaml(item any) (*yaml.Node, error) {
switch val := item.(type) {
case ifaces.Ordered:
- return orderedYAML(val)
+ return orderedYAML(val, depth)
case map[string]any:
var n yaml.Node
@@ -209,7 +228,7 @@ func json2yaml(item any) (*yaml.Node, error) {
for _, k := range keys {
v := val[k]
- childNode, err := json2yaml(v)
+ childNode, err := json2yaml(v, depth+1)
if err != nil {
return nil, err
}
@@ -225,7 +244,7 @@ func json2yaml(item any) (*yaml.Node, error) {
var n yaml.Node
n.Kind = yaml.SequenceNode
for i := range val {
- childNode, err := json2yaml(val[i])
+ childNode, err := json2yaml(val[i], depth+1)
if err != nil {
return nil, err
}
@@ -297,11 +316,11 @@ func uintegerNode[T conv.Unsigned](val T) (*yaml.Node, error) {
}, nil
}
-func orderedYAML[T ifaces.Ordered](val T) (*yaml.Node, error) {
+func orderedYAML[T ifaces.Ordered](val T, depth int) (*yaml.Node, error) {
var n yaml.Node
n.Kind = yaml.MappingNode
for key, value := range val.OrderedItems() {
- childNode, err := json2yaml(value)
+ childNode, err := json2yaml(value, depth+1)
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/go-openapi/swag/yamlutils/yaml.go b/vendor/github.com/go-openapi/swag/yamlutils/yaml.go
index e3aff3c2fd..d4b5335f6f 100644
--- a/vendor/github.com/go-openapi/swag/yamlutils/yaml.go
+++ b/vendor/github.com/go-openapi/swag/yamlutils/yaml.go
@@ -12,13 +12,99 @@ import (
yaml "go.yaml.in/yaml/v3"
)
+// defaultMaxNestingDepth caps the recursion depth of the YAML<->JSON transforms to
+// guard against stack-overflow on deeply nested (possibly adversarial) input.
+//
+// It matches the limit enforced by go.yaml.in/yaml/v3's own parser and by
+// encoding/json's decoder.
+const defaultMaxNestingDepth = 10000
+
+// Bounds on YAML anchor/alias expansion.
+//
+// go.yaml.in/yaml/v3 enforces these when decoding into Go values, but that guard is
+// coupled to the library's own tree walk: when we decode into a low-level [yaml.Node]
+// (to preserve key order) and expand aliases ourselves in [yamlWalker.node], we bypass
+// it. We therefore reproduce it here, with the same constants and ratio schedule as the
+// library's decoder (see go.yaml.in/yaml/v3 decode.go, "excessive aliasing").
+const (
+ aliasCountThreshold = 100
+ decodeCountThreshold = 1000
+
+ // 400,000 decode operations is ~500kb of dense object declarations, or
+ // ~5kb of dense object declarations with 10000% alias expansion.
+ aliasRatioRangeLow = 400000
+ // 4,000,000 decode operations is ~5MB of dense object declarations.
+ aliasRatioRangeHigh = 4000000
+ aliasRatioRange = float64(aliasRatioRangeHigh - aliasRatioRangeLow)
+
+ // tolerated share of alias-driven decodes: from aliasRatioSmall (small/medium documents)
+ // down to aliasRatioLarge (very large ones), interpolated with slope aliasRatioSlope.
+ aliasRatioSmall = 0.99
+ aliasRatioLarge = 0.10
+ aliasRatioSlope = aliasRatioSmall - aliasRatioLarge
+)
+
+var (
+ // errMaxNestingDepth is returned when a document nests deeper than [defaultMaxNestingDepth].
+ errMaxNestingDepth = fmt.Errorf("maximum nesting depth of %d exceeded: %w", defaultMaxNestingDepth, ErrYAML)
+
+ // errExcessiveAliasing is returned when anchor/alias expansion is disproportionate to the
+ // size of the document, i.e. an "alias bomb".
+ errExcessiveAliasing = fmt.Errorf("document contains excessive aliasing: %w", ErrYAML)
+)
+
+// allowedAliasRatio scales the tolerated share of alias-driven decode operations from 99%
+// for small-to-medium documents down to 10% for very large ones, mirroring go.yaml.in/yaml/v3.
+func allowedAliasRatio(decodeCount int) float64 {
+ switch {
+ case decodeCount <= aliasRatioRangeLow:
+ return aliasRatioSmall
+ case decodeCount >= aliasRatioRangeHigh:
+ return aliasRatioLarge
+ default:
+ return aliasRatioSmall - aliasRatioSlope*(float64(decodeCount-aliasRatioRangeLow)/aliasRatioRange)
+ }
+}
+
+// yamlWalker carries the state needed to bound a single YAML-tree traversal:
+// anchor/alias expansion accounting and cycle detection.
+//
+// A fresh walker is created per top-level conversion; it is threaded (not copied) through
+// the whole recursive walk so its counters accumulate across the entire document.
+type yamlWalker struct {
+ decodeCount int
+ aliasCount int
+ aliasDepth int
+ aliases map[*yaml.Node]bool // anchors currently being expanded, for cycle detection
+}
+
+func newYAMLWalker() *yamlWalker {
+ return &yamlWalker{aliases: make(map[*yaml.Node]bool)}
+}
+
+// account records one processed node and fails if alias expansion has become excessive.
+func (w *yamlWalker) account() error {
+ w.decodeCount++
+ if w.aliasDepth > 0 {
+ w.aliasCount++
+ }
+
+ if w.aliasCount > aliasCountThreshold &&
+ w.decodeCount > decodeCountThreshold &&
+ float64(w.aliasCount)/float64(w.decodeCount) > allowedAliasRatio(w.decodeCount) {
+ return errExcessiveAliasing
+ }
+
+ return nil
+}
+
// YAMLToJSON converts a YAML document into JSON bytes.
//
// Note: a YAML document is the output from a [yaml.Marshaler], e.g a pointer to a [yaml.Node].
//
// [YAMLToJSON] is typically called after [BytesToYAMLDoc].
func YAMLToJSON(value any) (json.RawMessage, error) {
- jm, err := transformData(value)
+ jm, err := transformData(value, 0)
if err != nil {
return nil, err
}
@@ -44,46 +130,73 @@ func BytesToYAMLDoc(data []byte) (any, error) {
return &document, nil
}
-func yamlNode(root *yaml.Node) (any, error) {
+func (w *yamlWalker) node(root *yaml.Node, depth int) (any, error) {
+ if depth > defaultMaxNestingDepth {
+ return nil, errMaxNestingDepth
+ }
+ if err := w.account(); err != nil {
+ return nil, err
+ }
+
switch root.Kind {
case yaml.DocumentNode:
- return yamlDocument(root)
+ return w.document(root, depth)
case yaml.SequenceNode:
- return yamlSequence(root)
+ return w.sequence(root, depth)
case yaml.MappingNode:
- return yamlMapping(root)
+ return w.mapping(root, depth)
case yaml.ScalarNode:
return yamlScalar(root)
case yaml.AliasNode:
- return yamlNode(root.Alias)
+ return w.alias(root, depth)
default:
return nil, fmt.Errorf("unsupported YAML node type: %v: %w", root.Kind, ErrYAML)
}
}
-func yamlDocument(node *yaml.Node) (any, error) {
+// alias resolves an anchor reference, expanding the anchored subtree. It detects cycles
+// (an anchor whose expansion transitively references itself) and accounts the expansion
+// against the alias-bomb budget via [yamlWalker.aliasDepth].
+func (w *yamlWalker) alias(node *yaml.Node, depth int) (any, error) {
+ if node.Alias == nil {
+ return nil, fmt.Errorf("invalid YAML alias node %q: %w", node.Value, ErrYAML)
+ }
+ if w.aliases[node.Alias] {
+ return nil, fmt.Errorf("anchor %q contains itself: %w", node.Value, ErrYAML)
+ }
+
+ w.aliases[node.Alias] = true
+ w.aliasDepth++
+ out, err := w.node(node.Alias, depth+1)
+ w.aliasDepth--
+ delete(w.aliases, node.Alias)
+
+ return out, err
+}
+
+func (w *yamlWalker) document(node *yaml.Node, depth int) (any, error) {
if len(node.Content) != 1 {
return nil, fmt.Errorf("unexpected YAML Document node content length: %d: %w", len(node.Content), ErrYAML)
}
- return yamlNode(node.Content[0])
+ return w.node(node.Content[0], depth+1)
}
-func yamlMapping(node *yaml.Node) (any, error) {
+func (w *yamlWalker) mapping(node *yaml.Node, depth int) (any, error) {
const sensibleAllocDivider = 2 // nodes concatenate (key,value) sequences
m := make(YAMLMapSlice, len(node.Content)/sensibleAllocDivider)
- if err := m.UnmarshalYAML(node); err != nil {
+ if err := m.unmarshalYAML(w, node, depth); err != nil {
return nil, err
}
return m, nil
}
-func yamlSequence(node *yaml.Node) (any, error) {
+func (w *yamlWalker) sequence(node *yaml.Node, depth int) (any, error) {
s := make([]any, 0)
for i := range len(node.Content) {
- v, err := yamlNode(node.Content[i])
+ v, err := w.node(node.Content[i], depth+1)
if err != nil {
return nil, fmt.Errorf("unable to decode YAML sequence value: %w: %w", err, ErrYAML)
}
@@ -174,12 +287,16 @@ func format(t any) (string, error) {
}
}
-func transformData(input any) (out any, err error) {
+func transformData(input any, depth int) (out any, err error) {
+ if depth > defaultMaxNestingDepth {
+ return nil, errMaxNestingDepth
+ }
+
switch in := input.(type) {
case yaml.Node:
- return yamlNode(&in)
+ return newYAMLWalker().node(&in, depth)
case *yaml.Node:
- return yamlNode(in)
+ return newYAMLWalker().node(in, depth)
case map[any]any:
o := make(YAMLMapSlice, 0, len(in))
for ke, va := range in {
@@ -188,7 +305,7 @@ func transformData(input any) (out any, err error) {
return nil, err
}
- v, ert := transformData(va)
+ v, ert := transformData(va, depth+1)
if ert != nil {
return nil, ert
}
@@ -200,7 +317,7 @@ func transformData(input any) (out any, err error) {
len1 := len(in)
o := make([]any, len1)
for i := range len1 {
- o[i], err = transformData(in[i])
+ o[i], err = transformData(in[i], depth+1)
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/go-openapi/validate/.gitignore b/vendor/github.com/go-openapi/validate/.gitignore
index d8f4186fe5..fbb78de2c3 100644
--- a/vendor/github.com/go-openapi/validate/.gitignore
+++ b/vendor/github.com/go-openapi/validate/.gitignore
@@ -3,3 +3,4 @@
.idea
.env
.mcp.json
+.worktrees
diff --git a/vendor/github.com/go-openapi/validate/.golangci.yml b/vendor/github.com/go-openapi/validate/.golangci.yml
index 4d6b36e472..b8875d7abb 100644
--- a/vendor/github.com/go-openapi/validate/.golangci.yml
+++ b/vendor/github.com/go-openapi/validate/.golangci.yml
@@ -7,6 +7,8 @@ linters:
- gochecknoglobals
- gochecknoinits
- godox
+ - gomodguard
+ - gomodguard_v2
- exhaustruct
- ireturn
- nlreturn
diff --git a/vendor/github.com/go-openapi/validate/CONTRIBUTORS.md b/vendor/github.com/go-openapi/validate/CONTRIBUTORS.md
index 0f5497c8bb..62bd8518f4 100644
--- a/vendor/github.com/go-openapi/validate/CONTRIBUTORS.md
+++ b/vendor/github.com/go-openapi/validate/CONTRIBUTORS.md
@@ -4,12 +4,12 @@
| Total Contributors | Total Contributions |
| --- | --- |
-| 31 | 305 |
+| 32 | 312 |
| Username | All Time Contribution Count | All Commits |
| --- | --- | --- |
| @casualjim | 169 | |
-| @fredbi | 68 | |
+| @fredbi | 74 | |
| @sttts | 11 | |
| @youyuanwu | 9 | |
| @keramix | 8 | |
@@ -32,6 +32,7 @@
| @liggitt | 1 | |
| @ilyakaznacheev | 1 | |
| @hypnoglow | 1 | |
+| @HNO3Miracle | 1 | |
| @gautierdelorme | 1 | |
| @flavioribeiro | 1 | |
| @pheepi | 1 | |
diff --git a/vendor/github.com/go-openapi/validate/default_validator.go b/vendor/github.com/go-openapi/validate/default_validator.go
index ebcd807137..5902cee5ca 100644
--- a/vendor/github.com/go-openapi/validate/default_validator.go
+++ b/vendor/github.com/go-openapi/validate/default_validator.go
@@ -4,9 +4,6 @@
package validate
import (
- "fmt"
- "strings"
-
"github.com/go-openapi/spec"
)
@@ -20,7 +17,7 @@ type defaultValidator struct {
// Validate validates the default values declared in the swagger spec.
func (d *defaultValidator) Validate() *Result {
- errs := pools.poolOfResults.BorrowResult() // will redeem when merged
+ errs := validatorPools.results.Borrow() // will redeem when merged
if d == nil || d.SpecValidator == nil {
return errs
@@ -44,28 +41,16 @@ func (d *defaultValidator) resetVisited() {
}
}
-func isVisited(path string, visitedSchemas map[string]struct{}) bool {
- _, found := visitedSchemas[path]
+func isVisited(path pathSegments, visitedSchemas map[string]struct{}) bool {
+ _, found := visitedSchemas[path.pointer()]
if found {
return true
}
- // search for overlapping paths
- var (
- parent string
- suffix string
- )
- const backtrackFromEnd = 2
- for i := len(path) - backtrackFromEnd; i >= 0; i-- {
- r := path[i]
- if r != '.' {
- continue
- }
-
- parent = path[0:i]
- suffix = path[i+1:]
-
- if strings.HasSuffix(parent, suffix) {
+ // search for overlapping paths: a trailing run of tokens that already
+ // appears at the end of what leads to it means we are going in circles.
+ for i := 1; i < len(path); i++ {
+ if path[:i].hasSuffix(path[i:]) {
return true
}
}
@@ -74,12 +59,12 @@ func isVisited(path string, visitedSchemas map[string]struct{}) bool {
}
// beingVisited asserts a schema is being visited.
-func (d *defaultValidator) beingVisited(path string) {
- d.visitedSchemas[path] = struct{}{}
+func (d *defaultValidator) beingVisited(path pathSegments) {
+ d.visitedSchemas[path.pointer()] = struct{}{}
}
// isVisited tells if a path has already been visited.
-func (d *defaultValidator) isVisited(path string) bool {
+func (d *defaultValidator) isVisited(path pathSegments) bool {
return isVisited(path, d.visitedSchemas)
}
@@ -88,15 +73,18 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result {
// every default value that is specified must validate against the schema for that property
// headers, items, parameters, schema
- res := pools.poolOfResults.BorrowResult() // will redeem when merged
+ res := validatorPools.results.Borrow() // will redeem when merged
s := d.SpecValidator
- for method, pathItem := range s.expandedAnalyzer().Operations() {
- for path, op := range pathItem {
+ operations := s.expandedAnalyzer().Operations()
+ for _, method := range sortedKeys(operations) {
+ pathItem := operations[method]
+ for _, path := range sortedKeys(pathItem) {
+ op := pathItem[path]
// parameters
for _, param := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) {
if param.Default != nil && param.Required {
- res.AddWarnings(requiredHasDefaultMsg(param.Name, param.In))
+ res.addWarningsAt(s.parameterPath(path, method, param.In, param.Name), requiredHasDefaultMsg(param.Name, param.In))
}
// reset explored schemas to get depth-first recursive-proof exploration
@@ -107,33 +95,34 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result {
if param.Default != nil && param.Schema == nil {
// check param default value is valid
red := newParamValidator(¶m, s.KnownFormats, d.schemaOptions).Validate(param.Default) //#nosec
+ red.relocate(s.parameterPath(path, method, param.In, param.Name).child(jsonDefault))
if red.HasErrorsOrWarnings() {
- res.AddErrors(defaultValueDoesNotValidateMsg(param.Name, param.In))
+ res.addErrorsAt(s.parameterPath(path, method, param.In, param.Name), defaultValueDoesNotValidateMsg(param.Name, param.In))
res.Merge(red)
} else if red.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(red)
+ redeemResult(red)
}
}
// Recursively follows Items and Schemas
if param.Items != nil {
- red := d.validateDefaultValueItemsAgainstSchema(param.Name, param.In, ¶m, param.Items) //#nosec
+ red := d.validateDefaultValueItemsAgainstSchema(s.parameterPath(path, method, param.In, param.Name), param.In, ¶m, param.Items) //#nosec
if red.HasErrorsOrWarnings() {
- res.AddErrors(defaultValueItemsDoesNotValidateMsg(param.Name, param.In))
+ res.addErrorsAt(s.parameterPath(path, method, param.In, param.Name), defaultValueItemsDoesNotValidateMsg(param.Name, param.In))
res.Merge(red)
} else if red.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(red)
+ redeemResult(red)
}
}
if param.Schema != nil {
// Validate default value against schema
- red := d.validateDefaultValueSchemaAgainstSchema(param.Name, param.In, param.Schema)
+ red := d.validateDefaultValueSchemaAgainstSchema(s.parameterPath(path, method, param.In, param.Name).structuralChild(jsonSchema), param.In, param.Schema)
if red.HasErrorsOrWarnings() {
- res.AddErrors(defaultValueDoesNotValidateMsg(param.Name, param.In))
+ res.addErrorsAt(s.parameterPath(path, method, param.In, param.Name), defaultValueDoesNotValidateMsg(param.Name, param.In))
res.Merge(red)
} else if red.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(red)
+ redeemResult(red)
}
}
}
@@ -141,68 +130,74 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result {
if op.Responses != nil {
if op.Responses.Default != nil {
// Same constraint on default Response
- res.Merge(d.validateDefaultInResponse(op.Responses.Default, jsonDefault, path, 0, op.ID))
+ res.Merge(d.validateDefaultInResponse(op.Responses.Default, jsonDefault, path, method, 0, op.ID))
}
// Same constraint on regular Responses
if op.Responses.StatusCodeResponses != nil { // Safeguard
- for code, r := range op.Responses.StatusCodeResponses {
- res.Merge(d.validateDefaultInResponse(&r, "response", path, code, op.ID)) //#nosec
+ for _, code := range sortedKeys(op.Responses.StatusCodeResponses) {
+ r := op.Responses.StatusCodeResponses[code]
+ res.Merge(d.validateDefaultInResponse(&r, "response", path, method, code, op.ID))
}
}
} else if op.ID != "" {
// Empty op.ID means there is no meaningful operation: no need to report a specific message
- res.AddErrors(noValidResponseMsg(op.ID))
+ res.addErrorsAt(operationPath(path, method), noValidResponseMsg(op.ID))
}
}
}
if s.spec.Spec().Definitions != nil { // Safeguard
// reset explored schemas to get depth-first recursive-proof exploration
d.resetVisited()
- for nm, sch := range s.spec.Spec().Definitions {
- res.Merge(d.validateDefaultValueSchemaAgainstSchema("definitions."+nm, "body", &sch)) //#nosec
+ definitions := s.spec.Spec().Definitions
+ for _, nm := range sortedKeys(definitions) {
+ sch := definitions[nm]
+ res.Merge(d.validateDefaultValueSchemaAgainstSchema(newPathSegments(swaggerDefinitions, nm), "body", &sch))
}
}
return res
}
-func (d *defaultValidator) validateDefaultInResponse(resp *spec.Response, responseType, path string, responseCode int, operationID string) *Result {
+func (d *defaultValidator) validateDefaultInResponse(
+ resp *spec.Response, responseType, path, method string, responseCode int, operationID string,
+) *Result {
s := d.SpecValidator
- response, res := responseHelp.expandResponseRef(resp, path, s)
+ responseName, responseCodeAsStr := responseHelp.responseMsgVariants(responseType, responseCode)
+ response, res := responseHelp.expandResponseRef(resp, path, responsePath(path, method, responseCodeAsStr), s)
if !res.IsValid() {
return res
}
- responseName, responseCodeAsStr := responseHelp.responseMsgVariants(responseType, responseCode)
-
if response.Headers != nil { // Safeguard
- for nm, h := range response.Headers {
+ for _, nm := range sortedKeys(response.Headers) {
+ h := response.Headers[nm]
// reset explored schemas to get depth-first recursive-proof exploration
d.resetVisited()
if h.Default != nil {
red := newHeaderValidator(nm, &h, s.KnownFormats, d.schemaOptions).Validate(h.Default) //#nosec
+ red.relocate(responseHeaderPath(path, method, responseCodeAsStr, nm).child(jsonDefault))
if red.HasErrorsOrWarnings() {
- res.AddErrors(defaultValueHeaderDoesNotValidateMsg(operationID, nm, responseName))
+ res.addErrorsAt(responseHeaderPath(path, method, responseCodeAsStr, nm), defaultValueHeaderDoesNotValidateMsg(operationID, nm, responseName))
res.Merge(red)
} else if red.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(red)
+ redeemResult(red)
}
}
// Headers have inline definition, like params
if h.Items != nil {
- red := d.validateDefaultValueItemsAgainstSchema(nm, "header", &h, h.Items) //#nosec
+ red := d.validateDefaultValueItemsAgainstSchema(responseHeaderPath(path, method, responseCodeAsStr, nm), "header", &h, h.Items) //#nosec
if red.HasErrorsOrWarnings() {
- res.AddErrors(defaultValueHeaderItemsDoesNotValidateMsg(operationID, nm, responseName))
+ res.addErrorsAt(responseHeaderPath(path, method, responseCodeAsStr, nm), defaultValueHeaderItemsDoesNotValidateMsg(operationID, nm, responseName))
res.Merge(red)
} else if red.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(red)
+ redeemResult(red)
}
}
if _, err := compileRegexp(h.Pattern); err != nil {
- res.AddErrors(invalidPatternInHeaderMsg(operationID, nm, responseName, h.Pattern, err))
+ res.addErrorsAt(responseHeaderPath(path, method, responseCodeAsStr, nm), invalidPatternInHeaderMsg(operationID, nm, responseName, h.Pattern, err))
}
// Headers don't have schema
@@ -212,62 +207,65 @@ func (d *defaultValidator) validateDefaultInResponse(resp *spec.Response, respon
// reset explored schemas to get depth-first recursive-proof exploration
d.resetVisited()
- red := d.validateDefaultValueSchemaAgainstSchema(responseCodeAsStr, "response", response.Schema)
+ red := d.validateDefaultValueSchemaAgainstSchema(
+ responsePath(path, method, responseCodeAsStr).structuralChild(jsonSchema), "response", response.Schema)
if red.HasErrorsOrWarnings() {
// Additional message to make sure the context of the error is not lost
- res.AddErrors(defaultValueInDoesNotValidateMsg(operationID, responseName))
+ res.addErrorsAt(responsePath(path, method, responseCodeAsStr), defaultValueInDoesNotValidateMsg(operationID, responseName))
res.Merge(red)
} else if red.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(red)
+ redeemResult(red)
}
}
return res
}
-func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path, in string, schema *spec.Schema) *Result {
+func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path pathSegments, in string, schema *spec.Schema) *Result {
if schema == nil || d.isVisited(path) {
// Avoids recursing if we are already done with that check
return nil
}
d.beingVisited(path)
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
s := d.SpecValidator
if schema.Default != nil {
res.Merge(
- newSchemaValidator(schema, s.spec.Spec(), path+".default", s.KnownFormats, d.schemaOptions).Validate(schema.Default),
+ newSchemaValidator(schema, s.spec.Spec(), path.child(jsonDefault), s.KnownFormats, d.schemaOptions).Validate(schema.Default),
)
}
if schema.Items != nil {
if schema.Items.Schema != nil {
- res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+".items.default", in, schema.Items.Schema))
+ res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.child(jsonItems), in, schema.Items.Schema))
}
// Multiple schemas in items
if schema.Items.Schemas != nil { // Safeguard
for i, sch := range schema.Items.Schemas {
- res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("%s.items[%d].default", path, i), in, &sch)) //#nosec
+ res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.child(jsonItems).item(i), in, &sch)) //#nosec
}
}
}
if _, err := compileRegexp(schema.Pattern); err != nil {
- res.AddErrors(invalidPatternInMsg(path, in, schema.Pattern))
+ res.addErrorsAt(path, invalidPatternInMsg(path.dotted(), in, schema.Pattern))
}
if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil {
// NOTE: we keep validating values, even though additionalItems is not supported by Swagger 2.0 (and 3.0 as well)
- res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+".additionalItems", in, schema.AdditionalItems.Schema))
+ res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.child(jsonAdditionalItems), in, schema.AdditionalItems.Schema))
}
- for propName, prop := range schema.Properties {
- res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec
+ for _, propName := range sortedKeys(schema.Properties) {
+ prop := schema.Properties[propName]
+ res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.structuralChild(jsonProperties).child(propName), in, &prop))
}
- for propName, prop := range schema.PatternProperties {
- res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec
+ for _, propName := range sortedKeys(schema.PatternProperties) {
+ prop := schema.PatternProperties[propName]
+ res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.structuralChild(jsonPatternProperties).child(propName), in, &prop))
}
if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil {
- res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+".additionalProperties", in, schema.AdditionalProperties.Schema))
+ res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.child(jsonAdditionalProperties), in, schema.AdditionalProperties.Schema))
}
if schema.AllOf != nil {
for i, aoSch := range schema.AllOf {
- res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("%s.allOf[%d]", path, i), in, &aoSch)) //#nosec
+ res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.child(jsonAllOf).item(i), in, &aoSch)) //#nosec
}
}
return res
@@ -275,8 +273,8 @@ func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path, in stri
// NOTE: Temporary duplicated code. Need to refactor with examples
-func (d *defaultValidator) validateDefaultValueItemsAgainstSchema(path, in string, root any, items *spec.Items) *Result {
- res := pools.poolOfResults.BorrowResult()
+func (d *defaultValidator) validateDefaultValueItemsAgainstSchema(path pathSegments, in string, root any, items *spec.Items) *Result {
+ res := validatorPools.results.Borrow()
s := d.SpecValidator
if items != nil {
if items.Default != nil {
@@ -285,10 +283,10 @@ func (d *defaultValidator) validateDefaultValueItemsAgainstSchema(path, in strin
)
}
if items.Items != nil {
- res.Merge(d.validateDefaultValueItemsAgainstSchema(path+"[0].default", in, root, items.Items))
+ res.Merge(d.validateDefaultValueItemsAgainstSchema(path.item(0), in, root, items.Items))
}
if _, err := compileRegexp(items.Pattern); err != nil {
- res.AddErrors(invalidPatternInMsg(path, in, items.Pattern))
+ res.addErrorsAt(path, invalidPatternInMsg(path.dotted(), in, items.Pattern))
}
}
return res
diff --git a/vendor/github.com/go-openapi/validate/example_validator.go b/vendor/github.com/go-openapi/validate/example_validator.go
index eb6b5ee5c7..0e193d5234 100644
--- a/vendor/github.com/go-openapi/validate/example_validator.go
+++ b/vendor/github.com/go-openapi/validate/example_validator.go
@@ -4,8 +4,6 @@
package validate
import (
- "fmt"
-
"github.com/go-openapi/spec"
)
@@ -24,7 +22,7 @@ type exampleValidator struct {
// - individual property
// - responses
func (ex *exampleValidator) Validate() *Result {
- errs := pools.poolOfResults.BorrowResult()
+ errs := validatorPools.results.Borrow()
if ex == nil || ex.SpecValidator == nil {
return errs
@@ -50,12 +48,12 @@ func (ex *exampleValidator) resetVisited() {
}
// beingVisited asserts a schema is being visited.
-func (ex *exampleValidator) beingVisited(path string) {
- ex.visitedSchemas[path] = struct{}{}
+func (ex *exampleValidator) beingVisited(path pathSegments) {
+ ex.visitedSchemas[path.pointer()] = struct{}{}
}
// isVisited tells if a path has already been visited.
-func (ex *exampleValidator) isVisited(path string) bool {
+func (ex *exampleValidator) isVisited(path pathSegments) bool {
return isVisited(path, ex.visitedSchemas)
}
@@ -65,11 +63,14 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result {
// in: schemas, properties, object, items
// not in: headers, parameters without schema
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
s := ex.SpecValidator
- for method, pathItem := range s.expandedAnalyzer().Operations() {
- for path, op := range pathItem {
+ operations := s.expandedAnalyzer().Operations()
+ for _, method := range sortedKeys(operations) {
+ pathItem := operations[method]
+ for _, path := range sortedKeys(pathItem) {
+ op := pathItem[path]
// parameters
for _, param := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) {
@@ -84,33 +85,34 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result {
if param.Example != nil && param.Schema == nil {
// check param default value is valid
red := newParamValidator(¶m, s.KnownFormats, ex.schemaOptions).Validate(param.Example) //#nosec
+ red.relocate(s.parameterPath(path, method, param.In, param.Name).child(swaggerExample))
if red.HasErrorsOrWarnings() {
- res.AddWarnings(exampleValueDoesNotValidateMsg(param.Name, param.In))
+ res.addWarningsAt(s.parameterPath(path, method, param.In, param.Name), exampleValueDoesNotValidateMsg(param.Name, param.In))
res.MergeAsWarnings(red)
} else if red.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(red)
+ redeemResult(red)
}
}
// Recursively follows Items and Schemas
if param.Items != nil {
- red := ex.validateExampleValueItemsAgainstSchema(param.Name, param.In, ¶m, param.Items) //#nosec
+ red := ex.validateExampleValueItemsAgainstSchema(s.parameterPath(path, method, param.In, param.Name), param.In, ¶m, param.Items) //#nosec
if red.HasErrorsOrWarnings() {
- res.AddWarnings(exampleValueItemsDoesNotValidateMsg(param.Name, param.In))
+ res.addWarningsAt(s.parameterPath(path, method, param.In, param.Name), exampleValueItemsDoesNotValidateMsg(param.Name, param.In))
res.Merge(red)
} else if red.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(red)
+ redeemResult(red)
}
}
if param.Schema != nil {
// Validate example value against schema
- red := ex.validateExampleValueSchemaAgainstSchema(param.Name, param.In, param.Schema)
+ red := ex.validateExampleValueSchemaAgainstSchema(s.parameterPath(path, method, param.In, param.Name).structuralChild(jsonSchema), param.In, param.Schema)
if red.HasErrorsOrWarnings() {
- res.AddWarnings(exampleValueDoesNotValidateMsg(param.Name, param.In))
+ res.addWarningsAt(s.parameterPath(path, method, param.In, param.Name), exampleValueDoesNotValidateMsg(param.Name, param.In))
res.Merge(red)
} else if red.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(red)
+ redeemResult(red)
}
}
}
@@ -118,68 +120,74 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result {
if op.Responses != nil {
if op.Responses.Default != nil {
// Same constraint on default Response
- res.Merge(ex.validateExampleInResponse(op.Responses.Default, jsonDefault, path, 0, op.ID))
+ res.Merge(ex.validateExampleInResponse(op.Responses.Default, jsonDefault, path, method, 0, op.ID))
}
// Same constraint on regular Responses
if op.Responses.StatusCodeResponses != nil { // Safeguard
- for code, r := range op.Responses.StatusCodeResponses {
- res.Merge(ex.validateExampleInResponse(&r, "response", path, code, op.ID)) //#nosec
+ for _, code := range sortedKeys(op.Responses.StatusCodeResponses) {
+ r := op.Responses.StatusCodeResponses[code]
+ res.Merge(ex.validateExampleInResponse(&r, "response", path, method, code, op.ID))
}
}
} else if op.ID != "" {
// Empty op.ID means there is no meaningful operation: no need to report a specific message
- res.AddErrors(noValidResponseMsg(op.ID))
+ res.addErrorsAt(operationPath(path, method), noValidResponseMsg(op.ID))
}
}
}
if s.spec.Spec().Definitions != nil { // Safeguard
// reset explored schemas to get depth-first recursive-proof exploration
ex.resetVisited()
- for nm, sch := range s.spec.Spec().Definitions {
- res.Merge(ex.validateExampleValueSchemaAgainstSchema("definitions."+nm, "body", &sch)) //#nosec
+ definitions := s.spec.Spec().Definitions
+ for _, nm := range sortedKeys(definitions) {
+ sch := definitions[nm]
+ res.Merge(ex.validateExampleValueSchemaAgainstSchema(newPathSegments(swaggerDefinitions, nm), "body", &sch))
}
}
return res
}
-func (ex *exampleValidator) validateExampleInResponse(resp *spec.Response, responseType, path string, responseCode int, operationID string) *Result {
+func (ex *exampleValidator) validateExampleInResponse(
+ resp *spec.Response, responseType, path, method string, responseCode int, operationID string,
+) *Result {
s := ex.SpecValidator
- response, res := responseHelp.expandResponseRef(resp, path, s)
+ responseName, responseCodeAsStr := responseHelp.responseMsgVariants(responseType, responseCode)
+ response, res := responseHelp.expandResponseRef(resp, path, responsePath(path, method, responseCodeAsStr), s)
if !res.IsValid() { // Safeguard
return res
}
- responseName, responseCodeAsStr := responseHelp.responseMsgVariants(responseType, responseCode)
-
if response.Headers != nil { // Safeguard
- for nm, h := range response.Headers {
+ for _, nm := range sortedKeys(response.Headers) {
+ h := response.Headers[nm]
// reset explored schemas to get depth-first recursive-proof exploration
ex.resetVisited()
if h.Example != nil {
red := newHeaderValidator(nm, &h, s.KnownFormats, ex.schemaOptions).Validate(h.Example) //#nosec
+ red.relocate(responseHeaderPath(path, method, responseCodeAsStr, nm).child(swaggerExample))
if red.HasErrorsOrWarnings() {
- res.AddWarnings(exampleValueHeaderDoesNotValidateMsg(operationID, nm, responseName))
+ res.addWarningsAt(responseHeaderPath(path, method, responseCodeAsStr, nm), exampleValueHeaderDoesNotValidateMsg(operationID, nm, responseName))
res.MergeAsWarnings(red)
} else if red.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(red)
+ redeemResult(red)
}
}
// Headers have inline definition, like params
if h.Items != nil {
- red := ex.validateExampleValueItemsAgainstSchema(nm, "header", &h, h.Items) //#nosec
+ red := ex.validateExampleValueItemsAgainstSchema(responseHeaderPath(path, method, responseCodeAsStr, nm), "header", &h, h.Items) //#nosec
if red.HasErrorsOrWarnings() {
- res.AddWarnings(exampleValueHeaderItemsDoesNotValidateMsg(operationID, nm, responseName))
+ res.addWarningsAt(responseHeaderPath(path, method, responseCodeAsStr, nm), exampleValueHeaderItemsDoesNotValidateMsg(operationID, nm, responseName))
res.MergeAsWarnings(red)
} else if red.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(red)
+ redeemResult(red)
}
}
if _, err := compileRegexp(h.Pattern); err != nil {
- res.AddErrors(invalidPatternInHeaderMsg(operationID, nm, responseName, h.Pattern, err))
+ res.addErrorsAt(responseHeaderPath(path, method, responseCodeAsStr, nm), invalidPatternInHeaderMsg(operationID, nm, responseName, h.Pattern, err))
}
// Headers don't have schema
@@ -189,77 +197,84 @@ func (ex *exampleValidator) validateExampleInResponse(resp *spec.Response, respo
// reset explored schemas to get depth-first recursive-proof exploration
ex.resetVisited()
- red := ex.validateExampleValueSchemaAgainstSchema(responseCodeAsStr, "response", response.Schema)
+ red := ex.validateExampleValueSchemaAgainstSchema(
+ responsePath(path, method, responseCodeAsStr).structuralChild(jsonSchema), "response", response.Schema)
if red.HasErrorsOrWarnings() {
// Additional message to make sure the context of the error is not lost
- res.AddWarnings(exampleValueInDoesNotValidateMsg(operationID, responseName))
+ res.addWarningsAt(responsePath(path, method, responseCodeAsStr), exampleValueInDoesNotValidateMsg(operationID, responseName))
res.Merge(red)
} else if red.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(red)
+ redeemResult(red)
}
}
if response.Examples != nil {
if response.Schema != nil {
- if example, ok := response.Examples["application/json"]; ok {
+ if example, ok := response.Examples[jsonMimeApplicationJSON]; ok {
+ exampleAt := responsePath(path, method, responseCodeAsStr).
+ child(swaggerExamples).
+ structuralChild(jsonMimeApplicationJSON)
res.MergeAsWarnings(
- newSchemaValidator(response.Schema, s.spec.Spec(), path+".examples", s.KnownFormats, s.schemaOptions).Validate(example),
+ newSchemaValidator(response.Schema, s.spec.Spec(),
+ exampleAt, s.KnownFormats, s.schemaOptions).Validate(example),
)
} else {
// Proposal for enhancement: validate other media types too
- res.AddWarnings(examplesMimeNotSupportedMsg(operationID, responseName))
+ res.addWarningsAt(responsePath(path, method, responseCodeAsStr).child(swaggerExamples), examplesMimeNotSupportedMsg(operationID, responseName))
}
} else {
- res.AddWarnings(examplesWithoutSchemaMsg(operationID, responseName))
+ res.addWarningsAt(responsePath(path, method, responseCodeAsStr).child(swaggerExamples), examplesWithoutSchemaMsg(operationID, responseName))
}
}
return res
}
-func (ex *exampleValidator) validateExampleValueSchemaAgainstSchema(path, in string, schema *spec.Schema) *Result {
+func (ex *exampleValidator) validateExampleValueSchemaAgainstSchema(path pathSegments, in string, schema *spec.Schema) *Result {
if schema == nil || ex.isVisited(path) {
// Avoids recursing if we are already done with that check
return nil
}
ex.beingVisited(path)
s := ex.SpecValidator
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
if schema.Example != nil {
res.MergeAsWarnings(
- newSchemaValidator(schema, s.spec.Spec(), path+".example", s.KnownFormats, ex.schemaOptions).Validate(schema.Example),
+ newSchemaValidator(schema, s.spec.Spec(), path.child(swaggerExample), s.KnownFormats, ex.schemaOptions).Validate(schema.Example),
)
}
if schema.Items != nil {
if schema.Items.Schema != nil {
- res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+".items.example", in, schema.Items.Schema))
+ res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.child(jsonItems), in, schema.Items.Schema))
}
// Multiple schemas in items
if schema.Items.Schemas != nil { // Safeguard
for i, sch := range schema.Items.Schemas {
- res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("%s.items[%d].example", path, i), in, &sch)) //#nosec
+ res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.child(jsonItems).item(i), in, &sch)) //#nosec
}
}
}
if _, err := compileRegexp(schema.Pattern); err != nil {
- res.AddErrors(invalidPatternInMsg(path, in, schema.Pattern))
+ res.addErrorsAt(path, invalidPatternInMsg(path.dotted(), in, schema.Pattern))
}
if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil {
// NOTE: we keep validating values, even though additionalItems is unsupported in Swagger 2.0 (and 3.0 as well)
- res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+".additionalItems", in, schema.AdditionalItems.Schema))
+ res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.child(jsonAdditionalItems), in, schema.AdditionalItems.Schema))
}
- for propName, prop := range schema.Properties {
- res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec
+ for _, propName := range sortedKeys(schema.Properties) {
+ prop := schema.Properties[propName]
+ res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.structuralChild(jsonProperties).child(propName), in, &prop))
}
- for propName, prop := range schema.PatternProperties {
- res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec
+ for _, propName := range sortedKeys(schema.PatternProperties) {
+ prop := schema.PatternProperties[propName]
+ res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.structuralChild(jsonPatternProperties).child(propName), in, &prop))
}
if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil {
- res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+".additionalProperties", in, schema.AdditionalProperties.Schema))
+ res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.child(jsonAdditionalProperties), in, schema.AdditionalProperties.Schema))
}
if schema.AllOf != nil {
for i, aoSch := range schema.AllOf {
- res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("%s.allOf[%d]", path, i), in, &aoSch)) //#nosec
+ res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.child(jsonAllOf).item(i), in, &aoSch)) //#nosec
}
}
return res
@@ -268,8 +283,8 @@ func (ex *exampleValidator) validateExampleValueSchemaAgainstSchema(path, in str
// NOTE: Temporary duplicated code. Need to refactor with examples
//
-func (ex *exampleValidator) validateExampleValueItemsAgainstSchema(path, in string, root any, items *spec.Items) *Result {
- res := pools.poolOfResults.BorrowResult()
+func (ex *exampleValidator) validateExampleValueItemsAgainstSchema(path pathSegments, in string, root any, items *spec.Items) *Result {
+ res := validatorPools.results.Borrow()
s := ex.SpecValidator
if items != nil {
if items.Example != nil {
@@ -278,10 +293,10 @@ func (ex *exampleValidator) validateExampleValueItemsAgainstSchema(path, in stri
)
}
if items.Items != nil {
- res.Merge(ex.validateExampleValueItemsAgainstSchema(path+"[0].example", in, root, items.Items))
+ res.Merge(ex.validateExampleValueItemsAgainstSchema(path.item(0), in, root, items.Items))
}
if _, err := compileRegexp(items.Pattern); err != nil {
- res.AddErrors(invalidPatternInMsg(path, in, items.Pattern))
+ res.addErrorsAt(path, invalidPatternInMsg(path.dotted(), in, items.Pattern))
}
}
diff --git a/vendor/github.com/go-openapi/validate/formats.go b/vendor/github.com/go-openapi/validate/formats.go
index eab2615376..23359e35dd 100644
--- a/vendor/github.com/go-openapi/validate/formats.go
+++ b/vendor/github.com/go-openapi/validate/formats.go
@@ -11,21 +11,21 @@ import (
)
type formatValidator struct {
- Path string
+ Path pathSegments
In string
Format string
KnownFormats strfmt.Registry
Options *SchemaValidatorOptions
}
-func newFormatValidator(path, in, format string, formats strfmt.Registry, opts *SchemaValidatorOptions) *formatValidator {
+func newFormatValidator(path pathSegments, in, format string, formats strfmt.Registry, opts *SchemaValidatorOptions) *formatValidator {
if opts == nil {
opts = new(SchemaValidatorOptions)
}
var f *formatValidator
if opts.recycleValidators {
- f = pools.poolOfFormatValidators.BorrowValidator()
+ f = validatorPools.formatValidators.Borrow()
} else {
f = new(formatValidator)
}
@@ -39,10 +39,6 @@ func newFormatValidator(path, in, format string, formats strfmt.Registry, opts *
return f
}
-func (f *formatValidator) SetPath(path string) {
- f.Path = path
-}
-
func (f *formatValidator) Applies(source any, kind reflect.Kind) bool {
if source == nil || f.KnownFormats == nil {
return false
@@ -71,7 +67,7 @@ func (f *formatValidator) Validate(val any) *Result {
var result *Result
if f.Options.recycleResult {
- result = pools.poolOfResults.BorrowResult()
+ result = validatorPools.results.Borrow()
} else {
result = new(Result)
}
@@ -81,13 +77,17 @@ func (f *formatValidator) Validate(val any) *Result {
return result
}
- if err := FormatOf(f.Path, f.In, f.Format, str, f.KnownFormats); err != nil {
- result.AddErrors(err)
+ if err := FormatOf(f.Path.dotted(), f.In, f.Format, str, f.KnownFormats); err != nil {
+ result.addErrorsAt(f.Path, err)
}
return result
}
+func (f *formatValidator) setPath(path pathSegments) {
+ f.Path = path
+}
+
func (f *formatValidator) redeem() {
- pools.poolOfFormatValidators.RedeemValidator(f)
+ validatorPools.formatValidators.Redeem(f)
}
diff --git a/vendor/github.com/go-openapi/validate/helpers.go b/vendor/github.com/go-openapi/validate/helpers.go
index 8a1a231283..62deb97d0e 100644
--- a/vendor/github.com/go-openapi/validate/helpers.go
+++ b/vendor/github.com/go-openapi/validate/helpers.go
@@ -12,6 +12,7 @@ import (
"strings"
"github.com/go-openapi/errors"
+ "github.com/go-openapi/jsonpointer"
"github.com/go-openapi/spec"
)
@@ -33,13 +34,78 @@ const (
)
const (
- jsonProperties = "properties"
- jsonItems = "items"
- jsonType = "type"
- // jsonSchema = "schema".
- jsonDefault = "default"
+ jsonProperties = "properties"
+ jsonPatternProperties = "patternProperties"
+ jsonItems = "items"
+ jsonType = "type"
+ jsonSchema = "schema"
+ jsonRequired = "required"
+ jsonRef = "$ref"
+ jsonDefault = "default"
+
+ jsonAllOf = "allOf"
+ jsonAnyOf = "anyOf"
+ jsonOneOf = "oneOf"
+ jsonNot = "not"
+ jsonAdditionalItems = "additionalItems"
+ jsonAdditionalProperties = "additionalProperties"
+
+ swaggerPaths = "paths"
+ swaggerDefinitions = "definitions"
+ swaggerResponses = "responses"
+ swaggerParameters = "parameters"
+ swaggerHeaders = "headers"
+ swaggerOperationID = "operationId"
+
+ jsonMimeApplicationJSON = "application/json"
)
+// operationPath locates an operation in the spec document.
+func operationPath(path, method string) pathSegments {
+ return newPathSegments(swaggerPaths, path, methodToken(method))
+}
+
+// parameterPath locates a parameter of an operation in the spec document.
+func (s *SpecValidator) parameterPath(path, method, in, name string) pathSegments {
+ return s.paramLocations.at(path, method, in, name)
+}
+
+// responsePath locates a response of an operation in the spec document.
+func responsePath(path, method, responseCode string) pathSegments {
+ return operationPath(path, method).children(swaggerResponses, responseCode)
+}
+
+// responseHeaderPath locates a header declared by a response.
+func responseHeaderPath(path, method, responseCode, header string) pathSegments {
+ return responsePath(path, method, responseCode).children(swaggerHeaders, header)
+}
+
+// methodToken normalizes an HTTP method into the key under which the operation
+// is found in the document: the analyzer hands them over in upper case, but a
+// path item spells them in lower case.
+func methodToken(method string) string {
+ return strings.ToLower(method)
+}
+
+// localRefPath turns a local JSON reference such as "#/definitions/Pet" into
+// the location of what it points to.
+//
+// It yields the document root for anything that does not address a local
+// fragment, a remote reference in particular.
+func localRefPath(ref string) pathSegments {
+ rest, isLocal := strings.CutPrefix(ref, "#/")
+ if !isLocal {
+ return rootPath()
+ }
+
+ tokens := strings.Split(rest, "/")
+ for i, token := range tokens {
+ tokens[i] = jsonpointer.Unescape(token)
+ }
+
+ return newPathSegments(tokens...)
+}
+
const (
stringFormatDate = "date"
stringFormatDateTime = "date-time"
@@ -91,24 +157,33 @@ type errorHelper struct {
}
func (h *errorHelper) sErr(err errors.Error, recycle bool) *Result {
- // Builds a Result from standard errors.Error
+ return h.sErrAt(nil, err, recycle)
+}
+
+// sErrAt builds a Result from a standard errors.Error reported at a known location.
+func (h *errorHelper) sErrAt(at pathSegments, err errors.Error, recycle bool) *Result {
var result *Result
if recycle {
- result = pools.poolOfResults.BorrowResult()
+ result = validatorPools.results.Borrow()
} else {
result = new(Result)
}
- result.Errors = []error{err}
+ result.addErrorsAt(at, err)
return result
}
func (h *errorHelper) addPointerError(res *Result, err error, ref string, fromPath string) *Result {
- // Provides more context on error messages
- // reported by the jsoinpointer package by altering the passed Result
+ return h.addPointerErrorAt(res, nil, err, ref, fromPath)
+}
+
+// addPointerErrorAt provides more context on error messages reported by the
+// jsonpointer package, by altering the passed Result.
+func (h *errorHelper) addPointerErrorAt(res *Result, at pathSegments, err error, ref string, fromPath string) *Result {
if err != nil {
- res.AddErrors(cannotResolveRefMsg(fromPath, ref, err))
+ res.addErrorsAt(at, cannotResolveRefMsg(fromPath, ref, err))
}
+
return res
}
@@ -222,15 +297,19 @@ func (h *paramHelper) safeExpandedParamsFor(path, method, operationID string, re
// remove params with invalid expansion from Slice
operation.Parameters = resolvedParams
- for _, ppr := range s.expandedAnalyzer().SafeParamsFor(method, path,
+ // the analyzer keys parameters by name and location: walk those keys in
+ // order, so that findings about an operation's parameters come out the
+ // same way on every run
+ safeParams := s.expandedAnalyzer().SafeParamsFor(method, path,
func(_ spec.Parameter, err error) bool {
// since params have already been expanded, there are few causes for error
- res.AddErrors(someParametersBrokenMsg(path, method, operationID))
+ res.addErrorsAt(operationPath(path, method), someParametersBrokenMsg(path, method, operationID))
// original error from analyzer
- res.AddErrors(err)
+ res.addErrorsAt(operationPath(path, method), err)
return true
- }) {
- params = append(params, ppr)
+ })
+ for _, k := range sortedKeys(safeParams) {
+ params = append(params, safeParams[k])
}
}
return
@@ -242,21 +321,23 @@ func (h *paramHelper) resolveParam(path, method, operationID string, param *spec
res := new(Result)
isRef := param.Ref.String() != ""
if s.spec.SpecFilePath() == "" {
- err = spec.ExpandParameterWithRoot(param, s.spec.Spec(), nil)
+ err = spec.ExpandParameterWithOptions(param, s.spec.Spec(), nil, s.schemaOptions.expandOptions(""))
} else {
- err = spec.ExpandParameter(param, s.spec.SpecFilePath())
+ err = spec.ExpandParameterWithOptions(param, nil, nil, s.schemaOptions.expandOptions(s.spec.SpecFilePath()))
}
if err != nil { // Safeguard
// NOTE: we may enter here when the whole parameter is an unresolved $ref
refPath := strings.Join([]string{"\"" + path + "\"", method}, ".")
- errorHelp.addPointerError(res, err, param.Ref.String(), refPath)
+ errorHelp.addPointerErrorAt(res, s.parameterPath(path, method, param.In, param.Name), err, param.Ref.String(), refPath)
return nil, res
}
- res.Merge(h.checkExpandedParam(param, param.Name, param.In, operationID, isRef))
+ res.Merge(h.checkExpandedParam(param, param.Name, param.In, operationID, s.parameterPath(path, method, param.In, param.Name), isRef))
return param, res
}
-func (h *paramHelper) checkExpandedParam(pr *spec.Parameter, path, in, operation string, isRef bool) *Result {
+func (h *paramHelper) checkExpandedParam(
+ pr *spec.Parameter, path, in, operation string, at pathSegments, isRef bool,
+) *Result {
// Secure parameter structure after $ref resolution
res := new(Result)
simpleZero := spec.SimpleSchema{}
@@ -267,17 +348,17 @@ func (h *paramHelper) checkExpandedParam(pr *spec.Parameter, path, in, operation
// Most likely, a $ref with a sibling is an unwanted situation: in itself this is a warning...
// but we detect it because of the following error:
// schema took over Parameter for an unexplained reason
- res.AddWarnings(refShouldNotHaveSiblingsMsg(path, operation))
+ res.addWarningsAt(at, refShouldNotHaveSiblingsMsg(path, operation))
}
- res.AddErrors(invalidParameterDefinitionMsg(path, in, operation))
+ res.addErrorsAt(at, invalidParameterDefinitionMsg(path, in, operation))
case pr.In != swaggerBody && pr.Schema != nil:
if isRef {
- res.AddWarnings(refShouldNotHaveSiblingsMsg(path, operation))
+ res.addWarningsAt(at, refShouldNotHaveSiblingsMsg(path, operation))
}
- res.AddErrors(invalidParameterDefinitionAsSchemaMsg(path, in, operation))
+ res.addErrorsAt(at, invalidParameterDefinitionAsSchemaMsg(path, in, operation))
case (pr.In == swaggerBody && pr.Schema == nil) || (pr.In != swaggerBody && pr.SimpleSchema == simpleZero):
// Other unexpected mishaps
- res.AddErrors(invalidParameterDefinitionMsg(path, in, operation))
+ res.addErrorsAt(at, invalidParameterDefinitionMsg(path, in, operation))
}
return res
}
@@ -288,20 +369,20 @@ type responseHelper struct {
func (r *responseHelper) expandResponseRef(
response *spec.Response,
- path string, s *SpecValidator,
+ path string, at pathSegments, s *SpecValidator,
) (*spec.Response, *Result) {
// Ensure response is expanded
var err error
res := new(Result)
if s.spec.SpecFilePath() == "" {
// there is no physical document to resolve $ref in response
- err = spec.ExpandResponseWithRoot(response, s.spec.Spec(), nil)
+ err = spec.ExpandResponseWithOptions(response, s.spec.Spec(), nil, s.schemaOptions.expandOptions(""))
} else {
- err = spec.ExpandResponse(response, s.spec.SpecFilePath())
+ err = spec.ExpandResponseWithOptions(response, nil, nil, s.schemaOptions.expandOptions(s.spec.SpecFilePath()))
}
if err != nil { // Safeguard
// NOTE: we may enter here when the whole response is an unresolved $ref.
- errorHelp.addPointerError(res, err, response.Ref.String(), path)
+ errorHelp.addPointerErrorAt(res, at, err, response.Ref.String(), path)
return nil, res
}
diff --git a/vendor/github.com/go-openapi/validate/object_validator.go b/vendor/github.com/go-openapi/validate/object_validator.go
index e651b3f70f..4f1dd15a29 100644
--- a/vendor/github.com/go-openapi/validate/object_validator.go
+++ b/vendor/github.com/go-openapi/validate/object_validator.go
@@ -4,7 +4,6 @@
package validate
import (
- "fmt"
"reflect"
"strings"
@@ -14,7 +13,7 @@ import (
)
type objectValidator struct {
- Path string
+ Path pathSegments
In string
MaxProperties *int64
MinProperties *int64
@@ -25,10 +24,9 @@ type objectValidator struct {
Root any
KnownFormats strfmt.Registry
Options *SchemaValidatorOptions
- splitPath []string
}
-func newObjectValidator(path, in string,
+func newObjectValidator(path pathSegments, in string,
maxProperties, minProperties *int64, required []string, properties spec.SchemaProperties,
additionalProperties *spec.SchemaOrBool, patternProperties spec.SchemaProperties,
root any, formats strfmt.Registry, opts *SchemaValidatorOptions,
@@ -39,7 +37,7 @@ func newObjectValidator(path, in string,
var v *objectValidator
if opts.recycleValidators {
- v = pools.poolOfObjectValidators.BorrowValidator()
+ v = validatorPools.objectValidators.Borrow()
} else {
v = new(objectValidator)
}
@@ -55,7 +53,6 @@ func newObjectValidator(path, in string,
v.Root = root
v.KnownFormats = formats
v.Options = opts
- v.splitPath = strings.Split(v.Path, ".")
return v
}
@@ -72,21 +69,21 @@ func (o *objectValidator) Validate(data any) *Result {
var ok bool
val, ok = data.(map[string]any)
if !ok {
- return errorHelp.sErr(invalidObjectMsg(o.Path, o.In), o.Options.recycleResult)
+ return errorHelp.sErrAt(o.Path, invalidObjectMsg(o.Path.dotted(), o.In), o.Options.recycleResult)
}
}
numKeys := int64(len(val))
if o.MinProperties != nil && numKeys < *o.MinProperties {
- return errorHelp.sErr(errors.TooFewProperties(o.Path, o.In, *o.MinProperties), o.Options.recycleResult)
+ return errorHelp.sErrAt(o.Path, errors.TooFewProperties(o.Path.dotted(), o.In, *o.MinProperties), o.Options.recycleResult)
}
if o.MaxProperties != nil && numKeys > *o.MaxProperties {
- return errorHelp.sErr(errors.TooManyProperties(o.Path, o.In, *o.MaxProperties), o.Options.recycleResult)
+ return errorHelp.sErrAt(o.Path, errors.TooManyProperties(o.Path.dotted(), o.In, *o.MaxProperties), o.Options.recycleResult)
}
var res *Result
if o.Options.recycleResult {
- res = pools.poolOfResults.BorrowResult()
+ res = validatorPools.results.Borrow()
} else {
res = new(Result)
}
@@ -106,7 +103,8 @@ func (o *objectValidator) Validate(data any) *Result {
// Check patternProperties
// NOTE: it looks like we have done that twice in many cases
- for key, value := range val {
+ for _, key := range sortedKeys(val) {
+ value := val[key]
_, regularProperty := o.Properties[key]
matched, _, patterns := o.validatePatternProperty(key, value, res) // applies to regular properties as well
if regularProperty || !matched {
@@ -115,7 +113,7 @@ func (o *objectValidator) Validate(data any) *Result {
for _, pName := range patterns {
if v, ok := o.PatternProperties[pName]; ok {
- r := newSchemaValidator(&v, o.Root, o.Path+"."+key, o.KnownFormats, o.Options).Validate(value)
+ r := newSchemaValidator(&v, o.Root, o.Path.child(key), o.KnownFormats, o.Options).Validate(value)
res.mergeForField(data.(map[string]any), key, r) //nolint:forcetypeassert // data is always map[string]any at this point
}
}
@@ -124,11 +122,6 @@ func (o *objectValidator) Validate(data any) *Result {
return res
}
-func (o *objectValidator) SetPath(path string) {
- o.Path = path
- o.splitPath = strings.Split(path, ".")
-}
-
func (o *objectValidator) Applies(source any, kind reflect.Kind) bool {
// NOTE: this should also work for structs
// there is a problem in the type validator where it will be unhappy about null values
@@ -137,19 +130,29 @@ func (o *objectValidator) Applies(source any, kind reflect.Kind) bool {
return isSchema && (kind == reflect.Map || kind == reflect.Struct)
}
+// The three predicates below tell what kind of content the validated object
+// is, so that schema-only checks are not run against plain data.
+//
+// Array indices are trimmed first: an element of an example is example data
+// just as much as the example itself.
+
func (o *objectValidator) isProperties() bool {
- p := o.splitPath
- return len(p) > 1 && p[len(p)-1] == jsonProperties && p[len(p)-2] != jsonProperties
+ p := o.Path.trimIndexes()
+
+ return p.last() == jsonProperties && p.beforeLast() != jsonProperties
}
func (o *objectValidator) isDefault() bool {
- p := o.splitPath
- return len(p) > 1 && p[len(p)-1] == jsonDefault && p[len(p)-2] != jsonDefault
+ p := o.Path.trimIndexes()
+
+ return p.last() == jsonDefault && p.beforeLast() != jsonDefault
}
func (o *objectValidator) isExample() bool {
- p := o.splitPath
- return len(p) > 1 && (p[len(p)-1] == swaggerExample || p[len(p)-1] == swaggerExamples) && p[len(p)-2] != swaggerExample
+ p := o.Path.trimIndexes()
+ last := p.last()
+
+ return (last == swaggerExample || last == swaggerExamples) && p.beforeLast() != swaggerExample
}
func (o *objectValidator) checkArrayMustHaveItems(res *Result, val map[string]any) {
@@ -174,7 +177,7 @@ func (o *objectValidator) checkArrayMustHaveItems(res *Result, val map[string]an
return
}
- res.AddErrors(errors.Required(jsonItems, o.Path, item))
+ res.addErrorsAt(o.Path, errors.Required(jsonItems, o.Path.dotted(), item))
}
func (o *objectValidator) checkItemsMustBeTypeArray(res *Result, val map[string]any) {
@@ -194,11 +197,11 @@ func (o *objectValidator) checkItemsMustBeTypeArray(res *Result, val map[string]
t, typeFound := val[jsonType]
if !typeFound {
// there is no type
- res.AddErrors(errors.Required(jsonType, o.Path, t))
+ res.addErrorsAt(o.Path, errors.Required(jsonType, o.Path.dotted(), t))
}
if tpe, isString := t.(string); !isString || tpe != arrayType {
- res.AddErrors(errors.InvalidType(o.Path, o.In, arrayType, nil))
+ res.addErrorsAt(o.Path, errors.InvalidType(o.Path.dotted(), o.In, arrayType, nil))
}
}
@@ -212,7 +215,7 @@ func (o *objectValidator) precheck(res *Result, val map[string]any) {
}
func (o *objectValidator) validateNoAdditionalProperties(val map[string]any, res *Result) {
- for k := range val {
+ for _, k := range sortedKeys(val) {
if k == "$schema" || k == "id" {
// special properties "$schema" and "id" are ignored
continue
@@ -238,7 +241,7 @@ func (o *objectValidator) validateNoAdditionalProperties(val map[string]any, res
continue
}
- res.AddErrors(errors.PropertyNotAllowed(o.Path, o.In, k))
+ res.addErrorsAt(o.Path.child(k), errors.PropertyNotAllowed(o.Path.dotted(), o.In, k))
// BUG(fredbi): This section should move to a part dedicated to spec validation as
// it will conflict with regular schemas where a property "headers" is defined.
@@ -261,7 +264,8 @@ func (o *objectValidator) validateNoAdditionalProperties(val map[string]any, res
continue
}
- for headerKey, headerBody := range headers {
+ for _, headerKey := range sortedKeys(headers) {
+ headerBody := headers[headerKey]
if headerBody == nil {
continue
}
@@ -282,7 +286,7 @@ func (o *objectValidator) validateNoAdditionalProperties(val map[string]any, res
}
msg := strings.Join([]string{", one may not use $ref=\":", refString, "\""}, "")
- res.AddErrors(refNotAllowedInHeaderMsg(o.Path, headerKey, msg))
+ res.addErrorsAt(o.Path, refNotAllowedInHeaderMsg(o.Path.dotted(), headerKey, msg))
/*
case "$ref":
if val[k] != nil {
@@ -294,7 +298,8 @@ func (o *objectValidator) validateNoAdditionalProperties(val map[string]any, res
}
func (o *objectValidator) validateAdditionalProperties(val map[string]any, res *Result) {
- for key, value := range val {
+ for _, key := range sortedKeys(val) {
+ value := val[key]
_, regularProperty := o.Properties[key]
if regularProperty {
continue
@@ -315,7 +320,7 @@ func (o *objectValidator) validateAdditionalProperties(val map[string]any, res *
// Cases: properties which are not regular properties and have not been matched by the PatternProperties validator
// AdditionalProperties as Schema
- r := newSchemaValidator(o.AdditionalProperties.Schema, o.Root, o.Path+"."+key, o.KnownFormats, o.Options).Validate(value)
+ r := newSchemaValidator(o.AdditionalProperties.Schema, o.Root, o.Path.child(key), o.KnownFormats, o.Options).Validate(value)
res.mergeForField(val, key, r)
}
// Valid cases: additionalProperties: true or undefined
@@ -326,19 +331,14 @@ func (o *objectValidator) validatePropertiesSchema(val map[string]any, res *Resu
// Property types:
// - regular Property
- pSchema := pools.poolOfSchemas.BorrowSchema() // recycle a spec.Schema object which lifespan extends only to the validation of properties
+ pSchema := validatorPools.schemas.Borrow() // recycle a spec.Schema object which lifespan extends only to the validation of properties
defer func() {
- pools.poolOfSchemas.RedeemSchema(pSchema)
+ validatorPools.schemas.Redeem(pSchema)
}()
- for pName := range o.Properties {
+ for _, pName := range sortedKeys(o.Properties) {
*pSchema = o.Properties[pName]
- var rName string
- if o.Path == "" {
- rName = pName
- } else {
- rName = o.Path + "." + pName
- }
+ rName := o.Path.child(pName)
// Recursively validates each property against its schema
v, ok := val[pName]
@@ -374,7 +374,9 @@ func (o *objectValidator) validatePropertiesSchema(val map[string]any, res *Resu
continue
}
- res.AddErrors(errors.Required(fmt.Sprintf("%s.%s", o.Path, k), o.In, v))
+ // located on the object that lacks the property: the property itself
+ // has no node to point at, and the object is what has to be amended
+ res.addErrorsAt(o.Path, errors.Required(o.Path.child(k).dotted(), o.In, v))
}
}
@@ -388,12 +390,12 @@ func (o *objectValidator) validatePatternProperty(key string, value any, result
succeededOnce := false
patterns := make([]string, 0, len(o.PatternProperties))
- schema := pools.poolOfSchemas.BorrowSchema()
+ schema := validatorPools.schemas.Borrow()
defer func() {
- pools.poolOfSchemas.RedeemSchema(schema)
+ validatorPools.schemas.Redeem(schema)
}()
- for k := range o.PatternProperties {
+ for _, k := range sortedKeys(o.PatternProperties) {
re, err := compileRegexp(k)
if err != nil {
continue
@@ -407,7 +409,7 @@ func (o *objectValidator) validatePatternProperty(key string, value any, result
*schema = o.PatternProperties[k]
patterns = append(patterns, k)
matched = true
- validator := newSchemaValidator(schema, o.Root, fmt.Sprintf("%s.%s", o.Path, key), o.KnownFormats, o.Options)
+ validator := newSchemaValidator(schema, o.Root, o.Path.child(key), o.KnownFormats, o.Options)
res := validator.Validate(value)
result.Merge(res)
@@ -416,6 +418,10 @@ func (o *objectValidator) validatePatternProperty(key string, value any, result
return matched, succeededOnce, patterns
}
+func (o *objectValidator) setPath(path pathSegments) {
+ o.Path = path
+}
+
func (o *objectValidator) redeem() {
- pools.poolOfObjectValidators.RedeemValidator(o)
+ validatorPools.objectValidators.Redeem(o)
}
diff --git a/vendor/github.com/go-openapi/validate/param_locations.go b/vendor/github.com/go-openapi/validate/param_locations.go
new file mode 100644
index 0000000000..703d6ca17f
--- /dev/null
+++ b/vendor/github.com/go-openapi/validate/param_locations.go
@@ -0,0 +1,122 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package validate
+
+import (
+ "strconv"
+
+ "github.com/go-openapi/spec"
+)
+
+// paramLocations tells where an operation declares a parameter.
+//
+// Parameters are held in an array, so a name is not how a document addresses
+// one: only its index is. The index is not something a validator can work out
+// from an expanded parameter either, because expansion merges the parameters
+// an operation declares with those its path item declares, and resolves the
+// ones written as a $ref. So the unexpanded document is indexed once, and
+// looked up by what a validator does know: the operation, and the name and
+// location of the parameter it is reporting on.
+type paramLocations map[paramKey]pathSegments
+
+// paramKey identifies a parameter the way the swagger specification does:
+// a name is unique only within an "in".
+type paramKey struct {
+ path string
+ method string
+ in string
+ name string
+}
+
+// newParamLocations indexes the parameters declared by an unexpanded document.
+func newParamLocations(sp *spec.Swagger) paramLocations {
+ locations := make(paramLocations)
+ if sp == nil || sp.Paths == nil {
+ return locations
+ }
+
+ for path, pathItem := range sp.Paths.Paths {
+ at := newPathSegments(swaggerPaths, path)
+
+ // parameters declared by the path item are shared by all its
+ // operations: recorded once, without a method
+ locations.collect(sp, paramKey{path: path}, at, pathItem.Parameters)
+
+ for method, op := range operationsOf(&pathItem) { //#nosec
+ if op == nil {
+ continue
+ }
+
+ locations.collect(sp, paramKey{path: path, method: method}, at.child(method), op.Parameters)
+ }
+ }
+
+ return locations
+}
+
+// at returns where an operation declares a parameter.
+//
+// A parameter the operation does not declare itself may come from its path
+// item. When neither knows it, which happens for a parameter too broken to be
+// identified, the pointer stops on the array holding it and the name is kept
+// for the message alone: an index no one could work out would be a guess.
+func (l paramLocations) at(path, method, in, name string) pathSegments {
+ if found, isDeclared := l[paramKey{path: path, method: methodToken(method), in: in, name: name}]; isDeclared {
+ return found
+ }
+
+ if found, isDeclared := l[paramKey{path: path, in: in, name: name}]; isDeclared {
+ return found
+ }
+
+ return operationPath(path, method).child(swaggerParameters).cosmeticChild(name)
+}
+
+func (l paramLocations) collect(sp *spec.Swagger, key paramKey, at pathSegments, params []spec.Parameter) {
+ for i := range params {
+ name, in, ok := parameterIdentity(sp, ¶ms[i])
+ if !ok {
+ continue
+ }
+
+ key.name = name
+ key.in = in
+ l[key] = at.child(swaggerParameters).childAs(strconv.Itoa(i), name)
+ }
+}
+
+// parameterIdentity names a parameter as declared, resolving the one indirection
+// a document may put in the way: an entry written as a local $ref.
+func parameterIdentity(sp *spec.Swagger, param *spec.Parameter) (name, in string, ok bool) {
+ if param.Ref.String() == "" {
+ return param.Name, param.In, param.Name != ""
+ }
+
+ shared := localRefPath(param.Ref.String())
+ const sharedParameterDepth = 2
+ if len(shared) != sharedParameterDepth || shared.beforeLast() != swaggerParameters {
+ return "", "", false
+ }
+
+ declared, isDeclared := sp.Parameters[shared.last()]
+ if !isDeclared {
+ return "", "", false
+ }
+
+ return declared.Name, declared.In, declared.Name != ""
+}
+
+// operationsOf yields the operations of a path item, keyed as the document
+// spells them.
+func operationsOf(pathItem *spec.PathItem) map[string]*spec.Operation {
+ return map[string]*spec.Operation{
+ "get": pathItem.Get,
+ "put": pathItem.Put,
+ "post": pathItem.Post,
+ "delete": pathItem.Delete,
+ "options": pathItem.Options,
+ "head": pathItem.Head,
+ "patch": pathItem.Patch,
+ }
+}
diff --git a/vendor/github.com/go-openapi/validate/path.go b/vendor/github.com/go-openapi/validate/path.go
new file mode 100644
index 0000000000..940fc4be55
--- /dev/null
+++ b/vendor/github.com/go-openapi/validate/path.go
@@ -0,0 +1,269 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package validate
+
+import (
+ "slices"
+ "strconv"
+ "strings"
+
+ "github.com/go-openapi/jsonpointer"
+)
+
+// pathSegments is the location of a validated value inside a document,
+// held as an ordered list of unescaped JSON pointer reference tokens.
+//
+// Validators build a location by appending tokens as they descend into
+// properties and array items, then render it only when they report an error.
+// Keeping the tokens apart until then is what makes it possible to produce a
+// valid [RFC 6901] JSON pointer: a token is escaped when it is rendered, and
+// the separator can never be confused with a token that contains one.
+//
+// The zero value is the location of the document root.
+//
+// [RFC 6901]: https://datatracker.ietf.org/doc/html/rfc6901
+type pathSegments []pathToken
+
+// pathToken is one step of a location.
+//
+// A token addresses a member the way the document does, which is not always
+// the way a reader recognizes it: an operation addresses its parameters by
+// index, while a message is far more useful naming them. When the two differ,
+// display carries the readable form and only the message uses it.
+type pathToken struct {
+ token string
+ display string
+
+ // structural marks a token a document needs to address the value, but
+ // that messages have never shown: a "properties" between a schema and one
+ // of its members, say. It is part of the pointer and absent from the
+ // dotted form.
+ structural bool
+
+ // cosmetic is the converse: a token messages name but that the document
+ // does not address, such as a parameter too broken to be found by name in
+ // the array holding it. It is part of the dotted form and absent from the
+ // pointer, which then stops at the deepest node the document does contain.
+ cosmetic bool
+}
+
+// readable renders a token the way a message should spell it.
+func (t pathToken) readable() string {
+ if t.display != "" {
+ return t.display
+ }
+
+ return t.token
+}
+
+// newPathSegments builds a location from a list of unescaped tokens.
+func newPathSegments(tokens ...string) pathSegments {
+ if len(tokens) == 0 {
+ return nil
+ }
+
+ segments := make(pathSegments, len(tokens))
+ for i, token := range tokens {
+ segments[i] = pathToken{token: token}
+ }
+
+ return segments
+}
+
+// rootPath is the location of the document root.
+func rootPath() pathSegments { return nil }
+
+// String implements [fmt.Stringer] with the legacy dotted notation, so that a
+// location interpolated into a message reads as it always has.
+func (p pathSegments) String() string { return p.dotted() }
+
+// child returns the location of a named member of the value at p.
+//
+// The receiver is never modified: sibling children may be derived from the
+// same parent without aliasing one another.
+func (p pathSegments) child(token string) pathSegments {
+ return p.appendToken(pathToken{token: token})
+}
+
+// childAs returns the location of a member the document addresses as token,
+// which messages should spell as display instead.
+func (p pathSegments) childAs(token, display string) pathSegments {
+ return p.appendToken(pathToken{token: token, display: display})
+}
+
+// structuralChild returns the location of a member a document addresses but
+// messages do not name.
+func (p pathSegments) structuralChild(token string) pathSegments {
+ return p.appendToken(pathToken{token: token, structural: true})
+}
+
+// cosmeticChild returns a location that messages spell as a member named token,
+// while the pointer stays on p.
+func (p pathSegments) cosmeticChild(token string) pathSegments {
+ return p.appendToken(pathToken{token: token, cosmetic: true})
+}
+
+func (p pathSegments) appendToken(token pathToken) pathSegments {
+ child := make(pathSegments, len(p)+1)
+ copy(child, p)
+ child[len(p)] = p.inherit(token)
+
+ return child
+}
+
+// inherit passes down what a parent token says about addressability: nothing
+// below a token the document does not address is addressable either, so the
+// pointer has to stop at the same place.
+func (p pathSegments) inherit(token pathToken) pathToken {
+ if len(p) > 0 && p[len(p)-1].cosmetic {
+ token.cosmetic = true
+ }
+
+ return token
+}
+
+// children returns the location of a chain of named members below p.
+func (p pathSegments) children(tokens ...string) pathSegments {
+ child := make(pathSegments, len(p)+len(tokens))
+ copy(child, p)
+ for i, token := range tokens {
+ child[len(p)+i] = child[:len(p)+i].inherit(pathToken{token: token})
+ }
+
+ return child
+}
+
+// item returns the location of the index'th element of the array at p.
+func (p pathSegments) item(index int) pathSegments {
+ return p.child(strconv.Itoa(index))
+}
+
+// isEmpty tells if p locates the document root.
+func (p pathSegments) isEmpty() bool { return len(p) == 0 }
+
+// last returns the trailing meaningful token, or an empty string at the
+// document root.
+//
+// Structural tokens are skipped: they say how a document addresses the value,
+// not what the value is, and the callers here are asking the latter.
+func (p pathSegments) last() string {
+ if token, ok := p.meaningfulAt(0); ok {
+ return token
+ }
+
+ return ""
+}
+
+// beforeLast returns the meaningful token before the trailing one, or an empty
+// string when p holds fewer than two of them.
+func (p pathSegments) beforeLast() string {
+ if token, ok := p.meaningfulAt(1); ok {
+ return token
+ }
+
+ return ""
+}
+
+// meaningfulAt returns the nth token from the end, counting only the tokens a
+// message would show.
+func (p pathSegments) meaningfulAt(n int) (string, bool) {
+ seen := 0
+ for _, token := range slices.Backward(p) {
+ if token.structural {
+ continue
+ }
+
+ if seen == n {
+ return token.token, true
+ }
+
+ seen++
+ }
+
+ return "", false
+}
+
+// trimIndexes returns p without its trailing array index tokens.
+//
+// It answers "what is this value inside of", disregarding how deep into an
+// array it sits: the items of an example are still an example.
+func (p pathSegments) trimIndexes() pathSegments {
+ end := len(p)
+ for end > 0 && isIndexToken(p[end-1].token) {
+ end--
+ }
+
+ return p[:end]
+}
+
+// isIndexToken tells if a token addresses an array element rather than a member.
+func isIndexToken(token string) bool {
+ if token == "" {
+ return false
+ }
+
+ for _, r := range token {
+ if r < '0' || r > '9' {
+ return false
+ }
+ }
+
+ return true
+}
+
+// hasSuffix tells if p ends with the given sequence of tokens.
+func (p pathSegments) hasSuffix(suffix pathSegments) bool {
+ if len(suffix) > len(p) {
+ return false
+ }
+
+ offset := len(p) - len(suffix)
+ for i, token := range suffix {
+ if p[offset+i].token != token.token {
+ return false
+ }
+ }
+
+ return true
+}
+
+// dotted renders the location in the legacy dot-separated notation, e.g.
+// "definitions.Pet.friends.0.name".
+//
+// Tokens are emitted verbatim: a token containing a dot is indistinguishable
+// from a separator. This notation is kept because it is what surfaces as the
+// name of a validation error, and API consumers of go-swagger servers see it.
+// Use [pathSegments.pointer] whenever the location needs to be unambiguous.
+func (p pathSegments) dotted() string {
+ readable := make([]string, 0, len(p))
+ for _, token := range p {
+ if token.structural {
+ continue
+ }
+
+ readable = append(readable, token.readable())
+ }
+
+ return strings.Join(readable, ".")
+}
+
+// pointer renders the location as an RFC 6901 JSON pointer, e.g.
+// "/definitions/Pet/friends/0/name". The document root renders as "".
+func (p pathSegments) pointer() string {
+ if len(p) == 0 {
+ return ""
+ }
+
+ var w strings.Builder
+ for _, token := range p {
+ if token.cosmetic {
+ continue
+ }
+
+ w.WriteByte('/')
+ w.WriteString(jsonpointer.Escape(token.token))
+ }
+
+ return w.String()
+}
diff --git a/vendor/github.com/go-openapi/validate/pools.go b/vendor/github.com/go-openapi/validate/pools.go
index c8936bd10b..0bc95d1aa6 100644
--- a/vendor/github.com/go-openapi/validate/pools.go
+++ b/vendor/github.com/go-openapi/validate/pools.go
@@ -1,369 +1,87 @@
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0
-//go:build !validatedebug
-
package validate
import (
- "sync"
-
"github.com/go-openapi/spec"
+ "github.com/go-openapi/swag/pools"
)
-var pools allPools
+// validatorPools recycles the objects allocated while validating.
+//
+// Validation allocates a validator per schema node and a result per check, so
+// the same handful of types are built and thrown away constantly. Recycling
+// them is what keeps validating a large specification affordable.
+//
+// Build with the "poolsdebug" tag to have every borrow and redeem tracked:
+// misuse then panics where it happens rather than corrupting a pool, and
+// [pools.AssertNoLeaks] reports what was borrowed and never given back.
+var validatorPools allPools
func init() {
resetPools()
}
+// resetPools builds a fresh set of pools.
+//
+// Recycling an object twice leaves a pool holding it twice, and it would then
+// be handed to two borrowers at once. A test that provokes such misuse has to
+// start the next one from clean pools.
func resetPools() {
- // NOTE: for testing purpose, we might want to reset pools after calling Validate twice.
- // The pool is corrupted in that case: calling Put twice inserts a duplicate in the pool
- // and further calls to Get are mishandled.
-
- pools = allPools{
- poolOfSchemaValidators: schemaValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &SchemaValidator{}
-
- return s
- },
- },
- },
- poolOfObjectValidators: objectValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &objectValidator{}
-
- return s
- },
- },
- },
- poolOfSliceValidators: sliceValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &schemaSliceValidator{}
-
- return s
- },
- },
- },
- poolOfItemsValidators: itemsValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &itemsValidator{}
-
- return s
- },
- },
- },
- poolOfBasicCommonValidators: basicCommonValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &basicCommonValidator{}
-
- return s
- },
- },
- },
- poolOfHeaderValidators: headerValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &HeaderValidator{}
-
- return s
- },
- },
- },
- poolOfParamValidators: paramValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &ParamValidator{}
-
- return s
- },
- },
- },
- poolOfBasicSliceValidators: basicSliceValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &basicSliceValidator{}
-
- return s
- },
- },
- },
- poolOfNumberValidators: numberValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &numberValidator{}
-
- return s
- },
- },
- },
- poolOfStringValidators: stringValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &stringValidator{}
-
- return s
- },
- },
- },
- poolOfSchemaPropsValidators: schemaPropsValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &schemaPropsValidator{}
-
- return s
- },
- },
- },
- poolOfFormatValidators: formatValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &formatValidator{}
-
- return s
- },
- },
- },
- poolOfTypeValidators: typeValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &typeValidator{}
-
- return s
- },
- },
- },
- poolOfSchemas: schemasPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &spec.Schema{}
-
- return s
- },
- },
- },
- poolOfResults: resultsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &Result{}
-
- return s
- },
- },
- },
- }
-}
-
-type (
- allPools struct {
- // memory pools for all validator objects.
- //
- // Each pool can be borrowed from and redeemed to.
- poolOfSchemaValidators schemaValidatorsPool
- poolOfObjectValidators objectValidatorsPool
- poolOfSliceValidators sliceValidatorsPool
- poolOfItemsValidators itemsValidatorsPool
- poolOfBasicCommonValidators basicCommonValidatorsPool
- poolOfHeaderValidators headerValidatorsPool
- poolOfParamValidators paramValidatorsPool
- poolOfBasicSliceValidators basicSliceValidatorsPool
- poolOfNumberValidators numberValidatorsPool
- poolOfStringValidators stringValidatorsPool
- poolOfSchemaPropsValidators schemaPropsValidatorsPool
- poolOfFormatValidators formatValidatorsPool
- poolOfTypeValidators typeValidatorsPool
- poolOfSchemas schemasPool
- poolOfResults resultsPool
- }
-
- schemaValidatorsPool struct {
- *sync.Pool
- }
-
- objectValidatorsPool struct {
- *sync.Pool
- }
-
- sliceValidatorsPool struct {
- *sync.Pool
- }
-
- itemsValidatorsPool struct {
- *sync.Pool
- }
-
- basicCommonValidatorsPool struct {
- *sync.Pool
- }
-
- headerValidatorsPool struct {
- *sync.Pool
- }
-
- paramValidatorsPool struct {
- *sync.Pool
- }
-
- basicSliceValidatorsPool struct {
- *sync.Pool
- }
-
- numberValidatorsPool struct {
- *sync.Pool
- }
-
- stringValidatorsPool struct {
- *sync.Pool
- }
-
- schemaPropsValidatorsPool struct {
- *sync.Pool
- }
-
- formatValidatorsPool struct {
- *sync.Pool
- }
-
- typeValidatorsPool struct {
- *sync.Pool
- }
-
- schemasPool struct {
- *sync.Pool
- }
-
- resultsPool struct {
- *sync.Pool
- }
-)
-
-func (p schemaValidatorsPool) BorrowValidator() *SchemaValidator {
- return p.Get().(*SchemaValidator) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p schemaValidatorsPool) RedeemValidator(s *SchemaValidator) {
- // NOTE: s might be nil. In that case, Put is a noop.
- p.Put(s)
-}
-
-func (p objectValidatorsPool) BorrowValidator() *objectValidator {
- return p.Get().(*objectValidator) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p objectValidatorsPool) RedeemValidator(s *objectValidator) {
- p.Put(s)
-}
-
-func (p sliceValidatorsPool) BorrowValidator() *schemaSliceValidator {
- return p.Get().(*schemaSliceValidator) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p sliceValidatorsPool) RedeemValidator(s *schemaSliceValidator) {
- p.Put(s)
-}
-
-func (p itemsValidatorsPool) BorrowValidator() *itemsValidator {
- return p.Get().(*itemsValidator) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p itemsValidatorsPool) RedeemValidator(s *itemsValidator) {
- p.Put(s)
-}
-
-func (p basicCommonValidatorsPool) BorrowValidator() *basicCommonValidator {
- return p.Get().(*basicCommonValidator) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p basicCommonValidatorsPool) RedeemValidator(s *basicCommonValidator) {
- p.Put(s)
-}
-
-func (p headerValidatorsPool) BorrowValidator() *HeaderValidator {
- return p.Get().(*HeaderValidator) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p headerValidatorsPool) RedeemValidator(s *HeaderValidator) {
- p.Put(s)
-}
-
-func (p paramValidatorsPool) BorrowValidator() *ParamValidator {
- return p.Get().(*ParamValidator) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p paramValidatorsPool) RedeemValidator(s *ParamValidator) {
- p.Put(s)
-}
-
-func (p basicSliceValidatorsPool) BorrowValidator() *basicSliceValidator {
- return p.Get().(*basicSliceValidator) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p basicSliceValidatorsPool) RedeemValidator(s *basicSliceValidator) {
- p.Put(s)
-}
-
-func (p numberValidatorsPool) BorrowValidator() *numberValidator {
- return p.Get().(*numberValidator) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p numberValidatorsPool) RedeemValidator(s *numberValidator) {
- p.Put(s)
-}
-
-func (p stringValidatorsPool) BorrowValidator() *stringValidator {
- return p.Get().(*stringValidator) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p stringValidatorsPool) RedeemValidator(s *stringValidator) {
- p.Put(s)
-}
-
-func (p schemaPropsValidatorsPool) BorrowValidator() *schemaPropsValidator {
- return p.Get().(*schemaPropsValidator) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p schemaPropsValidatorsPool) RedeemValidator(s *schemaPropsValidator) {
- p.Put(s)
-}
-
-func (p formatValidatorsPool) BorrowValidator() *formatValidator {
- return p.Get().(*formatValidator) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p formatValidatorsPool) RedeemValidator(s *formatValidator) {
- p.Put(s)
-}
-
-func (p typeValidatorsPool) BorrowValidator() *typeValidator {
- return p.Get().(*typeValidator) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p typeValidatorsPool) RedeemValidator(s *typeValidator) {
- p.Put(s)
-}
-
-func (p schemasPool) BorrowSchema() *spec.Schema {
- return p.Get().(*spec.Schema) //nolint:forcetypeassert // pool New always returns this type
-}
-
-func (p schemasPool) RedeemSchema(s *spec.Schema) {
- p.Put(s)
-}
-
-func (p resultsPool) BorrowResult() *Result {
- return p.Get().(*Result).cleared() //nolint:forcetypeassert // pool New always returns *Result
-}
-
-func (p resultsPool) RedeemResult(s *Result) {
- if s == emptyResult {
+ validatorPools = allPools{
+ schemaValidators: pools.New[SchemaValidator](),
+ objectValidators: pools.New[objectValidator](),
+ sliceValidators: pools.New[schemaSliceValidator](),
+ itemsValidators: pools.New[itemsValidator](),
+ basicCommonValidators: pools.New[basicCommonValidator](),
+ headerValidators: pools.New[HeaderValidator](),
+ paramValidators: pools.New[ParamValidator](),
+ basicSliceValidators: pools.New[basicSliceValidator](),
+ numberValidators: pools.New[numberValidator](),
+ stringValidators: pools.New[stringValidator](),
+ schemaPropsValidators: pools.New[schemaPropsValidator](),
+ formatValidators: pools.New[formatValidator](),
+ typeValidators: pools.New[typeValidator](),
+ schemas: pools.New[spec.Schema](),
+ results: pools.New[Result](),
+ }
+}
+
+// allPools is the set of pools shared by the validators of this package.
+type allPools struct {
+ schemaValidators *pools.Pool[SchemaValidator]
+ objectValidators *pools.Pool[objectValidator]
+ sliceValidators *pools.Pool[schemaSliceValidator]
+ itemsValidators *pools.Pool[itemsValidator]
+ basicCommonValidators *pools.Pool[basicCommonValidator]
+ headerValidators *pools.Pool[HeaderValidator]
+ paramValidators *pools.Pool[ParamValidator]
+ basicSliceValidators *pools.Pool[basicSliceValidator]
+ numberValidators *pools.Pool[numberValidator]
+ stringValidators *pools.Pool[stringValidator]
+ schemaPropsValidators *pools.Pool[schemaPropsValidator]
+ formatValidators *pools.Pool[formatValidator]
+ typeValidators *pools.Pool[typeValidator]
+ schemas *pools.Pool[spec.Schema]
+ results *pools.Pool[Result]
+}
+
+// redeemResult returns a result to the pool.
+//
+// emptyResult is a shared value that was never borrowed, so it is not the
+// pool's to take back: handing it over would be reported as a foreign redeem,
+// rightly.
+//
+// Results are borrowed straight from the pool rather than through a helper,
+// so that the instrumented build attributes a leak to the code that borrowed it.
+//
+// This wrapper costs that attribution on redeem, where a double redeem still
+// names the offending call site in the panic it raises.
+func redeemResult(r *Result) {
+ if r == emptyResult {
return
}
- p.Put(s)
+
+ validatorPools.results.Redeem(r)
}
diff --git a/vendor/github.com/go-openapi/validate/pools_debug.go b/vendor/github.com/go-openapi/validate/pools_debug.go
deleted file mode 100644
index d123ed4093..0000000000
--- a/vendor/github.com/go-openapi/validate/pools_debug.go
+++ /dev/null
@@ -1,1015 +0,0 @@
-// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
-// SPDX-License-Identifier: Apache-2.0
-
-//go:build validatedebug
-
-package validate
-
-import (
- "fmt"
- "runtime"
- "sync"
- "testing"
-
- "github.com/go-openapi/spec"
-)
-
-// This version of the pools is to be used for debugging and testing, with build tag "validatedebug".
-//
-// In this mode, the pools are tracked for allocation and redemption of borrowed objects, so we can
-// verify a few behaviors of the validators. The debug pools panic when an invalid usage pattern is detected.
-
-var pools allPools
-
-func init() {
- resetPools()
-}
-
-func resetPools() {
- // NOTE: for testing purpose, we might want to reset pools after calling Validate twice.
- // The pool is corrupted in that case: calling Put twice inserts a duplicate in the pool
- // and further calls to Get are mishandled.
-
- pools = allPools{
- poolOfSchemaValidators: schemaValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &SchemaValidator{}
-
- return s
- },
- },
- debugMap: make(map[*SchemaValidator]status),
- allocMap: make(map[*SchemaValidator]string),
- redeemMap: make(map[*SchemaValidator]string),
- },
- poolOfObjectValidators: objectValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &objectValidator{}
-
- return s
- },
- },
- debugMap: make(map[*objectValidator]status),
- allocMap: make(map[*objectValidator]string),
- redeemMap: make(map[*objectValidator]string),
- },
- poolOfSliceValidators: sliceValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &schemaSliceValidator{}
-
- return s
- },
- },
- debugMap: make(map[*schemaSliceValidator]status),
- allocMap: make(map[*schemaSliceValidator]string),
- redeemMap: make(map[*schemaSliceValidator]string),
- },
- poolOfItemsValidators: itemsValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &itemsValidator{}
-
- return s
- },
- },
- debugMap: make(map[*itemsValidator]status),
- allocMap: make(map[*itemsValidator]string),
- redeemMap: make(map[*itemsValidator]string),
- },
- poolOfBasicCommonValidators: basicCommonValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &basicCommonValidator{}
-
- return s
- },
- },
- debugMap: make(map[*basicCommonValidator]status),
- allocMap: make(map[*basicCommonValidator]string),
- redeemMap: make(map[*basicCommonValidator]string),
- },
- poolOfHeaderValidators: headerValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &HeaderValidator{}
-
- return s
- },
- },
- debugMap: make(map[*HeaderValidator]status),
- allocMap: make(map[*HeaderValidator]string),
- redeemMap: make(map[*HeaderValidator]string),
- },
- poolOfParamValidators: paramValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &ParamValidator{}
-
- return s
- },
- },
- debugMap: make(map[*ParamValidator]status),
- allocMap: make(map[*ParamValidator]string),
- redeemMap: make(map[*ParamValidator]string),
- },
- poolOfBasicSliceValidators: basicSliceValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &basicSliceValidator{}
-
- return s
- },
- },
- debugMap: make(map[*basicSliceValidator]status),
- allocMap: make(map[*basicSliceValidator]string),
- redeemMap: make(map[*basicSliceValidator]string),
- },
- poolOfNumberValidators: numberValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &numberValidator{}
-
- return s
- },
- },
- debugMap: make(map[*numberValidator]status),
- allocMap: make(map[*numberValidator]string),
- redeemMap: make(map[*numberValidator]string),
- },
- poolOfStringValidators: stringValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &stringValidator{}
-
- return s
- },
- },
- debugMap: make(map[*stringValidator]status),
- allocMap: make(map[*stringValidator]string),
- redeemMap: make(map[*stringValidator]string),
- },
- poolOfSchemaPropsValidators: schemaPropsValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &schemaPropsValidator{}
-
- return s
- },
- },
- debugMap: make(map[*schemaPropsValidator]status),
- allocMap: make(map[*schemaPropsValidator]string),
- redeemMap: make(map[*schemaPropsValidator]string),
- },
- poolOfFormatValidators: formatValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &formatValidator{}
-
- return s
- },
- },
- debugMap: make(map[*formatValidator]status),
- allocMap: make(map[*formatValidator]string),
- redeemMap: make(map[*formatValidator]string),
- },
- poolOfTypeValidators: typeValidatorsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &typeValidator{}
-
- return s
- },
- },
- debugMap: make(map[*typeValidator]status),
- allocMap: make(map[*typeValidator]string),
- redeemMap: make(map[*typeValidator]string),
- },
- poolOfSchemas: schemasPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &spec.Schema{}
-
- return s
- },
- },
- debugMap: make(map[*spec.Schema]status),
- allocMap: make(map[*spec.Schema]string),
- redeemMap: make(map[*spec.Schema]string),
- },
- poolOfResults: resultsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := &Result{}
-
- return s
- },
- },
- debugMap: make(map[*Result]status),
- allocMap: make(map[*Result]string),
- redeemMap: make(map[*Result]string),
- },
- }
-}
-
-const (
- statusFresh status = iota + 1
- statusRecycled
- statusRedeemed
-)
-
-func (s status) String() string {
- switch s {
- case statusFresh:
- return "fresh"
- case statusRecycled:
- return "recycled"
- case statusRedeemed:
- return "redeemed"
- default:
- panic(fmt.Errorf("invalid status: %d", s))
- }
-}
-
-type (
- // Debug
- status uint8
-
- allPools struct {
- // memory pools for all validator objects.
- //
- // Each pool can be borrowed from and redeemed to.
- poolOfSchemaValidators schemaValidatorsPool
- poolOfObjectValidators objectValidatorsPool
- poolOfSliceValidators sliceValidatorsPool
- poolOfItemsValidators itemsValidatorsPool
- poolOfBasicCommonValidators basicCommonValidatorsPool
- poolOfHeaderValidators headerValidatorsPool
- poolOfParamValidators paramValidatorsPool
- poolOfBasicSliceValidators basicSliceValidatorsPool
- poolOfNumberValidators numberValidatorsPool
- poolOfStringValidators stringValidatorsPool
- poolOfSchemaPropsValidators schemaPropsValidatorsPool
- poolOfFormatValidators formatValidatorsPool
- poolOfTypeValidators typeValidatorsPool
- poolOfSchemas schemasPool
- poolOfResults resultsPool
- }
-
- schemaValidatorsPool struct {
- *sync.Pool
- debugMap map[*SchemaValidator]status
- allocMap map[*SchemaValidator]string
- redeemMap map[*SchemaValidator]string
- mx sync.Mutex
- }
-
- objectValidatorsPool struct {
- *sync.Pool
- debugMap map[*objectValidator]status
- allocMap map[*objectValidator]string
- redeemMap map[*objectValidator]string
- mx sync.Mutex
- }
-
- sliceValidatorsPool struct {
- *sync.Pool
- debugMap map[*schemaSliceValidator]status
- allocMap map[*schemaSliceValidator]string
- redeemMap map[*schemaSliceValidator]string
- mx sync.Mutex
- }
-
- itemsValidatorsPool struct {
- *sync.Pool
- debugMap map[*itemsValidator]status
- allocMap map[*itemsValidator]string
- redeemMap map[*itemsValidator]string
- mx sync.Mutex
- }
-
- basicCommonValidatorsPool struct {
- *sync.Pool
- debugMap map[*basicCommonValidator]status
- allocMap map[*basicCommonValidator]string
- redeemMap map[*basicCommonValidator]string
- mx sync.Mutex
- }
-
- headerValidatorsPool struct {
- *sync.Pool
- debugMap map[*HeaderValidator]status
- allocMap map[*HeaderValidator]string
- redeemMap map[*HeaderValidator]string
- mx sync.Mutex
- }
-
- paramValidatorsPool struct {
- *sync.Pool
- debugMap map[*ParamValidator]status
- allocMap map[*ParamValidator]string
- redeemMap map[*ParamValidator]string
- mx sync.Mutex
- }
-
- basicSliceValidatorsPool struct {
- *sync.Pool
- debugMap map[*basicSliceValidator]status
- allocMap map[*basicSliceValidator]string
- redeemMap map[*basicSliceValidator]string
- mx sync.Mutex
- }
-
- numberValidatorsPool struct {
- *sync.Pool
- debugMap map[*numberValidator]status
- allocMap map[*numberValidator]string
- redeemMap map[*numberValidator]string
- mx sync.Mutex
- }
-
- stringValidatorsPool struct {
- *sync.Pool
- debugMap map[*stringValidator]status
- allocMap map[*stringValidator]string
- redeemMap map[*stringValidator]string
- mx sync.Mutex
- }
-
- schemaPropsValidatorsPool struct {
- *sync.Pool
- debugMap map[*schemaPropsValidator]status
- allocMap map[*schemaPropsValidator]string
- redeemMap map[*schemaPropsValidator]string
- mx sync.Mutex
- }
-
- formatValidatorsPool struct {
- *sync.Pool
- debugMap map[*formatValidator]status
- allocMap map[*formatValidator]string
- redeemMap map[*formatValidator]string
- mx sync.Mutex
- }
-
- typeValidatorsPool struct {
- *sync.Pool
- debugMap map[*typeValidator]status
- allocMap map[*typeValidator]string
- redeemMap map[*typeValidator]string
- mx sync.Mutex
- }
-
- schemasPool struct {
- *sync.Pool
- debugMap map[*spec.Schema]status
- allocMap map[*spec.Schema]string
- redeemMap map[*spec.Schema]string
- mx sync.Mutex
- }
-
- resultsPool struct {
- *sync.Pool
- debugMap map[*Result]status
- allocMap map[*Result]string
- redeemMap map[*Result]string
- mx sync.Mutex
- }
-)
-
-func (p *schemaValidatorsPool) BorrowValidator() *SchemaValidator {
- s := p.Get().(*SchemaValidator)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled schema should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *schemaValidatorsPool) RedeemValidator(s *SchemaValidator) {
- // NOTE: s might be nil. In that case, Put is a noop.
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed schema should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed schema should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *objectValidatorsPool) BorrowValidator() *objectValidator {
- s := p.Get().(*objectValidator)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled object should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *objectValidatorsPool) RedeemValidator(s *objectValidator) {
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed object should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed object should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *sliceValidatorsPool) BorrowValidator() *schemaSliceValidator {
- s := p.Get().(*schemaSliceValidator)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled schemaSliceValidator should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *sliceValidatorsPool) RedeemValidator(s *schemaSliceValidator) {
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed schemaSliceValidator should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed schemaSliceValidator should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *itemsValidatorsPool) BorrowValidator() *itemsValidator {
- s := p.Get().(*itemsValidator)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled itemsValidator should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *itemsValidatorsPool) RedeemValidator(s *itemsValidator) {
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed itemsValidator should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed itemsValidator should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *basicCommonValidatorsPool) BorrowValidator() *basicCommonValidator {
- s := p.Get().(*basicCommonValidator)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled basicCommonValidator should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *basicCommonValidatorsPool) RedeemValidator(s *basicCommonValidator) {
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed basicCommonValidator should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed basicCommonValidator should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *headerValidatorsPool) BorrowValidator() *HeaderValidator {
- s := p.Get().(*HeaderValidator)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled HeaderValidator should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *headerValidatorsPool) RedeemValidator(s *HeaderValidator) {
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed header should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed header should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *paramValidatorsPool) BorrowValidator() *ParamValidator {
- s := p.Get().(*ParamValidator)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled param should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *paramValidatorsPool) RedeemValidator(s *ParamValidator) {
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed param should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed param should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *basicSliceValidatorsPool) BorrowValidator() *basicSliceValidator {
- s := p.Get().(*basicSliceValidator)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled basicSliceValidator should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *basicSliceValidatorsPool) RedeemValidator(s *basicSliceValidator) {
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed basicSliceValidator should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed basicSliceValidator should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *numberValidatorsPool) BorrowValidator() *numberValidator {
- s := p.Get().(*numberValidator)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled number should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *numberValidatorsPool) RedeemValidator(s *numberValidator) {
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed number should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed number should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *stringValidatorsPool) BorrowValidator() *stringValidator {
- s := p.Get().(*stringValidator)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled string should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *stringValidatorsPool) RedeemValidator(s *stringValidator) {
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed string should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed string should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *schemaPropsValidatorsPool) BorrowValidator() *schemaPropsValidator {
- s := p.Get().(*schemaPropsValidator)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled param should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *schemaPropsValidatorsPool) RedeemValidator(s *schemaPropsValidator) {
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed schemaProps should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed schemaProps should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *formatValidatorsPool) BorrowValidator() *formatValidator {
- s := p.Get().(*formatValidator)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled format should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *formatValidatorsPool) RedeemValidator(s *formatValidator) {
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed format should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed format should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *typeValidatorsPool) BorrowValidator() *typeValidator {
- s := p.Get().(*typeValidator)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled type should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *typeValidatorsPool) RedeemValidator(s *typeValidator) {
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed type should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic(fmt.Errorf("redeemed type should have been allocated from a fresh or recycled pointer. Got status %s, already redeamed at: %s", x, p.redeemMap[s]))
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *schemasPool) BorrowSchema() *spec.Schema {
- s := p.Get().(*spec.Schema)
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled spec.Schema should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *schemasPool) RedeemSchema(s *spec.Schema) {
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed spec.Schema should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed spec.Schema should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *resultsPool) BorrowResult() *Result {
- s := p.Get().(*Result).cleared()
-
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- p.debugMap[s] = statusFresh
- } else {
- if x != statusRedeemed {
- panic("recycled result should have been redeemed")
- }
- p.debugMap[s] = statusRecycled
- }
- p.allocMap[s] = caller()
-
- return s
-}
-
-func (p *resultsPool) RedeemResult(s *Result) {
- if s == emptyResult {
- if len(s.Errors) > 0 || len(s.Warnings) > 0 {
- panic("empty result should not mutate")
- }
- return
- }
- p.mx.Lock()
- defer p.mx.Unlock()
- x, ok := p.debugMap[s]
- if !ok {
- panic("redeemed Result should have been allocated")
- }
- if x != statusRecycled && x != statusFresh {
- panic("redeemed Result should have been allocated from a fresh or recycled pointer")
- }
- p.debugMap[s] = statusRedeemed
- p.redeemMap[s] = caller()
- p.Put(s)
-}
-
-func (p *allPools) allIsRedeemed(t testing.TB) bool {
- outcome := true
- for k, v := range p.poolOfSchemaValidators.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("schemaValidator should be redeemed. Allocated by: %s", p.poolOfSchemaValidators.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfObjectValidators.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("objectValidator should be redeemed. Allocated by: %s", p.poolOfObjectValidators.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfSliceValidators.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("sliceValidator should be redeemed. Allocated by: %s", p.poolOfSliceValidators.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfItemsValidators.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("itemsValidator should be redeemed. Allocated by: %s", p.poolOfItemsValidators.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfBasicCommonValidators.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("basicCommonValidator should be redeemed. Allocated by: %s", p.poolOfBasicCommonValidators.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfHeaderValidators.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("headerValidator should be redeemed. Allocated by: %s", p.poolOfHeaderValidators.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfParamValidators.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("paramValidator should be redeemed. Allocated by: %s", p.poolOfParamValidators.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfBasicSliceValidators.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("basicSliceValidator should be redeemed. Allocated by: %s", p.poolOfBasicSliceValidators.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfNumberValidators.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("numberValidator should be redeemed. Allocated by: %s", p.poolOfNumberValidators.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfStringValidators.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("stringValidator should be redeemed. Allocated by: %s", p.poolOfStringValidators.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfSchemaPropsValidators.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("schemaPropsValidator should be redeemed. Allocated by: %s", p.poolOfSchemaPropsValidators.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfFormatValidators.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("formatValidator should be redeemed. Allocated by: %s", p.poolOfFormatValidators.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfTypeValidators.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("typeValidator should be redeemed. Allocated by: %s", p.poolOfTypeValidators.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfSchemas.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("schemas should be redeemed. Allocated by: %s", p.poolOfSchemas.allocMap[k])
- outcome = false
- }
- for k, v := range p.poolOfResults.debugMap {
- if v == statusRedeemed {
- continue
- }
- t.Logf("result should be redeemed. Allocated by: %s", p.poolOfResults.allocMap[k])
- outcome = false
- }
-
- return outcome
-}
-
-func caller() string {
- pc, _, _, _ := runtime.Caller(3) //nolint:dogsled
- from, line := runtime.FuncForPC(pc).FileLine(pc)
-
- return fmt.Sprintf("%s:%d", from, line)
-}
diff --git a/vendor/github.com/go-openapi/validate/ref_locations.go b/vendor/github.com/go-openapi/validate/ref_locations.go
new file mode 100644
index 0000000000..1853340d22
--- /dev/null
+++ b/vendor/github.com/go-openapi/validate/ref_locations.go
@@ -0,0 +1,49 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package validate
+
+import (
+ "github.com/go-openapi/analysis"
+)
+
+// refLocations tells where a $ref value is declared in a document.
+//
+// The analyzer indexes references the other way around, by the location each
+// was found at, so the index is inverted here. Only declarations are indexed:
+// a "$ref" member sitting in an example or in a default value is data, and the
+// analyzer never walks into it.
+type refLocations map[string]pathSegments
+
+// newRefLocations inverts the analyzer's reference index.
+//
+// A reference declared in several places keeps the smallest declaration, so
+// that the answer does not depend on map iteration order.
+func newRefLocations(analyzer *analysis.Spec) refLocations {
+ declarations := make(map[string]string)
+ for location, ref := range analyzer.AllRefsByLocation() {
+ value := ref.String()
+ if value == "" {
+ continue
+ }
+
+ if known, isKnown := declarations[value]; isKnown && known <= location {
+ continue
+ }
+
+ declarations[value] = location
+ }
+
+ locations := make(refLocations, len(declarations))
+ for value, location := range declarations {
+ locations[value] = localRefPath(location)
+ }
+
+ return locations
+}
+
+// at returns where a reference is declared, or the document root when the
+// reference is not one the analyzer indexed.
+func (l refLocations) at(ref string) pathSegments {
+ return l[ref]
+}
diff --git a/vendor/github.com/go-openapi/validate/ref_redirects.go b/vendor/github.com/go-openapi/validate/ref_redirects.go
new file mode 100644
index 0000000000..95fe96c229
--- /dev/null
+++ b/vendor/github.com/go-openapi/validate/ref_redirects.go
@@ -0,0 +1,71 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package validate
+
+import (
+ "strings"
+
+ "github.com/go-openapi/analysis"
+)
+
+// maxRefHops bounds how many $ref a pointer may be followed through, so that a
+// document referring to itself cannot spin here.
+const maxRefHops = 10
+
+// refRedirects maps the location of a $ref to the location it points at, for
+// the local references of a document.
+//
+// Checks walk the expanded document, so a finding below a $ref comes out with a
+// pointer that descends into a node the authored document does not contain: a
+// bare "$ref" member has nothing under it. Following the reference turns such a
+// pointer back into one the document addresses.
+type refRedirects map[string]string
+
+func newRefRedirects(analyzer *analysis.Spec) refRedirects {
+ redirects := make(refRedirects)
+ for location, ref := range analyzer.AllRefsByLocation() {
+ target := ref.String()
+ if !strings.HasPrefix(target, "#/") {
+ // only a local reference has a location in this document
+ continue
+ }
+
+ redirects[strings.TrimPrefix(location, "#")] = strings.TrimPrefix(target, "#")
+ }
+
+ return redirects
+}
+
+// through rewrites a pointer that descends below a $ref.
+//
+// A pointer that stops at the $ref itself is left alone: that node exists, and
+// it is where a reader has to go to amend the reference.
+func (r refRedirects) through(pointer string) string {
+ if len(r) == 0 {
+ return pointer
+ }
+
+ for range maxRefHops {
+ prefix, rest, ok := r.crossing(pointer)
+ if !ok {
+ return pointer
+ }
+
+ pointer = prefix + rest
+ }
+
+ return pointer
+}
+
+// crossing finds the longest prefix of pointer that holds a $ref, and returns
+// the location that reference points at together with what is left below it.
+func (r refRedirects) crossing(pointer string) (target, rest string, ok bool) {
+ for at := strings.LastIndex(pointer, "/"); at > 0; at = strings.LastIndex(pointer[:at], "/") {
+ if target, isRef := r[pointer[:at]]; isRef {
+ return target, pointer[at:], true
+ }
+ }
+
+ return "", "", false
+}
diff --git a/vendor/github.com/go-openapi/validate/required_walk.go b/vendor/github.com/go-openapi/validate/required_walk.go
new file mode 100644
index 0000000000..b3fd3cdf4a
--- /dev/null
+++ b/vendor/github.com/go-openapi/validate/required_walk.go
@@ -0,0 +1,179 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package validate
+
+import (
+ "strings"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/spec"
+)
+
+// schemaIdentity is how a message refers to the schema a required entry
+// belongs to.
+//
+// A definition is named on its own, the way it always has been. A schema the
+// definition holds is named by the way down to it, relative to the definition:
+// "A.inner" rather than "A", which would send a reader to the wrong place.
+type schemaIdentity struct {
+ name string
+ nested bool
+}
+
+// identify names the schema a location leads to.
+func identify(at pathSegments) schemaIdentity {
+ const definitionDepth = 2 // "definitions", then the name of one
+
+ return schemaIdentity{
+ name: strings.TrimPrefix(at.dotted(), swaggerDefinitions+"."),
+ nested: len(at) > definitionDepth,
+ }
+}
+
+func (i schemaIdentity) requiredButNotDefined(property string) errors.Error {
+ if i.nested {
+ return requiredButNotDefinedInSchemaMsg(property, i.name)
+ }
+
+ return requiredButNotDefinedMsg(property, i.name)
+}
+
+// maxCompositionHops bounds how far the search for a declared property follows
+// allOf members and the local $ref they may be written as.
+const maxCompositionHops = 20
+
+// walkRequired checks the required entries of a schema, then those of every
+// schema it holds inline.
+//
+// A definition is not the only place a document says an object must hold a
+// property: so does the schema of a property, of an array item, of an
+// additionalProperties. Each of those is a self-contained object definition,
+// and a required entry naming something it never declares is the same slip
+// wherever it sits.
+//
+// A schema written as a $ref is left alone: it is checked where it is defined,
+// and following it here would report the same slip twice and, for a recursive
+// definition, would not terminate.
+//
+// It reports whether the walk should carry on, which is how the caller stops on
+// the first fault unless it was asked for everything.
+func (s *SpecValidator) walkRequired(at pathSegments, v *spec.Schema, res *Result) bool {
+ if v == nil || v.Ref.String() != "" {
+ return true
+ }
+
+ for i, pn := range v.Required {
+ // the offending entry of the required array, not the schema holding
+ // it: that is what a reader has to go and amend
+ red := s.validateRequiredProperties(pn, identify(at), at, at.child(jsonRequired).item(i), v)
+ // NOTE: capture validity before merging: Merge may redeem `red` to the
+ // pool (wantsRedeemOnMerge), after which reading it races with a
+ // concurrent BorrowResult().cleared() in another goroutine.
+ isValid := red.IsValid()
+ res.Merge(red)
+ if !isValid && !s.Options.ContinueOnErrors {
+ return false
+ }
+ }
+
+ return s.walkInlineSchemas(at, v, res)
+}
+
+// walkInlineSchemas descends into every schema a schema holds, without checking
+// the required entries of a composition member.
+//
+// Inside allOf, anyOf, oneOf or not, a member is a fragment of a constraint
+// rather than a complete definition: its required entries speak of the instance
+// the whole composition describes, and are legitimately met by a sibling member
+// or by no declaration at all. Those are honoured when data is validated, and
+// saying anything about them here would be wrong. Their own members are still
+// walked, because a property schema nested in one of them is a definition like
+// any other.
+func (s *SpecValidator) walkInlineSchemas(at pathSegments, v *spec.Schema, res *Result) bool {
+ for _, name := range sortedKeys(v.Properties) {
+ held := v.Properties[name]
+ if !s.walkRequired(at.structuralChild(jsonProperties).child(name), &held, res) {
+ return false
+ }
+ }
+
+ for _, pattern := range sortedKeys(v.PatternProperties) {
+ held := v.PatternProperties[pattern]
+ if !s.walkRequired(at.structuralChild(jsonPatternProperties).child(pattern), &held, res) {
+ return false
+ }
+ }
+
+ if v.Items != nil {
+ if v.Items.Schema != nil && !s.walkRequired(at.child(jsonItems), v.Items.Schema, res) {
+ return false
+ }
+ for i := range v.Items.Schemas {
+ if !s.walkRequired(at.child(jsonItems).item(i), &v.Items.Schemas[i], res) {
+ return false
+ }
+ }
+ }
+
+ if v.AdditionalProperties != nil && v.AdditionalProperties.Schema != nil &&
+ !s.walkRequired(at.child(jsonAdditionalProperties), v.AdditionalProperties.Schema, res) {
+ return false
+ }
+
+ // a composition member is walked for the schemas it holds, never for its
+ // own required entries
+ for _, composition := range []struct {
+ keyword string
+ members []spec.Schema
+ }{
+ {jsonAllOf, v.AllOf},
+ {jsonAnyOf, v.AnyOf},
+ {jsonOneOf, v.OneOf},
+ } {
+ for i := range composition.members {
+ if !s.walkInlineSchemas(at.child(composition.keyword).item(i), &composition.members[i], res) {
+ return false
+ }
+ }
+ }
+
+ if v.Not != nil {
+ return s.walkInlineSchemas(at.child(jsonNot), v.Not, res)
+ }
+
+ return true
+}
+
+// declaresProperty reports whether a schema, or any schema composed into it by
+// allOf, declares the named property, and whether that declaration is readOnly.
+//
+// An allOf member may be written as a $ref, which is followed here: a property
+// contributed by a base definition is declared just as plainly as one written
+// in place.
+func (s *SpecValidator) declaresProperty(v *spec.Schema, name string, hops int) (readOnly, declared bool) {
+ if v == nil || hops <= 0 {
+ return false, false
+ }
+
+ if held, ok := v.Properties[name]; ok {
+ return held.ReadOnly, true
+ }
+
+ for i := range v.AllOf {
+ member := &v.AllOf[i]
+ if member.Ref.String() != "" {
+ resolved, err := s.resolveRef(&member.Ref)
+ if err != nil {
+ continue
+ }
+ member = resolved
+ }
+
+ if readOnly, ok := s.declaresProperty(member, name, hops-1); ok {
+ return readOnly, true
+ }
+ }
+
+ return false, false
+}
diff --git a/vendor/github.com/go-openapi/validate/resolvable.go b/vendor/github.com/go-openapi/validate/resolvable.go
new file mode 100644
index 0000000000..bbd35d3608
--- /dev/null
+++ b/vendor/github.com/go-openapi/validate/resolvable.go
@@ -0,0 +1,70 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package validate
+
+import (
+ "strconv"
+ "strings"
+
+ "github.com/go-openapi/jsonpointer"
+)
+
+// resolvable trims a pointer down to the deepest node the document holds.
+//
+// Checks walk an expanded, model-level view of a specification, which holds
+// members the document itself never wrote: a parameter merged in from a path
+// item, a member of a schema reached through a $ref. A pointer built along the
+// way may therefore end on something a reader cannot go to.
+//
+// Trimming is the last word on a location, applied once every check has had its
+// say: it only ever shortens, so a pointer that already addressed a node comes
+// back untouched, and one that did not still says as much as it truthfully can.
+// This is what makes [Located.Pointer] always resolve.
+func (s *SpecValidator) resolvable(pointer string) string {
+ if pointer == "" || s.document == nil {
+ return pointer
+ }
+
+ node := s.document
+ for at := 0; at < len(pointer); {
+ end := strings.IndexByte(pointer[at+1:], '/')
+ token := pointer[at+1:]
+ if end >= 0 {
+ token = pointer[at+1 : at+1+end]
+ }
+
+ member, isHeld := memberOf(node, jsonpointer.Unescape(token))
+ if !isHeld {
+ return pointer[:at]
+ }
+ node = member
+
+ if end < 0 {
+ break
+ }
+ at += end + 1
+ }
+
+ return pointer
+}
+
+// memberOf returns the member a reference token addresses in a decoded JSON
+// node, and whether the node holds one at all.
+func memberOf(node any, token string) (any, bool) {
+ switch held := node.(type) {
+ case map[string]any:
+ member, isHeld := held[token]
+
+ return member, isHeld
+ case []any:
+ index, err := strconv.Atoi(token)
+ if err != nil || index < 0 || index >= len(held) {
+ return nil, false
+ }
+
+ return held[index], true
+ default:
+ return nil, false
+ }
+}
diff --git a/vendor/github.com/go-openapi/validate/result.go b/vendor/github.com/go-openapi/validate/result.go
index ede945503d..5684774a5f 100644
--- a/vendor/github.com/go-openapi/validate/result.go
+++ b/vendor/github.com/go-openapi/validate/result.go
@@ -14,6 +14,25 @@ import (
var emptyResult = &Result{MatchCount: 1}
+// Located pairs a validation error with the location of the value that caused it.
+type Located struct {
+ // Err is the reported error or warning.
+ Err error
+
+ // Pointer locates the offending value as an RFC 6901 JSON pointer,
+ // relative to the validated document.
+ //
+ // It is empty when the document as a whole is the answer: either because
+ // the finding is about the document rather than a value in it, such as a
+ // duplicate operation id, or because the value in question is the root.
+ // An empty pointer is a valid one, addressing the whole document.
+ //
+ // A finding about something a document does not contain, a missing
+ // required property say, is located on the value that should contain it:
+ // what is absent has no node to point at.
+ Pointer string
+}
+
// Result represents a validation result set, composed of
// errors and warnings.
//
@@ -25,12 +44,17 @@ var emptyResult = &Result{MatchCount: 1}
// schema validation. Results from the validation branch
// with most matches get eventually selected.
//
-// Proposal for enhancement: keep path of key originating the error.
+// Use [Result.LocatedErrors] to know where each error happened.
type Result struct {
Errors []error
Warnings []error
MatchCount int
+ // errorLocations[i] locates Errors[i], and likewise for warnings. Kept
+ // aligned by the add methods; see [Result.LocatedErrors].
+ errorLocations []string
+ warningLocations []string
+
// the object data
data any
@@ -110,7 +134,7 @@ func (r *Result) Merge(others ...*Result) *Result {
r.mergeWithoutRootSchemata(other)
r.rootObjectSchemata.Append(other.rootObjectSchemata)
if other.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(other)
+ redeemResult(other)
}
}
return r
@@ -173,11 +197,11 @@ func (r *Result) MergeAsErrors(others ...*Result) *Result {
for _, other := range others {
if other != nil {
r.resetCaches()
- r.AddErrors(other.Errors...)
- r.AddErrors(other.Warnings...)
+ r.carryErrors(other.Errors, other.errorLocations)
+ r.carryErrors(other.Warnings, other.warningLocations)
r.MatchCount += other.MatchCount
if other.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(other)
+ redeemResult(other)
}
}
}
@@ -191,11 +215,11 @@ func (r *Result) MergeAsWarnings(others ...*Result) *Result {
for _, other := range others {
if other != nil {
r.resetCaches()
- r.AddWarnings(other.Errors...)
- r.AddWarnings(other.Warnings...)
+ r.carryWarnings(other.Errors, other.errorLocations)
+ r.carryWarnings(other.Warnings, other.warningLocations)
r.MatchCount += other.MatchCount
if other.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(other)
+ redeemResult(other)
}
}
}
@@ -207,39 +231,79 @@ func (r *Result) MergeAsWarnings(others ...*Result) *Result {
// Since the same check may be passed several times while exploring the
// spec structure (via $ref, ...) reported messages are kept
// unique.
+//
+// Errors added this way carry no location. Validators use [Result.addErrorsAt]
+// so that [Result.LocatedErrors] can tell where the failure happened.
func (r *Result) AddErrors(errors ...error) {
- for _, e := range errors {
- found := false
- if e != nil {
- for _, isReported := range r.Errors {
- if e.Error() == isReported.Error() {
- found = true
- break
- }
- }
- if !found {
- r.Errors = append(r.Errors, e)
- }
- }
- }
+ r.addLocatedErrors("", errors...)
}
// AddWarnings adds warnings to this validation result (if not already reported).
func (r *Result) AddWarnings(warnings ...error) {
- for _, e := range warnings {
- found := false
- if e != nil {
- for _, isReported := range r.Warnings {
- if e.Error() == isReported.Error() {
- found = true
- break
- }
- }
- if !found {
- r.Warnings = append(r.Warnings, e)
- }
+ r.addLocatedWarnings("", warnings...)
+}
+
+// isReportedError tells if the same message is already part of a collection.
+func isReportedError(reported []error, e error) bool {
+ msg := e.Error()
+ for _, isReported := range reported {
+ if msg == isReported.Error() {
+ return true
}
}
+
+ return false
+}
+
+// locationAt reads a location out of a slice that may be shorter than the
+// errors it describes.
+func locationAt(locations []string, i int) string {
+ if i < len(locations) {
+ return locations[i]
+ }
+
+ return ""
+}
+
+// appendLocation records the location of the error that has just been appended,
+// keeping the location slice aligned with the error slice it describes.
+//
+// Errors may reach a Result without going through the methods here (a caller
+// assigning Errors directly, say), so the slice is padded rather than assumed
+// to be in step.
+func appendLocation(locations []string, upTo int, pointer string) []string {
+ for len(locations) < upTo-1 {
+ locations = append(locations, "")
+ }
+
+ return append(locations, pointer)
+}
+
+// LocatedErrors returns the reported errors, each paired with the JSON pointer
+// of the value that caused it.
+//
+// The pointer is empty whenever the location is unknown, so callers should
+// treat it as a hint and keep using the error message as the primary report.
+func (r *Result) LocatedErrors() []Located {
+ return locate(r.Errors, r.errorLocations)
+}
+
+// LocatedWarnings returns the reported warnings, each paired with the JSON
+// pointer of the value that caused it.
+func (r *Result) LocatedWarnings() []Located {
+ return locate(r.Warnings, r.warningLocations)
+}
+
+func locate(errs []error, locations []string) []Located {
+ located := make([]Located, len(errs))
+ for i, err := range errs {
+ located[i] = Located{Err: err}
+ if i < len(locations) {
+ located[i].Pointer = locations[i]
+ }
+ }
+
+ return located
}
// IsValid returns true when this result is valid.
@@ -298,6 +362,106 @@ func (r *Result) AsError() error {
return errors.CompositeValidationError(r.Errors...)
}
+// Reset clears this result so it may be reused, keeping allocated capacity.
+//
+// It implements the hook the pool calls when a result is borrowed and when it
+// is redeemed. Calling it on a result still in use loses its findings.
+func (r *Result) Reset() {
+ _ = r.cleared()
+}
+
+// addErrorsAt adds errors located at the given path.
+func (r *Result) addErrorsAt(at pathSegments, errors ...error) {
+ r.addLocatedErrors(at.pointer(), errors...)
+}
+
+// addWarningsAt adds warnings located at the given path.
+func (r *Result) addWarningsAt(at pathSegments, warnings ...error) {
+ r.addLocatedWarnings(at.pointer(), warnings...)
+}
+
+func (r *Result) addLocatedErrors(pointer string, errors ...error) {
+ for _, e := range errors {
+ if e == nil {
+ continue
+ }
+
+ if isReportedError(r.Errors, e) {
+ continue
+ }
+
+ r.Errors = append(r.Errors, e)
+ r.errorLocations = appendLocation(r.errorLocations, len(r.Errors), pointer)
+ }
+}
+
+func (r *Result) addLocatedWarnings(pointer string, warnings ...error) {
+ for _, e := range warnings {
+ if e == nil {
+ continue
+ }
+
+ if isReportedError(r.Warnings, e) {
+ continue
+ }
+
+ r.Warnings = append(r.Warnings, e)
+ r.warningLocations = appendLocation(r.warningLocations, len(r.Warnings), pointer)
+ }
+}
+
+// relocate rewrites every location this result recorded.
+//
+// The parameter and header validators are the ones a generated client uses at
+// runtime, so they locate a finding by the name of the parameter or header it
+// concerns: a name is all the caller has. When spec validation borrows them to
+// check a default or an example, that name addresses nothing in the document,
+// and the value's own node is the best location available for everything the
+// borrowed validator found.
+func (r *Result) relocate(at pathSegments) {
+ if r == nil {
+ return
+ }
+
+ pointer := at.pointer()
+ r.errorLocations = fillLocations(r.errorLocations[:0], len(r.Errors), pointer)
+ r.warningLocations = fillLocations(r.warningLocations[:0], len(r.Warnings), pointer)
+}
+
+// fillLocations records the same location for a whole run of findings.
+func fillLocations(locations []string, count int, pointer string) []string {
+ for range count {
+ locations = append(locations, pointer)
+ }
+
+ return locations
+}
+
+// redirect rewrites every location this result recorded with the given mapping.
+func (r *Result) redirect(through func(string) string) {
+ for i, pointer := range r.errorLocations {
+ r.errorLocations[i] = through(pointer)
+ }
+ for i, pointer := range r.warningLocations {
+ r.warningLocations[i] = through(pointer)
+ }
+}
+
+// carryErrors adds errors from another result as errors, one by one, so that
+// each keeps the location that result recorded for it.
+func (r *Result) carryErrors(errs []error, locations []string) {
+ for i, e := range errs {
+ r.addLocatedErrors(locationAt(locations, i), e)
+ }
+}
+
+// carryWarnings adds errors from another result as warnings, keeping locations.
+func (r *Result) carryWarnings(errs []error, locations []string) {
+ for i, e := range errs {
+ r.addLocatedWarnings(locationAt(locations, i), e)
+ }
+}
+
func (r *Result) resetCaches() {
r.cachedFieldSchemata = nil
r.cachedItemSchemata = nil
@@ -324,7 +488,7 @@ func (r *Result) mergeForField(obj map[string]any, field string, other *Result)
})
}
if other.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(other)
+ redeemResult(other)
}
return r
@@ -352,7 +516,7 @@ func (r *Result) mergeForSlice(slice reflect.Value, i int, other *Result) *Resul
}
if other.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(other)
+ redeemResult(other)
}
return r
@@ -391,8 +555,8 @@ func (r *Result) addSliceSchemata(slice reflect.Value, i int, schema *spec.Schem
// mergeWithoutRootSchemata merges other into r, ignoring the rootObject schemata.
func (r *Result) mergeWithoutRootSchemata(other *Result) {
r.resetCaches()
- r.AddErrors(other.Errors...)
- r.AddWarnings(other.Warnings...)
+ r.carryErrors(other.Errors, other.errorLocations)
+ r.carryWarnings(other.Warnings, other.warningLocations)
r.MatchCount += other.MatchCount
if other.fieldSchemata != nil {
@@ -438,32 +602,40 @@ func (r *Result) keepRelevantErrors() *Result {
// codes would require to change a lot here. So, for the moment, let's go with
// placeholders.
strippedErrors := []error{}
- for _, e := range r.Errors {
+ strippedErrorLocations := []string{}
+ for i, e := range r.Errors {
if isImportant(e) {
strippedErrors = append(strippedErrors, stripImportantTag(e))
+ strippedErrorLocations = append(strippedErrorLocations, locationAt(r.errorLocations, i))
}
}
strippedWarnings := []error{}
- for _, e := range r.Warnings {
+ strippedWarningLocations := []string{}
+ for i, e := range r.Warnings {
if isImportant(e) {
strippedWarnings = append(strippedWarnings, stripImportantTag(e))
+ strippedWarningLocations = append(strippedWarningLocations, locationAt(r.warningLocations, i))
}
}
var strippedResult *Result
if r.wantsRedeemOnMerge {
- strippedResult = pools.poolOfResults.BorrowResult()
+ strippedResult = validatorPools.results.Borrow()
} else {
strippedResult = new(Result)
}
strippedResult.Errors = strippedErrors
+ strippedResult.errorLocations = strippedErrorLocations
strippedResult.Warnings = strippedWarnings
+ strippedResult.warningLocations = strippedWarningLocations
return strippedResult
}
func (r *Result) cleared() *Result {
// clear the Result to be reusable. Keep allocated capacity.
r.Errors = r.Errors[:0]
+ r.errorLocations = r.errorLocations[:0]
r.Warnings = r.Warnings[:0]
+ r.warningLocations = r.warningLocations[:0]
r.MatchCount = 0
r.data = nil
r.rootObjectSchemata.one = nil
diff --git a/vendor/github.com/go-openapi/validate/schema.go b/vendor/github.com/go-openapi/validate/schema.go
index b72a47bc33..e7af892c74 100644
--- a/vendor/github.com/go-openapi/validate/schema.go
+++ b/vendor/github.com/go-openapi/validate/schema.go
@@ -15,7 +15,17 @@ import (
// SchemaValidator validates data against a JSON schema.
type SchemaValidator struct {
- Path string
+ // Path is the location of the validated value, in the legacy dot-separated
+ // notation. It is what surfaces as the name of a validation error.
+ //
+ // Deprecated: a dotted path is ambiguous whenever a property name contains
+ // a dot. Prefer the JSON pointer rendering of the same location.
+ Path string
+
+ // path is the same location, kept as JSON pointer reference tokens so that
+ // children may be derived from it unambiguously.
+ path pathSegments
+
in string
Schema *spec.Schema
validators [8]valueValidator
@@ -32,7 +42,7 @@ func AgainstSchema(schema *spec.Schema, data any, formats strfmt.Registry, optio
append(options, WithRecycleValidators(true), withRecycleResults(true))...,
).Validate(data)
defer func() {
- pools.poolOfResults.RedeemResult(res)
+ redeemResult(res)
}()
if res.HasErrors() {
@@ -51,10 +61,23 @@ func NewSchemaValidator(schema *spec.Schema, rootSchema any, root string, format
o(opts)
}
- return newSchemaValidator(schema, rootSchema, root, formats, opts)
+ return newSchemaValidator(schema, rootSchema, rootPathFromString(root), formats, opts)
}
-func newSchemaValidator(schema *spec.Schema, rootSchema any, root string, formats strfmt.Registry, opts *SchemaValidatorOptions) *SchemaValidator {
+// rootPathFromString interprets the root path of the exported constructors.
+//
+// The caller hands over an opaque string, so there is no telling which of its
+// dots are separators and which belong to a name: it is taken as a single
+// reference token.
+func rootPathFromString(root string) pathSegments {
+ if root == "" {
+ return rootPath()
+ }
+
+ return newPathSegments(root)
+}
+
+func newSchemaValidator(schema *spec.Schema, rootSchema any, root pathSegments, formats strfmt.Registry, opts *SchemaValidatorOptions) *SchemaValidator {
if schema == nil {
return nil
}
@@ -63,26 +86,27 @@ func newSchemaValidator(schema *spec.Schema, rootSchema any, root string, format
rootSchema = schema
}
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
+ }
+
if schema.ID != "" || schema.Ref.String() != "" || schema.Ref.IsRoot() {
- err := spec.ExpandSchema(schema, rootSchema, nil)
+ err := spec.ExpandSchemaWithOptions(schema, rootSchema, nil, opts.expandOptions(""))
if err != nil {
msg := invalidSchemaProvidedMsg(err).Error()
panic(msg)
}
}
- if opts == nil {
- opts = new(SchemaValidatorOptions)
- }
-
var s *SchemaValidator
if opts.recycleValidators {
- s = pools.poolOfSchemaValidators.BorrowValidator()
+ s = validatorPools.schemaValidators.Borrow()
} else {
s = new(SchemaValidator)
}
- s.Path = root
+ s.path = root
+ s.Path = root.dotted()
s.in = "body"
s.Schema = schema
s.Root = rootSchema
@@ -104,8 +128,11 @@ func newSchemaValidator(schema *spec.Schema, rootSchema any, root string, format
}
// SetPath sets the path for this schema validator.
+//
+// Note that the sub-validators are built when the validator is created, so
+// this only affects errors reported by this validator, not by its children.
func (s *SchemaValidator) SetPath(path string) {
- s.Path = path
+ s.setPath(rootPathFromString(path))
}
// Applies returns true when this schema validator applies.
@@ -131,7 +158,7 @@ func (s *SchemaValidator) Validate(data any) *Result {
var result *Result
if s.Options.recycleResult {
- result = pools.poolOfResults.BorrowResult()
+ result = validatorPools.results.Borrow()
result.data = data
} else {
result = &Result{data: data}
@@ -169,7 +196,7 @@ func (s *SchemaValidator) Validate(data any) *Result {
// to map[string]interface{}.
var dd any
if err := jsonutils.FromDynamicJSON(data, &dd); err != nil {
- result.AddErrors(err)
+ result.addErrorsAt(s.path, err)
result.Inc()
return result
@@ -185,7 +212,7 @@ func (s *SchemaValidator) Validate(data any) *Result {
if s.Schema.Type.Contains(integerType) { // avoid lossy conversion
in, erri := num.Int64()
if erri != nil {
- result.AddErrors(invalidTypeConversionMsg(s.Path, erri))
+ result.addErrorsAt(s.path, invalidTypeConversionMsg(s.Path, erri))
result.Inc()
return result
@@ -194,7 +221,7 @@ func (s *SchemaValidator) Validate(data any) *Result {
} else {
nf, errf := num.Float64()
if errf != nil {
- result.AddErrors(invalidTypeConversionMsg(s.Path, errf))
+ result.addErrorsAt(s.path, invalidTypeConversionMsg(s.Path, errf))
result.Inc()
return result
@@ -235,7 +262,7 @@ func (s *SchemaValidator) Validate(data any) *Result {
func (s *SchemaValidator) typeValidator() valueValidator {
return newTypeValidator(
- s.Path,
+ s.path,
s.in,
s.Schema.Type,
s.Schema.Nullable,
@@ -246,7 +273,7 @@ func (s *SchemaValidator) typeValidator() valueValidator {
func (s *SchemaValidator) commonValidator() valueValidator {
return newBasicCommonValidator(
- s.Path,
+ s.path,
s.in,
s.Schema.Default,
s.Schema.Enum,
@@ -256,7 +283,7 @@ func (s *SchemaValidator) commonValidator() valueValidator {
func (s *SchemaValidator) sliceValidator() valueValidator {
return newSliceValidator(
- s.Path,
+ s.path,
s.in,
s.Schema.MaxItems,
s.Schema.MinItems,
@@ -271,7 +298,7 @@ func (s *SchemaValidator) sliceValidator() valueValidator {
func (s *SchemaValidator) numberValidator() valueValidator {
return newNumberValidator(
- s.Path,
+ s.path,
s.in,
s.Schema.Default,
s.Schema.MultipleOf,
@@ -287,7 +314,7 @@ func (s *SchemaValidator) numberValidator() valueValidator {
func (s *SchemaValidator) stringValidator() valueValidator {
return newStringValidator(
- s.Path,
+ s.path,
s.in,
nil,
false,
@@ -301,7 +328,7 @@ func (s *SchemaValidator) stringValidator() valueValidator {
func (s *SchemaValidator) formatValidator() valueValidator {
return newFormatValidator(
- s.Path,
+ s.path,
s.in,
s.Schema.Format,
s.KnownFormats,
@@ -312,14 +339,14 @@ func (s *SchemaValidator) formatValidator() valueValidator {
func (s *SchemaValidator) schemaPropsValidator() valueValidator {
sch := s.Schema
return newSchemaPropsValidator(
- s.Path, s.in, sch.AllOf, sch.OneOf, sch.AnyOf, sch.Not, sch.Dependencies, s.Root, s.KnownFormats,
+ s.path, s.in, sch.AllOf, sch.OneOf, sch.AnyOf, sch.Not, sch.Dependencies, s.Root, s.KnownFormats,
s.Options,
)
}
func (s *SchemaValidator) objectValidator() valueValidator {
return newObjectValidator(
- s.Path,
+ s.path,
s.in,
s.Schema.MaxProperties,
s.Schema.MinProperties,
@@ -333,8 +360,13 @@ func (s *SchemaValidator) objectValidator() valueValidator {
)
}
+func (s *SchemaValidator) setPath(path pathSegments) {
+ s.path = path
+ s.Path = path.dotted()
+}
+
func (s *SchemaValidator) redeem() {
- pools.poolOfSchemaValidators.RedeemValidator(s)
+ validatorPools.schemaValidators.Redeem(s)
}
func (s *SchemaValidator) redeemChildren() {
diff --git a/vendor/github.com/go-openapi/validate/schema_option.go b/vendor/github.com/go-openapi/validate/schema_option.go
index 3e1b882ed3..3ca489c0f5 100644
--- a/vendor/github.com/go-openapi/validate/schema_option.go
+++ b/vendor/github.com/go-openapi/validate/schema_option.go
@@ -3,6 +3,13 @@
package validate
+import (
+ "encoding/json"
+
+ "github.com/go-openapi/spec"
+ "github.com/go-openapi/swag/loading"
+)
+
// SchemaValidatorOptions defines optional rules for schema validation.
type SchemaValidatorOptions struct {
EnableObjectArrayTypeCheck bool
@@ -10,6 +17,7 @@ type SchemaValidatorOptions struct {
recycleValidators bool
recycleResult bool
skipSchemataResult bool
+ pathLoaderWithOptions func(string, ...loading.Option) (json.RawMessage, error)
}
// Option sets optional rules for schema validation.
@@ -60,6 +68,23 @@ func WithSkipSchemataResult(enable bool) Option {
}
}
+// WithPathLoader injects the document loader used to resolve remote and relative $ref while
+// validating a schema or specification. It matches the option-aware loader signature of
+// github.com/go-openapi/swag/loading (and go-openapi/loads).
+//
+// This lets validation resolve references through a caller-provided loader instead of the spec
+// package's global default. The loader may carry any loading options — a custom HTTP client or
+// timeout, authentication or custom headers, an embedded or rooted file system, and so on.
+//
+// One important use is confining loading of untrusted input: build the loader with loading.WithRoot
+// (to confine local reads) and loading.WithHTTPClient (to restrict remote fetches), or use a
+// restricted loader from go-openapi/loads. Left unset, the spec package default loader is used.
+func WithPathLoader(loader func(string, ...loading.Option) (json.RawMessage, error)) Option {
+ return func(svo *SchemaValidatorOptions) {
+ svo.pathLoaderWithOptions = loader
+ }
+}
+
// Options returns the current set of options.
func (svo SchemaValidatorOptions) Options() []Option {
return []Option{
@@ -68,5 +93,17 @@ func (svo SchemaValidatorOptions) Options() []Option {
WithRecycleValidators(svo.recycleValidators),
withRecycleResults(svo.recycleResult),
WithSkipSchemataResult(svo.skipSchemataResult),
+ WithPathLoader(svo.pathLoaderWithOptions),
+ }
+}
+
+// expandOptions builds the spec expand options for schema/$ref expansion during validation,
+// carrying the injected loader (when set) so resolution can be confined. relativeBase is used for
+// base-path-relative resolution; it is ignored by [spec.ExpandSchemaWithOptions], which derives the
+// base from the root.
+func (svo *SchemaValidatorOptions) expandOptions(relativeBase string) *spec.ExpandOptions {
+ return &spec.ExpandOptions{
+ RelativeBase: relativeBase,
+ PathLoaderWithOptions: svo.pathLoaderWithOptions,
}
}
diff --git a/vendor/github.com/go-openapi/validate/schema_props.go b/vendor/github.com/go-openapi/validate/schema_props.go
index 2c4354d08a..d7ecb14ce0 100644
--- a/vendor/github.com/go-openapi/validate/schema_props.go
+++ b/vendor/github.com/go-openapi/validate/schema_props.go
@@ -12,7 +12,7 @@ import (
)
type schemaPropsValidator struct {
- Path string
+ Path pathSegments
In string
AllOf []spec.Schema
OneOf []spec.Schema
@@ -28,12 +28,8 @@ type schemaPropsValidator struct {
Options *SchemaValidatorOptions
}
-func (s *schemaPropsValidator) SetPath(path string) {
- s.Path = path
-}
-
func newSchemaPropsValidator(
- path string, in string, allOf, oneOf, anyOf []spec.Schema, not *spec.Schema, deps spec.Dependencies, root any, formats strfmt.Registry,
+ path pathSegments, in string, allOf, oneOf, anyOf []spec.Schema, not *spec.Schema, deps spec.Dependencies, root any, formats strfmt.Registry,
opts *SchemaValidatorOptions,
) *schemaPropsValidator {
if opts == nil {
@@ -60,7 +56,7 @@ func newSchemaPropsValidator(
var s *schemaPropsValidator
if opts.recycleValidators {
- s = pools.poolOfSchemaPropsValidators.BorrowValidator()
+ s = validatorPools.schemaPropsValidators.Borrow()
} else {
s = new(schemaPropsValidator)
}
@@ -91,7 +87,7 @@ func (s *schemaPropsValidator) Applies(source any, _ reflect.Kind) bool {
func (s *schemaPropsValidator) Validate(data any) *Result {
var mainResult *Result
if s.Options.recycleResult {
- mainResult = pools.poolOfResults.BorrowResult()
+ mainResult = validatorPools.results.Borrow()
} else {
mainResult = new(Result)
}
@@ -111,17 +107,17 @@ func (s *schemaPropsValidator) Validate(data any) *Result {
}
if len(s.anyOfValidators) > 0 {
- keepResultAnyOf = pools.poolOfResults.BorrowResult()
+ keepResultAnyOf = validatorPools.results.Borrow()
s.validateAnyOf(data, mainResult, keepResultAnyOf)
}
if len(s.oneOfValidators) > 0 {
- keepResultOneOf = pools.poolOfResults.BorrowResult()
+ keepResultOneOf = validatorPools.results.Borrow()
s.validateOneOf(data, mainResult, keepResultOneOf)
}
if len(s.allOfValidators) > 0 {
- keepResultAllOf = pools.poolOfResults.BorrowResult()
+ keepResultAllOf = validatorPools.results.Borrow()
s.validateAllOf(data, mainResult, keepResultAllOf)
}
@@ -154,7 +150,7 @@ func (s *schemaPropsValidator) validateAnyOf(data any, mainResult, keepResultAny
if result.IsValid() {
if bestFailures != nil && bestFailures.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(bestFailures)
+ redeemResult(bestFailures)
}
_ = keepResultAnyOf.cleared()
@@ -166,7 +162,7 @@ func (s *schemaPropsValidator) validateAnyOf(data any, mainResult, keepResultAny
// MatchCount is used to select errors from the schema with most positive checks
if bestFailures == nil || result.MatchCount > bestFailures.MatchCount {
if bestFailures != nil && bestFailures.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(bestFailures)
+ redeemResult(bestFailures)
}
bestFailures = result
@@ -174,11 +170,11 @@ func (s *schemaPropsValidator) validateAnyOf(data any, mainResult, keepResultAny
}
if result.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(result) // this result is ditched
+ redeemResult(result) // this result is ditched
}
}
- mainResult.AddErrors(mustValidateAtLeastOneSchemaMsg(s.Path))
+ mainResult.addErrorsAt(s.Path, mustValidateAtLeastOneSchemaMsg(s.Path.dotted()))
mainResult.Merge(bestFailures)
}
@@ -205,7 +201,7 @@ func (s *schemaPropsValidator) validateOneOf(data any, mainResult, keepResultOne
if firstSuccess == nil {
firstSuccess = result
} else if result.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(result) // this result is ditched
+ redeemResult(result) // this result is ditched
}
continue
@@ -214,29 +210,29 @@ func (s *schemaPropsValidator) validateOneOf(data any, mainResult, keepResultOne
// MatchCount is used to select errors from the schema with most positive checks
if validated == 0 && (bestFailures == nil || result.MatchCount > bestFailures.MatchCount) {
if bestFailures != nil && bestFailures.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(bestFailures)
+ redeemResult(bestFailures)
}
bestFailures = result
} else if result.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(result) // this result is ditched
+ redeemResult(result) // this result is ditched
}
}
switch validated {
case 0:
- mainResult.AddErrors(mustValidateOnlyOneSchemaMsg(s.Path, "Found none valid"))
+ mainResult.addErrorsAt(s.Path, mustValidateOnlyOneSchemaMsg(s.Path.dotted(), "Found none valid"))
mainResult.Merge(bestFailures)
// firstSucess necessarily nil
case 1:
mainResult.Merge(firstSuccess)
if bestFailures != nil && bestFailures.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(bestFailures)
+ redeemResult(bestFailures)
}
default:
- mainResult.AddErrors(mustValidateOnlyOneSchemaMsg(s.Path, fmt.Sprintf("Found %d valid alternatives", validated)))
+ mainResult.addErrorsAt(s.Path, mustValidateOnlyOneSchemaMsg(s.Path.dotted(), fmt.Sprintf("Found %d valid alternatives", validated)))
mainResult.Merge(bestFailures)
if firstSuccess != nil && firstSuccess.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(firstSuccess)
+ redeemResult(firstSuccess)
}
}
}
@@ -260,10 +256,10 @@ func (s *schemaPropsValidator) validateAllOf(data any, mainResult, keepResultAll
switch validated {
case 0:
- mainResult.AddErrors(mustValidateAllSchemasMsg(s.Path, ". None validated"))
+ mainResult.addErrorsAt(s.Path, mustValidateAllSchemasMsg(s.Path.dotted(), ". None validated"))
case len(s.allOfValidators):
default:
- mainResult.AddErrors(mustValidateAllSchemasMsg(s.Path, ""))
+ mainResult.addErrorsAt(s.Path, mustValidateAllSchemasMsg(s.Path.dotted(), ""))
}
}
@@ -274,16 +270,16 @@ func (s *schemaPropsValidator) validateNot(data any, mainResult *Result) {
}
// We keep inner IMPORTANT! errors no matter what MatchCount tells us
if result.IsValid() {
- mainResult.AddErrors(mustNotValidatechemaMsg(s.Path))
+ mainResult.addErrorsAt(s.Path, mustNotValidatechemaMsg(s.Path.dotted()))
}
if result.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(result) // this result is ditched
+ redeemResult(result) // this result is ditched
}
}
func (s *schemaPropsValidator) validateDependencies(data any, mainResult *Result) {
val := data.(map[string]any) //nolint:forcetypeassert // caller guarantees map[string]any
- for key := range val {
+ for _, key := range sortedKeys(val) {
dep, ok := s.Dependencies[key]
if !ok {
continue
@@ -291,7 +287,7 @@ func (s *schemaPropsValidator) validateDependencies(data any, mainResult *Result
if dep.Schema != nil {
mainResult.Merge(
- newSchemaValidator(dep.Schema, s.Root, s.Path+"."+key, s.KnownFormats, s.Options).Validate(data),
+ newSchemaValidator(dep.Schema, s.Root, s.Path.child(key), s.KnownFormats, s.Options).Validate(data),
)
continue
}
@@ -299,15 +295,19 @@ func (s *schemaPropsValidator) validateDependencies(data any, mainResult *Result
if len(dep.Property) > 0 {
for _, depKey := range dep.Property {
if _, ok := val[depKey]; !ok {
- mainResult.AddErrors(hasADependencyMsg(s.Path, depKey))
+ mainResult.addErrorsAt(s.Path, hasADependencyMsg(s.Path.dotted(), depKey))
}
}
}
}
}
+func (s *schemaPropsValidator) setPath(path pathSegments) {
+ s.Path = path
+}
+
func (s *schemaPropsValidator) redeem() {
- pools.poolOfSchemaPropsValidators.RedeemValidator(s)
+ validatorPools.schemaPropsValidators.Redeem(s)
}
func (s *schemaPropsValidator) redeemChildren() {
diff --git a/vendor/github.com/go-openapi/validate/slice_validator.go b/vendor/github.com/go-openapi/validate/slice_validator.go
index 8f49d13707..0a0ee74027 100644
--- a/vendor/github.com/go-openapi/validate/slice_validator.go
+++ b/vendor/github.com/go-openapi/validate/slice_validator.go
@@ -4,7 +4,6 @@
package validate
import (
- "fmt"
"reflect"
"github.com/go-openapi/spec"
@@ -12,7 +11,7 @@ import (
)
type schemaSliceValidator struct {
- Path string
+ Path pathSegments
In string
MaxItems *int64
MinItems *int64
@@ -24,7 +23,7 @@ type schemaSliceValidator struct {
Options *SchemaValidatorOptions
}
-func newSliceValidator(path, in string,
+func newSliceValidator(path pathSegments, in string,
maxItems, minItems *int64, uniqueItems bool,
additionalItems *spec.SchemaOrBool, items *spec.SchemaOrArray,
root any, formats strfmt.Registry, opts *SchemaValidatorOptions,
@@ -35,7 +34,7 @@ func newSliceValidator(path, in string,
var v *schemaSliceValidator
if opts.recycleValidators {
- v = pools.poolOfSliceValidators.BorrowValidator()
+ v = validatorPools.sliceValidators.Borrow()
} else {
v = new(schemaSliceValidator)
}
@@ -54,10 +53,6 @@ func newSliceValidator(path, in string,
return v
}
-func (s *schemaSliceValidator) SetPath(path string) {
- s.Path = path
-}
-
func (s *schemaSliceValidator) Applies(source any, kind reflect.Kind) bool {
_, ok := source.(*spec.Schema)
r := ok && kind == reflect.Slice
@@ -73,7 +68,7 @@ func (s *schemaSliceValidator) Validate(data any) *Result {
var result *Result
if s.Options.recycleResult {
- result = pools.poolOfResults.BorrowResult()
+ result = validatorPools.results.Borrow()
} else {
result = new(Result)
}
@@ -85,8 +80,10 @@ func (s *schemaSliceValidator) Validate(data any) *Result {
if s.Items != nil && s.Items.Schema != nil {
for i := range size {
- validator := newSchemaValidator(s.Items.Schema, s.Root, s.Path, s.KnownFormats, s.Options)
- validator.SetPath(fmt.Sprintf("%s.%d", s.Path, i))
+ // the index has to reach the constructor: the sub-validators that
+ // report the error are built there, and setting the path afterwards
+ // would leave them located on the array rather than on the item.
+ validator := newSchemaValidator(s.Items.Schema, s.Root, s.Path.item(i), s.KnownFormats, s.Options)
value := val.Index(i)
result.mergeForSlice(val, i, validator.Validate(value.Interface()))
}
@@ -100,41 +97,45 @@ func (s *schemaSliceValidator) Validate(data any) *Result {
break
}
- validator := newSchemaValidator(&s.Items.Schemas[i], s.Root, fmt.Sprintf("%s.%d", s.Path, i), s.KnownFormats, s.Options)
+ validator := newSchemaValidator(&s.Items.Schemas[i], s.Root, s.Path.item(i), s.KnownFormats, s.Options)
result.mergeForSlice(val, i, validator.Validate(val.Index(i).Interface()))
}
}
if s.AdditionalItems != nil && itemsSize < size {
if s.Items != nil && len(s.Items.Schemas) > 0 && !s.AdditionalItems.Allows {
- result.AddErrors(arrayDoesNotAllowAdditionalItemsMsg())
+ result.addErrorsAt(s.Path, arrayDoesNotAllowAdditionalItemsMsg())
}
if s.AdditionalItems.Schema != nil {
for i := itemsSize; i < size-itemsSize+1; i++ {
- validator := newSchemaValidator(s.AdditionalItems.Schema, s.Root, fmt.Sprintf("%s.%d", s.Path, i), s.KnownFormats, s.Options)
+ validator := newSchemaValidator(s.AdditionalItems.Schema, s.Root, s.Path.item(i), s.KnownFormats, s.Options)
result.mergeForSlice(val, i, validator.Validate(val.Index(i).Interface()))
}
}
}
if s.MinItems != nil {
- if err := MinItems(s.Path, s.In, int64(size), *s.MinItems); err != nil {
- result.AddErrors(err)
+ if err := MinItems(s.Path.dotted(), s.In, int64(size), *s.MinItems); err != nil {
+ result.addErrorsAt(s.Path, err)
}
}
if s.MaxItems != nil {
- if err := MaxItems(s.Path, s.In, int64(size), *s.MaxItems); err != nil {
- result.AddErrors(err)
+ if err := MaxItems(s.Path.dotted(), s.In, int64(size), *s.MaxItems); err != nil {
+ result.addErrorsAt(s.Path, err)
}
}
if s.UniqueItems {
- if err := UniqueItems(s.Path, s.In, val.Interface()); err != nil {
- result.AddErrors(err)
+ if err := UniqueItems(s.Path.dotted(), s.In, val.Interface()); err != nil {
+ result.addErrorsAt(s.Path, err)
}
}
result.Inc()
return result
}
+func (s *schemaSliceValidator) setPath(path pathSegments) {
+ s.Path = path
+}
+
func (s *schemaSliceValidator) redeem() {
- pools.poolOfSliceValidators.RedeemValidator(s)
+ validatorPools.sliceValidators.Redeem(s)
}
diff --git a/vendor/github.com/go-openapi/validate/sorted.go b/vendor/github.com/go-openapi/validate/sorted.go
new file mode 100644
index 0000000000..829a042c67
--- /dev/null
+++ b/vendor/github.com/go-openapi/validate/sorted.go
@@ -0,0 +1,39 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package validate
+
+import (
+ "cmp"
+ "maps"
+ "slices"
+ "strings"
+
+ "github.com/go-openapi/spec"
+)
+
+// sortedKeys returns the keys of a map in ascending order.
+//
+// Findings are reported in the order the checks walk the document, and several
+// of them walk a map: definitions, paths, response codes, headers, properties.
+// Go randomises map iteration, so the same bytes validated twice would list
+// their findings in a different order — and where a check stops on the first
+// fault it meets, would name a different offender altogether.
+//
+// Walking keys in sorted order makes both defined: findings come out in
+// definition-name (or path, or status-code) order, on every run.
+func sortedKeys[K cmp.Ordered, V any](m map[K]V) []K {
+ return slices.Sorted(maps.Keys(m))
+}
+
+// sortedRefs orders references by the location they point at.
+//
+// The analyzer gathers references in a map, so the slice it hands back comes
+// out in a different order on every run. See [sortedKeys].
+func sortedRefs(refs []spec.Ref) []spec.Ref {
+ slices.SortFunc(refs, func(a, b spec.Ref) int {
+ return strings.Compare(a.String(), b.String())
+ })
+
+ return refs
+}
diff --git a/vendor/github.com/go-openapi/validate/spec.go b/vendor/github.com/go-openapi/validate/spec.go
index 0849e47ea5..e5d16b6793 100644
--- a/vendor/github.com/go-openapi/validate/spec.go
+++ b/vendor/github.com/go-openapi/validate/spec.go
@@ -10,6 +10,7 @@ import (
"fmt"
"slices"
"sort"
+ "strconv"
"strings"
"github.com/go-openapi/analysis"
@@ -25,6 +26,9 @@ import (
//
// Returns an error flattening in a single standard error, all validation messages.
//
+// Options are forwarded to the underlying [SpecValidator]; in particular [WithPathLoader] injects a
+// confined document loader for validating a specification from an untrusted source.
+//
// - Proposal for enhancement: $ref should not have siblings
// - Proposal for enhancement: make sure documentation reflects all checks and warnings
// - Proposal for enhancement: check on discriminators
@@ -35,8 +39,8 @@ import (
// - Proposal for enhancement: check on required properties to support anyOf, allOf, oneOf
//
// NOTE: SecurityScopes are maps: no need to check uniqueness.
-func Spec(doc *loads.Document, formats strfmt.Registry) error {
- errs, _ /*warns*/ := NewSpecValidator(doc.Schema(), formats).Validate(doc)
+func Spec(doc *loads.Document, formats strfmt.Registry, options ...Option) error {
+ errs, _ /*warns*/ := NewSpecValidator(doc.Schema(), formats, options...).Validate(doc)
if errs.HasErrors() {
return errors.CompositeValidationError(errs.Errors...)
}
@@ -45,24 +49,34 @@ func Spec(doc *loads.Document, formats strfmt.Registry) error {
// SpecValidator validates a swagger 2.0 spec.
type SpecValidator struct {
- schema *spec.Schema // swagger 2.0 schema
- spec *loads.Document
- analyzer *analysis.Spec
- expanded *loads.Document
- KnownFormats strfmt.Registry
- Options Opts // validation options
- schemaOptions *SchemaValidatorOptions
+ schema *spec.Schema // swagger 2.0 schema
+ spec *loads.Document
+ analyzer *analysis.Spec
+ expanded *loads.Document
+ refLocations refLocations
+ refRedirects refRedirects
+ paramLocations paramLocations
+ document any // the document as decoded, to tell what it holds
+ KnownFormats strfmt.Registry
+ Options Opts // validation options
+ schemaOptions *SchemaValidatorOptions
}
// NewSpecValidator creates a new swagger spec validator instance.
-func NewSpecValidator(schema *spec.Schema, formats strfmt.Registry) *SpecValidator {
- // schema options that apply to all called validators
+//
+// Options apply to the schema validators used internally. In particular, [WithPathLoader] injects
+// the document loader used to resolve $ref while validating the specification — set a confined
+// loader when validating a specification from an untrusted source (see the package "Security"
+// notes on [WithPathLoader]).
+func NewSpecValidator(schema *spec.Schema, formats strfmt.Registry, options ...Option) *SpecValidator {
+ // schema options that apply to all called validators: built-in defaults first, then
+ // caller-supplied options (which may add a loader or override a default).
schemaOptions := new(SchemaValidatorOptions)
- for _, o := range []Option{
+ for _, o := range append([]Option{
SwaggerSchema(true),
WithRecycleValidators(true),
// withRecycleResults(true),
- } {
+ }, options...) {
o(schemaOptions)
}
@@ -89,6 +103,15 @@ func (s *SpecValidator) Validate(data any) (*Result, *Result) {
}
s.spec = sd
s.analyzer = analysis.New(sd.Spec())
+ // where each $ref sits, as authored: refs are reported against the
+ // unexpanded document, before expansion flattens them away
+ s.refLocations = newRefLocations(s.analyzer)
+ // where each operation declares its parameters: the document addresses
+ // them by index, and expansion loses that
+ s.paramLocations = newParamLocations(sd.Spec())
+ // where each $ref leads: checks walk the expanded document, and a finding
+ // below a $ref has to be brought back to a node the document contains
+ s.refRedirects = newRefRedirects(s.analyzer)
// Raw spec unmarshalling errors
var obj any
@@ -97,16 +120,23 @@ func (s *SpecValidator) Validate(data any) (*Result, *Result) {
// So this one is just a paranoid check on the behavior of the spec package
panic(InvalidDocumentError)
}
+ s.document = obj
defer func() {
+ // bring findings reached through a $ref back onto the document, then
+ // hold every location to what the document actually addresses
+ errs.redirect(s.refRedirects.through)
+ errs.redirect(s.resolvable)
// errs holds all errors and warnings,
// warnings only warnings
errs.MergeAsWarnings(warnings)
- warnings.AddErrors(errs.Warnings...)
+ // reported as errors of the warnings-only result, but keeping the
+ // location each was recorded with
+ warnings.carryErrors(errs.Warnings, errs.warningLocations)
}()
// Swagger schema validator
- schv := newSchemaValidator(s.schema, nil, "", s.KnownFormats, s.schemaOptions)
+ schv := newSchemaValidator(s.schema, nil, rootPath(), s.KnownFormats, s.schemaOptions)
errs.Merge(schv.Validate(obj)) // error -
// There may be a point in continuing to try and determine more accurate errors
if !s.Options.ContinueOnErrors && errs.HasErrors() {
@@ -158,24 +188,25 @@ func (s *SpecValidator) SetContinueOnErrors(c bool) {
}
func (s *SpecValidator) validateNonEmptyPathParamNames() *Result {
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
if s.spec.Spec().Paths == nil {
- // There is no Paths object: error
- res.AddErrors(noValidPathMsg())
+ // There is no Paths object: the document itself is what lacks it, so
+ // there is no node below it to point at
+ res.addErrorsAt(rootPath(), noValidPathMsg())
return res
}
if s.spec.Spec().Paths.Paths == nil {
// Paths may be empty: warning
- res.AddWarnings(noValidPathMsg())
+ res.addWarningsAt(newPathSegments(swaggerPaths), noValidPathMsg())
return res
}
- for k := range s.spec.Spec().Paths.Paths {
+ for _, k := range sortedKeys(s.spec.Spec().Paths.Paths) {
if strings.Contains(k, "{}") {
- res.AddErrors(emptyPathParameterMsg(k))
+ res.addErrorsAt(newPathSegments(swaggerPaths, k), emptyPathParameterMsg(k))
}
}
@@ -192,21 +223,55 @@ func (s *SpecValidator) validateDuplicateOperationIDs() *Result {
// fallback on possible incomplete picture because of previous errors
analyzer = s.analyzer
}
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
+
+ // the message says how many times an identifier is used, so the count is
+ // what it needs; a reader needs somewhere to go, so the first operation to
+ // declare the identifier is remembered along with it
known := make(map[string]int)
- for _, v := range analyzer.OperationIDs() {
- if v != "" {
- known[v]++
+ declaredAt := make(map[string]pathSegments)
+ operations := analyzer.Operations()
+ for _, method := range sortedKeys(operations) {
+ byPath := operations[method]
+ for _, path := range sortedKeys(byPath) {
+ op := byPath[path]
+ id := operationIdentity(method, path, op)
+ known[id]++
+ if _, isKnown := declaredAt[id]; !isKnown {
+ declaredAt[id] = operationIDPath(path, method, op)
+ }
}
}
- for k, v := range known {
- if v > 1 {
- res.AddErrors(nonUniqueOperationIDMsg(k, v))
+
+ for _, k := range sortedKeys(known) {
+ if v := known[k]; v > 1 {
+ res.addErrorsAt(declaredAt[k], nonUniqueOperationIDMsg(k, v))
}
}
return res
}
+// operationIdentity names an operation the way the analyzer does: by its
+// operationId, or by method and path when it declares none.
+func operationIdentity(method, path string, op *spec.Operation) string {
+ if op == nil || op.ID == "" {
+ return strings.ToUpper(method) + " " + path
+ }
+
+ return op.ID
+}
+
+// operationIDPath locates the operationId of an operation, or the operation
+// itself when it declares none.
+func operationIDPath(path, method string, op *spec.Operation) pathSegments {
+ at := operationPath(path, method)
+ if op == nil || op.ID == "" {
+ return at
+ }
+
+ return at.child(swaggerOperationID)
+}
+
type dupProp struct {
Name string
Definition string
@@ -214,8 +279,10 @@ type dupProp struct {
func (s *SpecValidator) validateDuplicatePropertyNames() *Result {
// definition can't declare a property that's already defined by one of its ancestors
- res := pools.poolOfResults.BorrowResult()
- for k, sch := range s.spec.Spec().Definitions {
+ res := validatorPools.results.Borrow()
+ definitions := s.spec.Spec().Definitions
+ for _, k := range sortedKeys(definitions) {
+ sch := definitions[k]
if len(sch.AllOf) == 0 {
continue
}
@@ -229,8 +296,15 @@ func (s *SpecValidator) validateDuplicatePropertyNames() *Result {
res.Merge(rec)
}
if len(ancs) > 0 {
- res.AddErrors(circularAncestryDefinitionMsg(k, ancs))
- return res
+ res.addErrorsAt(newPathSegments(swaggerDefinitions, k), circularAncestryDefinitionMsg(k, ancs))
+ if !s.Options.ContinueOnErrors {
+ return res
+ }
+
+ // the ancestry loops back on itself: searching it for duplicate
+ // property names would not terminate, so this definition stops here
+ // and the next one is examined.
+ continue
}
knowns := make(map[string]struct{})
@@ -243,7 +317,7 @@ func (s *SpecValidator) validateDuplicatePropertyNames() *Result {
for _, v := range dups {
pns = append(pns, v.Definition+"."+v.Name)
}
- res.AddErrors(duplicatePropertiesMsg(k, pns))
+ res.addErrorsAt(newPathSegments(swaggerDefinitions, k), duplicatePropertiesMsg(k, pns))
}
}
@@ -252,7 +326,7 @@ func (s *SpecValidator) validateDuplicatePropertyNames() *Result {
func (s *SpecValidator) resolveRef(ref *spec.Ref) (*spec.Schema, error) {
if s.spec.SpecFilePath() != "" {
- return spec.ResolveRefWithBase(s.spec.Spec(), ref, &spec.ExpandOptions{RelativeBase: s.spec.SpecFilePath()})
+ return spec.ResolveRefWithBase(s.spec.Spec(), ref, s.schemaOptions.expandOptions(s.spec.SpecFilePath()))
}
// NOTE: it looks like with the new spec resolver, this code is now unrecheable
return spec.ResolveRef(s.spec.Spec(), ref)
@@ -263,7 +337,7 @@ func (s *SpecValidator) validateSchemaPropertyNames(nm string, sch spec.Schema,
schn := nm
schc := &sch
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
for schc.Ref.String() != "" {
// gather property names
@@ -287,7 +361,7 @@ func (s *SpecValidator) validateSchemaPropertyNames(nm string, sch spec.Schema,
return dups, res
}
- for k := range schc.Properties {
+ for _, k := range sortedKeys(schc.Properties) {
_, ok := knowns[k]
if ok {
dups = append(dups, dupProp{Name: k, Definition: schn})
@@ -300,7 +374,7 @@ func (s *SpecValidator) validateSchemaPropertyNames(nm string, sch spec.Schema,
}
func (s *SpecValidator) validateCircularAncestry(nm string, sch spec.Schema, knowns map[string]struct{}) ([]string, *Result) {
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
if sch.Ref.String() == "" && len(sch.AllOf) == 0 { // Safeguard. We should not be able to actually get there
return nil, res
@@ -351,14 +425,17 @@ func (s *SpecValidator) validateCircularAncestry(nm string, sch spec.Schema, kno
//nolint:gocognit // refactor in a forthcoming PR
func (s *SpecValidator) validateItems() *Result {
// validate parameter, items, schema and response objects for presence of item if type is array
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
- for method, pi := range s.analyzer.Operations() {
- for path, op := range pi {
+ operations := s.analyzer.Operations()
+ for _, method := range sortedKeys(operations) {
+ pi := operations[method]
+ for _, path := range sortedKeys(pi) {
+ op := pi[path]
for _, param := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) {
if param.TypeName() == arrayType && param.ItemsTypeName() == "" {
- res.AddErrors(arrayInParamRequiresItemsMsg(param.Name, op.ID))
+ res.addErrorsAt(s.parameterPath(path, method, param.In, param.Name), arrayInParamRequiresItemsMsg(param.Name, op.ID))
continue
}
if param.In != swaggerBody {
@@ -366,7 +443,7 @@ func (s *SpecValidator) validateItems() *Result {
items := param.Items
for items.TypeName() == arrayType {
if items.ItemsTypeName() == "" {
- res.AddErrors(arrayInParamRequiresItemsMsg(param.Name, op.ID))
+ res.addErrorsAt(s.parameterPath(path, method, param.In, param.Name), arrayInParamRequiresItemsMsg(param.Name, op.ID))
break
}
items = items.Items
@@ -375,32 +452,41 @@ func (s *SpecValidator) validateItems() *Result {
} else {
// In: body
if param.Schema != nil {
- res.Merge(s.validateSchemaItems(*param.Schema, fmt.Sprintf("body param %q", param.Name), op.ID))
+ res.Merge(s.validateSchemaItems(*param.Schema, s.parameterPath(path, method, param.In, param.Name).child(jsonSchema),
+ fmt.Sprintf("body param %q", param.Name), op.ID))
}
}
}
- var responses []spec.Response
+ type codedResponse struct {
+ code string
+ resp spec.Response
+ }
+ var responses []codedResponse
if op.Responses != nil {
if op.Responses.Default != nil {
- responses = append(responses, *op.Responses.Default)
+ responses = append(responses, codedResponse{code: jsonDefault, resp: *op.Responses.Default})
}
if op.Responses.StatusCodeResponses != nil {
- for _, v := range op.Responses.StatusCodeResponses {
- responses = append(responses, v)
+ for _, code := range sortedKeys(op.Responses.StatusCodeResponses) {
+ responses = append(responses, codedResponse{
+ code: strconv.Itoa(code),
+ resp: op.Responses.StatusCodeResponses[code],
+ })
}
}
}
for _, resp := range responses {
+ at := responsePath(path, method, resp.code)
// Response headers with array
- for hn, hv := range resp.Headers {
- if hv.TypeName() == arrayType && hv.ItemsTypeName() == "" {
- res.AddErrors(arrayInHeaderRequiresItemsMsg(hn, op.ID))
+ for _, hn := range sortedKeys(resp.resp.Headers) {
+ if hv := resp.resp.Headers[hn]; hv.TypeName() == arrayType && hv.ItemsTypeName() == "" {
+ res.addErrorsAt(at.children(swaggerHeaders, hn), arrayInHeaderRequiresItemsMsg(hn, op.ID))
}
}
- if resp.Schema != nil {
- res.Merge(s.validateSchemaItems(*resp.Schema, "response body", op.ID))
+ if resp.resp.Schema != nil {
+ res.Merge(s.validateSchemaItems(*resp.resp.Schema, at.child(jsonSchema), "response body", op.ID))
}
}
}
@@ -409,24 +495,24 @@ func (s *SpecValidator) validateItems() *Result {
}
// Verifies constraints on array type.
-func (s *SpecValidator) validateSchemaItems(schema spec.Schema, prefix, opID string) *Result {
- res := pools.poolOfResults.BorrowResult()
+func (s *SpecValidator) validateSchemaItems(schema spec.Schema, at pathSegments, prefix, opID string) *Result {
+ res := validatorPools.results.Borrow()
if !schema.Type.Contains(arrayType) {
return res
}
if schema.Items == nil || schema.Items.Len() == 0 {
- res.AddErrors(arrayRequiresItemsMsg(prefix, opID))
+ res.addErrorsAt(at, arrayRequiresItemsMsg(prefix, opID))
return res
}
if schema.Items.Schema != nil {
schema = *schema.Items.Schema
if _, err := compileRegexp(schema.Pattern); err != nil {
- res.AddErrors(invalidItemsPatternMsg(prefix, opID, schema.Pattern))
+ res.addErrorsAt(at, invalidItemsPatternMsg(prefix, opID, schema.Pattern))
}
- res.Merge(s.validateSchemaItems(schema, prefix, opID))
+ res.Merge(s.validateSchemaItems(schema, at.child(jsonItems), prefix, opID))
}
return res
}
@@ -434,7 +520,7 @@ func (s *SpecValidator) validateSchemaItems(schema spec.Schema, prefix, opID str
func (s *SpecValidator) validatePathParamPresence(path string, fromPath, fromOperation []string) *Result {
// Each defined operation path parameters must correspond to a named element in the API's path pattern.
// (For example, you cannot have a path parameter named id for the following path /pets/{petId} but you must have a path parameter named petId.)
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
for _, l := range fromPath {
var matched bool
for _, r := range fromOperation {
@@ -444,7 +530,7 @@ func (s *SpecValidator) validatePathParamPresence(path string, fromPath, fromOpe
}
}
if !matched {
- res.AddErrors(noParameterInPathMsg(l))
+ res.addErrorsAt(newPathSegments(swaggerPaths, path), noParameterInPathMsg(l))
}
}
@@ -454,7 +540,7 @@ func (s *SpecValidator) validatePathParamPresence(path string, fromPath, fromOpe
matched = true
}
if !matched {
- res.AddErrors(pathParamNotInPathMsg(path, p))
+ res.addErrorsAt(newPathSegments(swaggerPaths, path), pathParamNotInPathMsg(path, p))
}
}
@@ -487,9 +573,9 @@ func (s *SpecValidator) validateReferencedParameters() *Result {
if len(expected) == 0 {
return nil
}
- result := pools.poolOfResults.BorrowResult()
- for k := range expected {
- result.AddWarnings(unusedParamMsg(k))
+ result := validatorPools.results.Borrow()
+ for _, k := range sortedKeys(expected) {
+ result.addWarningsAt(localRefPath(k), unusedParamMsg(k))
}
return result
}
@@ -512,10 +598,12 @@ func (s *SpecValidator) validateReferencedResponses() *Result {
if len(expected) == 0 {
return nil
}
- result := pools.poolOfResults.BorrowResult()
- for k := range expected {
- result.AddWarnings(unusedResponseMsg(k))
+
+ result := validatorPools.results.Borrow()
+ for _, k := range sortedKeys(expected) {
+ result.addWarningsAt(localRefPath(k), unusedResponseMsg(k))
}
+
return result
}
@@ -539,59 +627,63 @@ func (s *SpecValidator) validateReferencedDefinitions() *Result {
}
result := new(Result)
- for k := range expected {
- result.AddWarnings(unusedDefinitionMsg(k))
+ for _, k := range sortedKeys(expected) {
+ result.addWarningsAt(localRefPath(k), unusedDefinitionMsg(k))
}
return result
}
func (s *SpecValidator) validateRequiredDefinitions() *Result {
// Each property listed in the required array must be defined in the properties of the model
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
+
+ definitions := s.spec.Spec().Definitions
DEFINITIONS:
- for d, schema := range s.spec.Spec().Definitions {
- if schema.Required != nil { // Safeguard
- for _, pn := range schema.Required {
- red := s.validateRequiredProperties(pn, d, &schema) //#nosec
- // NOTE: capture validity before merging: Merge may redeem `red` to the
- // pool (wantsRedeemOnMerge), after which reading it races with a concurrent
- // BorrowResult().cleared() in another goroutine sharing the global pool.
- isValid := red.IsValid()
- res.Merge(red)
- if !isValid && !s.Options.ContinueOnErrors {
- break DEFINITIONS // there is an error, let's stop that bleeding
- }
- }
+ for _, d := range sortedKeys(definitions) {
+ schema := definitions[d]
+ red := validatorPools.results.Borrow()
+ keepGoing := s.walkRequired(newPathSegments(swaggerDefinitions, d), &schema, red) //#nosec
+ res.Merge(red)
+ if !keepGoing {
+ break DEFINITIONS // there is an error, let's stop that bleeding
}
}
return res
}
-func (s *SpecValidator) validateRequiredProperties(path, in string, v *spec.Schema) *Result {
+// validateRequiredProperties checks one entry of a required array.
+//
+// schemaAt locates the schema being searched for the property, which moves as
+// the search descends into additionalProperties. requiredAt locates the entry
+// of the required array that started it, and stays put.
+func (s *SpecValidator) validateRequiredProperties(
+ path string, of schemaIdentity, schemaAt, requiredAt pathSegments, v *spec.Schema,
+) *Result {
+ in := of.name
// Takes care of recursive property definitions, which may be nested in additionalProperties schemas
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
propertyMatch := false
patternMatch := false
additionalPropertiesMatch := false
isReadOnly := false
- // Regular properties
- if _, ok := v.Properties[path]; ok {
+ // Regular properties, including those a base definition contributes
+ if readOnly, declared := s.declaresProperty(v, path, maxCompositionHops); declared {
propertyMatch = true
- isReadOnly = v.Properties[path].ReadOnly
+ isReadOnly = readOnly
}
// NOTE: patternProperties are not supported in swagger. Even though, we continue validation here
// We check all defined patterns: if one regexp is invalid, croaks an error
- for pp, pv := range v.PatternProperties {
+ for _, pp := range sortedKeys(v.PatternProperties) {
re, err := compileRegexp(pp)
if err != nil {
- res.AddErrors(invalidPatternMsg(pp, in))
+ res.addErrorsAt(schemaAt, invalidPatternMsg(pp, in))
} else if re.MatchString(path) {
patternMatch = true
if !propertyMatch {
- isReadOnly = pv.ReadOnly
+ isReadOnly = v.PatternProperties[pp].ReadOnly
}
}
}
@@ -604,7 +696,7 @@ func (s *SpecValidator) validateRequiredProperties(path, in string, v *spec.Sche
// additionalProperties as schema are upported in swagger
// recursively validates additionalProperties schema
// Proposal for enhancement: anyOf, allOf, oneOf like in schemaPropsValidator
- red := s.validateRequiredProperties(path, in, v.AdditionalProperties.Schema)
+ red := s.validateRequiredProperties(path, of, schemaAt.child(jsonAdditionalProperties), requiredAt, v.AdditionalProperties.Schema)
if red.IsValid() {
additionalPropertiesMatch = true
if !propertyMatch && !patternMatch {
@@ -617,11 +709,11 @@ func (s *SpecValidator) validateRequiredProperties(path, in string, v *spec.Sche
}
if !propertyMatch && !patternMatch && !additionalPropertiesMatch {
- res.AddErrors(requiredButNotDefinedMsg(path, in))
+ res.addErrorsAt(requiredAt, of.requiredButNotDefined(path))
}
if isReadOnly {
- res.AddWarnings(readOnlyAndRequiredMsg(in, path))
+ res.addWarningsAt(requiredAt, readOnlyAndRequiredMsg(in, path))
}
return res
}
@@ -637,26 +729,29 @@ func (s *SpecValidator) validateParameters() *Result {
// - parameters with pattern property must specify valid patterns
// - $ref in parameters must resolve
// - path param must be required
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
rexGarbledPathSegment := mustCompileRegexp(`.*[{}\s]+.*`)
- for method, pi := range s.expandedAnalyzer().Operations() {
+ operations := s.expandedAnalyzer().Operations()
+ for _, method := range sortedKeys(operations) {
+ pi := operations[method]
methodPaths := make(map[string]map[string]string)
- for path, op := range pi {
+ for _, path := range sortedKeys(pi) {
+ op := pi[path]
if s.Options.StrictPathParamUniqueness {
pathToAdd := pathHelp.stripParametersInPath(path)
// Warn on garbled path afer param stripping
if rexGarbledPathSegment.MatchString(pathToAdd) {
- res.AddWarnings(pathStrippedParamGarbledMsg(pathToAdd))
+ res.addWarningsAt(newPathSegments(swaggerPaths, path), pathStrippedParamGarbledMsg(pathToAdd))
}
// Check uniqueness of stripped paths
if _, found := methodPaths[method][pathToAdd]; found {
// Sort names for stable, testable output
if strings.Compare(path, methodPaths[method][pathToAdd]) < 0 {
- res.AddErrors(pathOverlapMsg(path, methodPaths[method][pathToAdd]))
+ res.addErrorsAt(newPathSegments(swaggerPaths, path), pathOverlapMsg(path, methodPaths[method][pathToAdd]))
} else {
- res.AddErrors(pathOverlapMsg(methodPaths[method][pathToAdd], path))
+ res.addErrorsAt(newPathSegments(swaggerPaths, path), pathOverlapMsg(methodPaths[method][pathToAdd], path))
}
} else {
if _, found := methodPaths[method]; !found {
@@ -688,10 +783,10 @@ func (s *SpecValidator) validateParameters() *Result {
for _, pr := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) {
// An expanded parameter must validate the Parameter schema (an unexpanded $ref always passes high-level schema validation)
- schv := newSchemaValidator(¶mSchema, s.schema, fmt.Sprintf("%s.%s.parameters.%s", path, method, pr.Name), s.KnownFormats, s.schemaOptions)
+ schv := newSchemaValidator(¶mSchema, s.schema, s.parameterPath(path, method, pr.In, pr.Name), s.KnownFormats, s.schemaOptions)
var obj any
if err := jsonutils.FromDynamicJSON(pr, &obj); err != nil {
- res.AddErrors(err)
+ res.addErrorsAt(s.parameterPath(path, method, pr.In, pr.Name), err)
return res
}
@@ -700,7 +795,7 @@ func (s *SpecValidator) validateParameters() *Result {
// Validate pattern regexp for parameters with a Pattern property
if _, err := compileRegexp(pr.Pattern); err != nil {
- res.AddErrors(invalidPatternInParamMsg(op.ID, pr.Name, pr.Pattern))
+ res.addErrorsAt(s.parameterPath(path, method, pr.In, pr.Name), invalidPatternInParamMsg(op.ID, pr.Name, pr.Pattern))
}
// There must be at most one parameter in body: list them all
@@ -713,7 +808,7 @@ func (s *SpecValidator) validateParameters() *Result {
paramNames = append(paramNames, pr.Name)
// Path declared in path must have the required: true property
if !pr.Required {
- res.AddErrors(pathParamRequiredMsg(op.ID, pr.Name))
+ res.addErrorsAt(s.parameterPath(path, method, pr.In, pr.Name), pathParamRequiredMsg(op.ID, pr.Name))
}
}
@@ -724,31 +819,31 @@ func (s *SpecValidator) validateParameters() *Result {
if pr.Type != numberType && pr.Type != integerType &&
(pr.Maximum != nil || pr.Minimum != nil || pr.MultipleOf != nil) {
// A non-numeric parameter has validation keywords for numeric instances (number and integer)
- res.AddWarnings(parameterValidationTypeMismatchMsg(pr.Name, path, pr.Type))
+ res.addWarningsAt(s.parameterPath(path, method, pr.In, pr.Name), parameterValidationTypeMismatchMsg(pr.Name, path, pr.Type))
}
if pr.Type != stringType &&
// A non-string parameter has validation keywords for strings
(pr.MaxLength != nil || pr.MinLength != nil || pr.Pattern != "") {
- res.AddWarnings(parameterValidationTypeMismatchMsg(pr.Name, path, pr.Type))
+ res.addWarningsAt(s.parameterPath(path, method, pr.In, pr.Name), parameterValidationTypeMismatchMsg(pr.Name, path, pr.Type))
}
if pr.Type != arrayType &&
// A non-array parameter has validation keywords for arrays
(pr.MaxItems != nil || pr.MinItems != nil || pr.UniqueItems) {
- res.AddWarnings(parameterValidationTypeMismatchMsg(pr.Name, path, pr.Type))
+ res.addWarningsAt(s.parameterPath(path, method, pr.In, pr.Name), parameterValidationTypeMismatchMsg(pr.Name, path, pr.Type))
}
}
// In:formData and In:body are mutually exclusive
if hasBody && hasForm {
- res.AddErrors(bothFormDataAndBodyMsg(op.ID))
+ res.addErrorsAt(operationPath(path, method), bothFormDataAndBodyMsg(op.ID))
}
// There must be at most one body param
// Accurately report situations when more than 1 body param is declared (possibly unnamed)
if len(bodyParams) > 1 {
sort.Strings(bodyParams)
- res.AddErrors(multipleBodyParamMsg(op.ID, bodyParams))
+ res.addErrorsAt(operationPath(path, method), multipleBodyParamMsg(op.ID, bodyParams))
}
// Check uniqueness of parameters in path
@@ -756,7 +851,7 @@ func (s *SpecValidator) validateParameters() *Result {
for i, p := range paramsInPath {
for j, q := range paramsInPath {
if p == q && i > j {
- res.AddErrors(pathParamNotUniqueMsg(path, p, q))
+ res.addErrorsAt(newPathSegments(swaggerPaths, path), pathParamNotUniqueMsg(path, p, q))
break
}
}
@@ -766,7 +861,7 @@ func (s *SpecValidator) validateParameters() *Result {
rexGarbledParam := mustCompileRegexp(`{.*[{}\s]+.*}`)
for _, p := range paramsInPath {
if rexGarbledParam.MatchString(p) {
- res.AddWarnings(pathParamGarbledMsg(path, p))
+ res.addWarningsAt(newPathSegments(swaggerPaths, path), pathParamGarbledMsg(path, p))
}
}
@@ -779,25 +874,63 @@ func (s *SpecValidator) validateParameters() *Result {
func (s *SpecValidator) validateReferencesValid() *Result {
// each reference must point to a valid object
- res := pools.poolOfResults.BorrowResult()
- for _, r := range s.analyzer.AllRefs() {
+ res := validatorPools.results.Borrow()
+ for _, r := range sortedRefs(s.analyzer.AllRefs()) {
if !r.IsValidURI(s.spec.SpecFilePath()) { // Safeguard - spec should always yield a valid URI
- res.AddErrors(invalidRefMsg(r.String()))
+ res.addErrorsAt(s.refLocations.at(r.String()), invalidRefMsg(r.String()))
}
}
if !res.HasErrors() {
// NOTE: with default settings, loads.Document.Expanded()
// stops on first error. Anyhow, the expand option to continue
// on errors fails to report errors at all.
- exp, err := s.spec.Expanded()
+ //
+ // Pass the injected loader (if any) so whole-spec expansion is confined too. When no loader
+ // is set, this is a no-op: loads falls back to the document's own loader.
+ exp, err := s.spec.Expanded(s.schemaOptions.expandOptions(""))
if err != nil {
- res.AddErrors(unresolvedReferencesMsg(err))
+ res.addErrorsAt(s.firstUnresolvableRef(), unresolvedReferencesMsg(err))
}
s.expanded = exp
}
return res
}
+// firstUnresolvableRef locates the declaration of the first local $ref, in
+// document order, that points at a node the document does not hold.
+//
+// Expansion reports the whole document in a single message, naming only the
+// reference it happened to trip on, so the finding has no location of its own.
+// A document usually has one broken reference; when it has several, this is the
+// first one a reader would meet.
+func (s *SpecValidator) firstUnresolvableRef() pathSegments {
+ first := rootPath()
+ found := false
+
+ for _, r := range s.analyzer.AllRefs() {
+ value := r.String()
+ if !strings.HasPrefix(value, "#/") {
+ // a remote reference cannot be checked against the document alone
+ continue
+ }
+
+ pointer, err := jsonpointer.New(strings.TrimPrefix(value, "#"))
+ if err != nil {
+ continue
+ }
+ if _, _, err := pointer.Get(s.document); err == nil {
+ continue
+ }
+
+ at := s.refLocations.at(value)
+ if !found || at.pointer() < first.pointer() {
+ first, found = at, true
+ }
+ }
+
+ return first
+}
+
func (s *SpecValidator) checkUniqueParams(path, method string, op *spec.Operation) *Result {
// Check for duplicate parameters declaration in param section.
// Each parameter should have a unique `name` and `type` combination
@@ -805,7 +938,7 @@ func (s *SpecValidator) checkUniqueParams(path, method string, op *spec.Operatio
// However, there are some issues with such a factorization:
// - analysis does not seem to fully expand params
// - param keys may be altered by x-go-name
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
pnames := make(map[string]struct{})
if op.Parameters != nil { // Safeguard
@@ -818,7 +951,7 @@ func (s *SpecValidator) checkUniqueParams(path, method string, op *spec.Operatio
key := fmt.Sprintf("%s#%s", pr.In, pr.Name)
if _, ok = pnames[key]; ok {
- res.AddErrors(duplicateParamNameMsg(pr.In, pr.Name, op.ID))
+ res.addErrorsAt(s.parameterPath(path, method, pr.In, pr.Name), duplicateParamNameMsg(pr.In, pr.Name, op.ID))
}
pnames[key] = struct{}{}
}
diff --git a/vendor/github.com/go-openapi/validate/spec_messages.go b/vendor/github.com/go-openapi/validate/spec_messages.go
index eeb8a86951..0a0739a75d 100644
--- a/vendor/github.com/go-openapi/validate/spec_messages.go
+++ b/vendor/github.com/go-openapi/validate/spec_messages.go
@@ -132,6 +132,9 @@ const (
// RequiredButNotDefinedError ...
RequiredButNotDefinedError = "%q is present in required but not defined as property in definition %q"
+ // RequiredButNotDefinedInSchemaError is the same slip, in a schema a definition holds rather than
+ // in the definition itself.
+ RequiredButNotDefinedInSchemaError = "%q is present in required but not defined as property in schema %q"
// SomeParametersBrokenError indicates that some parameters could not be resolved, which might result in partial checks to be carried on.
SomeParametersBrokenError = "some parameters definitions are broken in %q.%s. Cannot carry on full checks on parameters for operation %s"
@@ -260,6 +263,10 @@ func requiredButNotDefinedMsg(path, definition string) errors.Error {
return errors.New(errors.CompositeErrorCode, RequiredButNotDefinedError, path, definition)
}
+func requiredButNotDefinedInSchemaMsg(path, schema string) errors.Error {
+ return errors.New(errors.CompositeErrorCode, RequiredButNotDefinedInSchemaError, path, schema)
+}
+
func pathParamGarbledMsg(path, param string) errors.Error {
return errors.New(errors.CompositeErrorCode, PathParamGarbledWarning, path, param)
}
diff --git a/vendor/github.com/go-openapi/validate/spec_ref_warnings.go b/vendor/github.com/go-openapi/validate/spec_ref_warnings.go
index 49c72314c9..d56cb177cc 100644
--- a/vendor/github.com/go-openapi/validate/spec_ref_warnings.go
+++ b/vendor/github.com/go-openapi/validate/spec_ref_warnings.go
@@ -34,12 +34,12 @@ const minDistinctHostsToWarn = 2
//
// All findings are warnings: they do not affect validity (see Result.IsValid).
func (s *SpecValidator) validateDubiousRefs() *Result {
- res := pools.poolOfResults.BorrowResult()
+ res := validatorPools.results.Borrow()
baseDir, hasBase := s.localBaseDir()
remoteHosts := make(map[string]struct{})
- for _, r := range s.analyzer.AllRefs() {
+ for _, r := range sortedRefs(s.analyzer.AllRefs()) {
u := r.GetURL()
if u == nil { // Safeguard: a valid spec always yields parseable refs
continue
@@ -48,7 +48,7 @@ func (s *SpecValidator) validateDubiousRefs() *Result {
// Rule 1: absolute local reference escaping the base path.
if refPath, isLocalAbs := absoluteLocalRefPath(r, u); isLocalAbs {
if !hasBase || !isBeneathBase(refPath, baseDir) {
- res.AddWarnings(dubiousAbsoluteRefMsg(r.String()))
+ res.addWarningsAt(s.refLocations.at(r.String()), dubiousAbsoluteRefMsg(r.String()))
}
continue
}
diff --git a/vendor/github.com/go-openapi/validate/type.go b/vendor/github.com/go-openapi/validate/type.go
index d29574c349..3016783f07 100644
--- a/vendor/github.com/go-openapi/validate/type.go
+++ b/vendor/github.com/go-openapi/validate/type.go
@@ -15,7 +15,7 @@ import (
)
type typeValidator struct {
- Path string
+ Path pathSegments
In string
Type spec.StringOrArray
Nullable bool
@@ -23,14 +23,14 @@ type typeValidator struct {
Options *SchemaValidatorOptions
}
-func newTypeValidator(path, in string, typ spec.StringOrArray, nullable bool, format string, opts *SchemaValidatorOptions) *typeValidator {
+func newTypeValidator(path pathSegments, in string, typ spec.StringOrArray, nullable bool, format string, opts *SchemaValidatorOptions) *typeValidator {
if opts == nil {
opts = new(SchemaValidatorOptions)
}
var t *typeValidator
if opts.recycleValidators {
- t = pools.poolOfTypeValidators.BorrowValidator()
+ t = validatorPools.typeValidators.Borrow()
} else {
t = new(typeValidator)
}
@@ -45,10 +45,6 @@ func newTypeValidator(path, in string, typ spec.StringOrArray, nullable bool, fo
return t
}
-func (t *typeValidator) SetPath(path string) {
- t.Path = path
-}
-
func (t *typeValidator) Applies(source any, _ reflect.Kind) bool {
// typeValidator applies to Schema, Parameter and Header objects
switch source.(type) {
@@ -72,7 +68,7 @@ func (t *typeValidator) Validate(data any) *Result {
if data == nil {
// nil or zero value for the passed structure require Type: null
if len(t.Type) > 0 && !t.Type.Contains(nullType) && !t.Nullable { // NOTE: if a property is not required it also passes this
- return errorHelp.sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), nullType), t.Options.recycleResult)
+ return errorHelp.sErrAt(t.Path, errors.InvalidType(t.Path.dotted(), t.In, strings.Join(t.Type, ","), nullType), t.Options.recycleResult)
}
return emptyResult
@@ -98,7 +94,7 @@ func (t *typeValidator) Validate(data any) *Result {
!isFloatInt && !isIntFloat && !isLowerInt && !isLowerFloat
if formatMismatch {
// NOTE: test case
- return errorHelp.sErr(errors.InvalidType(t.Path, t.In, t.Format, format), t.Options.recycleResult)
+ return errorHelp.sErrAt(t.Path, errors.InvalidType(t.Path.dotted(), t.In, t.Format, format), t.Options.recycleResult)
}
if !t.Type.Contains(numberType) && !t.Type.Contains(integerType) && t.Format != "" && (kind == reflect.String || kind == reflect.Slice) {
@@ -106,7 +102,7 @@ func (t *typeValidator) Validate(data any) *Result {
}
if !t.Type.Contains(schType) && !isFloatInt && !isIntFloat {
- return errorHelp.sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), schType), t.Options.recycleResult)
+ return errorHelp.sErrAt(t.Path, errors.InvalidType(t.Path.dotted(), t.In, strings.Join(t.Type, ","), schType), t.Options.recycleResult)
}
return emptyResult
@@ -201,6 +197,10 @@ func (t *typeValidator) schemaInfoForType(data any) (string, string) {
return "", ""
}
+func (t *typeValidator) setPath(path pathSegments) {
+ t.Path = path
+}
+
func (t *typeValidator) redeem() {
- pools.poolOfTypeValidators.RedeemValidator(t)
+ validatorPools.typeValidators.Redeem(t)
}
diff --git a/vendor/github.com/go-openapi/validate/validator.go b/vendor/github.com/go-openapi/validate/validator.go
index e7aebc5256..3989b21e7d 100644
--- a/vendor/github.com/go-openapi/validate/validator.go
+++ b/vendor/github.com/go-openapi/validate/validator.go
@@ -4,7 +4,6 @@
package validate
import (
- "fmt"
"reflect"
"github.com/go-openapi/errors"
@@ -18,7 +17,7 @@ type EntityValidator interface {
}
type valueValidator interface {
- SetPath(path string)
+ setPath(path pathSegments)
Applies(source any, kind reflect.Kind) bool
Validate(data any) *Result
}
@@ -26,21 +25,21 @@ type valueValidator interface {
type itemsValidator struct {
items *spec.Items
root any
- path string
+ path pathSegments
in string
validators [6]valueValidator
KnownFormats strfmt.Registry
Options *SchemaValidatorOptions
}
-func newItemsValidator(path, in string, items *spec.Items, root any, formats strfmt.Registry, opts *SchemaValidatorOptions) *itemsValidator {
+func newItemsValidator(path pathSegments, in string, items *spec.Items, root any, formats strfmt.Registry, opts *SchemaValidatorOptions) *itemsValidator {
if opts == nil {
opts = new(SchemaValidatorOptions)
}
var iv *itemsValidator
if opts.recycleValidators {
- iv = pools.poolOfItemsValidators.BorrowValidator()
+ iv = validatorPools.itemsValidators.Borrow()
} else {
iv = new(itemsValidator)
}
@@ -74,12 +73,12 @@ func (i *itemsValidator) Validate(index int, data any) *Result {
kind := tpe.Kind()
var result *Result
if i.Options.recycleResult {
- result = pools.poolOfResults.BorrowResult()
+ result = validatorPools.results.Borrow()
} else {
result = new(Result)
}
- path := fmt.Sprintf("%s.%d", i.path, index)
+ path := i.path.item(index)
for idx, validator := range i.validators {
if !validator.Applies(i.root, kind) {
@@ -97,7 +96,7 @@ func (i *itemsValidator) Validate(index int, data any) *Result {
continue
}
- validator.SetPath(path)
+ validator.setPath(path)
err := validator.Validate(data)
if i.Options.recycleValidators {
i.validators[idx] = nil // prevents further (unsafe) usage
@@ -130,7 +129,7 @@ func (i *itemsValidator) typeValidator() valueValidator {
func (i *itemsValidator) commonValidator() valueValidator {
return newBasicCommonValidator(
- "",
+ nil, // located by the item index, set on each Validate call
i.in,
i.items.Default,
i.items.Enum,
@@ -140,7 +139,7 @@ func (i *itemsValidator) commonValidator() valueValidator {
func (i *itemsValidator) sliceValidator() valueValidator {
return newBasicSliceValidator(
- "",
+ nil, // located by the item index, set on each Validate call
i.in,
i.items.Default,
i.items.MaxItems,
@@ -155,7 +154,7 @@ func (i *itemsValidator) sliceValidator() valueValidator {
func (i *itemsValidator) numberValidator() valueValidator {
return newNumberValidator(
- "",
+ nil, // located by the item index, set on each Validate call
i.in,
i.items.Default,
i.items.MultipleOf,
@@ -171,7 +170,7 @@ func (i *itemsValidator) numberValidator() valueValidator {
func (i *itemsValidator) stringValidator() valueValidator {
return newStringValidator(
- "",
+ nil, // located by the item index, set on each Validate call
i.in,
i.items.Default,
false, // Required
@@ -185,7 +184,7 @@ func (i *itemsValidator) stringValidator() valueValidator {
func (i *itemsValidator) formatValidator() valueValidator {
return newFormatValidator(
- "",
+ nil, // located by the item index, set on each Validate call
i.in,
i.items.Format,
i.KnownFormats,
@@ -194,7 +193,7 @@ func (i *itemsValidator) formatValidator() valueValidator {
}
func (i *itemsValidator) redeem() {
- pools.poolOfItemsValidators.RedeemValidator(i)
+ validatorPools.itemsValidators.Redeem(i)
}
func (i *itemsValidator) redeemChildren() {
@@ -213,21 +212,21 @@ func (i *itemsValidator) redeemChildren() {
}
type basicCommonValidator struct {
- Path string
+ Path pathSegments
In string
Default any
Enum []any
Options *SchemaValidatorOptions
}
-func newBasicCommonValidator(path, in string, def any, enum []any, opts *SchemaValidatorOptions) *basicCommonValidator {
+func newBasicCommonValidator(path pathSegments, in string, def any, enum []any, opts *SchemaValidatorOptions) *basicCommonValidator {
if opts == nil {
opts = new(SchemaValidatorOptions)
}
var b *basicCommonValidator
if opts.recycleValidators {
- b = pools.poolOfBasicCommonValidators.BorrowValidator()
+ b = validatorPools.basicCommonValidators.Borrow()
} else {
b = new(basicCommonValidator)
}
@@ -241,10 +240,6 @@ func newBasicCommonValidator(path, in string, def any, enum []any, opts *SchemaV
return b
}
-func (b *basicCommonValidator) SetPath(path string) {
- b.Path = path
-}
-
func (b *basicCommonValidator) Applies(source any, _ reflect.Kind) bool {
switch source.(type) {
case *spec.Parameter, *spec.Schema, *spec.Header:
@@ -279,11 +274,15 @@ func (b *basicCommonValidator) Validate(data any) (res *Result) {
}
}
- return errorHelp.sErr(errors.EnumFail(b.Path, b.In, data, b.Enum), b.Options.recycleResult)
+ return errorHelp.sErrAt(b.Path, errors.EnumFail(b.Path.dotted(), b.In, data, b.Enum), b.Options.recycleResult)
+}
+
+func (b *basicCommonValidator) setPath(path pathSegments) {
+ b.Path = path
}
func (b *basicCommonValidator) redeem() {
- pools.poolOfBasicCommonValidators.RedeemValidator(b)
+ validatorPools.basicCommonValidators.Redeem(b)
}
// A HeaderValidator has very limited subset of validations to apply.
@@ -312,7 +311,7 @@ func newHeaderValidator(name string, header *spec.Header, formats strfmt.Registr
var p *HeaderValidator
if opts.recycleValidators {
- p = pools.poolOfHeaderValidators.BorrowValidator()
+ p = validatorPools.headerValidators.Borrow()
} else {
p = new(HeaderValidator)
}
@@ -323,7 +322,7 @@ func newHeaderValidator(name string, header *spec.Header, formats strfmt.Registr
p.Options = opts
p.validators = [6]valueValidator{
newTypeValidator(
- name,
+ newPathSegments(name),
"header",
spec.StringOrArray([]string{header.Type}),
header.Nullable,
@@ -355,7 +354,7 @@ func (p *HeaderValidator) Validate(data any) *Result {
var result *Result
if p.Options.recycleResult {
- result = pools.poolOfResults.BorrowResult()
+ result = validatorPools.results.Borrow()
} else {
result = new(Result)
}
@@ -397,7 +396,7 @@ func (p *HeaderValidator) Validate(data any) *Result {
func (p *HeaderValidator) commonValidator() valueValidator {
return newBasicCommonValidator(
- p.name,
+ newPathSegments(p.name),
"response",
p.header.Default,
p.header.Enum,
@@ -407,7 +406,7 @@ func (p *HeaderValidator) commonValidator() valueValidator {
func (p *HeaderValidator) sliceValidator() valueValidator {
return newBasicSliceValidator(
- p.name,
+ newPathSegments(p.name),
"response",
p.header.Default,
p.header.MaxItems,
@@ -422,7 +421,7 @@ func (p *HeaderValidator) sliceValidator() valueValidator {
func (p *HeaderValidator) numberValidator() valueValidator {
return newNumberValidator(
- p.name,
+ newPathSegments(p.name),
"response",
p.header.Default,
p.header.MultipleOf,
@@ -438,7 +437,7 @@ func (p *HeaderValidator) numberValidator() valueValidator {
func (p *HeaderValidator) stringValidator() valueValidator {
return newStringValidator(
- p.name,
+ newPathSegments(p.name),
"response",
p.header.Default,
true,
@@ -452,7 +451,7 @@ func (p *HeaderValidator) stringValidator() valueValidator {
func (p *HeaderValidator) formatValidator() valueValidator {
return newFormatValidator(
- p.name,
+ newPathSegments(p.name),
"response",
p.header.Format,
p.KnownFormats,
@@ -461,7 +460,7 @@ func (p *HeaderValidator) formatValidator() valueValidator {
}
func (p *HeaderValidator) redeem() {
- pools.poolOfHeaderValidators.RedeemValidator(p)
+ validatorPools.headerValidators.Redeem(p)
}
func (p *HeaderValidator) redeemChildren() {
@@ -504,7 +503,7 @@ func newParamValidator(param *spec.Parameter, formats strfmt.Registry, opts *Sch
var p *ParamValidator
if opts.recycleValidators {
- p = pools.poolOfParamValidators.BorrowValidator()
+ p = validatorPools.paramValidators.Borrow()
} else {
p = new(ParamValidator)
}
@@ -514,7 +513,7 @@ func newParamValidator(param *spec.Parameter, formats strfmt.Registry, opts *Sch
p.Options = opts
p.validators = [6]valueValidator{
newTypeValidator(
- param.Name,
+ newPathSegments(param.Name),
param.In,
spec.StringOrArray([]string{param.Type}),
param.Nullable,
@@ -539,7 +538,7 @@ func (p *ParamValidator) Validate(data any) *Result {
var result *Result
if p.Options.recycleResult {
- result = pools.poolOfResults.BorrowResult()
+ result = validatorPools.results.Borrow()
} else {
result = new(Result)
}
@@ -589,7 +588,7 @@ func (p *ParamValidator) Validate(data any) *Result {
func (p *ParamValidator) commonValidator() valueValidator {
return newBasicCommonValidator(
- p.param.Name,
+ newPathSegments(p.param.Name),
p.param.In,
p.param.Default,
p.param.Enum,
@@ -599,7 +598,7 @@ func (p *ParamValidator) commonValidator() valueValidator {
func (p *ParamValidator) sliceValidator() valueValidator {
return newBasicSliceValidator(
- p.param.Name,
+ newPathSegments(p.param.Name),
p.param.In,
p.param.Default,
p.param.MaxItems,
@@ -614,7 +613,7 @@ func (p *ParamValidator) sliceValidator() valueValidator {
func (p *ParamValidator) numberValidator() valueValidator {
return newNumberValidator(
- p.param.Name,
+ newPathSegments(p.param.Name),
p.param.In,
p.param.Default,
p.param.MultipleOf,
@@ -630,7 +629,7 @@ func (p *ParamValidator) numberValidator() valueValidator {
func (p *ParamValidator) stringValidator() valueValidator {
return newStringValidator(
- p.param.Name,
+ newPathSegments(p.param.Name),
p.param.In,
p.param.Default,
p.param.Required,
@@ -644,7 +643,7 @@ func (p *ParamValidator) stringValidator() valueValidator {
func (p *ParamValidator) formatValidator() valueValidator {
return newFormatValidator(
- p.param.Name,
+ newPathSegments(p.param.Name),
p.param.In,
p.param.Format,
p.KnownFormats,
@@ -653,7 +652,7 @@ func (p *ParamValidator) formatValidator() valueValidator {
}
func (p *ParamValidator) redeem() {
- pools.poolOfParamValidators.RedeemValidator(p)
+ validatorPools.paramValidators.Redeem(p)
}
func (p *ParamValidator) redeemChildren() {
@@ -672,7 +671,7 @@ func (p *ParamValidator) redeemChildren() {
}
type basicSliceValidator struct {
- Path string
+ Path pathSegments
In string
Default any
MaxItems *int64
@@ -685,7 +684,7 @@ type basicSliceValidator struct {
}
func newBasicSliceValidator(
- path, in string,
+ path pathSegments, in string,
def any, maxItems, minItems *int64, uniqueItems bool, items *spec.Items,
source any, formats strfmt.Registry,
opts *SchemaValidatorOptions,
@@ -696,7 +695,7 @@ func newBasicSliceValidator(
var s *basicSliceValidator
if opts.recycleValidators {
- s = pools.poolOfBasicSliceValidators.BorrowValidator()
+ s = validatorPools.basicSliceValidators.Borrow()
} else {
s = new(basicSliceValidator)
}
@@ -715,10 +714,6 @@ func newBasicSliceValidator(
return s
}
-func (s *basicSliceValidator) SetPath(path string) {
- s.Path = path
-}
-
func (s *basicSliceValidator) Applies(source any, kind reflect.Kind) bool {
switch source.(type) {
case *spec.Parameter, *spec.Items, *spec.Header:
@@ -738,20 +733,20 @@ func (s *basicSliceValidator) Validate(data any) *Result {
size := int64(val.Len())
if s.MinItems != nil {
- if err := MinItems(s.Path, s.In, size, *s.MinItems); err != nil {
- return errorHelp.sErr(err, s.Options.recycleResult)
+ if err := MinItems(s.Path.dotted(), s.In, size, *s.MinItems); err != nil {
+ return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult)
}
}
if s.MaxItems != nil {
- if err := MaxItems(s.Path, s.In, size, *s.MaxItems); err != nil {
- return errorHelp.sErr(err, s.Options.recycleResult)
+ if err := MaxItems(s.Path.dotted(), s.In, size, *s.MaxItems); err != nil {
+ return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult)
}
}
if s.UniqueItems {
- if err := UniqueItems(s.Path, s.In, data); err != nil {
- return errorHelp.sErr(err, s.Options.recycleResult)
+ if err := UniqueItems(s.Path.dotted(), s.In, data); err != nil {
+ return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult)
}
}
@@ -767,7 +762,7 @@ func (s *basicSliceValidator) Validate(data any) *Result {
return err
}
if err.wantsRedeemOnMerge {
- pools.poolOfResults.RedeemResult(err)
+ redeemResult(err)
}
}
}
@@ -775,12 +770,16 @@ func (s *basicSliceValidator) Validate(data any) *Result {
return nil
}
+func (s *basicSliceValidator) setPath(path pathSegments) {
+ s.Path = path
+}
+
func (s *basicSliceValidator) redeem() {
- pools.poolOfBasicSliceValidators.RedeemValidator(s)
+ validatorPools.basicSliceValidators.Redeem(s)
}
type numberValidator struct {
- Path string
+ Path pathSegments
In string
Default any
MultipleOf *float64
@@ -795,7 +794,7 @@ type numberValidator struct {
}
func newNumberValidator(
- path, in string, def any,
+ path pathSegments, in string, def any,
multipleOf, maximum *float64, exclusiveMaximum bool, minimum *float64, exclusiveMinimum bool,
typ, format string,
opts *SchemaValidatorOptions,
@@ -806,7 +805,7 @@ func newNumberValidator(
var n *numberValidator
if opts.recycleValidators {
- n = pools.poolOfNumberValidators.BorrowValidator()
+ n = validatorPools.numberValidators.Borrow()
} else {
n = new(numberValidator)
}
@@ -826,10 +825,6 @@ func newNumberValidator(
return n
}
-func (n *numberValidator) SetPath(path string) {
- n.Path = path
-}
-
func (n *numberValidator) Applies(source any, kind reflect.Kind) bool {
switch source.(type) {
case *spec.Parameter, *spec.Schema, *spec.Items, *spec.Header:
@@ -871,7 +866,7 @@ func (n *numberValidator) Validate(val any) *Result {
var res, resMultiple, resMinimum, resMaximum *Result
if n.Options.recycleResult {
- res = pools.poolOfResults.BorrowResult()
+ res = validatorPools.results.Borrow()
} else {
res = new(Result)
}
@@ -881,58 +876,58 @@ func (n *numberValidator) Validate(val any) *Result {
data := valueHelp.asFloat64(val)
// Is the provided value within the range of the specified numeric type and format?
- res.AddErrors(IsValueValidAgainstRange(val, n.Type, n.Format, "Checked", n.Path))
+ res.addErrorsAt(n.Path, IsValueValidAgainstRange(val, n.Type, n.Format, "Checked", n.Path.dotted()))
if n.MultipleOf != nil {
- resMultiple = pools.poolOfResults.BorrowResult()
+ resMultiple = validatorPools.results.Borrow()
// Is the constraint specifier within the range of the specific numeric type and format?
- resMultiple.AddErrors(IsValueValidAgainstRange(*n.MultipleOf, n.Type, n.Format, "MultipleOf", n.Path))
+ resMultiple.addErrorsAt(n.Path, IsValueValidAgainstRange(*n.MultipleOf, n.Type, n.Format, "MultipleOf", n.Path.dotted()))
if resMultiple.IsValid() {
// Constraint validated with compatible types
- if err := MultipleOfNativeType(n.Path, n.In, val, *n.MultipleOf); err != nil {
- resMultiple.Merge(errorHelp.sErr(err, n.Options.recycleResult))
+ if err := MultipleOfNativeType(n.Path.dotted(), n.In, val, *n.MultipleOf); err != nil {
+ resMultiple.Merge(errorHelp.sErrAt(n.Path, err, n.Options.recycleResult))
}
} else {
// Constraint nevertheless validated, converted as general number
- if err := MultipleOf(n.Path, n.In, data, *n.MultipleOf); err != nil {
- resMultiple.Merge(errorHelp.sErr(err, n.Options.recycleResult))
+ if err := MultipleOf(n.Path.dotted(), n.In, data, *n.MultipleOf); err != nil {
+ resMultiple.Merge(errorHelp.sErrAt(n.Path, err, n.Options.recycleResult))
}
}
}
if n.Maximum != nil {
- resMaximum = pools.poolOfResults.BorrowResult()
+ resMaximum = validatorPools.results.Borrow()
// Is the constraint specifier within the range of the specific numeric type and format?
- resMaximum.AddErrors(IsValueValidAgainstRange(*n.Maximum, n.Type, n.Format, "Maximum boundary", n.Path))
+ resMaximum.addErrorsAt(n.Path, IsValueValidAgainstRange(*n.Maximum, n.Type, n.Format, "Maximum boundary", n.Path.dotted()))
if resMaximum.IsValid() {
// Constraint validated with compatible types
- if err := MaximumNativeType(n.Path, n.In, val, *n.Maximum, n.ExclusiveMaximum); err != nil {
- resMaximum.Merge(errorHelp.sErr(err, n.Options.recycleResult))
+ if err := MaximumNativeType(n.Path.dotted(), n.In, val, *n.Maximum, n.ExclusiveMaximum); err != nil {
+ resMaximum.Merge(errorHelp.sErrAt(n.Path, err, n.Options.recycleResult))
}
} else {
// Constraint nevertheless validated, converted as general number
- if err := Maximum(n.Path, n.In, data, *n.Maximum, n.ExclusiveMaximum); err != nil {
- resMaximum.Merge(errorHelp.sErr(err, n.Options.recycleResult))
+ if err := Maximum(n.Path.dotted(), n.In, data, *n.Maximum, n.ExclusiveMaximum); err != nil {
+ resMaximum.Merge(errorHelp.sErrAt(n.Path, err, n.Options.recycleResult))
}
}
}
if n.Minimum != nil {
- resMinimum = pools.poolOfResults.BorrowResult()
+ resMinimum = validatorPools.results.Borrow()
// Is the constraint specifier within the range of the specific numeric type and format?
- resMinimum.AddErrors(IsValueValidAgainstRange(*n.Minimum, n.Type, n.Format, "Minimum boundary", n.Path))
+ resMinimum.addErrorsAt(n.Path, IsValueValidAgainstRange(*n.Minimum, n.Type, n.Format, "Minimum boundary", n.Path.dotted()))
if resMinimum.IsValid() {
// Constraint validated with compatible types
- if err := MinimumNativeType(n.Path, n.In, val, *n.Minimum, n.ExclusiveMinimum); err != nil {
- resMinimum.Merge(errorHelp.sErr(err, n.Options.recycleResult))
+ if err := MinimumNativeType(n.Path.dotted(), n.In, val, *n.Minimum, n.ExclusiveMinimum); err != nil {
+ resMinimum.Merge(errorHelp.sErrAt(n.Path, err, n.Options.recycleResult))
}
} else {
// Constraint nevertheless validated, converted as general number
- if err := Minimum(n.Path, n.In, data, *n.Minimum, n.ExclusiveMinimum); err != nil {
- resMinimum.Merge(errorHelp.sErr(err, n.Options.recycleResult))
+ if err := Minimum(n.Path.dotted(), n.In, data, *n.Minimum, n.ExclusiveMinimum); err != nil {
+ resMinimum.Merge(errorHelp.sErrAt(n.Path, err, n.Options.recycleResult))
}
}
}
@@ -942,12 +937,16 @@ func (n *numberValidator) Validate(val any) *Result {
return res
}
+func (n *numberValidator) setPath(path pathSegments) {
+ n.Path = path
+}
+
func (n *numberValidator) redeem() {
- pools.poolOfNumberValidators.RedeemValidator(n)
+ validatorPools.numberValidators.Redeem(n)
}
type stringValidator struct {
- Path string
+ Path pathSegments
In string
Default any
Required bool
@@ -959,7 +958,7 @@ type stringValidator struct {
}
func newStringValidator(
- path, in string,
+ path pathSegments, in string,
def any, required, allowEmpty bool, maxLength, minLength *int64, pattern string,
opts *SchemaValidatorOptions,
) *stringValidator {
@@ -969,7 +968,7 @@ func newStringValidator(
var s *stringValidator
if opts.recycleValidators {
- s = pools.poolOfStringValidators.BorrowValidator()
+ s = validatorPools.stringValidators.Borrow()
} else {
s = new(stringValidator)
}
@@ -987,10 +986,6 @@ func newStringValidator(
return s
}
-func (s *stringValidator) SetPath(path string) {
- s.Path = path
-}
-
func (s *stringValidator) Applies(source any, kind reflect.Kind) bool {
switch source.(type) {
case *spec.Parameter, *spec.Schema, *spec.Items, *spec.Header:
@@ -1009,35 +1004,39 @@ func (s *stringValidator) Validate(val any) *Result {
data, ok := val.(string)
if !ok {
- return errorHelp.sErr(errors.InvalidType(s.Path, s.In, stringType, val), s.Options.recycleResult)
+ return errorHelp.sErrAt(s.Path, errors.InvalidType(s.Path.dotted(), s.In, stringType, val), s.Options.recycleResult)
}
if s.Required && !s.AllowEmptyValue && (s.Default == nil || s.Default == "") {
- if err := RequiredString(s.Path, s.In, data); err != nil {
- return errorHelp.sErr(err, s.Options.recycleResult)
+ if err := RequiredString(s.Path.dotted(), s.In, data); err != nil {
+ return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult)
}
}
if s.MaxLength != nil {
- if err := MaxLength(s.Path, s.In, data, *s.MaxLength); err != nil {
- return errorHelp.sErr(err, s.Options.recycleResult)
+ if err := MaxLength(s.Path.dotted(), s.In, data, *s.MaxLength); err != nil {
+ return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult)
}
}
if s.MinLength != nil {
- if err := MinLength(s.Path, s.In, data, *s.MinLength); err != nil {
- return errorHelp.sErr(err, s.Options.recycleResult)
+ if err := MinLength(s.Path.dotted(), s.In, data, *s.MinLength); err != nil {
+ return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult)
}
}
if s.Pattern != "" {
- if err := Pattern(s.Path, s.In, data, s.Pattern); err != nil {
- return errorHelp.sErr(err, s.Options.recycleResult)
+ if err := Pattern(s.Path.dotted(), s.In, data, s.Pattern); err != nil {
+ return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult)
}
}
return nil
}
+func (s *stringValidator) setPath(path pathSegments) {
+ s.Path = path
+}
+
func (s *stringValidator) redeem() {
- pools.poolOfStringValidators.RedeemValidator(s)
+ validatorPools.stringValidators.Redeem(s)
}
diff --git a/vendor/github.com/miekg/pkcs11/params.go b/vendor/github.com/miekg/pkcs11/params.go
index 6d9ce96ae8..f111086c37 100644
--- a/vendor/github.com/miekg/pkcs11/params.go
+++ b/vendor/github.com/miekg/pkcs11/params.go
@@ -26,6 +26,11 @@ static inline void putECDH1PublicParams(CK_ECDH1_DERIVE_PARAMS_PTR params, CK_VO
params->pPublicData = pPublicData;
params->ulPublicDataLen = ulPublicDataLen;
}
+
+static inline void putRSAAESKeyWrapParams(CK_RSA_AES_KEY_WRAP_PARAMS_PTR params, CK_VOID_PTR pOAEPParams)
+{
+ params->pOAEPParams = pOAEPParams;
+}
*/
import "C"
import "unsafe"
@@ -84,7 +89,7 @@ func cGCMParams(p *GCMParams) []byte {
p.Free()
p.arena = arena
p.params = ¶ms
- return C.GoBytes(unsafe.Pointer(¶ms), C.int(unsafe.Sizeof(params)))
+ return memBytes(unsafe.Pointer(¶ms), unsafe.Sizeof(params))
}
// IV returns a copy of the actual IV used for the operation.
@@ -121,7 +126,7 @@ func NewPSSParams(hashAlg, mgf, saltLength uint) []byte {
mgf: C.CK_RSA_PKCS_MGF_TYPE(mgf),
sLen: C.CK_ULONG(saltLength),
}
- return C.GoBytes(unsafe.Pointer(&p), C.int(unsafe.Sizeof(p)))
+ return memBytes(unsafe.Pointer(&p), unsafe.Sizeof(p))
}
// OAEPParams can be passed to NewMechanism to implement CKM_RSA_PKCS_OAEP.
@@ -153,7 +158,7 @@ func cOAEPParams(p *OAEPParams, arena arena) ([]byte, arena) {
// field is unaligned on windows so this has to call into C
C.putOAEPParams(¶ms, buf, len)
}
- return C.GoBytes(unsafe.Pointer(¶ms), C.int(unsafe.Sizeof(params))), arena
+ return memBytes(unsafe.Pointer(¶ms), unsafe.Sizeof(params)), arena
}
// ECDH1DeriveParams can be passed to NewMechanism to implement CK_ECDH1_DERIVE_PARAMS.
@@ -186,5 +191,25 @@ func cECDH1DeriveParams(p *ECDH1DeriveParams, arena arena) ([]byte, arena) {
publicKeyData, publicKeyDataLen := arena.Allocate(p.PublicKeyData)
C.putECDH1PublicParams(¶ms, publicKeyData, publicKeyDataLen)
- return C.GoBytes(unsafe.Pointer(¶ms), C.int(unsafe.Sizeof(params))), arena
+ return memBytes(unsafe.Pointer(¶ms), unsafe.Sizeof(params)), arena
}
+
+type RSAAESKeyWrapParams struct {
+ AESKeyBits uint
+ OAEPParams OAEPParams
+}
+
+func cRSAAESKeyWrapParams(p *RSAAESKeyWrapParams, arena arena) ([]byte, arena) {
+ var param []byte
+ params := C.CK_RSA_AES_KEY_WRAP_PARAMS {
+ ulAESKeyBits: C.CK_MECHANISM_TYPE(p.AESKeyBits),
+ }
+
+ param, arena = cOAEPParams(&p.OAEPParams, arena)
+ if len(param) != 0 {
+ buf, _ := arena.Allocate(param)
+ C.putRSAAESKeyWrapParams(¶ms, buf)
+ }
+ return memBytes(unsafe.Pointer(¶ms), unsafe.Sizeof(params)), arena
+}
+
diff --git a/vendor/github.com/miekg/pkcs11/pkcs11.go b/vendor/github.com/miekg/pkcs11/pkcs11.go
index e1b5824ec8..8d8d4c39cd 100644
--- a/vendor/github.com/miekg/pkcs11/pkcs11.go
+++ b/vendor/github.com/miekg/pkcs11/pkcs11.go
@@ -5,6 +5,8 @@
//go:generate go run const_generate.go
// Package pkcs11 is a wrapper around the PKCS#11 cryptographic library.
+// Latest version of the specification:
+// http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html
package pkcs11
// It is *assumed*, that:
@@ -104,11 +106,12 @@ void Destroy(struct ctx *c)
}
#endif
-CK_RV Initialize(struct ctx * c)
+CK_RV Initialize(struct ctx * c, CK_FLAGS flags, CK_VOID_PTR reserved)
{
CK_C_INITIALIZE_ARGS args;
memset(&args, 0, sizeof(args));
- args.flags = CKF_OS_LOCKING_OK;
+ args.flags = flags;
+ args.pReserved = reserved;
return c->sym->C_Initialize(&args);
}
@@ -803,9 +806,36 @@ func (c *Ctx) Destroy() {
c.ctx = nil
}
+type initializeArgs struct {
+ flags uint
+ reserved unsafe.Pointer
+}
+
+// An InitializeOption modifies the default behavior of Initialize.
+type InitializeOption func(*initializeArgs)
+
+// InitializeWithFlags sets the flags field in CK_C_INITIALIZE_ARGS.
+// Note that flags defaults to CKF_OS_LOCKING_OK if this option is not provided.
+func InitializeWithFlags(flags uint) InitializeOption {
+ return func(args *initializeArgs) {
+ args.flags = flags
+ }
+}
+
+// InitializeWithReserved sets the pReserved field in CK_C_INITIALIZE_ARGS.
+func InitializeWithReserved(reserved unsafe.Pointer) InitializeOption {
+ return func(args *initializeArgs) {
+ args.reserved = reserved
+ }
+}
+
// Initialize initializes the Cryptoki library.
-func (c *Ctx) Initialize() error {
- e := C.Initialize(c.ctx)
+func (c *Ctx) Initialize(opts ...InitializeOption) error {
+ args := initializeArgs{flags: CKF_OS_LOCKING_OK}
+ for _, o := range opts {
+ o(&args)
+ }
+ e := C.Initialize(c.ctx, C.CK_FLAGS(args.flags), C.CK_VOID_PTR(args.reserved))
return toError(e)
}
diff --git a/vendor/github.com/miekg/pkcs11/release.go b/vendor/github.com/miekg/pkcs11/release.go
index d8b99f147e..c9fcb0e735 100644
--- a/vendor/github.com/miekg/pkcs11/release.go
+++ b/vendor/github.com/miekg/pkcs11/release.go
@@ -6,7 +6,7 @@ package pkcs11
import "fmt"
// Release is current version of the pkcs11 library.
-var Release = R{1, 1, 1}
+var Release = R{1, 1, 2}
// R holds the version of this library.
type R struct {
diff --git a/vendor/github.com/miekg/pkcs11/types.go b/vendor/github.com/miekg/pkcs11/types.go
index 60eadcb71b..d3bfce80da 100644
--- a/vendor/github.com/miekg/pkcs11/types.go
+++ b/vendor/github.com/miekg/pkcs11/types.go
@@ -53,7 +53,7 @@ func toList(clist C.CK_ULONG_PTR, size C.CK_ULONG) []uint {
for i := 0; i < len(l); i++ {
l[i] = uint(C.Index(clist, C.CK_ULONG(i)))
}
- defer C.free(unsafe.Pointer(clist))
+ C.free(unsafe.Pointer(clist))
return l
}
@@ -65,9 +65,15 @@ func cBBool(x bool) C.CK_BBOOL {
return C.CK_BBOOL(C.CK_FALSE)
}
+// memBytes returns a byte slice that references an arbitrary memory area
+func memBytes(p unsafe.Pointer, len uintptr) []byte {
+ const maxIndex int32 = (1 << 31) - 1
+ return (*([maxIndex]byte))(p)[:len:len]
+}
+
func uintToBytes(x uint64) []byte {
ul := C.CK_ULONG(x)
- return C.GoBytes(unsafe.Pointer(&ul), C.int(unsafe.Sizeof(ul)))
+ return memBytes(unsafe.Pointer(&ul), unsafe.Sizeof(ul))
}
// Error represents an PKCS#11 error.
@@ -255,13 +261,14 @@ func NewMechanism(mech uint, x interface{}) *Mechanism {
}
switch p := x.(type) {
- case *GCMParams, *OAEPParams, *ECDH1DeriveParams:
+ case *GCMParams, *OAEPParams, *ECDH1DeriveParams, *RSAAESKeyWrapParams:
// contains pointers; defer serialization until cMechanism
m.generator = p
case []byte:
m.Parameter = p
default:
- panic("parameter must be one of type: []byte, *GCMParams, *OAEPParams, *ECDH1DeriveParams")
+ panic("parameter must be one of type: []byte, *GCMParams, *OAEPParams, *ECDH1DeriveParams," +
+ " *RSAAESKeyWrapParams")
}
return m
@@ -284,6 +291,8 @@ func cMechanism(mechList []*Mechanism) (arena, *C.CK_MECHANISM) {
param, arena = cOAEPParams(p, arena)
case *ECDH1DeriveParams:
param, arena = cECDH1DeriveParams(p, arena)
+ case *RSAAESKeyWrapParams:
+ param, arena = cRSAAESKeyWrapParams(p, arena)
}
if len(param) != 0 {
buf, len := arena.Allocate(param)
diff --git a/vendor/github.com/miekg/pkcs11/vendor.go b/vendor/github.com/miekg/pkcs11/vendor.go
index 83188e5001..5132dc4f07 100644
--- a/vendor/github.com/miekg/pkcs11/vendor.go
+++ b/vendor/github.com/miekg/pkcs11/vendor.go
@@ -10,12 +10,12 @@ const (
// Vendor specific mechanisms for HMAC on Ncipher HSMs where Ncipher does not allow use of generic_secret keys.
const (
- CKM_NC_SHA_1_HMAC_KEY_GEN = CKM_NCIPHER + 0x3 /* no params */
- CKM_NC_MD5_HMAC_KEY_GEN = CKM_NCIPHER + 0x6 /* no params */
- CKM_NC_SHA224_HMAC_KEY_GEN = CKM_NCIPHER + 0x24 /* no params */
- CKM_NC_SHA256_HMAC_KEY_GEN = CKM_NCIPHER + 0x25 /* no params */
- CKM_NC_SHA384_HMAC_KEY_GEN = CKM_NCIPHER + 0x26 /* no params */
- CKM_NC_SHA512_HMAC_KEY_GEN = CKM_NCIPHER + 0x27 /* no params */
+ CKM_NC_SHA_1_HMAC_KEY_GEN = CKM_NCIPHER + 0x3 // no params
+ CKM_NC_MD5_HMAC_KEY_GEN = CKM_NCIPHER + 0x6 // no params
+ CKM_NC_SHA224_HMAC_KEY_GEN = CKM_NCIPHER + 0x24 // no params
+ CKM_NC_SHA256_HMAC_KEY_GEN = CKM_NCIPHER + 0x25 // no params
+ CKM_NC_SHA384_HMAC_KEY_GEN = CKM_NCIPHER + 0x26 // no params
+ CKM_NC_SHA512_HMAC_KEY_GEN = CKM_NCIPHER + 0x27 // no params
)
// Vendor specific range for Mozilla NSS.
@@ -67,6 +67,8 @@ const (
CKA_NSS_JPAKE_X2 = CKA_NSS + 32
CKA_NSS_JPAKE_X2S = CKA_NSS + 33
CKA_NSS_MOZILLA_CA_POLICY = CKA_NSS + 34
+ CKA_NSS_SERVER_DISTRUST_AFTER = CKA_NSS + 35
+ CKA_NSS_EMAIL_DISTRUST_AFTER = CKA_NSS + 36
CKA_TRUST_DIGITAL_SIGNATURE = CKA_TRUST + 1
CKA_TRUST_NON_REPUDIATION = CKA_TRUST + 2
CKA_TRUST_KEY_ENCIPHERMENT = CKA_TRUST + 3
diff --git a/vendor/github.com/miekg/pkcs11/zconst.go b/vendor/github.com/miekg/pkcs11/zconst.go
index 41df5cfcf0..164054decc 100644
--- a/vendor/github.com/miekg/pkcs11/zconst.go
+++ b/vendor/github.com/miekg/pkcs11/zconst.go
@@ -7,107 +7,199 @@
package pkcs11
const (
- CK_TRUE = 1
- CK_FALSE = 0
- CK_UNAVAILABLE_INFORMATION = ^uint(0)
- CK_EFFECTIVELY_INFINITE = 0
- CK_INVALID_HANDLE = 0
- CKN_SURRENDER = 0
- CKN_OTP_CHANGED = 1
- CKF_TOKEN_PRESENT = 0x00000001
- CKF_REMOVABLE_DEVICE = 0x00000002
- CKF_HW_SLOT = 0x00000004
- CKF_RNG = 0x00000001
- CKF_WRITE_PROTECTED = 0x00000002
- CKF_LOGIN_REQUIRED = 0x00000004
- CKF_USER_PIN_INITIALIZED = 0x00000008
- CKF_RESTORE_KEY_NOT_NEEDED = 0x00000020
- CKF_CLOCK_ON_TOKEN = 0x00000040
- CKF_PROTECTED_AUTHENTICATION_PATH = 0x00000100
- CKF_DUAL_CRYPTO_OPERATIONS = 0x00000200
- CKF_TOKEN_INITIALIZED = 0x00000400
- CKF_SECONDARY_AUTHENTICATION = 0x00000800
- CKF_USER_PIN_COUNT_LOW = 0x00010000
- CKF_USER_PIN_FINAL_TRY = 0x00020000
- CKF_USER_PIN_LOCKED = 0x00040000
- CKF_USER_PIN_TO_BE_CHANGED = 0x00080000
- CKF_SO_PIN_COUNT_LOW = 0x00100000
- CKF_SO_PIN_FINAL_TRY = 0x00200000
- CKF_SO_PIN_LOCKED = 0x00400000
- CKF_SO_PIN_TO_BE_CHANGED = 0x00800000
- CKF_ERROR_STATE = 0x01000000
- CKU_SO = 0
- CKU_USER = 1
- CKU_CONTEXT_SPECIFIC = 2
- CKS_RO_PUBLIC_SESSION = 0
- CKS_RO_USER_FUNCTIONS = 1
- CKS_RW_PUBLIC_SESSION = 2
- CKS_RW_USER_FUNCTIONS = 3
- CKS_RW_SO_FUNCTIONS = 4
- CKF_RW_SESSION = 0x00000002
- CKF_SERIAL_SESSION = 0x00000004
- CKO_DATA = 0x00000000
- CKO_CERTIFICATE = 0x00000001
- CKO_PUBLIC_KEY = 0x00000002
- CKO_PRIVATE_KEY = 0x00000003
- CKO_SECRET_KEY = 0x00000004
- CKO_HW_FEATURE = 0x00000005
- CKO_DOMAIN_PARAMETERS = 0x00000006
- CKO_MECHANISM = 0x00000007
- CKO_OTP_KEY = 0x00000008
- CKO_VENDOR_DEFINED = 0x80000000
- CKH_MONOTONIC_COUNTER = 0x00000001
- CKH_CLOCK = 0x00000002
- CKH_USER_INTERFACE = 0x00000003
- CKH_VENDOR_DEFINED = 0x80000000
- CKK_RSA = 0x00000000
- CKK_DSA = 0x00000001
- CKK_DH = 0x00000002
- CKK_ECDSA = 0x00000003 // Deprecated
- CKK_EC = 0x00000003
- CKK_X9_42_DH = 0x00000004
- CKK_KEA = 0x00000005
- CKK_GENERIC_SECRET = 0x00000010
- CKK_RC2 = 0x00000011
- CKK_RC4 = 0x00000012
- CKK_DES = 0x00000013
- CKK_DES2 = 0x00000014
- CKK_DES3 = 0x00000015
- CKK_CAST = 0x00000016
- CKK_CAST3 = 0x00000017
- CKK_CAST5 = 0x00000018 // Deprecated
- CKK_CAST128 = 0x00000018
- CKK_RC5 = 0x00000019
- CKK_IDEA = 0x0000001A
- CKK_SKIPJACK = 0x0000001B
- CKK_BATON = 0x0000001C
- CKK_JUNIPER = 0x0000001D
- CKK_CDMF = 0x0000001E
- CKK_AES = 0x0000001F
- CKK_BLOWFISH = 0x00000020
- CKK_TWOFISH = 0x00000021
- CKK_SECURID = 0x00000022
- CKK_HOTP = 0x00000023
- CKK_ACTI = 0x00000024
- CKK_CAMELLIA = 0x00000025
- CKK_ARIA = 0x00000026
- CKK_MD5_HMAC = 0x00000027
- CKK_SHA_1_HMAC = 0x00000028
- CKK_RIPEMD128_HMAC = 0x00000029
- CKK_RIPEMD160_HMAC = 0x0000002A
- CKK_SHA256_HMAC = 0x0000002B
- CKK_SHA384_HMAC = 0x0000002C
- CKK_SHA512_HMAC = 0x0000002D
- CKK_SHA224_HMAC = 0x0000002E
- CKK_SEED = 0x0000002F
- CKK_GOSTR3410 = 0x00000030
- CKK_GOSTR3411 = 0x00000031
- CKK_GOST28147 = 0x00000032
- CKK_SHA3_224_HMAC = 0x00000033
- CKK_SHA3_256_HMAC = 0x00000034
- CKK_SHA3_384_HMAC = 0x00000035
- CKK_SHA3_512_HMAC = 0x00000036
- CKK_VENDOR_DEFINED = 0x80000000
+ CK_TRUE = true
+ CK_FALSE = false
+
+ // some special values for certain CK_ULONG variables
+ CK_UNAVAILABLE_INFORMATION = ^uint(0)
+ CK_EFFECTIVELY_INFINITE = 0
+
+ // The following value is always invalid if used as a session
+ // handle or object handle
+ CK_INVALID_HANDLE = 0
+
+ CKN_SURRENDER = 0
+ CKN_OTP_CHANGED = 1
+
+ // flags: bit flags that provide capabilities of the slot
+ //
+ // Bit Flag Mask Meaning
+ CKF_TOKEN_PRESENT = 0x00000001 // a token is there
+ CKF_REMOVABLE_DEVICE = 0x00000002 // removable devices
+ CKF_HW_SLOT = 0x00000004 // hardware slot
+
+ // The flags parameter is defined as follows:
+ //
+ // Bit Flag Mask Meaning
+ CKF_RNG = 0x00000001 // has random # generator
+ CKF_WRITE_PROTECTED = 0x00000002 // token is write-protected
+ CKF_LOGIN_REQUIRED = 0x00000004 // user must login
+ CKF_USER_PIN_INITIALIZED = 0x00000008 // normal user's PIN is set
+
+ // CKF_RESTORE_KEY_NOT_NEEDED. If it is set,
+ // that means that *every* time the state of cryptographic
+ // operations of a session is successfully saved, all keys
+ // needed to continue those operations are stored in the state
+ CKF_RESTORE_KEY_NOT_NEEDED = 0x00000020
+
+ // CKF_CLOCK_ON_TOKEN. If it is set, that means
+ // that the token has some sort of clock. The time on that
+ // clock is returned in the token info structure
+ CKF_CLOCK_ON_TOKEN = 0x00000040
+
+ // CKF_PROTECTED_AUTHENTICATION_PATH. If it is
+ // set, that means that there is some way for the user to login
+ // without sending a PIN through the Cryptoki library itself
+ CKF_PROTECTED_AUTHENTICATION_PATH = 0x00000100
+
+ // CKF_DUAL_CRYPTO_OPERATIONS. If it is true,
+ // that means that a single session with the token can perform
+ // dual simultaneous cryptographic operations (digest and
+ // encrypt; decrypt and digest; sign and encrypt; and decrypt
+ // and sign)
+ CKF_DUAL_CRYPTO_OPERATIONS = 0x00000200
+
+ // CKF_TOKEN_INITIALIZED. If it is true, the
+ // token has been initialized using C_InitializeToken or an
+ // equivalent mechanism outside the scope of PKCS #11.
+ // Calling C_InitializeToken when this flag is set will cause
+ // the token to be reinitialized.
+ CKF_TOKEN_INITIALIZED = 0x00000400
+
+ // CKF_SECONDARY_AUTHENTICATION. If it is
+ // true, the token supports secondary authentication for
+ // private key objects.
+ CKF_SECONDARY_AUTHENTICATION = 0x00000800
+
+ // CKF_USER_PIN_COUNT_LOW. If it is true, an
+ // incorrect user login PIN has been entered at least once
+ // since the last successful authentication.
+ CKF_USER_PIN_COUNT_LOW = 0x00010000
+
+ // CKF_USER_PIN_FINAL_TRY. If it is true,
+ // supplying an incorrect user PIN will it to become locked.
+ CKF_USER_PIN_FINAL_TRY = 0x00020000
+
+ // CKF_USER_PIN_LOCKED. If it is true, the
+ // user PIN has been locked. User login to the token is not
+ // possible.
+ CKF_USER_PIN_LOCKED = 0x00040000
+
+ // CKF_USER_PIN_TO_BE_CHANGED. If it is true,
+ // the user PIN value is the default value set by token
+ // initialization or manufacturing, or the PIN has been
+ // expired by the card.
+ CKF_USER_PIN_TO_BE_CHANGED = 0x00080000
+
+ // CKF_SO_PIN_COUNT_LOW. If it is true, an
+ // incorrect SO login PIN has been entered at least once since
+ // the last successful authentication.
+ CKF_SO_PIN_COUNT_LOW = 0x00100000
+
+ // CKF_SO_PIN_FINAL_TRY. If it is true,
+ // supplying an incorrect SO PIN will it to become locked.
+ CKF_SO_PIN_FINAL_TRY = 0x00200000
+
+ // CKF_SO_PIN_LOCKED. If it is true, the SO
+ // PIN has been locked. SO login to the token is not possible.
+ CKF_SO_PIN_LOCKED = 0x00400000
+
+ // CKF_SO_PIN_TO_BE_CHANGED. If it is true,
+ // the SO PIN value is the default value set by token
+ // initialization or manufacturing, or the PIN has been
+ // expired by the card.
+ CKF_SO_PIN_TO_BE_CHANGED = 0x00800000
+ CKF_ERROR_STATE = 0x01000000
+
+ // Security Officer
+ CKU_SO = 0
+
+ // Normal user
+ CKU_USER = 1
+
+ // Context specific
+ CKU_CONTEXT_SPECIFIC = 2
+
+ CKS_RO_PUBLIC_SESSION = 0
+ CKS_RO_USER_FUNCTIONS = 1
+ CKS_RW_PUBLIC_SESSION = 2
+ CKS_RW_USER_FUNCTIONS = 3
+ CKS_RW_SO_FUNCTIONS = 4
+
+ // The flags are defined in the following table:
+ //
+ // Bit Flag Mask Meaning
+ CKF_RW_SESSION = 0x00000002 // session is r/w
+ CKF_SERIAL_SESSION = 0x00000004 // no parallel
+
+ // The following classes of objects are defined:
+ CKO_DATA = 0x00000000
+ CKO_CERTIFICATE = 0x00000001
+ CKO_PUBLIC_KEY = 0x00000002
+ CKO_PRIVATE_KEY = 0x00000003
+ CKO_SECRET_KEY = 0x00000004
+ CKO_HW_FEATURE = 0x00000005
+ CKO_DOMAIN_PARAMETERS = 0x00000006
+ CKO_MECHANISM = 0x00000007
+ CKO_OTP_KEY = 0x00000008
+ CKO_VENDOR_DEFINED = 0x80000000
+
+ // The following hardware feature types are defined
+ CKH_MONOTONIC_COUNTER = 0x00000001
+ CKH_CLOCK = 0x00000002
+ CKH_USER_INTERFACE = 0x00000003
+ CKH_VENDOR_DEFINED = 0x80000000
+
+ // the following key types are defined:
+ CKK_RSA = 0x00000000
+ CKK_DSA = 0x00000001
+ CKK_DH = 0x00000002
+ CKK_ECDSA = 0x00000003 // Deprecated
+ CKK_EC = 0x00000003
+ CKK_X9_42_DH = 0x00000004
+ CKK_KEA = 0x00000005
+ CKK_GENERIC_SECRET = 0x00000010
+ CKK_RC2 = 0x00000011
+ CKK_RC4 = 0x00000012
+ CKK_DES = 0x00000013
+ CKK_DES2 = 0x00000014
+ CKK_DES3 = 0x00000015
+ CKK_CAST = 0x00000016
+ CKK_CAST3 = 0x00000017
+ CKK_CAST5 = 0x00000018 // Deprecated
+ CKK_CAST128 = 0x00000018
+ CKK_RC5 = 0x00000019
+ CKK_IDEA = 0x0000001A
+ CKK_SKIPJACK = 0x0000001B
+ CKK_BATON = 0x0000001C
+ CKK_JUNIPER = 0x0000001D
+ CKK_CDMF = 0x0000001E
+ CKK_AES = 0x0000001F
+ CKK_BLOWFISH = 0x00000020
+ CKK_TWOFISH = 0x00000021
+ CKK_SECURID = 0x00000022
+ CKK_HOTP = 0x00000023
+ CKK_ACTI = 0x00000024
+ CKK_CAMELLIA = 0x00000025
+ CKK_ARIA = 0x00000026
+ CKK_MD5_HMAC = 0x00000027
+ CKK_SHA_1_HMAC = 0x00000028
+ CKK_RIPEMD128_HMAC = 0x00000029
+ CKK_RIPEMD160_HMAC = 0x0000002A
+ CKK_SHA256_HMAC = 0x0000002B
+ CKK_SHA384_HMAC = 0x0000002C
+ CKK_SHA512_HMAC = 0x0000002D
+ CKK_SHA224_HMAC = 0x0000002E
+ CKK_SEED = 0x0000002F
+ CKK_GOSTR3410 = 0x00000030
+ CKK_GOSTR3411 = 0x00000031
+ CKK_GOST28147 = 0x00000032
+ CKK_SHA3_224_HMAC = 0x00000033
+ CKK_SHA3_256_HMAC = 0x00000034
+ CKK_SHA3_384_HMAC = 0x00000035
+ CKK_SHA3_512_HMAC = 0x00000036
+ CKK_VENDOR_DEFINED = 0x80000000
+
CK_CERTIFICATE_CATEGORY_UNSPECIFIED = 0
CK_CERTIFICATE_CATEGORY_TOKEN_USER = 1
CK_CERTIFICATE_CATEGORY_AUTHORITY = 2
@@ -116,513 +208,539 @@ const (
CK_SECURITY_DOMAIN_MANUFACTURER = 1
CK_SECURITY_DOMAIN_OPERATOR = 2
CK_SECURITY_DOMAIN_THIRD_PARTY = 3
- CKC_X_509 = 0x00000000
- CKC_X_509_ATTR_CERT = 0x00000001
- CKC_WTLS = 0x00000002
- CKC_VENDOR_DEFINED = 0x80000000
- CKF_ARRAY_ATTRIBUTE = 0x40000000
- CK_OTP_FORMAT_DECIMAL = 0
- CK_OTP_FORMAT_HEXADECIMAL = 1
- CK_OTP_FORMAT_ALPHANUMERIC = 2
- CK_OTP_FORMAT_BINARY = 3
- CK_OTP_PARAM_IGNORED = 0
- CK_OTP_PARAM_OPTIONAL = 1
- CK_OTP_PARAM_MANDATORY = 2
- CKA_CLASS = 0x00000000
- CKA_TOKEN = 0x00000001
- CKA_PRIVATE = 0x00000002
- CKA_LABEL = 0x00000003
- CKA_APPLICATION = 0x00000010
- CKA_VALUE = 0x00000011
- CKA_OBJECT_ID = 0x00000012
- CKA_CERTIFICATE_TYPE = 0x00000080
- CKA_ISSUER = 0x00000081
- CKA_SERIAL_NUMBER = 0x00000082
- CKA_AC_ISSUER = 0x00000083
- CKA_OWNER = 0x00000084
- CKA_ATTR_TYPES = 0x00000085
- CKA_TRUSTED = 0x00000086
- CKA_CERTIFICATE_CATEGORY = 0x00000087
- CKA_JAVA_MIDP_SECURITY_DOMAIN = 0x00000088
- CKA_URL = 0x00000089
- CKA_HASH_OF_SUBJECT_PUBLIC_KEY = 0x0000008A
- CKA_HASH_OF_ISSUER_PUBLIC_KEY = 0x0000008B
- CKA_NAME_HASH_ALGORITHM = 0x0000008C
- CKA_CHECK_VALUE = 0x00000090
- CKA_KEY_TYPE = 0x00000100
- CKA_SUBJECT = 0x00000101
- CKA_ID = 0x00000102
- CKA_SENSITIVE = 0x00000103
- CKA_ENCRYPT = 0x00000104
- CKA_DECRYPT = 0x00000105
- CKA_WRAP = 0x00000106
- CKA_UNWRAP = 0x00000107
- CKA_SIGN = 0x00000108
- CKA_SIGN_RECOVER = 0x00000109
- CKA_VERIFY = 0x0000010A
- CKA_VERIFY_RECOVER = 0x0000010B
- CKA_DERIVE = 0x0000010C
- CKA_START_DATE = 0x00000110
- CKA_END_DATE = 0x00000111
- CKA_MODULUS = 0x00000120
- CKA_MODULUS_BITS = 0x00000121
- CKA_PUBLIC_EXPONENT = 0x00000122
- CKA_PRIVATE_EXPONENT = 0x00000123
- CKA_PRIME_1 = 0x00000124
- CKA_PRIME_2 = 0x00000125
- CKA_EXPONENT_1 = 0x00000126
- CKA_EXPONENT_2 = 0x00000127
- CKA_COEFFICIENT = 0x00000128
- CKA_PUBLIC_KEY_INFO = 0x00000129
- CKA_PRIME = 0x00000130
- CKA_SUBPRIME = 0x00000131
- CKA_BASE = 0x00000132
- CKA_PRIME_BITS = 0x00000133
- CKA_SUBPRIME_BITS = 0x00000134
- CKA_SUB_PRIME_BITS = CKA_SUBPRIME_BITS
- CKA_VALUE_BITS = 0x00000160
- CKA_VALUE_LEN = 0x00000161
- CKA_EXTRACTABLE = 0x00000162
- CKA_LOCAL = 0x00000163
- CKA_NEVER_EXTRACTABLE = 0x00000164
- CKA_ALWAYS_SENSITIVE = 0x00000165
- CKA_KEY_GEN_MECHANISM = 0x00000166
- CKA_MODIFIABLE = 0x00000170
- CKA_COPYABLE = 0x00000171
- CKA_DESTROYABLE = 0x00000172
- CKA_ECDSA_PARAMS = 0x00000180 // Deprecated
- CKA_EC_PARAMS = 0x00000180
- CKA_EC_POINT = 0x00000181
- CKA_SECONDARY_AUTH = 0x00000200 // Deprecated
- CKA_AUTH_PIN_FLAGS = 0x00000201 // Deprecated
- CKA_ALWAYS_AUTHENTICATE = 0x00000202
- CKA_WRAP_WITH_TRUSTED = 0x00000210
- CKA_WRAP_TEMPLATE = (CKF_ARRAY_ATTRIBUTE | 0x00000211)
- CKA_UNWRAP_TEMPLATE = (CKF_ARRAY_ATTRIBUTE | 0x00000212)
- CKA_DERIVE_TEMPLATE = (CKF_ARRAY_ATTRIBUTE | 0x00000213)
- CKA_OTP_FORMAT = 0x00000220
- CKA_OTP_LENGTH = 0x00000221
- CKA_OTP_TIME_INTERVAL = 0x00000222
- CKA_OTP_USER_FRIENDLY_MODE = 0x00000223
- CKA_OTP_CHALLENGE_REQUIREMENT = 0x00000224
- CKA_OTP_TIME_REQUIREMENT = 0x00000225
- CKA_OTP_COUNTER_REQUIREMENT = 0x00000226
- CKA_OTP_PIN_REQUIREMENT = 0x00000227
- CKA_OTP_COUNTER = 0x0000022E
- CKA_OTP_TIME = 0x0000022F
- CKA_OTP_USER_IDENTIFIER = 0x0000022A
- CKA_OTP_SERVICE_IDENTIFIER = 0x0000022B
- CKA_OTP_SERVICE_LOGO = 0x0000022C
- CKA_OTP_SERVICE_LOGO_TYPE = 0x0000022D
- CKA_GOSTR3410_PARAMS = 0x00000250
- CKA_GOSTR3411_PARAMS = 0x00000251
- CKA_GOST28147_PARAMS = 0x00000252
- CKA_HW_FEATURE_TYPE = 0x00000300
- CKA_RESET_ON_INIT = 0x00000301
- CKA_HAS_RESET = 0x00000302
- CKA_PIXEL_X = 0x00000400
- CKA_PIXEL_Y = 0x00000401
- CKA_RESOLUTION = 0x00000402
- CKA_CHAR_ROWS = 0x00000403
- CKA_CHAR_COLUMNS = 0x00000404
- CKA_COLOR = 0x00000405
- CKA_BITS_PER_PIXEL = 0x00000406
- CKA_CHAR_SETS = 0x00000480
- CKA_ENCODING_METHODS = 0x00000481
- CKA_MIME_TYPES = 0x00000482
- CKA_MECHANISM_TYPE = 0x00000500
- CKA_REQUIRED_CMS_ATTRIBUTES = 0x00000501
- CKA_DEFAULT_CMS_ATTRIBUTES = 0x00000502
- CKA_SUPPORTED_CMS_ATTRIBUTES = 0x00000503
- CKA_ALLOWED_MECHANISMS = (CKF_ARRAY_ATTRIBUTE | 0x00000600)
- CKA_VENDOR_DEFINED = 0x80000000
- CKM_RSA_PKCS_KEY_PAIR_GEN = 0x00000000
- CKM_RSA_PKCS = 0x00000001
- CKM_RSA_9796 = 0x00000002
- CKM_RSA_X_509 = 0x00000003
- CKM_MD2_RSA_PKCS = 0x00000004
- CKM_MD5_RSA_PKCS = 0x00000005
- CKM_SHA1_RSA_PKCS = 0x00000006
- CKM_RIPEMD128_RSA_PKCS = 0x00000007
- CKM_RIPEMD160_RSA_PKCS = 0x00000008
- CKM_RSA_PKCS_OAEP = 0x00000009
- CKM_RSA_X9_31_KEY_PAIR_GEN = 0x0000000A
- CKM_RSA_X9_31 = 0x0000000B
- CKM_SHA1_RSA_X9_31 = 0x0000000C
- CKM_RSA_PKCS_PSS = 0x0000000D
- CKM_SHA1_RSA_PKCS_PSS = 0x0000000E
- CKM_DSA_KEY_PAIR_GEN = 0x00000010
- CKM_DSA = 0x00000011
- CKM_DSA_SHA1 = 0x00000012
- CKM_DSA_SHA224 = 0x00000013
- CKM_DSA_SHA256 = 0x00000014
- CKM_DSA_SHA384 = 0x00000015
- CKM_DSA_SHA512 = 0x00000016
- CKM_DSA_SHA3_224 = 0x00000018
- CKM_DSA_SHA3_256 = 0x00000019
- CKM_DSA_SHA3_384 = 0x0000001A
- CKM_DSA_SHA3_512 = 0x0000001B
- CKM_DH_PKCS_KEY_PAIR_GEN = 0x00000020
- CKM_DH_PKCS_DERIVE = 0x00000021
- CKM_X9_42_DH_KEY_PAIR_GEN = 0x00000030
- CKM_X9_42_DH_DERIVE = 0x00000031
- CKM_X9_42_DH_HYBRID_DERIVE = 0x00000032
- CKM_X9_42_MQV_DERIVE = 0x00000033
- CKM_SHA256_RSA_PKCS = 0x00000040
- CKM_SHA384_RSA_PKCS = 0x00000041
- CKM_SHA512_RSA_PKCS = 0x00000042
- CKM_SHA256_RSA_PKCS_PSS = 0x00000043
- CKM_SHA384_RSA_PKCS_PSS = 0x00000044
- CKM_SHA512_RSA_PKCS_PSS = 0x00000045
- CKM_SHA224_RSA_PKCS = 0x00000046
- CKM_SHA224_RSA_PKCS_PSS = 0x00000047
- CKM_SHA512_224 = 0x00000048
- CKM_SHA512_224_HMAC = 0x00000049
- CKM_SHA512_224_HMAC_GENERAL = 0x0000004A
- CKM_SHA512_224_KEY_DERIVATION = 0x0000004B
- CKM_SHA512_256 = 0x0000004C
- CKM_SHA512_256_HMAC = 0x0000004D
- CKM_SHA512_256_HMAC_GENERAL = 0x0000004E
- CKM_SHA512_256_KEY_DERIVATION = 0x0000004F
- CKM_SHA512_T = 0x00000050
- CKM_SHA512_T_HMAC = 0x00000051
- CKM_SHA512_T_HMAC_GENERAL = 0x00000052
- CKM_SHA512_T_KEY_DERIVATION = 0x00000053
- CKM_SHA3_256_RSA_PKCS = 0x00000060
- CKM_SHA3_384_RSA_PKCS = 0x00000061
- CKM_SHA3_512_RSA_PKCS = 0x00000062
- CKM_SHA3_256_RSA_PKCS_PSS = 0x00000063
- CKM_SHA3_384_RSA_PKCS_PSS = 0x00000064
- CKM_SHA3_512_RSA_PKCS_PSS = 0x00000065
- CKM_SHA3_224_RSA_PKCS = 0x00000066
- CKM_SHA3_224_RSA_PKCS_PSS = 0x00000067
- CKM_RC2_KEY_GEN = 0x00000100
- CKM_RC2_ECB = 0x00000101
- CKM_RC2_CBC = 0x00000102
- CKM_RC2_MAC = 0x00000103
- CKM_RC2_MAC_GENERAL = 0x00000104
- CKM_RC2_CBC_PAD = 0x00000105
- CKM_RC4_KEY_GEN = 0x00000110
- CKM_RC4 = 0x00000111
- CKM_DES_KEY_GEN = 0x00000120
- CKM_DES_ECB = 0x00000121
- CKM_DES_CBC = 0x00000122
- CKM_DES_MAC = 0x00000123
- CKM_DES_MAC_GENERAL = 0x00000124
- CKM_DES_CBC_PAD = 0x00000125
- CKM_DES2_KEY_GEN = 0x00000130
- CKM_DES3_KEY_GEN = 0x00000131
- CKM_DES3_ECB = 0x00000132
- CKM_DES3_CBC = 0x00000133
- CKM_DES3_MAC = 0x00000134
- CKM_DES3_MAC_GENERAL = 0x00000135
- CKM_DES3_CBC_PAD = 0x00000136
- CKM_DES3_CMAC_GENERAL = 0x00000137
- CKM_DES3_CMAC = 0x00000138
- CKM_CDMF_KEY_GEN = 0x00000140
- CKM_CDMF_ECB = 0x00000141
- CKM_CDMF_CBC = 0x00000142
- CKM_CDMF_MAC = 0x00000143
- CKM_CDMF_MAC_GENERAL = 0x00000144
- CKM_CDMF_CBC_PAD = 0x00000145
- CKM_DES_OFB64 = 0x00000150
- CKM_DES_OFB8 = 0x00000151
- CKM_DES_CFB64 = 0x00000152
- CKM_DES_CFB8 = 0x00000153
- CKM_MD2 = 0x00000200
- CKM_MD2_HMAC = 0x00000201
- CKM_MD2_HMAC_GENERAL = 0x00000202
- CKM_MD5 = 0x00000210
- CKM_MD5_HMAC = 0x00000211
- CKM_MD5_HMAC_GENERAL = 0x00000212
- CKM_SHA_1 = 0x00000220
- CKM_SHA_1_HMAC = 0x00000221
- CKM_SHA_1_HMAC_GENERAL = 0x00000222
- CKM_RIPEMD128 = 0x00000230
- CKM_RIPEMD128_HMAC = 0x00000231
- CKM_RIPEMD128_HMAC_GENERAL = 0x00000232
- CKM_RIPEMD160 = 0x00000240
- CKM_RIPEMD160_HMAC = 0x00000241
- CKM_RIPEMD160_HMAC_GENERAL = 0x00000242
- CKM_SHA256 = 0x00000250
- CKM_SHA256_HMAC = 0x00000251
- CKM_SHA256_HMAC_GENERAL = 0x00000252
- CKM_SHA224 = 0x00000255
- CKM_SHA224_HMAC = 0x00000256
- CKM_SHA224_HMAC_GENERAL = 0x00000257
- CKM_SHA384 = 0x00000260
- CKM_SHA384_HMAC = 0x00000261
- CKM_SHA384_HMAC_GENERAL = 0x00000262
- CKM_SHA512 = 0x00000270
- CKM_SHA512_HMAC = 0x00000271
- CKM_SHA512_HMAC_GENERAL = 0x00000272
- CKM_SECURID_KEY_GEN = 0x00000280
- CKM_SECURID = 0x00000282
- CKM_HOTP_KEY_GEN = 0x00000290
- CKM_HOTP = 0x00000291
- CKM_ACTI = 0x000002A0
- CKM_ACTI_KEY_GEN = 0x000002A1
- CKM_SHA3_256 = 0x000002B0
- CKM_SHA3_256_HMAC = 0x000002B1
- CKM_SHA3_256_HMAC_GENERAL = 0x000002B2
- CKM_SHA3_256_KEY_GEN = 0x000002B3
- CKM_SHA3_224 = 0x000002B5
- CKM_SHA3_224_HMAC = 0x000002B6
- CKM_SHA3_224_HMAC_GENERAL = 0x000002B7
- CKM_SHA3_224_KEY_GEN = 0x000002B8
- CKM_SHA3_384 = 0x000002C0
- CKM_SHA3_384_HMAC = 0x000002C1
- CKM_SHA3_384_HMAC_GENERAL = 0x000002C2
- CKM_SHA3_384_KEY_GEN = 0x000002C3
- CKM_SHA3_512 = 0x000002D0
- CKM_SHA3_512_HMAC = 0x000002D1
- CKM_SHA3_512_HMAC_GENERAL = 0x000002D2
- CKM_SHA3_512_KEY_GEN = 0x000002D3
- CKM_CAST_KEY_GEN = 0x00000300
- CKM_CAST_ECB = 0x00000301
- CKM_CAST_CBC = 0x00000302
- CKM_CAST_MAC = 0x00000303
- CKM_CAST_MAC_GENERAL = 0x00000304
- CKM_CAST_CBC_PAD = 0x00000305
- CKM_CAST3_KEY_GEN = 0x00000310
- CKM_CAST3_ECB = 0x00000311
- CKM_CAST3_CBC = 0x00000312
- CKM_CAST3_MAC = 0x00000313
- CKM_CAST3_MAC_GENERAL = 0x00000314
- CKM_CAST3_CBC_PAD = 0x00000315
- CKM_CAST5_KEY_GEN = 0x00000320
- CKM_CAST128_KEY_GEN = 0x00000320
- CKM_CAST5_ECB = 0x00000321
- CKM_CAST128_ECB = 0x00000321
- CKM_CAST5_CBC = 0x00000322 // Deprecated
- CKM_CAST128_CBC = 0x00000322
- CKM_CAST5_MAC = 0x00000323 // Deprecated
- CKM_CAST128_MAC = 0x00000323
- CKM_CAST5_MAC_GENERAL = 0x00000324 // Deprecated
- CKM_CAST128_MAC_GENERAL = 0x00000324
- CKM_CAST5_CBC_PAD = 0x00000325 // Deprecated
- CKM_CAST128_CBC_PAD = 0x00000325
- CKM_RC5_KEY_GEN = 0x00000330
- CKM_RC5_ECB = 0x00000331
- CKM_RC5_CBC = 0x00000332
- CKM_RC5_MAC = 0x00000333
- CKM_RC5_MAC_GENERAL = 0x00000334
- CKM_RC5_CBC_PAD = 0x00000335
- CKM_IDEA_KEY_GEN = 0x00000340
- CKM_IDEA_ECB = 0x00000341
- CKM_IDEA_CBC = 0x00000342
- CKM_IDEA_MAC = 0x00000343
- CKM_IDEA_MAC_GENERAL = 0x00000344
- CKM_IDEA_CBC_PAD = 0x00000345
- CKM_GENERIC_SECRET_KEY_GEN = 0x00000350
- CKM_CONCATENATE_BASE_AND_KEY = 0x00000360
- CKM_CONCATENATE_BASE_AND_DATA = 0x00000362
- CKM_CONCATENATE_DATA_AND_BASE = 0x00000363
- CKM_XOR_BASE_AND_DATA = 0x00000364
- CKM_EXTRACT_KEY_FROM_KEY = 0x00000365
- CKM_SSL3_PRE_MASTER_KEY_GEN = 0x00000370
- CKM_SSL3_MASTER_KEY_DERIVE = 0x00000371
- CKM_SSL3_KEY_AND_MAC_DERIVE = 0x00000372
- CKM_SSL3_MASTER_KEY_DERIVE_DH = 0x00000373
- CKM_TLS_PRE_MASTER_KEY_GEN = 0x00000374
- CKM_TLS_MASTER_KEY_DERIVE = 0x00000375
- CKM_TLS_KEY_AND_MAC_DERIVE = 0x00000376
- CKM_TLS_MASTER_KEY_DERIVE_DH = 0x00000377
- CKM_TLS_PRF = 0x00000378
- CKM_SSL3_MD5_MAC = 0x00000380
- CKM_SSL3_SHA1_MAC = 0x00000381
- CKM_MD5_KEY_DERIVATION = 0x00000390
- CKM_MD2_KEY_DERIVATION = 0x00000391
- CKM_SHA1_KEY_DERIVATION = 0x00000392
- CKM_SHA256_KEY_DERIVATION = 0x00000393
- CKM_SHA384_KEY_DERIVATION = 0x00000394
- CKM_SHA512_KEY_DERIVATION = 0x00000395
- CKM_SHA224_KEY_DERIVATION = 0x00000396
- CKM_SHA3_256_KEY_DERIVE = 0x00000397
- CKM_SHA3_224_KEY_DERIVE = 0x00000398
- CKM_SHA3_384_KEY_DERIVE = 0x00000399
- CKM_SHA3_512_KEY_DERIVE = 0x0000039A
- CKM_SHAKE_128_KEY_DERIVE = 0x0000039B
- CKM_SHAKE_256_KEY_DERIVE = 0x0000039C
- CKM_PBE_MD2_DES_CBC = 0x000003A0
- CKM_PBE_MD5_DES_CBC = 0x000003A1
- CKM_PBE_MD5_CAST_CBC = 0x000003A2
- CKM_PBE_MD5_CAST3_CBC = 0x000003A3
- CKM_PBE_MD5_CAST5_CBC = 0x000003A4 // Deprecated
- CKM_PBE_MD5_CAST128_CBC = 0x000003A4
- CKM_PBE_SHA1_CAST5_CBC = 0x000003A5 // Deprecated
- CKM_PBE_SHA1_CAST128_CBC = 0x000003A5
- CKM_PBE_SHA1_RC4_128 = 0x000003A6
- CKM_PBE_SHA1_RC4_40 = 0x000003A7
- CKM_PBE_SHA1_DES3_EDE_CBC = 0x000003A8
- CKM_PBE_SHA1_DES2_EDE_CBC = 0x000003A9
- CKM_PBE_SHA1_RC2_128_CBC = 0x000003AA
- CKM_PBE_SHA1_RC2_40_CBC = 0x000003AB
- CKM_PKCS5_PBKD2 = 0x000003B0
- CKM_PBA_SHA1_WITH_SHA1_HMAC = 0x000003C0
- CKM_WTLS_PRE_MASTER_KEY_GEN = 0x000003D0
- CKM_WTLS_MASTER_KEY_DERIVE = 0x000003D1
- CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC = 0x000003D2
- CKM_WTLS_PRF = 0x000003D3
- CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE = 0x000003D4
- CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE = 0x000003D5
- CKM_TLS10_MAC_SERVER = 0x000003D6
- CKM_TLS10_MAC_CLIENT = 0x000003D7
- CKM_TLS12_MAC = 0x000003D8
- CKM_TLS12_KDF = 0x000003D9
- CKM_TLS12_MASTER_KEY_DERIVE = 0x000003E0
- CKM_TLS12_KEY_AND_MAC_DERIVE = 0x000003E1
- CKM_TLS12_MASTER_KEY_DERIVE_DH = 0x000003E2
- CKM_TLS12_KEY_SAFE_DERIVE = 0x000003E3
- CKM_TLS_MAC = 0x000003E4
- CKM_TLS_KDF = 0x000003E5
- CKM_KEY_WRAP_LYNKS = 0x00000400
- CKM_KEY_WRAP_SET_OAEP = 0x00000401
- CKM_CMS_SIG = 0x00000500
- CKM_KIP_DERIVE = 0x00000510
- CKM_KIP_WRAP = 0x00000511
- CKM_KIP_MAC = 0x00000512
- CKM_CAMELLIA_KEY_GEN = 0x00000550
- CKM_CAMELLIA_ECB = 0x00000551
- CKM_CAMELLIA_CBC = 0x00000552
- CKM_CAMELLIA_MAC = 0x00000553
- CKM_CAMELLIA_MAC_GENERAL = 0x00000554
- CKM_CAMELLIA_CBC_PAD = 0x00000555
- CKM_CAMELLIA_ECB_ENCRYPT_DATA = 0x00000556
- CKM_CAMELLIA_CBC_ENCRYPT_DATA = 0x00000557
- CKM_CAMELLIA_CTR = 0x00000558
- CKM_ARIA_KEY_GEN = 0x00000560
- CKM_ARIA_ECB = 0x00000561
- CKM_ARIA_CBC = 0x00000562
- CKM_ARIA_MAC = 0x00000563
- CKM_ARIA_MAC_GENERAL = 0x00000564
- CKM_ARIA_CBC_PAD = 0x00000565
- CKM_ARIA_ECB_ENCRYPT_DATA = 0x00000566
- CKM_ARIA_CBC_ENCRYPT_DATA = 0x00000567
- CKM_SEED_KEY_GEN = 0x00000650
- CKM_SEED_ECB = 0x00000651
- CKM_SEED_CBC = 0x00000652
- CKM_SEED_MAC = 0x00000653
- CKM_SEED_MAC_GENERAL = 0x00000654
- CKM_SEED_CBC_PAD = 0x00000655
- CKM_SEED_ECB_ENCRYPT_DATA = 0x00000656
- CKM_SEED_CBC_ENCRYPT_DATA = 0x00000657
- CKM_SKIPJACK_KEY_GEN = 0x00001000
- CKM_SKIPJACK_ECB64 = 0x00001001
- CKM_SKIPJACK_CBC64 = 0x00001002
- CKM_SKIPJACK_OFB64 = 0x00001003
- CKM_SKIPJACK_CFB64 = 0x00001004
- CKM_SKIPJACK_CFB32 = 0x00001005
- CKM_SKIPJACK_CFB16 = 0x00001006
- CKM_SKIPJACK_CFB8 = 0x00001007
- CKM_SKIPJACK_WRAP = 0x00001008
- CKM_SKIPJACK_PRIVATE_WRAP = 0x00001009
- CKM_SKIPJACK_RELAYX = 0x0000100a
- CKM_KEA_KEY_PAIR_GEN = 0x00001010
- CKM_KEA_KEY_DERIVE = 0x00001011
- CKM_KEA_DERIVE = 0x00001012
- CKM_FORTEZZA_TIMESTAMP = 0x00001020
- CKM_BATON_KEY_GEN = 0x00001030
- CKM_BATON_ECB128 = 0x00001031
- CKM_BATON_ECB96 = 0x00001032
- CKM_BATON_CBC128 = 0x00001033
- CKM_BATON_COUNTER = 0x00001034
- CKM_BATON_SHUFFLE = 0x00001035
- CKM_BATON_WRAP = 0x00001036
- CKM_ECDSA_KEY_PAIR_GEN = 0x00001040 // Deprecated
- CKM_EC_KEY_PAIR_GEN = 0x00001040
- CKM_ECDSA = 0x00001041
- CKM_ECDSA_SHA1 = 0x00001042
- CKM_ECDSA_SHA224 = 0x00001043
- CKM_ECDSA_SHA256 = 0x00001044
- CKM_ECDSA_SHA384 = 0x00001045
- CKM_ECDSA_SHA512 = 0x00001046
- CKM_ECDH1_DERIVE = 0x00001050
- CKM_ECDH1_COFACTOR_DERIVE = 0x00001051
- CKM_ECMQV_DERIVE = 0x00001052
- CKM_ECDH_AES_KEY_WRAP = 0x00001053
- CKM_RSA_AES_KEY_WRAP = 0x00001054
- CKM_JUNIPER_KEY_GEN = 0x00001060
- CKM_JUNIPER_ECB128 = 0x00001061
- CKM_JUNIPER_CBC128 = 0x00001062
- CKM_JUNIPER_COUNTER = 0x00001063
- CKM_JUNIPER_SHUFFLE = 0x00001064
- CKM_JUNIPER_WRAP = 0x00001065
- CKM_FASTHASH = 0x00001070
- CKM_AES_KEY_GEN = 0x00001080
- CKM_AES_ECB = 0x00001081
- CKM_AES_CBC = 0x00001082
- CKM_AES_MAC = 0x00001083
- CKM_AES_MAC_GENERAL = 0x00001084
- CKM_AES_CBC_PAD = 0x00001085
- CKM_AES_CTR = 0x00001086
- CKM_AES_GCM = 0x00001087
- CKM_AES_CCM = 0x00001088
- CKM_AES_CTS = 0x00001089
- CKM_AES_CMAC = 0x0000108A
- CKM_AES_CMAC_GENERAL = 0x0000108B
- CKM_AES_XCBC_MAC = 0x0000108C
- CKM_AES_XCBC_MAC_96 = 0x0000108D
- CKM_AES_GMAC = 0x0000108E
- CKM_BLOWFISH_KEY_GEN = 0x00001090
- CKM_BLOWFISH_CBC = 0x00001091
- CKM_TWOFISH_KEY_GEN = 0x00001092
- CKM_TWOFISH_CBC = 0x00001093
- CKM_BLOWFISH_CBC_PAD = 0x00001094
- CKM_TWOFISH_CBC_PAD = 0x00001095
- CKM_DES_ECB_ENCRYPT_DATA = 0x00001100
- CKM_DES_CBC_ENCRYPT_DATA = 0x00001101
- CKM_DES3_ECB_ENCRYPT_DATA = 0x00001102
- CKM_DES3_CBC_ENCRYPT_DATA = 0x00001103
- CKM_AES_ECB_ENCRYPT_DATA = 0x00001104
- CKM_AES_CBC_ENCRYPT_DATA = 0x00001105
- CKM_GOSTR3410_KEY_PAIR_GEN = 0x00001200
- CKM_GOSTR3410 = 0x00001201
- CKM_GOSTR3410_WITH_GOSTR3411 = 0x00001202
- CKM_GOSTR3410_KEY_WRAP = 0x00001203
- CKM_GOSTR3410_DERIVE = 0x00001204
- CKM_GOSTR3411 = 0x00001210
- CKM_GOSTR3411_HMAC = 0x00001211
- CKM_GOST28147_KEY_GEN = 0x00001220
- CKM_GOST28147_ECB = 0x00001221
- CKM_GOST28147 = 0x00001222
- CKM_GOST28147_MAC = 0x00001223
- CKM_GOST28147_KEY_WRAP = 0x00001224
- CKM_DSA_PARAMETER_GEN = 0x00002000
- CKM_DH_PKCS_PARAMETER_GEN = 0x00002001
- CKM_X9_42_DH_PARAMETER_GEN = 0x00002002
- CKM_DSA_PROBABLISTIC_PARAMETER_GEN = 0x00002003
- CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN = 0x00002004
- CKM_AES_OFB = 0x00002104
- CKM_AES_CFB64 = 0x00002105
- CKM_AES_CFB8 = 0x00002106
- CKM_AES_CFB128 = 0x00002107
- CKM_AES_CFB1 = 0x00002108
- CKM_AES_KEY_WRAP = 0x00002109
- CKM_AES_KEY_WRAP_PAD = 0x0000210A
- CKM_RSA_PKCS_TPM_1_1 = 0x00004001
- CKM_RSA_PKCS_OAEP_TPM_1_1 = 0x00004002
- CKM_VENDOR_DEFINED = 0x80000000
- CKF_HW = 0x00000001
- CKF_ENCRYPT = 0x00000100
- CKF_DECRYPT = 0x00000200
- CKF_DIGEST = 0x00000400
- CKF_SIGN = 0x00000800
- CKF_SIGN_RECOVER = 0x00001000
- CKF_VERIFY = 0x00002000
- CKF_VERIFY_RECOVER = 0x00004000
- CKF_GENERATE = 0x00008000
- CKF_GENERATE_KEY_PAIR = 0x00010000
- CKF_WRAP = 0x00020000
- CKF_UNWRAP = 0x00040000
- CKF_DERIVE = 0x00080000
- CKF_EC_F_P = 0x00100000
- CKF_EC_F_2M = 0x00200000
- CKF_EC_ECPARAMETERS = 0x00400000
- CKF_EC_NAMEDCURVE = 0x00800000
- CKF_EC_UNCOMPRESS = 0x01000000
- CKF_EC_COMPRESS = 0x02000000
- CKF_EXTENSION = 0x80000000
+
+ // The following certificate types are defined:
+ CKC_X_509 = 0x00000000
+ CKC_X_509_ATTR_CERT = 0x00000001
+ CKC_WTLS = 0x00000002
+ CKC_VENDOR_DEFINED = 0x80000000
+
+ // The CKF_ARRAY_ATTRIBUTE flag identifies an attribute which
+ // consists of an array of values.
+ CKF_ARRAY_ATTRIBUTE = 0x40000000
+
+ // The following OTP-related defines relate to the CKA_OTP_FORMAT attribute
+ CK_OTP_FORMAT_DECIMAL = 0
+ CK_OTP_FORMAT_HEXADECIMAL = 1
+ CK_OTP_FORMAT_ALPHANUMERIC = 2
+ CK_OTP_FORMAT_BINARY = 3
+
+ // The following OTP-related defines relate to the CKA_OTP_..._REQUIREMENT
+ // attributes
+ CK_OTP_PARAM_IGNORED = 0
+ CK_OTP_PARAM_OPTIONAL = 1
+ CK_OTP_PARAM_MANDATORY = 2
+
+ // The following attribute types are defined:
+ CKA_CLASS = 0x00000000
+ CKA_TOKEN = 0x00000001
+ CKA_PRIVATE = 0x00000002
+ CKA_LABEL = 0x00000003
+ CKA_APPLICATION = 0x00000010
+ CKA_VALUE = 0x00000011
+ CKA_OBJECT_ID = 0x00000012
+ CKA_CERTIFICATE_TYPE = 0x00000080
+ CKA_ISSUER = 0x00000081
+ CKA_SERIAL_NUMBER = 0x00000082
+ CKA_AC_ISSUER = 0x00000083
+ CKA_OWNER = 0x00000084
+ CKA_ATTR_TYPES = 0x00000085
+ CKA_TRUSTED = 0x00000086
+ CKA_CERTIFICATE_CATEGORY = 0x00000087
+ CKA_JAVA_MIDP_SECURITY_DOMAIN = 0x00000088
+ CKA_URL = 0x00000089
+ CKA_HASH_OF_SUBJECT_PUBLIC_KEY = 0x0000008A
+ CKA_HASH_OF_ISSUER_PUBLIC_KEY = 0x0000008B
+ CKA_NAME_HASH_ALGORITHM = 0x0000008C
+ CKA_CHECK_VALUE = 0x00000090
+ CKA_KEY_TYPE = 0x00000100
+ CKA_SUBJECT = 0x00000101
+ CKA_ID = 0x00000102
+ CKA_SENSITIVE = 0x00000103
+ CKA_ENCRYPT = 0x00000104
+ CKA_DECRYPT = 0x00000105
+ CKA_WRAP = 0x00000106
+ CKA_UNWRAP = 0x00000107
+ CKA_SIGN = 0x00000108
+ CKA_SIGN_RECOVER = 0x00000109
+ CKA_VERIFY = 0x0000010A
+ CKA_VERIFY_RECOVER = 0x0000010B
+ CKA_DERIVE = 0x0000010C
+ CKA_START_DATE = 0x00000110
+ CKA_END_DATE = 0x00000111
+ CKA_MODULUS = 0x00000120
+ CKA_MODULUS_BITS = 0x00000121
+ CKA_PUBLIC_EXPONENT = 0x00000122
+ CKA_PRIVATE_EXPONENT = 0x00000123
+ CKA_PRIME_1 = 0x00000124
+ CKA_PRIME_2 = 0x00000125
+ CKA_EXPONENT_1 = 0x00000126
+ CKA_EXPONENT_2 = 0x00000127
+ CKA_COEFFICIENT = 0x00000128
+ CKA_PUBLIC_KEY_INFO = 0x00000129
+ CKA_PRIME = 0x00000130
+ CKA_SUBPRIME = 0x00000131
+ CKA_BASE = 0x00000132
+ CKA_PRIME_BITS = 0x00000133
+ CKA_SUBPRIME_BITS = 0x00000134
+ CKA_SUB_PRIME_BITS = CKA_SUBPRIME_BITS
+ CKA_VALUE_BITS = 0x00000160
+ CKA_VALUE_LEN = 0x00000161
+ CKA_EXTRACTABLE = 0x00000162
+ CKA_LOCAL = 0x00000163
+ CKA_NEVER_EXTRACTABLE = 0x00000164
+ CKA_ALWAYS_SENSITIVE = 0x00000165
+ CKA_KEY_GEN_MECHANISM = 0x00000166
+ CKA_MODIFIABLE = 0x00000170
+ CKA_COPYABLE = 0x00000171
+ CKA_DESTROYABLE = 0x00000172
+ CKA_ECDSA_PARAMS = 0x00000180 // Deprecated
+ CKA_EC_PARAMS = 0x00000180
+ CKA_EC_POINT = 0x00000181
+ CKA_SECONDARY_AUTH = 0x00000200 // Deprecated
+ CKA_AUTH_PIN_FLAGS = 0x00000201 // Deprecated
+ CKA_ALWAYS_AUTHENTICATE = 0x00000202
+ CKA_WRAP_WITH_TRUSTED = 0x00000210
+ CKA_WRAP_TEMPLATE = (CKF_ARRAY_ATTRIBUTE | 0x00000211)
+ CKA_UNWRAP_TEMPLATE = (CKF_ARRAY_ATTRIBUTE | 0x00000212)
+ CKA_DERIVE_TEMPLATE = (CKF_ARRAY_ATTRIBUTE | 0x00000213)
+ CKA_OTP_FORMAT = 0x00000220
+ CKA_OTP_LENGTH = 0x00000221
+ CKA_OTP_TIME_INTERVAL = 0x00000222
+ CKA_OTP_USER_FRIENDLY_MODE = 0x00000223
+ CKA_OTP_CHALLENGE_REQUIREMENT = 0x00000224
+ CKA_OTP_TIME_REQUIREMENT = 0x00000225
+ CKA_OTP_COUNTER_REQUIREMENT = 0x00000226
+ CKA_OTP_PIN_REQUIREMENT = 0x00000227
+ CKA_OTP_COUNTER = 0x0000022E
+ CKA_OTP_TIME = 0x0000022F
+ CKA_OTP_USER_IDENTIFIER = 0x0000022A
+ CKA_OTP_SERVICE_IDENTIFIER = 0x0000022B
+ CKA_OTP_SERVICE_LOGO = 0x0000022C
+ CKA_OTP_SERVICE_LOGO_TYPE = 0x0000022D
+ CKA_GOSTR3410_PARAMS = 0x00000250
+ CKA_GOSTR3411_PARAMS = 0x00000251
+ CKA_GOST28147_PARAMS = 0x00000252
+ CKA_HW_FEATURE_TYPE = 0x00000300
+ CKA_RESET_ON_INIT = 0x00000301
+ CKA_HAS_RESET = 0x00000302
+ CKA_PIXEL_X = 0x00000400
+ CKA_PIXEL_Y = 0x00000401
+ CKA_RESOLUTION = 0x00000402
+ CKA_CHAR_ROWS = 0x00000403
+ CKA_CHAR_COLUMNS = 0x00000404
+ CKA_COLOR = 0x00000405
+ CKA_BITS_PER_PIXEL = 0x00000406
+ CKA_CHAR_SETS = 0x00000480
+ CKA_ENCODING_METHODS = 0x00000481
+ CKA_MIME_TYPES = 0x00000482
+ CKA_MECHANISM_TYPE = 0x00000500
+ CKA_REQUIRED_CMS_ATTRIBUTES = 0x00000501
+ CKA_DEFAULT_CMS_ATTRIBUTES = 0x00000502
+ CKA_SUPPORTED_CMS_ATTRIBUTES = 0x00000503
+ CKA_ALLOWED_MECHANISMS = (CKF_ARRAY_ATTRIBUTE | 0x00000600)
+ CKA_VENDOR_DEFINED = 0x80000000
+
+ // the following mechanism types are defined:
+ CKM_RSA_PKCS_KEY_PAIR_GEN = 0x00000000
+ CKM_RSA_PKCS = 0x00000001
+ CKM_RSA_9796 = 0x00000002
+ CKM_RSA_X_509 = 0x00000003
+ CKM_MD2_RSA_PKCS = 0x00000004
+ CKM_MD5_RSA_PKCS = 0x00000005
+ CKM_SHA1_RSA_PKCS = 0x00000006
+ CKM_RIPEMD128_RSA_PKCS = 0x00000007
+ CKM_RIPEMD160_RSA_PKCS = 0x00000008
+ CKM_RSA_PKCS_OAEP = 0x00000009
+ CKM_RSA_X9_31_KEY_PAIR_GEN = 0x0000000A
+ CKM_RSA_X9_31 = 0x0000000B
+ CKM_SHA1_RSA_X9_31 = 0x0000000C
+ CKM_RSA_PKCS_PSS = 0x0000000D
+ CKM_SHA1_RSA_PKCS_PSS = 0x0000000E
+ CKM_DSA_KEY_PAIR_GEN = 0x00000010
+ CKM_DSA = 0x00000011
+ CKM_DSA_SHA1 = 0x00000012
+ CKM_DSA_SHA224 = 0x00000013
+ CKM_DSA_SHA256 = 0x00000014
+ CKM_DSA_SHA384 = 0x00000015
+ CKM_DSA_SHA512 = 0x00000016
+ CKM_DSA_SHA3_224 = 0x00000018
+ CKM_DSA_SHA3_256 = 0x00000019
+ CKM_DSA_SHA3_384 = 0x0000001A
+ CKM_DSA_SHA3_512 = 0x0000001B
+ CKM_DH_PKCS_KEY_PAIR_GEN = 0x00000020
+ CKM_DH_PKCS_DERIVE = 0x00000021
+ CKM_X9_42_DH_KEY_PAIR_GEN = 0x00000030
+ CKM_X9_42_DH_DERIVE = 0x00000031
+ CKM_X9_42_DH_HYBRID_DERIVE = 0x00000032
+ CKM_X9_42_MQV_DERIVE = 0x00000033
+ CKM_SHA256_RSA_PKCS = 0x00000040
+ CKM_SHA384_RSA_PKCS = 0x00000041
+ CKM_SHA512_RSA_PKCS = 0x00000042
+ CKM_SHA256_RSA_PKCS_PSS = 0x00000043
+ CKM_SHA384_RSA_PKCS_PSS = 0x00000044
+ CKM_SHA512_RSA_PKCS_PSS = 0x00000045
+ CKM_SHA224_RSA_PKCS = 0x00000046
+ CKM_SHA224_RSA_PKCS_PSS = 0x00000047
+ CKM_SHA512_224 = 0x00000048
+ CKM_SHA512_224_HMAC = 0x00000049
+ CKM_SHA512_224_HMAC_GENERAL = 0x0000004A
+ CKM_SHA512_224_KEY_DERIVATION = 0x0000004B
+ CKM_SHA512_256 = 0x0000004C
+ CKM_SHA512_256_HMAC = 0x0000004D
+ CKM_SHA512_256_HMAC_GENERAL = 0x0000004E
+ CKM_SHA512_256_KEY_DERIVATION = 0x0000004F
+ CKM_SHA512_T = 0x00000050
+ CKM_SHA512_T_HMAC = 0x00000051
+ CKM_SHA512_T_HMAC_GENERAL = 0x00000052
+ CKM_SHA512_T_KEY_DERIVATION = 0x00000053
+ CKM_SHA3_256_RSA_PKCS = 0x00000060
+ CKM_SHA3_384_RSA_PKCS = 0x00000061
+ CKM_SHA3_512_RSA_PKCS = 0x00000062
+ CKM_SHA3_256_RSA_PKCS_PSS = 0x00000063
+ CKM_SHA3_384_RSA_PKCS_PSS = 0x00000064
+ CKM_SHA3_512_RSA_PKCS_PSS = 0x00000065
+ CKM_SHA3_224_RSA_PKCS = 0x00000066
+ CKM_SHA3_224_RSA_PKCS_PSS = 0x00000067
+ CKM_RC2_KEY_GEN = 0x00000100
+ CKM_RC2_ECB = 0x00000101
+ CKM_RC2_CBC = 0x00000102
+ CKM_RC2_MAC = 0x00000103
+ CKM_RC2_MAC_GENERAL = 0x00000104
+ CKM_RC2_CBC_PAD = 0x00000105
+ CKM_RC4_KEY_GEN = 0x00000110
+ CKM_RC4 = 0x00000111
+ CKM_DES_KEY_GEN = 0x00000120
+ CKM_DES_ECB = 0x00000121
+ CKM_DES_CBC = 0x00000122
+ CKM_DES_MAC = 0x00000123
+ CKM_DES_MAC_GENERAL = 0x00000124
+ CKM_DES_CBC_PAD = 0x00000125
+ CKM_DES2_KEY_GEN = 0x00000130
+ CKM_DES3_KEY_GEN = 0x00000131
+ CKM_DES3_ECB = 0x00000132
+ CKM_DES3_CBC = 0x00000133
+ CKM_DES3_MAC = 0x00000134
+ CKM_DES3_MAC_GENERAL = 0x00000135
+ CKM_DES3_CBC_PAD = 0x00000136
+ CKM_DES3_CMAC_GENERAL = 0x00000137
+ CKM_DES3_CMAC = 0x00000138
+ CKM_CDMF_KEY_GEN = 0x00000140
+ CKM_CDMF_ECB = 0x00000141
+ CKM_CDMF_CBC = 0x00000142
+ CKM_CDMF_MAC = 0x00000143
+ CKM_CDMF_MAC_GENERAL = 0x00000144
+ CKM_CDMF_CBC_PAD = 0x00000145
+ CKM_DES_OFB64 = 0x00000150
+ CKM_DES_OFB8 = 0x00000151
+ CKM_DES_CFB64 = 0x00000152
+ CKM_DES_CFB8 = 0x00000153
+ CKM_MD2 = 0x00000200
+ CKM_MD2_HMAC = 0x00000201
+ CKM_MD2_HMAC_GENERAL = 0x00000202
+ CKM_MD5 = 0x00000210
+ CKM_MD5_HMAC = 0x00000211
+ CKM_MD5_HMAC_GENERAL = 0x00000212
+ CKM_SHA_1 = 0x00000220
+ CKM_SHA_1_HMAC = 0x00000221
+ CKM_SHA_1_HMAC_GENERAL = 0x00000222
+ CKM_RIPEMD128 = 0x00000230
+ CKM_RIPEMD128_HMAC = 0x00000231
+ CKM_RIPEMD128_HMAC_GENERAL = 0x00000232
+ CKM_RIPEMD160 = 0x00000240
+ CKM_RIPEMD160_HMAC = 0x00000241
+ CKM_RIPEMD160_HMAC_GENERAL = 0x00000242
+ CKM_SHA256 = 0x00000250
+ CKM_SHA256_HMAC = 0x00000251
+ CKM_SHA256_HMAC_GENERAL = 0x00000252
+ CKM_SHA224 = 0x00000255
+ CKM_SHA224_HMAC = 0x00000256
+ CKM_SHA224_HMAC_GENERAL = 0x00000257
+ CKM_SHA384 = 0x00000260
+ CKM_SHA384_HMAC = 0x00000261
+ CKM_SHA384_HMAC_GENERAL = 0x00000262
+ CKM_SHA512 = 0x00000270
+ CKM_SHA512_HMAC = 0x00000271
+ CKM_SHA512_HMAC_GENERAL = 0x00000272
+ CKM_SECURID_KEY_GEN = 0x00000280
+ CKM_SECURID = 0x00000282
+ CKM_HOTP_KEY_GEN = 0x00000290
+ CKM_HOTP = 0x00000291
+ CKM_ACTI = 0x000002A0
+ CKM_ACTI_KEY_GEN = 0x000002A1
+ CKM_SHA3_256 = 0x000002B0
+ CKM_SHA3_256_HMAC = 0x000002B1
+ CKM_SHA3_256_HMAC_GENERAL = 0x000002B2
+ CKM_SHA3_256_KEY_GEN = 0x000002B3
+ CKM_SHA3_224 = 0x000002B5
+ CKM_SHA3_224_HMAC = 0x000002B6
+ CKM_SHA3_224_HMAC_GENERAL = 0x000002B7
+ CKM_SHA3_224_KEY_GEN = 0x000002B8
+ CKM_SHA3_384 = 0x000002C0
+ CKM_SHA3_384_HMAC = 0x000002C1
+ CKM_SHA3_384_HMAC_GENERAL = 0x000002C2
+ CKM_SHA3_384_KEY_GEN = 0x000002C3
+ CKM_SHA3_512 = 0x000002D0
+ CKM_SHA3_512_HMAC = 0x000002D1
+ CKM_SHA3_512_HMAC_GENERAL = 0x000002D2
+ CKM_SHA3_512_KEY_GEN = 0x000002D3
+ CKM_CAST_KEY_GEN = 0x00000300
+ CKM_CAST_ECB = 0x00000301
+ CKM_CAST_CBC = 0x00000302
+ CKM_CAST_MAC = 0x00000303
+ CKM_CAST_MAC_GENERAL = 0x00000304
+ CKM_CAST_CBC_PAD = 0x00000305
+ CKM_CAST3_KEY_GEN = 0x00000310
+ CKM_CAST3_ECB = 0x00000311
+ CKM_CAST3_CBC = 0x00000312
+ CKM_CAST3_MAC = 0x00000313
+ CKM_CAST3_MAC_GENERAL = 0x00000314
+ CKM_CAST3_CBC_PAD = 0x00000315
+
+ // Note that CAST128 and CAST5 are the same algorithm
+ CKM_CAST5_KEY_GEN = 0x00000320
+ CKM_CAST128_KEY_GEN = 0x00000320
+ CKM_CAST5_ECB = 0x00000321
+ CKM_CAST128_ECB = 0x00000321
+ CKM_CAST5_CBC = 0x00000322 // Deprecated
+ CKM_CAST128_CBC = 0x00000322
+ CKM_CAST5_MAC = 0x00000323 // Deprecated
+ CKM_CAST128_MAC = 0x00000323
+ CKM_CAST5_MAC_GENERAL = 0x00000324 // Deprecated
+ CKM_CAST128_MAC_GENERAL = 0x00000324
+ CKM_CAST5_CBC_PAD = 0x00000325 // Deprecated
+ CKM_CAST128_CBC_PAD = 0x00000325
+ CKM_RC5_KEY_GEN = 0x00000330
+ CKM_RC5_ECB = 0x00000331
+ CKM_RC5_CBC = 0x00000332
+ CKM_RC5_MAC = 0x00000333
+ CKM_RC5_MAC_GENERAL = 0x00000334
+ CKM_RC5_CBC_PAD = 0x00000335
+ CKM_IDEA_KEY_GEN = 0x00000340
+ CKM_IDEA_ECB = 0x00000341
+ CKM_IDEA_CBC = 0x00000342
+ CKM_IDEA_MAC = 0x00000343
+ CKM_IDEA_MAC_GENERAL = 0x00000344
+ CKM_IDEA_CBC_PAD = 0x00000345
+ CKM_GENERIC_SECRET_KEY_GEN = 0x00000350
+ CKM_CONCATENATE_BASE_AND_KEY = 0x00000360
+ CKM_CONCATENATE_BASE_AND_DATA = 0x00000362
+ CKM_CONCATENATE_DATA_AND_BASE = 0x00000363
+ CKM_XOR_BASE_AND_DATA = 0x00000364
+ CKM_EXTRACT_KEY_FROM_KEY = 0x00000365
+ CKM_SSL3_PRE_MASTER_KEY_GEN = 0x00000370
+ CKM_SSL3_MASTER_KEY_DERIVE = 0x00000371
+ CKM_SSL3_KEY_AND_MAC_DERIVE = 0x00000372
+ CKM_SSL3_MASTER_KEY_DERIVE_DH = 0x00000373
+ CKM_TLS_PRE_MASTER_KEY_GEN = 0x00000374
+ CKM_TLS_MASTER_KEY_DERIVE = 0x00000375
+ CKM_TLS_KEY_AND_MAC_DERIVE = 0x00000376
+ CKM_TLS_MASTER_KEY_DERIVE_DH = 0x00000377
+ CKM_TLS_PRF = 0x00000378
+ CKM_SSL3_MD5_MAC = 0x00000380
+ CKM_SSL3_SHA1_MAC = 0x00000381
+ CKM_MD5_KEY_DERIVATION = 0x00000390
+ CKM_MD2_KEY_DERIVATION = 0x00000391
+ CKM_SHA1_KEY_DERIVATION = 0x00000392
+ CKM_SHA256_KEY_DERIVATION = 0x00000393
+ CKM_SHA384_KEY_DERIVATION = 0x00000394
+ CKM_SHA512_KEY_DERIVATION = 0x00000395
+ CKM_SHA224_KEY_DERIVATION = 0x00000396
+ CKM_SHA3_256_KEY_DERIVE = 0x00000397
+ CKM_SHA3_224_KEY_DERIVE = 0x00000398
+ CKM_SHA3_384_KEY_DERIVE = 0x00000399
+ CKM_SHA3_512_KEY_DERIVE = 0x0000039A
+ CKM_SHAKE_128_KEY_DERIVE = 0x0000039B
+ CKM_SHAKE_256_KEY_DERIVE = 0x0000039C
+ CKM_PBE_MD2_DES_CBC = 0x000003A0
+ CKM_PBE_MD5_DES_CBC = 0x000003A1
+ CKM_PBE_MD5_CAST_CBC = 0x000003A2
+ CKM_PBE_MD5_CAST3_CBC = 0x000003A3
+ CKM_PBE_MD5_CAST5_CBC = 0x000003A4 // Deprecated
+ CKM_PBE_MD5_CAST128_CBC = 0x000003A4
+ CKM_PBE_SHA1_CAST5_CBC = 0x000003A5 // Deprecated
+ CKM_PBE_SHA1_CAST128_CBC = 0x000003A5
+ CKM_PBE_SHA1_RC4_128 = 0x000003A6
+ CKM_PBE_SHA1_RC4_40 = 0x000003A7
+ CKM_PBE_SHA1_DES3_EDE_CBC = 0x000003A8
+ CKM_PBE_SHA1_DES2_EDE_CBC = 0x000003A9
+ CKM_PBE_SHA1_RC2_128_CBC = 0x000003AA
+ CKM_PBE_SHA1_RC2_40_CBC = 0x000003AB
+ CKM_PKCS5_PBKD2 = 0x000003B0
+ CKM_PBA_SHA1_WITH_SHA1_HMAC = 0x000003C0
+ CKM_WTLS_PRE_MASTER_KEY_GEN = 0x000003D0
+ CKM_WTLS_MASTER_KEY_DERIVE = 0x000003D1
+ CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC = 0x000003D2
+ CKM_WTLS_PRF = 0x000003D3
+ CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE = 0x000003D4
+ CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE = 0x000003D5
+ CKM_TLS10_MAC_SERVER = 0x000003D6
+ CKM_TLS10_MAC_CLIENT = 0x000003D7
+ CKM_TLS12_MAC = 0x000003D8
+ CKM_TLS12_KDF = 0x000003D9
+ CKM_TLS12_MASTER_KEY_DERIVE = 0x000003E0
+ CKM_TLS12_KEY_AND_MAC_DERIVE = 0x000003E1
+ CKM_TLS12_MASTER_KEY_DERIVE_DH = 0x000003E2
+ CKM_TLS12_KEY_SAFE_DERIVE = 0x000003E3
+ CKM_TLS_MAC = 0x000003E4
+ CKM_TLS_KDF = 0x000003E5
+ CKM_KEY_WRAP_LYNKS = 0x00000400
+ CKM_KEY_WRAP_SET_OAEP = 0x00000401
+ CKM_CMS_SIG = 0x00000500
+ CKM_KIP_DERIVE = 0x00000510
+ CKM_KIP_WRAP = 0x00000511
+ CKM_KIP_MAC = 0x00000512
+ CKM_CAMELLIA_KEY_GEN = 0x00000550
+ CKM_CAMELLIA_ECB = 0x00000551
+ CKM_CAMELLIA_CBC = 0x00000552
+ CKM_CAMELLIA_MAC = 0x00000553
+ CKM_CAMELLIA_MAC_GENERAL = 0x00000554
+ CKM_CAMELLIA_CBC_PAD = 0x00000555
+ CKM_CAMELLIA_ECB_ENCRYPT_DATA = 0x00000556
+ CKM_CAMELLIA_CBC_ENCRYPT_DATA = 0x00000557
+ CKM_CAMELLIA_CTR = 0x00000558
+ CKM_ARIA_KEY_GEN = 0x00000560
+ CKM_ARIA_ECB = 0x00000561
+ CKM_ARIA_CBC = 0x00000562
+ CKM_ARIA_MAC = 0x00000563
+ CKM_ARIA_MAC_GENERAL = 0x00000564
+ CKM_ARIA_CBC_PAD = 0x00000565
+ CKM_ARIA_ECB_ENCRYPT_DATA = 0x00000566
+ CKM_ARIA_CBC_ENCRYPT_DATA = 0x00000567
+ CKM_SEED_KEY_GEN = 0x00000650
+ CKM_SEED_ECB = 0x00000651
+ CKM_SEED_CBC = 0x00000652
+ CKM_SEED_MAC = 0x00000653
+ CKM_SEED_MAC_GENERAL = 0x00000654
+ CKM_SEED_CBC_PAD = 0x00000655
+ CKM_SEED_ECB_ENCRYPT_DATA = 0x00000656
+ CKM_SEED_CBC_ENCRYPT_DATA = 0x00000657
+ CKM_SKIPJACK_KEY_GEN = 0x00001000
+ CKM_SKIPJACK_ECB64 = 0x00001001
+ CKM_SKIPJACK_CBC64 = 0x00001002
+ CKM_SKIPJACK_OFB64 = 0x00001003
+ CKM_SKIPJACK_CFB64 = 0x00001004
+ CKM_SKIPJACK_CFB32 = 0x00001005
+ CKM_SKIPJACK_CFB16 = 0x00001006
+ CKM_SKIPJACK_CFB8 = 0x00001007
+ CKM_SKIPJACK_WRAP = 0x00001008
+ CKM_SKIPJACK_PRIVATE_WRAP = 0x00001009
+ CKM_SKIPJACK_RELAYX = 0x0000100a
+ CKM_KEA_KEY_PAIR_GEN = 0x00001010
+ CKM_KEA_KEY_DERIVE = 0x00001011
+ CKM_KEA_DERIVE = 0x00001012
+ CKM_FORTEZZA_TIMESTAMP = 0x00001020
+ CKM_BATON_KEY_GEN = 0x00001030
+ CKM_BATON_ECB128 = 0x00001031
+ CKM_BATON_ECB96 = 0x00001032
+ CKM_BATON_CBC128 = 0x00001033
+ CKM_BATON_COUNTER = 0x00001034
+ CKM_BATON_SHUFFLE = 0x00001035
+ CKM_BATON_WRAP = 0x00001036
+ CKM_ECDSA_KEY_PAIR_GEN = 0x00001040 // Deprecated
+ CKM_EC_KEY_PAIR_GEN = 0x00001040
+ CKM_ECDSA = 0x00001041
+ CKM_ECDSA_SHA1 = 0x00001042
+ CKM_ECDSA_SHA224 = 0x00001043
+ CKM_ECDSA_SHA256 = 0x00001044
+ CKM_ECDSA_SHA384 = 0x00001045
+ CKM_ECDSA_SHA512 = 0x00001046
+ CKM_ECDH1_DERIVE = 0x00001050
+ CKM_ECDH1_COFACTOR_DERIVE = 0x00001051
+ CKM_ECMQV_DERIVE = 0x00001052
+ CKM_ECDH_AES_KEY_WRAP = 0x00001053
+ CKM_RSA_AES_KEY_WRAP = 0x00001054
+ CKM_JUNIPER_KEY_GEN = 0x00001060
+ CKM_JUNIPER_ECB128 = 0x00001061
+ CKM_JUNIPER_CBC128 = 0x00001062
+ CKM_JUNIPER_COUNTER = 0x00001063
+ CKM_JUNIPER_SHUFFLE = 0x00001064
+ CKM_JUNIPER_WRAP = 0x00001065
+ CKM_FASTHASH = 0x00001070
+ CKM_AES_KEY_GEN = 0x00001080
+ CKM_AES_ECB = 0x00001081
+ CKM_AES_CBC = 0x00001082
+ CKM_AES_MAC = 0x00001083
+ CKM_AES_MAC_GENERAL = 0x00001084
+ CKM_AES_CBC_PAD = 0x00001085
+ CKM_AES_CTR = 0x00001086
+ CKM_AES_GCM = 0x00001087
+ CKM_AES_CCM = 0x00001088
+ CKM_AES_CTS = 0x00001089
+ CKM_AES_CMAC = 0x0000108A
+ CKM_AES_CMAC_GENERAL = 0x0000108B
+ CKM_AES_XCBC_MAC = 0x0000108C
+ CKM_AES_XCBC_MAC_96 = 0x0000108D
+ CKM_AES_GMAC = 0x0000108E
+ CKM_BLOWFISH_KEY_GEN = 0x00001090
+ CKM_BLOWFISH_CBC = 0x00001091
+ CKM_TWOFISH_KEY_GEN = 0x00001092
+ CKM_TWOFISH_CBC = 0x00001093
+ CKM_BLOWFISH_CBC_PAD = 0x00001094
+ CKM_TWOFISH_CBC_PAD = 0x00001095
+ CKM_DES_ECB_ENCRYPT_DATA = 0x00001100
+ CKM_DES_CBC_ENCRYPT_DATA = 0x00001101
+ CKM_DES3_ECB_ENCRYPT_DATA = 0x00001102
+ CKM_DES3_CBC_ENCRYPT_DATA = 0x00001103
+ CKM_AES_ECB_ENCRYPT_DATA = 0x00001104
+ CKM_AES_CBC_ENCRYPT_DATA = 0x00001105
+ CKM_GOSTR3410_KEY_PAIR_GEN = 0x00001200
+ CKM_GOSTR3410 = 0x00001201
+ CKM_GOSTR3410_WITH_GOSTR3411 = 0x00001202
+ CKM_GOSTR3410_KEY_WRAP = 0x00001203
+ CKM_GOSTR3410_DERIVE = 0x00001204
+ CKM_GOSTR3411 = 0x00001210
+ CKM_GOSTR3411_HMAC = 0x00001211
+ CKM_GOST28147_KEY_GEN = 0x00001220
+ CKM_GOST28147_ECB = 0x00001221
+ CKM_GOST28147 = 0x00001222
+ CKM_GOST28147_MAC = 0x00001223
+ CKM_GOST28147_KEY_WRAP = 0x00001224
+ CKM_DSA_PARAMETER_GEN = 0x00002000
+ CKM_DH_PKCS_PARAMETER_GEN = 0x00002001
+ CKM_X9_42_DH_PARAMETER_GEN = 0x00002002
+ CKM_DSA_PROBABLISTIC_PARAMETER_GEN = 0x00002003
+ CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN = 0x00002004
+ CKM_AES_OFB = 0x00002104
+ CKM_AES_CFB64 = 0x00002105
+ CKM_AES_CFB8 = 0x00002106
+ CKM_AES_CFB128 = 0x00002107
+ CKM_AES_CFB1 = 0x00002108
+ CKM_AES_KEY_WRAP = 0x00002109 // WAS: 0x00001090
+ CKM_AES_KEY_WRAP_PAD = 0x0000210A // WAS: 0x00001091
+ CKM_RSA_PKCS_TPM_1_1 = 0x00004001
+ CKM_RSA_PKCS_OAEP_TPM_1_1 = 0x00004002
+ CKM_VENDOR_DEFINED = 0x80000000
+
+ // The flags are defined as follows:
+ //
+ // Bit Flag Mask Meaning
+ CKF_HW = 0x00000001 // performed by HW
+
+ // Specify whether or not a mechanism can be used for a particular task
+ CKF_ENCRYPT = 0x00000100
+ CKF_DECRYPT = 0x00000200
+ CKF_DIGEST = 0x00000400
+ CKF_SIGN = 0x00000800
+ CKF_SIGN_RECOVER = 0x00001000
+ CKF_VERIFY = 0x00002000
+ CKF_VERIFY_RECOVER = 0x00004000
+ CKF_GENERATE = 0x00008000
+ CKF_GENERATE_KEY_PAIR = 0x00010000
+ CKF_WRAP = 0x00020000
+ CKF_UNWRAP = 0x00040000
+ CKF_DERIVE = 0x00080000
+
+ // Describe a token's EC capabilities not available in mechanism
+ // information.
+ CKF_EC_F_P = 0x00100000
+ CKF_EC_F_2M = 0x00200000
+ CKF_EC_ECPARAMETERS = 0x00400000
+ CKF_EC_NAMEDCURVE = 0x00800000
+ CKF_EC_UNCOMPRESS = 0x01000000
+ CKF_EC_COMPRESS = 0x02000000
+ CKF_EXTENSION = 0x80000000
+
CKR_OK = 0x00000000
CKR_CANCEL = 0x00000001
CKR_HOST_MEMORY = 0x00000002
@@ -718,49 +836,69 @@ const (
CKR_PUBLIC_KEY_INVALID = 0x000001B9
CKR_FUNCTION_REJECTED = 0x00000200
CKR_VENDOR_DEFINED = 0x80000000
- CKF_LIBRARY_CANT_CREATE_OS_THREADS = 0x00000001
- CKF_OS_LOCKING_OK = 0x00000002
- CKF_DONT_BLOCK = 1
- CKG_MGF1_SHA1 = 0x00000001
- CKG_MGF1_SHA256 = 0x00000002
- CKG_MGF1_SHA384 = 0x00000003
- CKG_MGF1_SHA512 = 0x00000004
- CKG_MGF1_SHA224 = 0x00000005
- CKZ_DATA_SPECIFIED = 0x00000001
- CKD_NULL = 0x00000001
- CKD_SHA1_KDF = 0x00000002
- CKD_SHA1_KDF_ASN1 = 0x00000003
- CKD_SHA1_KDF_CONCATENATE = 0x00000004
- CKD_SHA224_KDF = 0x00000005
- CKD_SHA256_KDF = 0x00000006
- CKD_SHA384_KDF = 0x00000007
- CKD_SHA512_KDF = 0x00000008
- CKD_CPDIVERSIFY_KDF = 0x00000009
- CKD_SHA3_224_KDF = 0x0000000A
- CKD_SHA3_256_KDF = 0x0000000B
- CKD_SHA3_384_KDF = 0x0000000C
- CKD_SHA3_512_KDF = 0x0000000D
- CKP_PKCS5_PBKD2_HMAC_SHA1 = 0x00000001
- CKP_PKCS5_PBKD2_HMAC_GOSTR3411 = 0x00000002
- CKP_PKCS5_PBKD2_HMAC_SHA224 = 0x00000003
- CKP_PKCS5_PBKD2_HMAC_SHA256 = 0x00000004
- CKP_PKCS5_PBKD2_HMAC_SHA384 = 0x00000005
- CKP_PKCS5_PBKD2_HMAC_SHA512 = 0x00000006
- CKP_PKCS5_PBKD2_HMAC_SHA512_224 = 0x00000007
- CKP_PKCS5_PBKD2_HMAC_SHA512_256 = 0x00000008
- CKZ_SALT_SPECIFIED = 0x00000001
- CK_OTP_VALUE = 0
- CK_OTP_PIN = 1
- CK_OTP_CHALLENGE = 2
- CK_OTP_TIME = 3
- CK_OTP_COUNTER = 4
- CK_OTP_FLAGS = 5
- CK_OTP_OUTPUT_LENGTH = 6
- CK_OTP_OUTPUT_FORMAT = 7
- CKF_NEXT_OTP = 0x00000001
- CKF_EXCLUDE_TIME = 0x00000002
- CKF_EXCLUDE_COUNTER = 0x00000004
- CKF_EXCLUDE_CHALLENGE = 0x00000008
- CKF_EXCLUDE_PIN = 0x00000010
- CKF_USER_FRIENDLY_OTP = 0x00000020
+
+ // flags: bit flags that provide capabilities of the slot
+ //
+ // Bit Flag Mask Meaning
+ CKF_LIBRARY_CANT_CREATE_OS_THREADS = 0x00000001
+ CKF_OS_LOCKING_OK = 0x00000002
+
+ // additional flags for parameters to functions
+ // CKF_DONT_BLOCK is for the function C_WaitForSlotEvent
+ CKF_DONT_BLOCK = 1
+
+ // The following MGFs are defined
+ CKG_MGF1_SHA1 = 0x00000001
+ CKG_MGF1_SHA256 = 0x00000002
+ CKG_MGF1_SHA384 = 0x00000003
+ CKG_MGF1_SHA512 = 0x00000004
+ CKG_MGF1_SHA224 = 0x00000005
+
+ // The following encoding parameter sources are defined
+ CKZ_DATA_SPECIFIED = 0x00000001
+
+ // The following EC Key Derivation Functions are defined
+ CKD_NULL = 0x00000001
+ CKD_SHA1_KDF = 0x00000002
+
+ // The following X9.42 DH key derivation functions are defined
+ CKD_SHA1_KDF_ASN1 = 0x00000003
+ CKD_SHA1_KDF_CONCATENATE = 0x00000004
+ CKD_SHA224_KDF = 0x00000005
+ CKD_SHA256_KDF = 0x00000006
+ CKD_SHA384_KDF = 0x00000007
+ CKD_SHA512_KDF = 0x00000008
+ CKD_CPDIVERSIFY_KDF = 0x00000009
+ CKD_SHA3_224_KDF = 0x0000000A
+ CKD_SHA3_256_KDF = 0x0000000B
+ CKD_SHA3_384_KDF = 0x0000000C
+ CKD_SHA3_512_KDF = 0x0000000D
+
+ CKP_PKCS5_PBKD2_HMAC_SHA1 = 0x00000001
+ CKP_PKCS5_PBKD2_HMAC_GOSTR3411 = 0x00000002
+ CKP_PKCS5_PBKD2_HMAC_SHA224 = 0x00000003
+ CKP_PKCS5_PBKD2_HMAC_SHA256 = 0x00000004
+ CKP_PKCS5_PBKD2_HMAC_SHA384 = 0x00000005
+ CKP_PKCS5_PBKD2_HMAC_SHA512 = 0x00000006
+ CKP_PKCS5_PBKD2_HMAC_SHA512_224 = 0x00000007
+ CKP_PKCS5_PBKD2_HMAC_SHA512_256 = 0x00000008
+
+ // The following salt value sources are defined in PKCS #5 v2.0.
+ CKZ_SALT_SPECIFIED = 0x00000001
+
+ CK_OTP_VALUE = 0
+ CK_OTP_PIN = 1
+ CK_OTP_CHALLENGE = 2
+ CK_OTP_TIME = 3
+ CK_OTP_COUNTER = 4
+ CK_OTP_FLAGS = 5
+ CK_OTP_OUTPUT_LENGTH = 6
+ CK_OTP_OUTPUT_FORMAT = 7
+
+ CKF_NEXT_OTP = 0x00000001
+ CKF_EXCLUDE_TIME = 0x00000002
+ CKF_EXCLUDE_COUNTER = 0x00000004
+ CKF_EXCLUDE_CHALLENGE = 0x00000008
+ CKF_EXCLUDE_PIN = 0x00000010
+ CKF_USER_FRIENDLY_OTP = 0x00000020
)
diff --git a/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header/header.go b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header/header.go
index 8547c8dfd1..820bf436ab 100644
--- a/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header/header.go
+++ b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header/header.go
@@ -90,7 +90,7 @@ loop:
s = skipSpace(s[1:])
}
}
- return
+ return specs
}
func skipSpace(s string) (rest string) {
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/counter.go b/vendor/github.com/prometheus/client_golang/prometheus/counter.go
index 4ce84e7a80..7d963d3afb 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/counter.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/counter.go
@@ -85,11 +85,12 @@ type CounterVecOpts struct {
// Both internal tracking values are added up in the Write method. This has to
// be taken into account when it comes to precision and overflow behavior.
func NewCounter(opts CounterOpts) Counter {
- desc := NewDesc(
+ desc := V2.NewDesc(
BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
opts.Help,
- nil,
+ UnconstrainedLabels(nil),
opts.ConstLabels,
+ WithUnit(opts.Unit),
)
if opts.now == nil {
opts.now = time.Now
@@ -205,6 +206,7 @@ func (v2) NewCounterVec(opts CounterVecOpts) *CounterVec {
opts.Help,
opts.VariableLabels,
opts.ConstLabels,
+ WithUnit(opts.Unit),
)
if opts.now == nil {
opts.now = time.Now
@@ -349,10 +351,11 @@ type CounterFunc interface {
//
// Check out the ExampleGaugeFunc examples for the similar GaugeFunc.
func NewCounterFunc(opts CounterOpts, function func() float64) CounterFunc {
- return newValueFunc(NewDesc(
+ return newValueFunc(V2.NewDesc(
BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
opts.Help,
- nil,
+ UnconstrainedLabels(nil),
opts.ConstLabels,
+ WithUnit(opts.Unit),
), CounterValue, function)
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/desc.go b/vendor/github.com/prometheus/client_golang/prometheus/desc.go
index 2331b8b4f3..a3c92e7a4c 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/desc.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/desc.go
@@ -47,6 +47,8 @@ type Desc struct {
fqName string
// help provides some helpful information about this metric.
help string
+ // unit provides the unit of this metric.
+ unit string
// constLabelPairs contains precalculated DTO label pairs based on
// the constant labels.
constLabelPairs []*dto.LabelPair
@@ -66,6 +68,16 @@ type Desc struct {
err error
}
+// DescOpt allows setting optional fields for NewDesc.
+type DescOpt func(*Desc)
+
+// WithUnit sets the unit for a Desc.
+func WithUnit(unit string) DescOpt {
+ return func(d *Desc) {
+ d.unit = unit
+ }
+}
+
// NewDesc allocates and initializes a new Desc. Errors are recorded in the Desc
// and will be reported on registration time. variableLabels and constLabels can
// be nil if no such labels should be set. fqName must not be empty.
@@ -89,14 +101,17 @@ func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) *
//
// For constLabels, the label values are constant. Therefore, they are fully
// specified in the Desc. See the Collector example for a usage pattern.
-func (v2) NewDesc(fqName, help string, variableLabels ConstrainableLabels, constLabels Labels) *Desc {
+func (v2) NewDesc(fqName, help string, variableLabels ConstrainableLabels, constLabels Labels, opts ...DescOpt) *Desc {
d := &Desc{
fqName: fqName,
help: help,
variableLabels: variableLabels.compile(),
}
- //nolint:staticcheck // TODO: Don't use deprecated model.NameValidationScheme.
- if !model.NameValidationScheme.IsValidMetricName(fqName) {
+
+ for _, opt := range opts {
+ opt(d)
+ }
+ if !model.UTF8Validation.IsValidMetricName(fqName) {
d.err = fmt.Errorf("%q is not a valid metric name", fqName)
return d
}
@@ -150,11 +165,13 @@ func (v2) NewDesc(fqName, help string, variableLabels ConstrainableLabels, const
d.id = xxh.Sum64()
// Sort labelNames so that order doesn't matter for the hash.
sort.Strings(labelNames)
- // Now hash together (in this order) the help string and the sorted
+ // Now hash together (in this order) the help string, the unit string and the sorted
// label names.
xxh.Reset()
xxh.WriteString(help)
xxh.Write(separatorByteSlice)
+ xxh.WriteString(d.unit)
+ xxh.Write(separatorByteSlice)
for _, labelName := range labelNames {
xxh.WriteString(labelName)
xxh.Write(separatorByteSlice)
@@ -182,6 +199,15 @@ func NewInvalidDesc(err error) *Desc {
}
}
+// Err returns an error that occurred during construction, if any.
+//
+// Calling this method is optional. It can be used to detect construction
+// errors early, before invoking other methods on the Desc. If an error is
+// present, later operations may not behave as expected.
+func (d *Desc) Err() error {
+ return d.err
+}
+
func (d *Desc) String() string {
lpStrings := make([]string, 0, len(d.constLabelPairs))
for _, lp := range d.constLabelPairs {
@@ -202,9 +228,10 @@ func (d *Desc) String() string {
}
}
return fmt.Sprintf(
- "Desc{fqName: %q, help: %q, constLabels: {%s}, variableLabels: {%s}}",
+ "Desc{fqName: %q, help: %q, unit: %q, constLabels: {%s}, variableLabels: {%s}}",
d.fqName,
d.help,
+ d.unit,
strings.Join(lpStrings, ","),
strings.Join(vlStrings, ","),
)
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go b/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go
index de5a856293..327746f433 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go
@@ -47,14 +47,14 @@ func (e *expvarCollector) Collect(ch chan<- Metric) {
if expVar == nil {
continue
}
- var v interface{}
+ var v any
labels := make([]string, len(desc.variableLabels.names))
if err := json.Unmarshal([]byte(expVar.String()), &v); err != nil {
ch <- NewInvalidMetric(desc, err)
continue
}
- var processValue func(v interface{}, i int)
- processValue = func(v interface{}, i int) {
+ var processValue func(v any, i int)
+ processValue = func(v any, i int) {
if i >= len(labels) {
copiedLabels := append(make([]string, 0, len(labels)), labels...)
switch v := v.(type) {
@@ -72,7 +72,7 @@ func (e *expvarCollector) Collect(ch chan<- Metric) {
ch <- m
return
}
- vm, ok := v.(map[string]interface{})
+ vm, ok := v.(map[string]any)
if !ok {
return
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/gauge.go b/vendor/github.com/prometheus/client_golang/prometheus/gauge.go
index dd2eac9406..41e54bf270 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/gauge.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/gauge.go
@@ -76,11 +76,12 @@ type GaugeVecOpts struct {
// scenarios for Gauges and Counters, where the former tends to be Set-heavy and
// the latter Inc-heavy.
func NewGauge(opts GaugeOpts) Gauge {
- desc := NewDesc(
+ desc := V2.NewDesc(
BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
opts.Help,
- nil,
+ UnconstrainedLabels(nil),
opts.ConstLabels,
+ WithUnit(opts.Unit),
)
result := &gauge{desc: desc, labelPairs: desc.constLabelPairs}
result.init(result) // Init self-collection.
@@ -163,6 +164,7 @@ func (v2) NewGaugeVec(opts GaugeVecOpts) *GaugeVec {
opts.Help,
opts.VariableLabels,
opts.ConstLabels,
+ WithUnit(opts.Unit),
)
return &GaugeVec{
MetricVec: NewMetricVec(desc, func(lvs ...string) Metric {
@@ -302,10 +304,11 @@ type GaugeFunc interface {
// value of 1. Example:
// https://github.com/prometheus/common/blob/8558a5b7db3c84fa38b4766966059a7bd5bfa2ee/version/info.go#L36-L56
func NewGaugeFunc(opts GaugeOpts, function func() float64) GaugeFunc {
- return newValueFunc(NewDesc(
+ return newValueFunc(V2.NewDesc(
BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
opts.Help,
- nil,
+ UnconstrainedLabels(nil),
opts.ConstLabels,
+ WithUnit(opts.Unit),
), GaugeValue, function)
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/go_collector_go116.go b/vendor/github.com/prometheus/client_golang/prometheus/go_collector_go116.go
deleted file mode 100644
index 897a6e906b..0000000000
--- a/vendor/github.com/prometheus/client_golang/prometheus/go_collector_go116.go
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2021 The Prometheus 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.
-
-//go:build !go1.17
-// +build !go1.17
-
-package prometheus
-
-import (
- "runtime"
- "sync"
- "time"
-)
-
-type goCollector struct {
- base baseGoCollector
-
- // ms... are memstats related.
- msLast *runtime.MemStats // Previously collected memstats.
- msLastTimestamp time.Time
- msMtx sync.Mutex // Protects msLast and msLastTimestamp.
- msMetrics memStatsMetrics
- msRead func(*runtime.MemStats) // For mocking in tests.
- msMaxWait time.Duration // Wait time for fresh memstats.
- msMaxAge time.Duration // Maximum allowed age of old memstats.
-}
-
-// NewGoCollector is the obsolete version of collectors.NewGoCollector.
-// See there for documentation.
-//
-// Deprecated: Use collectors.NewGoCollector instead.
-func NewGoCollector() Collector {
- msMetrics := goRuntimeMemStats()
- msMetrics = append(msMetrics, struct {
- desc *Desc
- eval func(*runtime.MemStats) float64
- valType ValueType
- }{
- // This metric is omitted in Go1.17+, see https://github.com/prometheus/client_golang/issues/842#issuecomment-861812034
- desc: NewDesc(
- memstatNamespace("gc_cpu_fraction"),
- "The fraction of this program's available CPU time used by the GC since the program started.",
- nil, nil,
- ),
- eval: func(ms *runtime.MemStats) float64 { return ms.GCCPUFraction },
- valType: GaugeValue,
- })
- return &goCollector{
- base: newBaseGoCollector(),
- msLast: &runtime.MemStats{},
- msRead: runtime.ReadMemStats,
- msMaxWait: time.Second,
- msMaxAge: 5 * time.Minute,
- msMetrics: msMetrics,
- }
-}
-
-// Describe returns all descriptions of the collector.
-func (c *goCollector) Describe(ch chan<- *Desc) {
- c.base.Describe(ch)
- for _, i := range c.msMetrics {
- ch <- i.desc
- }
-}
-
-// Collect returns the current state of all metrics of the collector.
-func (c *goCollector) Collect(ch chan<- Metric) {
- var (
- ms = &runtime.MemStats{}
- done = make(chan struct{})
- )
- // Start reading memstats first as it might take a while.
- go func() {
- c.msRead(ms)
- c.msMtx.Lock()
- c.msLast = ms
- c.msLastTimestamp = time.Now()
- c.msMtx.Unlock()
- close(done)
- }()
-
- // Collect base non-memory metrics.
- c.base.Collect(ch)
-
- timer := time.NewTimer(c.msMaxWait)
- select {
- case <-done: // Our own ReadMemStats succeeded in time. Use it.
- timer.Stop() // Important for high collection frequencies to not pile up timers.
- c.msCollect(ch, ms)
- return
- case <-timer.C: // Time out, use last memstats if possible. Continue below.
- }
- c.msMtx.Lock()
- if time.Since(c.msLastTimestamp) < c.msMaxAge {
- // Last memstats are recent enough. Collect from them under the lock.
- c.msCollect(ch, c.msLast)
- c.msMtx.Unlock()
- return
- }
- // If we are here, the last memstats are too old or don't exist. We have
- // to wait until our own ReadMemStats finally completes. For that to
- // happen, we have to release the lock.
- c.msMtx.Unlock()
- <-done
- c.msCollect(ch, ms)
-}
-
-func (c *goCollector) msCollect(ch chan<- Metric, ms *runtime.MemStats) {
- for _, i := range c.msMetrics {
- ch <- MustNewConstMetric(i.desc, i.valType, i.eval(ms))
- }
-}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go b/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go
index 6b8684731c..1db1c4be09 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go
@@ -98,7 +98,7 @@ type goCollector struct {
// snapshot is always produced by Collect.
mu sync.Mutex
- // Contains all samples that has to retrieved from runtime/metrics (not all of them will be exposed).
+ // Contains all samples that have to be retrieved from runtime/metrics (not all of them will be exposed).
sampleBuf []metrics.Sample
// sampleMap allows lookup for MemStats metrics and runtime/metrics histograms for exact sums.
sampleMap map[string]*metrics.Sample
@@ -210,16 +210,26 @@ func NewGoCollector(opts ...func(o *internal.GoCollectorOptions)) Collector {
sampleBuf = append(sampleBuf, metrics.Sample{Name: d.Name})
sampleMap[d.Name] = &sampleBuf[len(sampleBuf)-1]
+ // Extract unit from the runtime/metrics name (e.g., "/gc/heap/allocs:bytes" -> "bytes")
+ // and sanitize to match Prometheus naming conventions (e.g., "cpu-seconds" -> "cpu_seconds")
+ var unit string
+ if idx := strings.IndexRune(d.Name, ':'); idx >= 0 {
+ unit = d.Name[idx+1:]
+ unit = strings.ReplaceAll(unit, "-", "_")
+ unit = strings.ReplaceAll(unit, "*", "_")
+ unit = strings.ReplaceAll(unit, "/", "_per_")
+ }
+
var m collectorMetric
if d.Kind == metrics.KindFloat64Histogram {
_, hasSum := opt.RuntimeMetricSumForHist[d.Name]
- unit := d.Name[strings.IndexRune(d.Name, ':')+1:]
m = newBatchHistogram(
- NewDesc(
+ V2.NewDesc(
BuildFQName(namespace, subsystem, name),
help,
+ UnconstrainedLabels(nil),
nil,
- nil,
+ WithUnit(unit),
),
internal.RuntimeMetricsBucketsForUnit(bucketsMap[d.Name], unit),
hasSum,
@@ -230,6 +240,7 @@ func NewGoCollector(opts ...func(o *internal.GoCollectorOptions)) Collector {
Subsystem: subsystem,
Name: name,
Help: help,
+ Unit: unit,
},
)
} else {
@@ -238,6 +249,7 @@ func NewGoCollector(opts ...func(o *internal.GoCollectorOptions)) Collector {
Subsystem: subsystem,
Name: name,
Help: help,
+ Unit: unit,
})
}
metricSet = append(metricSet, m)
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go
index c453b754a7..88bae3b32c 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go
@@ -378,6 +378,9 @@ type HistogramOpts struct {
// string.
Help string
+ // Unit provides the unit of this Histogram.
+ Unit string
+
// ConstLabels are used to attach fixed labels to this metric. Metrics
// with the same fully-qualified name must have the same label names in
// their ConstLabels.
@@ -522,11 +525,12 @@ type HistogramVecOpts struct {
// for each bucket.
func NewHistogram(opts HistogramOpts) Histogram {
return newHistogram(
- NewDesc(
+ V2.NewDesc(
BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
opts.Help,
- nil,
+ UnconstrainedLabels(nil),
opts.ConstLabels,
+ WithUnit(opts.Unit),
),
opts,
)
@@ -966,7 +970,7 @@ func (h *histogram) maybeReset(
// We are using the possibly mocked h.now() rather than
// time.Since(h.lastResetTime) to enable testing.
if h.nativeHistogramMinResetDuration == 0 || // No reset configured.
- h.resetScheduled || // Do not interefere if a reset is already scheduled.
+ h.resetScheduled || // Do not interfere if a reset is already scheduled.
h.now().Sub(h.lastResetTime) < h.nativeHistogramMinResetDuration {
return false
}
@@ -1053,8 +1057,8 @@ func (h *histogram) maybeWidenZeroBucket(hot, cold *histogramCounts) bool {
atomic.StoreUint64(&cold.nativeHistogramZeroThresholdBits, math.Float64bits(newZeroThreshold))
// ...and then merge the newly deleted buckets into the wider zero
// bucket.
- mergeAndDeleteOrAddAndReset := func(hotBuckets, coldBuckets *sync.Map) func(k, v interface{}) bool {
- return func(k, v interface{}) bool {
+ mergeAndDeleteOrAddAndReset := func(hotBuckets, coldBuckets *sync.Map) func(k, v any) bool {
+ return func(k, v any) bool {
key := k.(int)
bucket := v.(*int64)
if key == smallestKey {
@@ -1107,8 +1111,8 @@ func (h *histogram) doubleBucketWidth(hot, cold *histogramCounts) {
// ...adjust the schema in the cold counts, too...
atomic.StoreInt32(&cold.nativeHistogramSchema, coldSchema)
// ...and then merge the cold buckets into the wider hot buckets.
- merge := func(hotBuckets *sync.Map) func(k, v interface{}) bool {
- return func(k, v interface{}) bool {
+ merge := func(hotBuckets *sync.Map) func(k, v any) bool {
+ return func(k, v any) bool {
key := k.(int)
bucket := v.(*int64)
// Adjust key to match the bucket to merge into.
@@ -1190,6 +1194,7 @@ func (v2) NewHistogramVec(opts HistogramVecOpts) *HistogramVec {
opts.Help,
opts.VariableLabels,
opts.ConstLabels,
+ WithUnit(opts.Unit),
)
return &HistogramVec{
MetricVec: NewMetricVec(desc, func(lvs ...string) Metric {
@@ -1476,7 +1481,7 @@ func pickSchema(bucketFactor float64) int32 {
func makeBuckets(buckets *sync.Map) ([]*dto.BucketSpan, []int64) {
var ii []int
- buckets.Range(func(k, v interface{}) bool {
+ buckets.Range(func(k, v any) bool {
ii = append(ii, k.(int))
return true
})
@@ -1553,8 +1558,8 @@ func addToBucket(buckets *sync.Map, key int, increment int64) bool {
// according to the buckets ranged through. It then resets all buckets ranged
// through to 0 (but leaves them in place so that they don't need to get
// recreated on the next scrape).
-func addAndReset(hotBuckets *sync.Map, bucketNumber *uint32) func(k, v interface{}) bool {
- return func(k, v interface{}) bool {
+func addAndReset(hotBuckets *sync.Map, bucketNumber *uint32) func(k, v any) bool {
+ return func(k, v any) bool {
bucket := v.(*int64)
if addToBucket(hotBuckets, k.(int), atomic.LoadInt64(bucket)) {
atomic.AddUint32(bucketNumber, 1)
@@ -1565,7 +1570,7 @@ func addAndReset(hotBuckets *sync.Map, bucketNumber *uint32) func(k, v interface
}
func deleteSyncMap(m *sync.Map) {
- m.Range(func(k, v interface{}) bool {
+ m.Range(func(k, v any) bool {
m.Delete(k)
return true
})
@@ -1573,7 +1578,7 @@ func deleteSyncMap(m *sync.Map) {
func findSmallestKey(m *sync.Map) int {
result := math.MaxInt32
- m.Range(func(k, v interface{}) bool {
+ m.Range(func(k, v any) bool {
key := k.(int)
if key < result {
result = key
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go b/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go
index 7bac0da33d..2db270f216 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go
@@ -78,7 +78,7 @@ type OpCode struct {
// notion, pairing up elements that appear uniquely in each sequence.
// That, and the method here, appear to yield more intuitive difference
// reports than does diff. This method appears to be the least vulnerable
-// to synching up on blocks of "junk lines", though (like blank lines in
+// to syncing up on blocks of "junk lines", though (like blank lines in
// ordinary text files, or maybe "" lines in HTML files). That may be
// because this is the only method of the 3 that has a *concept* of
// "junk" .
@@ -567,7 +567,7 @@ type UnifiedDiff struct {
func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error {
buf := bufio.NewWriter(writer)
defer buf.Flush()
- wf := func(format string, args ...interface{}) error {
+ wf := func(format string, args ...any) error {
_, err := fmt.Fprintf(buf, format, args...)
return err
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/labels.go b/vendor/github.com/prometheus/client_golang/prometheus/labels.go
index 5fe8d3b4d2..a0285489a0 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/labels.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/labels.go
@@ -184,6 +184,5 @@ func validateLabelValues(vals []string, expectedNumberOfValues int) error {
}
func checkLabelName(l string) bool {
- //nolint:staticcheck // TODO: Don't use deprecated model.NameValidationScheme.
- return model.NameValidationScheme.IsValidLabelName(l) && !strings.HasPrefix(l, reservedLabelPrefix)
+ return model.UTF8Validation.IsValidLabelName(l) && !strings.HasPrefix(l, reservedLabelPrefix)
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/metric.go b/vendor/github.com/prometheus/client_golang/prometheus/metric.go
index 76e59f1288..c5cb90adf8 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/metric.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/metric.go
@@ -81,6 +81,9 @@ type Opts struct {
// string.
Help string
+ // Unit provides the unit of this metric as per https://prometheus.io/docs/specs/om
+ Unit string
+
// ConstLabels are used to attach fixed labels to this metric. Metrics
// with the same fully-qualified name must have the same label names in
// their ConstLabels.
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_darwin.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_darwin.go
index b32c95fa3f..2b16298f40 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_darwin.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_darwin.go
@@ -72,7 +72,13 @@ func getOpenFileCount() (float64, error) {
}
func (c *processCollector) processCollect(ch chan<- Metric) {
- if procs, err := unix.SysctlKinfoProcSlice("kern.proc.pid", os.Getpid()); err == nil {
+ pid, err := c.pidFn()
+ if err != nil {
+ c.reportError(ch, nil, err)
+ return
+ }
+
+ if procs, err := unix.SysctlKinfoProcSlice("kern.proc.pid", pid); err == nil {
if len(procs) == 1 {
startTime := float64(procs[0].Proc.P_starttime.Nano() / 1e9)
ch <- MustNewConstMetric(c.startTime, GaugeValue, startTime)
@@ -84,6 +90,11 @@ func (c *processCollector) processCollect(ch chan<- Metric) {
c.reportError(ch, c.startTime, err)
}
+ if pid != os.Getpid() {
+ c.reportError(ch, nil, fmt.Errorf("collecting metrics for pid %d is not supported on darwin: process metrics collection is limited to the current process (pid %d)", pid, os.Getpid()))
+ return
+ }
+
// The proc structure returned by kern.proc.pid above has an Rusage member,
// but it is not filled in, so it needs to be fetched by getrusage(2). For
// that call, the UTime, STime, and Maxrss members are filled out, but not
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_windows.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_windows.go
index fa474289ef..c08dd05f03 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_windows.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_windows.go
@@ -30,6 +30,10 @@ var (
procGetProcessMemoryInfo = modpsapi.NewProc("GetProcessMemoryInfo")
procGetProcessHandleCount = modkernel32.NewProc("GetProcessHandleCount")
+
+ openProcess = windows.OpenProcess
+ closeHandle = windows.CloseHandle
+ getProcessTimes = windows.GetProcessTimes
)
type processMemoryCounters struct {
@@ -79,10 +83,21 @@ func getProcessHandleCount(handle windows.Handle) (uint32, error) {
}
func (c *processCollector) processCollect(ch chan<- Metric) {
- h := windows.CurrentProcess()
+ pid, err := c.pidFn()
+ if err != nil {
+ c.reportError(ch, nil, err)
+ return
+ }
+
+ h, err := openProcess(windows.PROCESS_QUERY_INFORMATION|windows.PROCESS_VM_READ, false, uint32(pid))
+ if err != nil {
+ c.reportError(ch, nil, err)
+ return
+ }
+ defer closeHandle(h)
var startTime, exitTime, kernelTime, userTime windows.Filetime
- err := windows.GetProcessTimes(h, &startTime, &exitTime, &kernelTime, &userTime)
+ err = getProcessTimes(h, &startTime, &exitTime, &kernelTime, &userTime)
if err != nil {
c.reportError(ch, nil, err)
return
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go
index 763d99e362..c28af5ce2b 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go
@@ -37,10 +37,12 @@ import (
"fmt"
"io"
"net/http"
+ "slices"
"strconv"
"sync"
"time"
+ dto "github.com/prometheus/client_model/go"
"github.com/prometheus/common/expfmt"
"github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil"
@@ -74,11 +76,118 @@ func defaultCompressionFormats() []Compression {
}
var gzipPool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return gzip.NewWriter(nil)
},
}
+// coalescingGatherer wraps a TransactionalGatherer to deduplicate concurrent
+// Gather calls. When a Gather is already in flight, new callers join the
+// existing cycle and receive the same result once it completes. The underlying
+// done function is called exactly once, when the last joined caller releases.
+//
+// This prevents goroutine pile-up when the scrape rate is faster than the
+// time collectors need to produce metrics.
+type coalescingGatherer struct {
+ g prometheus.TransactionalGatherer
+ mu sync.Mutex
+ cycle *gatherCycle
+}
+
+// gatherCycle tracks a single in-flight Gather and all HTTP handlers sharing it.
+type gatherCycle struct {
+ ready chan struct{} // closed when Gather completes; happens-before reads of mfs/err/done
+ mfs []*dto.MetricFamily // canonical result, set before ready is closed; callers get a slices.Clone, the element values stay shared and must not be mutated
+ err error // set before ready is closed
+ done func() // underlying done callback; set before ready is closed
+ refs int // number of handlers using this cycle; protected by coalescingGatherer.mu
+}
+
+var _ prometheus.TransactionalGatherer = (*coalescingGatherer)(nil) // compile-time interface check
+
+// errGatherPanicked is returned to callers that joined an in-flight coalesced
+// Gather whose underlying gatherer panicked. See the panic guard in Gather for
+// why joiners receive this error instead of the panic itself.
+var errGatherPanicked = errors.New("coalesced gather panicked")
+
+func (c *coalescingGatherer) Gather() ([]*dto.MetricFamily, func(), error) {
+ c.mu.Lock()
+ if cy := c.cycle; cy != nil {
+ // c.cycle is non-nil while Gather runs or handlers are still consuming its results.
+ cy.refs++
+ c.mu.Unlock()
+ <-cy.ready
+ // Each caller gets its own slice header so it can filter or reorder
+ // without racing other callers sharing this cycle. The *dto.MetricFamily
+ // values remain shared and must not be mutated in place.
+ return slices.Clone(cy.mfs), c.releaseFunc(cy), cy.err
+ }
+ cy := &gatherCycle{
+ ready: make(chan struct{}),
+ done: func() {},
+ refs: 1,
+ }
+ c.cycle = cy
+ c.mu.Unlock()
+
+ // Guard against a panic in c.g.Gather. The common case, a panicking
+ // Collector, never reaches here: Registry.Gather recovers Collector panics
+ // and returns them as an error. This guard only covers the rare case where
+ // the wrapped gatherer itself panics.
+ //
+ // We deliberately do not recover: the leader's panic propagates and is
+ // handled by net/http exactly as it would be without coalescing. We only
+ // set cy.err before closing cy.ready so joiners waiting on <-cy.ready fail
+ // with that error instead of silently returning an empty, successful
+ // response, and we clear c.cycle so the next Gather starts a fresh cycle.
+ //
+ // The leader never runs its own releaseFunc on this path, so its ref is
+ // not decremented; that is harmless because the cycle is detached (c.cycle
+ // = nil) and cy.done is still the no-op set at construction (c.g.Gather
+ // panicked before assigning a real done). If cy.done is ever made non-nil
+ // before c.g.Gather runs, this path would need to release it.
+ panicked := true
+ defer func() {
+ if panicked {
+ c.mu.Lock()
+ if c.cycle == cy {
+ c.cycle = nil
+ }
+ c.mu.Unlock()
+ cy.err = errGatherPanicked // set before close: happens-before joiners' reads
+ close(cy.ready)
+ }
+ }()
+ cy.mfs, cy.done, cy.err = c.g.Gather()
+ panicked = false
+ close(cy.ready) // happens-before joiners' reads of cy.mfs/err/done
+
+ // Clone here too so cy.mfs stays the write-once canonical slice: joiners
+ // read it concurrently via slices.Clone, so the leader must not hand out
+ // (and potentially reorder) the same backing array.
+ return slices.Clone(cy.mfs), c.releaseFunc(cy), cy.err
+}
+
+// releaseFunc returns the done callback for one caller sharing cy.
+// When the last caller releases, the underlying done is invoked and the
+// cycle is cleared so the next Gather starts fresh.
+func (c *coalescingGatherer) releaseFunc(cy *gatherCycle) func() {
+ return func() {
+ c.mu.Lock()
+ cy.refs--
+ if cy.refs > 0 {
+ c.mu.Unlock()
+ return
+ }
+ // Last caller.
+ if c.cycle == cy {
+ c.cycle = nil
+ }
+ c.mu.Unlock()
+ cy.done() // called outside the lock to avoid holding it during done
+ }
+}
+
// Handler returns an http.Handler for the prometheus.DefaultGatherer, using
// default HandlerOpts, i.e. it reports the first error as an HTTP error, it has
// no error logging, and it applies compression if requested by the client.
@@ -89,6 +198,10 @@ var gzipPool = sync.Pool{
// metrics used for instrumentation will be shared between them, providing
// global scrape counts.
//
+// The handler supports filtering metrics by name using the `name[]` query parameter.
+// Multiple metric names can be specified by providing the parameter multiple times.
+// When no name[] parameters are provided, all metrics are returned.
+//
// This function is meant to cover the bulk of basic use cases. If you are doing
// anything that requires more customization (including using a non-default
// Gatherer, different instrumentation, and non-default HandlerOpts), use the
@@ -105,6 +218,10 @@ func Handler() http.Handler {
// Gatherers, with non-default HandlerOpts, and/or with custom (or no)
// instrumentation. Use the InstrumentMetricHandler function to apply the same
// kind of instrumentation as it is used by the Handler function.
+//
+// The handler supports filtering metrics by name using the `name[]` query parameter.
+// Multiple metric names can be specified by providing the parameter multiple times.
+// When no name[] parameters are provided, all metrics are returned.
func HandlerFor(reg prometheus.Gatherer, opts HandlerOpts) http.Handler {
return HandlerForTransactional(prometheus.ToTransactionalGatherer(reg), opts)
}
@@ -112,7 +229,15 @@ func HandlerFor(reg prometheus.Gatherer, opts HandlerOpts) http.Handler {
// HandlerForTransactional is like HandlerFor, but it uses transactional gather, which
// can safely change in-place returned *dto.MetricFamily before call to `Gather` and after
// call to `done` of that `Gather`.
+//
+// The handler supports filtering metrics by name using the `name[]` query parameter.
+// Multiple metric names can be specified by providing the parameter multiple times.
+// When no name[] parameters are provided, all metrics are returned.
func HandlerForTransactional(reg prometheus.TransactionalGatherer, opts HandlerOpts) http.Handler {
+ if opts.CoalesceGather {
+ reg = &coalescingGatherer{g: reg}
+ }
+
var (
inFlightSem chan struct{}
errCnt = prometheus.NewCounterVec(
@@ -214,12 +339,14 @@ func HandlerForTransactional(reg prometheus.TransactionalGatherer, opts HandlerO
rsp.Header().Set(contentEncodingHeader, encodingHeader)
}
- var enc expfmt.Encoder
+ var (
+ enc expfmt.Encoder
+ encOpts []expfmt.EncoderOption
+ )
if opts.EnableOpenMetricsTextCreatedSamples {
- enc = expfmt.NewEncoder(w, contentType, expfmt.WithCreatedLines())
- } else {
- enc = expfmt.NewEncoder(w, contentType)
+ encOpts = append(encOpts, expfmt.WithCreatedLines())
}
+ enc = expfmt.NewEncoder(w, contentType, encOpts...)
// handleError handles the error according to opts.ErrorHandling
// and returns true if we have to abort after the handling.
@@ -245,7 +372,24 @@ func HandlerForTransactional(reg prometheus.TransactionalGatherer, opts HandlerO
return false
}
+ // Build metric name filter set from query params (if any). The URL
+ // can be nil on hand-constructed requests.
+ var metricFilter map[string]struct{}
+ if req.URL != nil {
+ if metricNames := req.URL.Query()["name[]"]; len(metricNames) > 0 {
+ metricFilter = make(map[string]struct{}, len(metricNames))
+ for _, name := range metricNames {
+ metricFilter[name] = struct{}{}
+ }
+ }
+ }
+
for _, mf := range mfs {
+ if metricFilter != nil {
+ if _, ok := metricFilter[mf.GetName()]; !ok {
+ continue
+ }
+ }
if handleError(enc.Encode(mf)) {
return
}
@@ -353,7 +497,7 @@ const (
// log.Logger from the standard library implements this interface, and it is
// easy to implement by custom loggers, if they don't do so already anyway.
type Logger interface {
- Println(v ...interface{})
+ Println(v ...any)
}
// HandlerOpts specifies options how to serve metrics via an http.Handler. The
@@ -400,6 +544,40 @@ type HandlerOpts struct {
// Service Unavailable and a suitable message in the body. If
// MaxRequestsInFlight is 0 or negative, no limit is applied.
MaxRequestsInFlight int
+ // CoalesceGather, if true, deduplicates concurrent Gather calls so that
+ // only one collection runs at a time. Additional requests that arrive
+ // while a Gather is in flight will receive the same result once it
+ // completes. This prevents goroutine pile-up when the scrape rate is
+ // faster than the time collectors need to produce metrics.
+ //
+ // When enabled, concurrent scrapers share a single metric snapshot per
+ // collection cycle. Each request receives its own copy of the returned
+ // slice, so filtering or reordering it (for example via name[] query
+ // parameters) is safe. The pointed-to MetricFamily values are still
+ // shared: the built-in handler only reads them, so this is safe in
+ // practice, but a custom TransactionalGatherer that mutates the returned
+ // families in place after Gather returns must not use this option.
+ //
+ // Because the snapshot is shared, a request that arrives while a cycle is
+ // in flight receives that cycle's result even though collection began
+ // before the request; two scrapers joined to one cycle observe the same
+ // timestamps rather than independently gathered data.
+ //
+ // Consider using CoalesceGather together with Timeout. Timeout bounds the
+ // client-facing response time and keeps at most one collection running at
+ // a time, but it does not cancel the underlying Gather: a joined request
+ // that times out still holds a MaxRequestsInFlight slot until the shared
+ // collection completes.
+ //
+ // Panic handling: a panicking Collector is already turned into an error by
+ // the registry, so joiners receive that error like any other. In the rare
+ // case where the wrapped gatherer itself panics, the panicking request's
+ // panic propagates as usual (handled by net/http), while requests that
+ // joined the same cycle receive an error rather than an empty response.
+ //
+ // NOTE: This option is experimental and may change or be removed in a
+ // future release.
+ CoalesceGather bool
// If handling a request takes longer than Timeout, it is responded to
// with 503 ServiceUnavailable and a suitable Message. No timeout is
// applied if Timeout is 0 or negative. Note that with the current
@@ -407,8 +585,9 @@ type HandlerOpts struct {
// described above (and even that only if sending of the body hasn't
// started yet), while the bulk work of gathering all the metrics keeps
// running in the background (with the eventual result to be thrown
- // away). Until the implementation is improved, it is recommended to
- // implement a separate timeout in potentially slow Collectors.
+ // away). When CoalesceGather is enabled, only one such background Gather
+ // can be in flight at a time. It is also recommended to implement a
+ // separate timeout in potentially slow Collectors.
Timeout time.Duration
// If true, the experimental OpenMetrics encoding is added to the
// possible options during content negotiation. Note that Prometheus
@@ -460,7 +639,7 @@ func httpError(rsp http.ResponseWriter, err error) {
// negotiateEncodingWriter reads the Accept-Encoding header from a request and
// selects the right compression based on an allow-list of supported
-// compressions. It returns a writer implementing the compression and an the
+// compressions. It returns a writer implementing the compression and the
// correct value that the caller can set in the response header.
func negotiateEncodingWriter(r *http.Request, rw io.Writer, compressions []string) (_ io.Writer, encodingHeaderValue string, closeWriter func(), _ error) {
if len(compressions) == 0 {
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go
index d3482c40ca..0248579742 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_client.go
@@ -75,10 +75,10 @@ func InstrumentRoundTripperCounter(counter *prometheus.CounterVec, next http.Rou
resp, err := next.RoundTrip(r)
if err == nil {
l := labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)
- for label, resolve := range rtOpts.extraLabelsFromCtx {
- l[label] = resolve(resp.Request.Context())
+ for label, resolve := range rtOpts.extraLabelsFromRequest {
+ l[label] = resolve(resp.Request)
}
- addWithExemplar(counter.With(l), 1, rtOpts.getExemplarFn(r.Context()))
+ addWithExemplar(counter.With(l), 1, rtOpts.getExemplarFn(r))
}
return resp, err
}
@@ -119,10 +119,10 @@ func InstrumentRoundTripperDuration(obs prometheus.ObserverVec, next http.RoundT
resp, err := next.RoundTrip(r)
if err == nil {
l := labels(code, method, r.Method, resp.StatusCode, rtOpts.extraMethods...)
- for label, resolve := range rtOpts.extraLabelsFromCtx {
- l[label] = resolve(resp.Request.Context())
+ for label, resolve := range rtOpts.extraLabelsFromRequest {
+ l[label] = resolve(resp.Request)
}
- observeWithExemplar(obs.With(l), time.Since(start).Seconds(), rtOpts.getExemplarFn(r.Context()))
+ observeWithExemplar(obs.With(l), time.Since(start).Seconds(), rtOpts.getExemplarFn(r))
}
return resp, err
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go
index 9332b0249a..9dec091ac7 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go
@@ -28,24 +28,36 @@ import (
// magicString is used for the hacky label test in checkLabels. Remove once fixed.
const magicString = "zZgWfBxLqvG8kc8IMv3POi2Bb0tZI3vAnBx+gBaFi9FyPzB/CzKUer1yufDa"
-// observeWithExemplar is a wrapper for [prometheus.ExemplarAdder.ExemplarObserver],
-// which falls back to [prometheus.Observer.Observe] if no labels are provided.
+// observeWithExemplar records val on obs. If labels is non-nil and obs
+// implements [prometheus.ExemplarObserver], the exemplar is attached via
+// ObserveWithExemplar; otherwise the exemplar is dropped and the value is
+// recorded with a plain [prometheus.Observer.Observe]. This mirrors the
+// safe-cast pattern in [prometheus.Timer.ObserveDurationWithExemplar] and
+// ensures we never panic when callers pass an ObserverVec backed by a
+// summary, which cannot carry exemplars in the Prometheus exposition format.
func observeWithExemplar(obs prometheus.Observer, val float64, labels map[string]string) {
- if labels == nil {
- obs.Observe(val)
- return
+ if labels != nil {
+ if eo, ok := obs.(prometheus.ExemplarObserver); ok {
+ eo.ObserveWithExemplar(val, labels)
+ return
+ }
}
- obs.(prometheus.ExemplarObserver).ObserveWithExemplar(val, labels)
+ obs.Observe(val)
}
-// addWithExemplar is a wrapper for [prometheus.ExemplarAdder.AddWithExemplar],
-// which falls back to [prometheus.Counter.Add] if no labels are provided.
-func addWithExemplar(obs prometheus.Counter, val float64, labels map[string]string) {
- if labels == nil {
- obs.Add(val)
- return
+// addWithExemplar records val on c. If labels is non-nil and c implements
+// [prometheus.ExemplarAdder], the exemplar is attached via AddWithExemplar;
+// otherwise the exemplar is dropped and the value is recorded with a plain
+// [prometheus.Counter.Add]. The safe-cast keeps the helper robust against
+// custom Counter implementations that do not advertise exemplar support.
+func addWithExemplar(c prometheus.Counter, val float64, labels map[string]string) {
+ if labels != nil {
+ if ea, ok := c.(prometheus.ExemplarAdder); ok {
+ ea.AddWithExemplar(val, labels)
+ return
+ }
}
- obs.(prometheus.ExemplarAdder).AddWithExemplar(val, labels)
+ c.Add(val)
}
// InstrumentHandlerInFlight is a middleware that wraps the provided
@@ -97,10 +109,10 @@ func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler, op
next.ServeHTTP(d, r)
l := labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)
- for label, resolve := range hOpts.extraLabelsFromCtx {
- l[label] = resolve(r.Context())
+ for label, resolve := range hOpts.extraLabelsFromRequest {
+ l[label] = resolve(r)
}
- observeWithExemplar(obs.With(l), time.Since(now).Seconds(), hOpts.getExemplarFn(r.Context()))
+ observeWithExemplar(obs.With(l), time.Since(now).Seconds(), hOpts.getExemplarFn(r))
}
}
@@ -108,10 +120,10 @@ func InstrumentHandlerDuration(obs prometheus.ObserverVec, next http.Handler, op
now := time.Now()
next.ServeHTTP(w, r)
l := labels(code, method, r.Method, 0, hOpts.extraMethods...)
- for label, resolve := range hOpts.extraLabelsFromCtx {
- l[label] = resolve(r.Context())
+ for label, resolve := range hOpts.extraLabelsFromRequest {
+ l[label] = resolve(r)
}
- observeWithExemplar(obs.With(l), time.Since(now).Seconds(), hOpts.getExemplarFn(r.Context()))
+ observeWithExemplar(obs.With(l), time.Since(now).Seconds(), hOpts.getExemplarFn(r))
}
}
@@ -147,10 +159,10 @@ func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler,
next.ServeHTTP(d, r)
l := labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)
- for label, resolve := range hOpts.extraLabelsFromCtx {
- l[label] = resolve(r.Context())
+ for label, resolve := range hOpts.extraLabelsFromRequest {
+ l[label] = resolve(r)
}
- addWithExemplar(counter.With(l), 1, hOpts.getExemplarFn(r.Context()))
+ addWithExemplar(counter.With(l), 1, hOpts.getExemplarFn(r))
}
}
@@ -158,10 +170,10 @@ func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler,
next.ServeHTTP(w, r)
l := labels(code, method, r.Method, 0, hOpts.extraMethods...)
- for label, resolve := range hOpts.extraLabelsFromCtx {
- l[label] = resolve(r.Context())
+ for label, resolve := range hOpts.extraLabelsFromRequest {
+ l[label] = resolve(r)
}
- addWithExemplar(counter.With(l), 1, hOpts.getExemplarFn(r.Context()))
+ addWithExemplar(counter.With(l), 1, hOpts.getExemplarFn(r))
}
}
@@ -200,10 +212,10 @@ func InstrumentHandlerTimeToWriteHeader(obs prometheus.ObserverVec, next http.Ha
now := time.Now()
d := newDelegator(w, func(status int) {
l := labels(code, method, r.Method, status, hOpts.extraMethods...)
- for label, resolve := range hOpts.extraLabelsFromCtx {
- l[label] = resolve(r.Context())
+ for label, resolve := range hOpts.extraLabelsFromRequest {
+ l[label] = resolve(r)
}
- observeWithExemplar(obs.With(l), time.Since(now).Seconds(), hOpts.getExemplarFn(r.Context()))
+ observeWithExemplar(obs.With(l), time.Since(now).Seconds(), hOpts.getExemplarFn(r))
})
next.ServeHTTP(d, r)
}
@@ -244,10 +256,10 @@ func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler,
size := computeApproximateRequestSize(r)
l := labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)
- for label, resolve := range hOpts.extraLabelsFromCtx {
- l[label] = resolve(r.Context())
+ for label, resolve := range hOpts.extraLabelsFromRequest {
+ l[label] = resolve(r)
}
- observeWithExemplar(obs.With(l), float64(size), hOpts.getExemplarFn(r.Context()))
+ observeWithExemplar(obs.With(l), float64(size), hOpts.getExemplarFn(r))
}
}
@@ -256,10 +268,10 @@ func InstrumentHandlerRequestSize(obs prometheus.ObserverVec, next http.Handler,
size := computeApproximateRequestSize(r)
l := labels(code, method, r.Method, 0, hOpts.extraMethods...)
- for label, resolve := range hOpts.extraLabelsFromCtx {
- l[label] = resolve(r.Context())
+ for label, resolve := range hOpts.extraLabelsFromRequest {
+ l[label] = resolve(r)
}
- observeWithExemplar(obs.With(l), float64(size), hOpts.getExemplarFn(r.Context()))
+ observeWithExemplar(obs.With(l), float64(size), hOpts.getExemplarFn(r))
}
}
@@ -296,10 +308,10 @@ func InstrumentHandlerResponseSize(obs prometheus.ObserverVec, next http.Handler
next.ServeHTTP(d, r)
l := labels(code, method, r.Method, d.Status(), hOpts.extraMethods...)
- for label, resolve := range hOpts.extraLabelsFromCtx {
- l[label] = resolve(r.Context())
+ for label, resolve := range hOpts.extraLabelsFromRequest {
+ l[label] = resolve(r)
}
- observeWithExemplar(obs.With(l), float64(d.Written()), hOpts.getExemplarFn(r.Context()))
+ observeWithExemplar(obs.With(l), float64(d.Written()), hOpts.getExemplarFn(r))
})
}
@@ -366,7 +378,7 @@ func checkLabels(c prometheus.Collector) (code, method bool) {
panic("metric partitioned with non-supported labels")
}
}
- return
+ return code, method
}
func isLabelCurried(c prometheus.Collector, label string) bool {
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/option.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/option.go
index 5d4383aa14..d4c0954f36 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/option.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/option.go
@@ -15,6 +15,7 @@ package promhttp
import (
"context"
+ "net/http"
"github.com/prometheus/client_golang/prometheus"
)
@@ -24,28 +25,31 @@ type Option interface {
apply(*options)
}
+// LabelValueFromRequest is used to compute the label value from request.
+type LabelValueFromRequest func(request *http.Request) string
+
// LabelValueFromCtx are used to compute the label value from request context.
// Context can be filled with values from request through middleware.
type LabelValueFromCtx func(ctx context.Context) string
// options store options for both a handler or round tripper.
type options struct {
- extraMethods []string
- getExemplarFn func(requestCtx context.Context) prometheus.Labels
- extraLabelsFromCtx map[string]LabelValueFromCtx
+ extraMethods []string
+ getExemplarFn func(req *http.Request) prometheus.Labels
+ extraLabelsFromRequest map[string]LabelValueFromRequest
}
func defaultOptions() *options {
return &options{
- getExemplarFn: func(ctx context.Context) prometheus.Labels { return nil },
- extraLabelsFromCtx: map[string]LabelValueFromCtx{},
+ getExemplarFn: func(req *http.Request) prometheus.Labels { return nil },
+ extraLabelsFromRequest: map[string]LabelValueFromRequest{},
}
}
func (o *options) emptyDynamicLabels() prometheus.Labels {
labels := prometheus.Labels{}
- for label := range o.extraLabelsFromCtx {
+ for label := range o.extraLabelsFromRequest {
labels[label] = ""
}
@@ -66,19 +70,39 @@ func WithExtraMethods(methods ...string) Option {
})
}
-// WithExemplarFromContext allows to inject function that will get exemplar from context that will be put to counter and histogram metrics.
+// WithExemplarFromRequest allows you to inject a function that will get exemplar from request that will be put to counter and histogram metrics.
// If the function returns nil labels or the metric does not support exemplars, no exemplar will be added (noop), but
// metric will continue to observe/increment.
-func WithExemplarFromContext(getExemplarFn func(requestCtx context.Context) prometheus.Labels) Option {
+func WithExemplarFromRequest(getExemplarFn func(req *http.Request) prometheus.Labels) Option {
return optionApplyFunc(func(o *options) {
o.getExemplarFn = getExemplarFn
})
}
+// WithExemplarFromContext allows you to inject a function that will get exemplar from context that will be put to counter and histogram metrics.
+// If the function returns nil labels or the metric does not support exemplars, no exemplar will be added (noop), but
+// metric will continue to observe/increment.
+func WithExemplarFromContext(getExemplarFn func(requestCtx context.Context) prometheus.Labels) Option {
+ return optionApplyFunc(func(o *options) {
+ o.getExemplarFn = func(req *http.Request) prometheus.Labels {
+ return getExemplarFn(req.Context())
+ }
+ })
+}
+
+// WithLabelFromRequest registers a label for dynamic resolution with access to the request.
+func WithLabelFromRequest(name string, valueFn LabelValueFromRequest) Option {
+ return optionApplyFunc(func(o *options) {
+ o.extraLabelsFromRequest[name] = valueFn
+ })
+}
+
// WithLabelFromCtx registers a label for dynamic resolution with access to context.
// See the example for ExampleInstrumentHandlerWithLabelResolver for example usage
func WithLabelFromCtx(name string, valueFn LabelValueFromCtx) Option {
return optionApplyFunc(func(o *options) {
- o.extraLabelsFromCtx[name] = valueFn
+ o.extraLabelsFromRequest[name] = func(req *http.Request) string {
+ return valueFn(req.Context())
+ }
})
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/registry.go b/vendor/github.com/prometheus/client_golang/prometheus/registry.go
index c6fd2f58b7..ed0681c8b4 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/registry.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/registry.go
@@ -214,6 +214,19 @@ func (err AlreadyRegisteredError) Error() string {
// by a Gatherer to report multiple errors during MetricFamily gathering.
type MultiError []error
+// SafeMultiError is a thread-safe wrapper around MultiError using a mutex.
+type SafeMultiError struct {
+ mu sync.Mutex
+ errs MultiError
+}
+
+// Appends the provided error to the contained MultiError in a thread-safe way.
+func (s *SafeMultiError) Append(err error) {
+ s.mu.Lock()
+ s.errs.Append(err)
+ s.mu.Unlock()
+}
+
// Error formats the contained errors as a bullet point list, preceded by the
// total number of errors. Note that this results in a multi-line string.
func (errs MultiError) Error() string {
@@ -408,6 +421,16 @@ func (r *Registry) MustRegister(cs ...Collector) {
}
}
+// MustGather implements Gatherer.
+// Wraps around Gather and panics if Gather fails for any reason.
+func (r *Registry) MustGather() []*dto.MetricFamily {
+ mfs, err := r.Gather()
+ if err != nil {
+ panic(err)
+ }
+ return mfs
+}
+
// Gather implements Gatherer.
func (r *Registry) Gather() ([]*dto.MetricFamily, error) {
r.mtx.RLock()
@@ -423,7 +446,7 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) {
uncheckedMetricChan = make(chan Metric, capMetricChan)
metricHashes = map[uint64]struct{}{}
wg sync.WaitGroup
- errs MultiError // The collected errors to return in the end.
+ safeErrs = &SafeMultiError{} // To collect errors in a threadsafe way
registeredDescIDs map[uint64]struct{} // Only used for pedantic checks
)
@@ -453,9 +476,9 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) {
for {
select {
case collector := <-checkedCollectors:
- collector.Collect(checkedMetricChan)
+ safeErrs.Append((safeCollect(collector, checkedMetricChan)))
case collector := <-uncheckedCollectors:
- collector.Collect(uncheckedMetricChan)
+ safeErrs.Append(safeCollect(collector, uncheckedMetricChan))
default:
return
}
@@ -499,7 +522,7 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) {
cmc = nil
break
}
- errs.Append(processMetric(
+ safeErrs.Append(processMetric(
metric, metricFamiliesByName,
metricHashes,
registeredDescIDs,
@@ -509,7 +532,7 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) {
umc = nil
break
}
- errs.Append(processMetric(
+ safeErrs.Append(processMetric(
metric, metricFamiliesByName,
metricHashes,
nil,
@@ -526,7 +549,7 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) {
cmc = nil
break
}
- errs.Append(processMetric(
+ safeErrs.Append(processMetric(
metric, metricFamiliesByName,
metricHashes,
registeredDescIDs,
@@ -536,7 +559,7 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) {
umc = nil
break
}
- errs.Append(processMetric(
+ safeErrs.Append(processMetric(
metric, metricFamiliesByName,
metricHashes,
nil,
@@ -556,7 +579,8 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) {
break
}
}
- return internal.NormalizeMetricFamilies(metricFamiliesByName), errs.MaybeUnwrap()
+
+ return internal.NormalizeMetricFamilies(metricFamiliesByName), safeErrs.errs.MaybeUnwrap()
}
// Describe implements Collector.
@@ -571,6 +595,24 @@ func (r *Registry) Describe(ch chan<- *Desc) {
}
}
+// Helper wrapper around Collector.Collect.
+// It tries to collect from the channel, recovers on panic and
+// if it has recovered from a panic, then it sends an InvalidMetric into
+// the channel with an InvalidDesc, and an error that includes a stack trace.
+func safeCollect(c Collector, ch chan<- Metric) (err error) {
+ defer func() {
+ if r := recover(); r != nil {
+ buf := make([]byte, 64<<10) // 64 KB
+ n := runtime.Stack(buf, false)
+ err = fmt.Errorf("prometheus collector panic recovered: type=%T: error=%v\nstack trace=%s", c, r, buf[:n])
+ ch <- NewInvalidMetric(NewInvalidDesc(err), err)
+ }
+ }()
+ c.Collect(ch)
+
+ return err
+}
+
// Collect implements Collector.
func (r *Registry) Collect(ch chan<- Metric) {
r.mtx.RLock()
@@ -599,10 +641,12 @@ func WriteToTextfile(filename string, g Gatherer) error {
mfs, err := g.Gather()
if err != nil {
+ tmp.Close()
return err
}
for _, mf := range mfs {
if _, err := expfmt.MetricFamilyToText(tmp, mf); err != nil {
+ tmp.Close()
return err
}
}
@@ -685,6 +729,9 @@ func processMetric(
metricFamily = &dto.MetricFamily{}
metricFamily.Name = proto.String(desc.fqName)
metricFamily.Help = proto.String(desc.help)
+ if desc.unit != "" {
+ metricFamily.Unit = proto.String(desc.unit)
+ }
// TODO(beorn7): Simplify switch once Desc has type.
switch {
case dtoMetric.Gauge != nil:
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/summary.go b/vendor/github.com/prometheus/client_golang/prometheus/summary.go
index ac5203c6fa..c12b8d13d4 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/summary.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/summary.go
@@ -101,6 +101,9 @@ type SummaryOpts struct {
// string.
Help string
+ // Unit provides the unit of this Summary.
+ Unit string
+
// ConstLabels are used to attach fixed labels to this metric. Metrics
// with the same fully-qualified name must have the same label names in
// their ConstLabels.
@@ -181,11 +184,12 @@ type SummaryVecOpts struct {
// NewSummary creates a new Summary based on the provided SummaryOpts.
func NewSummary(opts SummaryOpts) Summary {
return newSummary(
- NewDesc(
+ V2.NewDesc(
BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
opts.Help,
- nil,
+ UnconstrainedLabels(nil),
opts.ConstLabels,
+ WithUnit(opts.Unit),
),
opts,
)
@@ -578,6 +582,7 @@ func (v2) NewSummaryVec(opts SummaryVecOpts) *SummaryVec {
opts.Help,
opts.VariableLabels,
opts.ConstLabels,
+ WithUnit(opts.Unit),
)
return &SummaryVec{
MetricVec: NewMetricVec(desc, func(lvs ...string) Metric {
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/timer.go b/vendor/github.com/prometheus/client_golang/prometheus/timer.go
index 52344fef53..c1318ffb51 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/timer.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/timer.go
@@ -37,10 +37,10 @@ type Timer struct {
// or
//
// func TimeMeWithExemplar() {
-// timer := NewTimer(myHistogram)
-// defer timer.ObserveDurationWithExemplar(exemplar)
-// // Do actual work.
-// }
+// timer := NewTimer(myHistogram)
+// defer timer.ObserveDurationWithExemplar(exemplar)
+// // Do actual work.
+// }
func NewTimer(o Observer) *Timer {
return &Timer{
begin: time.Now(),
@@ -66,7 +66,7 @@ func (t *Timer) ObserveDuration() time.Duration {
// ObserveDurationWithExemplar is like ObserveDuration, but it will also
// observe exemplar with the duration unless exemplar is nil or provided Observer can't
-// be casted to ExemplarObserver.
+// be cast to ExemplarObserver.
func (t *Timer) ObserveDurationWithExemplar(exemplar Labels) time.Duration {
d := time.Since(t.begin)
eo, ok := t.observer.(ExemplarObserver)
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/vec.go b/vendor/github.com/prometheus/client_golang/prometheus/vec.go
index 487b466563..121d2a9639 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/vec.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/vec.go
@@ -193,9 +193,11 @@ func (m *MetricVec) CurryWith(labels Labels) (*MetricVec, error) {
//
// Keeping the Metric for later use is possible (and should be considered if
// performance is critical), but keep in mind that Reset, DeleteLabelValues and
-// Delete can be used to delete the Metric from the MetricVec. In that case, the
-// Metric will still exist, but it will not be exported anymore, even if a
-// Metric with the same label values is created later.
+// Delete can be used to delete the Metric from the MetricVec. In that case, if
+// you have previously kept a reference to that Metric, the Metric object still
+// exists and can be used, but it will not be exported anymore. If a Metric with
+// the same label values is created later, updates to the old Metric reference
+// will not be exported.
//
// An error is returned if the number of label values is not the same as the
// number of variable labels in Desc (minus any curried labels).
@@ -657,7 +659,7 @@ func inlineLabelValues(lvs []string, curry []curriedLabelValue) []string {
}
var labelsPool = &sync.Pool{
- New: func() interface{} {
+ New: func() any {
return make(Labels)
},
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/wrap.go b/vendor/github.com/prometheus/client_golang/prometheus/wrap.go
index 2ed1285068..697f55558b 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/wrap.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/wrap.go
@@ -230,6 +230,7 @@ func wrapDesc(desc *Desc, prefix string, labels Labels) *Desc {
return &Desc{
fqName: desc.fqName,
help: desc.help,
+ unit: desc.unit,
variableLabels: desc.variableLabels,
constLabelPairs: desc.constLabelPairs,
err: fmt.Errorf("attempted wrapping with already existing label name %q", ln),
@@ -238,8 +239,8 @@ func wrapDesc(desc *Desc, prefix string, labels Labels) *Desc {
constLabels[ln] = lv
}
// NewDesc will do remaining validations.
- newDesc := V2.NewDesc(prefix+desc.fqName, desc.help, desc.variableLabels, constLabels)
- // Propagate errors if there was any. This will override any errer
+ newDesc := V2.NewDesc(prefix+desc.fqName, desc.help, desc.variableLabels, constLabels, WithUnit(desc.unit))
+ // Propagate errors if there was any. This will override any error
// created by NewDesc above, i.e. earlier errors get precedence.
if desc.err != nil {
newDesc.err = desc.err
diff --git a/vendor/github.com/prometheus/common/expfmt/expfmt.go b/vendor/github.com/prometheus/common/expfmt/expfmt.go
index 4e4c13e724..10bf35708c 100644
--- a/vendor/github.com/prometheus/common/expfmt/expfmt.go
+++ b/vendor/github.com/prometheus/common/expfmt/expfmt.go
@@ -122,7 +122,7 @@ func NewOpenMetricsFormat(version string) (Format, error) {
// removed.
func (f Format) WithEscapingScheme(s model.EscapingScheme) Format {
var terms []string
- for _, p := range strings.Split(string(f), ";") {
+ for p := range strings.SplitSeq(string(f), ";") {
toks := strings.Split(p, "=")
if len(toks) != 2 {
trimmed := strings.TrimSpace(p)
@@ -194,7 +194,7 @@ func (f Format) FormatType() FormatType {
// "escaping" term exists, that will be used. Otherwise, the global default will
// be returned.
func (f Format) ToEscapingScheme() model.EscapingScheme {
- for _, p := range strings.Split(string(f), ";") {
+ for p := range strings.SplitSeq(string(f), ";") {
toks := strings.Split(p, "=")
if len(toks) != 2 {
continue
diff --git a/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go b/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
index 21b93bca36..0480e7af5b 100644
--- a/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
+++ b/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
@@ -30,7 +30,6 @@ import (
type encoderOption struct {
withCreatedLines bool
- withUnit bool
}
type EncoderOption func(*encoderOption)
@@ -51,17 +50,6 @@ func WithCreatedLines() EncoderOption {
}
}
-// WithUnit is an EncoderOption enabling a set unit to be written to the output
-// and to be added to the metric name, if it's not there already, as a suffix.
-// Without opting in this way, the unit will not be added to the metric name and,
-// on top of that, the unit will not be passed onto the output, even if it
-// were declared in the *dto.MetricFamily struct, i.e. even if in.Unit !=nil.
-func WithUnit() EncoderOption {
- return func(t *encoderOption) {
- t.withUnit = true
- }
-}
-
// MetricFamilyToOpenMetrics converts a MetricFamily proto message into the
// OpenMetrics text format and writes the resulting lines to 'out'. It returns
// the number of bytes written and any error encountered. The output will have
@@ -99,15 +87,6 @@ func WithUnit() EncoderOption {
// its type will be set to `unknown` in that case to avoid invalid OpenMetrics
// output.
//
-// - According to the OM specs, the `# UNIT` line is optional, but if populated,
-// the unit has to be present in the metric name as its suffix:
-// (see https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#unit).
-// However, in order to accommodate any potential scenario where such a change in the
-// metric name is not desirable, the users are here given the choice of either explicitly
-// opt in, in case they wish for the unit to be included in the output AND in the metric name
-// as a suffix (see the description of the WithUnit function above),
-// or not to opt in, in case they don't want for any of that to happen.
-//
// - No support for the following (optional) features: info type,
// stateset type, gaugehistogram type.
//
@@ -151,9 +130,6 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...E
if metricType == dto.MetricType_COUNTER && strings.HasSuffix(compliantName, "_total") {
compliantName = name[:len(name)-6]
}
- if toOM.withUnit && in.Unit != nil && !strings.HasSuffix(compliantName, "_"+*in.Unit) {
- compliantName = compliantName + "_" + *in.Unit
- }
// Comments, first HELP, then TYPE.
if in.Help != nil {
@@ -217,7 +193,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...E
if err != nil {
return written, err
}
- if toOM.withUnit && in.Unit != nil {
+ if in.Unit != nil {
n, err = w.WriteString("# UNIT ")
written += n
if err != nil {
diff --git a/vendor/github.com/prometheus/common/expfmt/text_create.go b/vendor/github.com/prometheus/common/expfmt/text_create.go
index 6b89781456..f4074ae9a3 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_create.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_create.go
@@ -42,12 +42,12 @@ const (
var (
bufPool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return bufio.NewWriter(io.Discard)
},
}
numBufPool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
b := make([]byte, 0, initialNumBufSize)
return &b
},
diff --git a/vendor/github.com/prometheus/common/expfmt/text_parse.go b/vendor/github.com/prometheus/common/expfmt/text_parse.go
index 00c8841a10..4ce1f40b81 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_parse.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_parse.go
@@ -339,6 +339,16 @@ func (p *TextParser) startLabelName() stateFn {
return nil // Unexpected end of input.
}
if p.currentByte == '}' {
+ if p.currentMF == nil {
+ // The closing brace was reached before any metric name was read,
+ // e.g. for the input "{}". There is no metric to attach labels to,
+ // so this is a malformed exposition. This mirrors the guard in
+ // startLabelValue. currentMF (not currentMetric) is checked because
+ // reset only clears currentMF between parses.
+ p.parseError("invalid metric name")
+ p.currentLabelPairs = nil
+ return nil
+ }
p.currentMetric.Label = append(p.currentMetric.Label, p.currentLabelPairs...)
p.currentLabelPairs = nil
if p.skipBlankTab(); p.err != nil {
diff --git a/vendor/github.com/prometheus/common/model/labels.go b/vendor/github.com/prometheus/common/model/labels.go
index dfeb34be5f..29688a13c8 100644
--- a/vendor/github.com/prometheus/common/model/labels.go
+++ b/vendor/github.com/prometheus/common/model/labels.go
@@ -124,7 +124,7 @@ func (ln LabelName) IsValidLegacy() bool {
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
-func (ln *LabelName) UnmarshalYAML(unmarshal func(interface{}) error) error {
+func (ln *LabelName) UnmarshalYAML(unmarshal func(any) error) error {
var s string
if err := unmarshal(&s); err != nil {
return err
diff --git a/vendor/github.com/prometheus/common/model/labelset.go b/vendor/github.com/prometheus/common/model/labelset.go
index 9de47b2568..6010b26a88 100644
--- a/vendor/github.com/prometheus/common/model/labelset.go
+++ b/vendor/github.com/prometheus/common/model/labelset.go
@@ -16,6 +16,7 @@ package model
import (
"encoding/json"
"fmt"
+ "maps"
"sort"
)
@@ -107,9 +108,7 @@ func (ls LabelSet) Before(o LabelSet) bool {
// Clone returns a copy of the label set.
func (ls LabelSet) Clone() LabelSet {
lsn := make(LabelSet, len(ls))
- for ln, lv := range ls {
- lsn[ln] = lv
- }
+ maps.Copy(lsn, ls)
return lsn
}
@@ -117,13 +116,9 @@ func (ls LabelSet) Clone() LabelSet {
func (ls LabelSet) Merge(other LabelSet) LabelSet {
result := make(LabelSet, len(ls))
- for k, v := range ls {
- result[k] = v
- }
+ maps.Copy(result, ls)
- for k, v := range other {
- result[k] = v
- }
+ maps.Copy(result, other)
return result
}
diff --git a/vendor/github.com/prometheus/common/model/metric.go b/vendor/github.com/prometheus/common/model/metric.go
index 3feebf328a..2fe461511d 100644
--- a/vendor/github.com/prometheus/common/model/metric.go
+++ b/vendor/github.com/prometheus/common/model/metric.go
@@ -17,6 +17,7 @@ import (
"encoding/json"
"errors"
"fmt"
+ "maps"
"regexp"
"sort"
"strconv"
@@ -24,7 +25,6 @@ import (
"unicode/utf8"
dto "github.com/prometheus/client_model/go"
- "go.yaml.in/yaml/v2"
"google.golang.org/protobuf/proto"
)
@@ -78,14 +78,6 @@ const (
UTF8Validation
)
-var _ interface {
- yaml.Marshaler
- yaml.Unmarshaler
- json.Marshaler
- json.Unmarshaler
- fmt.Stringer
-} = new(ValidationScheme)
-
// String returns the string representation of s.
func (s ValidationScheme) String() string {
switch s {
@@ -267,9 +259,7 @@ func (m Metric) Before(o Metric) bool {
// Clone returns a copy of the Metric.
func (m Metric) Clone() Metric {
clone := make(Metric, len(m))
- for k, v := range m {
- clone[k] = v
- }
+ maps.Copy(clone, m)
return clone
}
diff --git a/vendor/github.com/prometheus/common/model/time.go b/vendor/github.com/prometheus/common/model/time.go
index 1730b0fdc1..0854753f4a 100644
--- a/vendor/github.com/prometheus/common/model/time.go
+++ b/vendor/github.com/prometheus/common/model/time.go
@@ -123,44 +123,38 @@ func (t Time) MarshalJSON() ([]byte, error) {
// UnmarshalJSON implements the json.Unmarshaler interface.
func (t *Time) UnmarshalJSON(b []byte) error {
- p := strings.Split(string(b), ".")
- switch len(p) {
- case 1:
- v, err := strconv.ParseInt(p[0], 10, 64)
+ base, frac, found := strings.Cut(string(b), ".")
+ if !found {
+ v, err := strconv.ParseInt(base, 10, 64)
if err != nil {
return err
}
*t = Time(v * second)
-
- case 2:
- v, err := strconv.ParseInt(p[0], 10, 64)
+ } else {
+ v, err := strconv.ParseInt(base, 10, 64)
if err != nil {
return err
}
- v *= second
- prec := dotPrecision - len(p[1])
+ prec := dotPrecision - len(frac)
if prec < 0 {
- p[1] = p[1][:dotPrecision]
- } else if prec > 0 {
- p[1] += strings.Repeat("0", prec)
+ frac = frac[:dotPrecision]
}
-
- va, err := strconv.ParseInt(p[1], 10, 32)
+ va, err := strconv.ParseInt(frac, 10, 32)
if err != nil {
return err
}
-
- // If the value was something like -0.1 the negative is lost in the
- // parsing because of the leading zero, this ensures that we capture it.
- if len(p[0]) > 0 && p[0][0] == '-' && v+va > 0 {
- *t = Time(v+va) * -1
- } else {
- *t = Time(v + va)
+ switch prec {
+ case 1:
+ va *= 10
+ case 2:
+ va *= 100
}
- default:
- return fmt.Errorf("invalid time %q", string(b))
+ if len(base) > 0 && base[0] == '-' {
+ va = -va
+ }
+ *t = Time(v*second + va)
}
return nil
}
@@ -340,12 +334,12 @@ func (d *Duration) UnmarshalText(text []byte) error {
}
// MarshalYAML implements the yaml.Marshaler interface.
-func (d Duration) MarshalYAML() (interface{}, error) {
+func (d Duration) MarshalYAML() (any, error) {
return d.String(), nil
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.
-func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error {
+func (d *Duration) UnmarshalYAML(unmarshal func(any) error) error {
var s string
if err := unmarshal(&s); err != nil {
return err
diff --git a/vendor/github.com/prometheus/common/model/value.go b/vendor/github.com/prometheus/common/model/value.go
index a9995a37ee..8dffd9c4a5 100644
--- a/vendor/github.com/prometheus/common/model/value.go
+++ b/vendor/github.com/prometheus/common/model/value.go
@@ -259,13 +259,13 @@ func (s Scalar) String() string {
// MarshalJSON implements json.Marshaler.
func (s Scalar) MarshalJSON() ([]byte, error) {
v := strconv.FormatFloat(float64(s.Value), 'f', -1, 64)
- return json.Marshal([...]interface{}{s.Timestamp, v})
+ return json.Marshal([...]any{s.Timestamp, v})
}
// UnmarshalJSON implements json.Unmarshaler.
func (s *Scalar) UnmarshalJSON(b []byte) error {
var f string
- v := [...]interface{}{&s.Timestamp, &f}
+ v := [...]any{&s.Timestamp, &f}
if err := json.Unmarshal(b, &v); err != nil {
return err
@@ -291,12 +291,12 @@ func (s *String) String() string {
// MarshalJSON implements json.Marshaler.
func (s String) MarshalJSON() ([]byte, error) {
- return json.Marshal([]interface{}{s.Timestamp, s.Value})
+ return json.Marshal([]any{s.Timestamp, s.Value})
}
// UnmarshalJSON implements json.Unmarshaler.
func (s *String) UnmarshalJSON(b []byte) error {
- v := [...]interface{}{&s.Timestamp, &s.Value}
+ v := [...]any{&s.Timestamp, &s.Value}
return json.Unmarshal(b, &v)
}
diff --git a/vendor/github.com/prometheus/common/model/value_float.go b/vendor/github.com/prometheus/common/model/value_float.go
index 6bfc757d18..b7d93615e2 100644
--- a/vendor/github.com/prometheus/common/model/value_float.go
+++ b/vendor/github.com/prometheus/common/model/value_float.go
@@ -79,7 +79,7 @@ func (s SamplePair) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
- return []byte(fmt.Sprintf("[%s,%s]", t, v)), nil
+ return fmt.Appendf(nil, "[%s,%s]", t, v), nil
}
// UnmarshalJSON implements json.Unmarshaler.
diff --git a/vendor/github.com/prometheus/common/model/value_histogram.go b/vendor/github.com/prometheus/common/model/value_histogram.go
index 91ce5b7a45..f27856ccc4 100644
--- a/vendor/github.com/prometheus/common/model/value_histogram.go
+++ b/vendor/github.com/prometheus/common/model/value_histogram.go
@@ -67,11 +67,11 @@ func (s HistogramBucket) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
- return []byte(fmt.Sprintf("[%s,%s,%s,%s]", b, l, u, c)), nil
+ return fmt.Appendf(nil, "[%s,%s,%s,%s]", b, l, u, c), nil
}
func (s *HistogramBucket) UnmarshalJSON(buf []byte) error {
- tmp := []interface{}{&s.Boundaries, &s.Lower, &s.Upper, &s.Count}
+ tmp := []any{&s.Boundaries, &s.Lower, &s.Upper, &s.Count}
wantLen := len(tmp)
if err := json.Unmarshal(buf, &tmp); err != nil {
return err
@@ -152,11 +152,11 @@ func (s SampleHistogramPair) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
- return []byte(fmt.Sprintf("[%s,%s]", t, v)), nil
+ return fmt.Appendf(nil, "[%s,%s]", t, v), nil
}
func (s *SampleHistogramPair) UnmarshalJSON(buf []byte) error {
- tmp := []interface{}{&s.Timestamp, &s.Histogram}
+ tmp := []any{&s.Timestamp, &s.Histogram}
wantLen := len(tmp)
if err := json.Unmarshal(buf, &tmp); err != nil {
return err
diff --git a/vendor/github.com/prometheus/procfs/Makefile.common b/vendor/github.com/prometheus/procfs/Makefile.common
index cce3ef1d16..a7c5f553e1 100644
--- a/vendor/github.com/prometheus/procfs/Makefile.common
+++ b/vendor/github.com/prometheus/procfs/Makefile.common
@@ -55,13 +55,13 @@ ifneq ($(shell command -v gotestsum 2> /dev/null),)
endif
endif
-PROMU_VERSION ?= 0.18.0
+PROMU_VERSION ?= 0.20.0
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
SKIP_GOLANGCI_LINT :=
GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
-GOLANGCI_LINT_VERSION ?= v2.10.1
+GOLANGCI_LINT_VERSION ?= v2.11.4
GOLANGCI_FMT_OPTS ?=
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
# windows isn't included here because of the path separator being different.
@@ -90,8 +90,8 @@ ifdef DOCKERFILE_PATH
$(error DOCKERFILE_PATH is deprecated. Use DOCKERFILE_VARIANTS ?= $(DOCKERFILE_PATH) in the Makefile)
endif
-DOCKER_ARCHS ?= amd64
-DOCKERFILE_VARIANTS ?= Dockerfile $(wildcard Dockerfile.*)
+DOCKER_ARCHS ?= amd64 arm64 armv7 ppc64le riscv64 s390x
+DOCKERFILE_VARIANTS ?= $(wildcard Dockerfile Dockerfile.*)
# Function to extract variant from Dockerfile label.
# Returns the variant name from io.prometheus.image.variant label, or "default" if not found.
@@ -109,24 +109,6 @@ endif
# Build variant:dockerfile pairs for shell iteration.
DOCKERFILE_VARIANTS_WITH_NAMES := $(foreach df,$(DOCKERFILE_VARIANTS),$(call dockerfile_variant,$(df)):$(df))
-# Shell helper to check whether a dockerfile/arch pair is excluded.
-define dockerfile_arch_is_excluded
-case " $(DOCKERFILE_ARCH_EXCLUSIONS) " in \
- *" $$dockerfile:$(1) "*) true ;; \
- *) false ;; \
-esac
-endef
-
-# Shell helper to check whether a registry/arch pair is excluded.
-# Extracts registry from DOCKER_REPO (e.g., quay.io/prometheus -> quay.io)
-define registry_arch_is_excluded
-registry=$$(echo "$(DOCKER_REPO)" | cut -d'/' -f1); \
-case " $(DOCKER_REGISTRY_ARCH_EXCLUSIONS) " in \
- *" $$registry:$(1) "*) true ;; \
- *) false ;; \
-esac
-endef
-
BUILD_DOCKER_ARCHS = $(addprefix common-docker-,$(DOCKER_ARCHS))
PUBLISH_DOCKER_ARCHS = $(addprefix common-docker-publish-,$(DOCKER_ARCHS))
TAG_DOCKER_ARCHS = $(addprefix common-docker-tag-latest-,$(DOCKER_ARCHS))
@@ -268,10 +250,6 @@ $(BUILD_DOCKER_ARCHS): common-docker-%:
@for variant in $(DOCKERFILE_VARIANTS_WITH_NAMES); do \
dockerfile=$${variant#*:}; \
variant_name=$${variant%%:*}; \
- if $(call dockerfile_arch_is_excluded,$*); then \
- echo "Skipping $$variant_name variant for linux-$* (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
- continue; \
- fi; \
distroless_arch="$*"; \
if [ "$*" = "armv7" ]; then \
distroless_arch="arm"; \
@@ -306,14 +284,6 @@ $(PUBLISH_DOCKER_ARCHS): common-docker-publish-%:
@for variant in $(DOCKERFILE_VARIANTS_WITH_NAMES); do \
dockerfile=$${variant#*:}; \
variant_name=$${variant%%:*}; \
- if $(call dockerfile_arch_is_excluded,$*); then \
- echo "Skipping push for $$variant_name variant on linux-$* (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
- continue; \
- fi; \
- if $(call registry_arch_is_excluded,$*); then \
- echo "Skipping push for $$variant_name variant on linux-$* to $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \
- continue; \
- fi; \
if [ "$$dockerfile" != "Dockerfile" ] || [ "$$variant_name" != "default" ]; then \
echo "Pushing $$variant_name variant for linux-$*"; \
docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name"; \
@@ -341,14 +311,6 @@ $(TAG_DOCKER_ARCHS): common-docker-tag-latest-%:
@for variant in $(DOCKERFILE_VARIANTS_WITH_NAMES); do \
dockerfile=$${variant#*:}; \
variant_name=$${variant%%:*}; \
- if $(call dockerfile_arch_is_excluded,$*); then \
- echo "Skipping tag for $$variant_name variant on linux-$* (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
- continue; \
- fi; \
- if $(call registry_arch_is_excluded,$*); then \
- echo "Skipping tag for $$variant_name variant on linux-$* for $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \
- continue; \
- fi; \
if [ "$$dockerfile" != "Dockerfile" ] || [ "$$variant_name" != "default" ]; then \
echo "Tagging $$variant_name variant for linux-$* as latest"; \
docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest-$$variant_name"; \
@@ -370,14 +332,6 @@ common-docker-manifest:
echo "Creating manifest for $$variant_name variant"; \
refs=""; \
for arch in $(DOCKER_ARCHS); do \
- if $(call dockerfile_arch_is_excluded,$$arch); then \
- echo " Skipping $$arch for $$variant_name (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
- continue; \
- fi; \
- if $(call registry_arch_is_excluded,$$arch); then \
- echo " Skipping $$arch for $$variant_name on $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \
- continue; \
- fi; \
refs="$$refs $(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$$arch:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name"; \
done; \
if [ -z "$$refs" ]; then \
@@ -391,14 +345,6 @@ common-docker-manifest:
echo "Creating default variant ($$variant_name) manifest"; \
refs=""; \
for arch in $(DOCKER_ARCHS); do \
- if $(call dockerfile_arch_is_excluded,$$arch); then \
- echo " Skipping $$arch for default variant (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
- continue; \
- fi; \
- if $(call registry_arch_is_excluded,$$arch); then \
- echo " Skipping $$arch for default variant on $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \
- continue; \
- fi; \
refs="$$refs $(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$$arch:$(SANITIZED_DOCKER_IMAGE_TAG)"; \
done; \
if [ -z "$$refs" ]; then \
@@ -413,14 +359,6 @@ common-docker-manifest:
echo "Creating manifest for $$variant_name variant version tag"; \
refs=""; \
for arch in $(DOCKER_ARCHS); do \
- if $(call dockerfile_arch_is_excluded,$$arch); then \
- echo " Skipping $$arch for $$variant_name version tag (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
- continue; \
- fi; \
- if $(call registry_arch_is_excluded,$$arch); then \
- echo " Skipping $$arch for $$variant_name version tag on $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \
- continue; \
- fi; \
refs="$$refs $(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$$arch:v$(DOCKER_MAJOR_VERSION_TAG)-$$variant_name"; \
done; \
if [ -z "$$refs" ]; then \
@@ -434,14 +372,6 @@ common-docker-manifest:
echo "Creating default variant version tag manifest"; \
refs=""; \
for arch in $(DOCKER_ARCHS); do \
- if $(call dockerfile_arch_is_excluded,$$arch); then \
- echo " Skipping $$arch for default variant version tag (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \
- continue; \
- fi; \
- if $(call registry_arch_is_excluded,$$arch); then \
- echo " Skipping $$arch for default variant version tag on $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \
- continue; \
- fi; \
refs="$$refs $(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$$arch:v$(DOCKER_MAJOR_VERSION_TAG)"; \
done; \
if [ -z "$$refs" ]; then \
@@ -495,9 +425,3 @@ $(1)_precheck:
exit 1; \
fi
endef
-
-govulncheck: install-govulncheck
- govulncheck ./...
-
-install-govulncheck:
- command -v govulncheck > /dev/null || go install golang.org/x/vuln/cmd/govulncheck@latest
diff --git a/vendor/github.com/prometheus/procfs/README.md b/vendor/github.com/prometheus/procfs/README.md
index 0718239cf1..363524094b 100644
--- a/vendor/github.com/prometheus/procfs/README.md
+++ b/vendor/github.com/prometheus/procfs/README.md
@@ -7,7 +7,7 @@ metrics from the pseudo-filesystems /proc and /sys.
backwards-incompatible ways without warnings. Use it at your own risk.
[](https://pkg.go.dev/github.com/prometheus/procfs)
-[](https://circleci.com/gh/prometheus/procfs/tree/master)
+[](https://github.com/prometheus/procfs/actions/workflows/ci.yml)
[](https://goreportcard.com/report/github.com/prometheus/procfs)
## Usage
diff --git a/vendor/github.com/prometheus/procfs/SECURITY.md b/vendor/github.com/prometheus/procfs/SECURITY.md
index fed02d85c7..5e6f976dbf 100644
--- a/vendor/github.com/prometheus/procfs/SECURITY.md
+++ b/vendor/github.com/prometheus/procfs/SECURITY.md
@@ -3,4 +3,4 @@
The Prometheus security policy, including how to report vulnerabilities, can be
found here:
-
+[https://prometheus.io/docs/operating/security/](https://prometheus.io/docs/operating/security/)
diff --git a/vendor/github.com/prometheus/procfs/crypto.go b/vendor/github.com/prometheus/procfs/crypto.go
index e4a5876eaf..d93b712e05 100644
--- a/vendor/github.com/prometheus/procfs/crypto.go
+++ b/vendor/github.com/prometheus/procfs/crypto.go
@@ -48,11 +48,13 @@ type Crypto struct {
Walksize *uint64
}
+var cryptoFile = "crypto"
+
// Crypto parses an crypto-file (/proc/crypto) and returns a slice of
// structs containing the relevant info. More information available here:
// https://kernel.readthedocs.io/en/sphinx-samples/crypto-API.html
func (fs FS) Crypto() ([]Crypto, error) {
- path := fs.proc.Path("crypto")
+ path := fs.proc.Path(cryptoFile)
b, err := util.ReadFileNoStat(path)
if err != nil {
return nil, fmt.Errorf("%w: Cannot read file %v: %w", ErrFileRead, b, err)
@@ -82,6 +84,10 @@ func parseCrypto(r io.Reader) ([]Crypto, error) {
continue
}
+ if len(out) == 0 {
+ return nil, fmt.Errorf("%w: parsed invalid line before name parsed: %q", ErrFileParse, text)
+ }
+
kv := strings.Split(text, ":")
if len(kv) != 2 {
return nil, fmt.Errorf("%w: Cannot parse line: %q", ErrFileParse, text)
diff --git a/vendor/github.com/prometheus/procfs/mountinfo.go b/vendor/github.com/prometheus/procfs/mountinfo.go
index 9414a12f42..8594ae7f1e 100644
--- a/vendor/github.com/prometheus/procfs/mountinfo.go
+++ b/vendor/github.com/prometheus/procfs/mountinfo.go
@@ -17,10 +17,10 @@ import (
"bufio"
"bytes"
"fmt"
+ "io"
+ "os"
"strconv"
"strings"
-
- "github.com/prometheus/procfs/internal/util"
)
// A MountInfo is a type that describes the details, options
@@ -160,9 +160,19 @@ func mountOptionsParser(mountOptions string) map[string]string {
return opts
}
+// readMountInfo reads a full mountinfo file (no 1 MiB cap, unlike util.ReadFileNoStat).
+func readMountInfo(path string) ([]byte, error) {
+ f, err := os.Open(path)
+ if err != nil {
+ return nil, err
+ }
+ defer f.Close()
+ return io.ReadAll(f)
+}
+
// GetMounts retrieves mountinfo information from `/proc/self/mountinfo`.
func GetMounts() ([]*MountInfo, error) {
- data, err := util.ReadFileNoStat("/proc/self/mountinfo")
+ data, err := readMountInfo("/proc/self/mountinfo")
if err != nil {
return nil, err
}
@@ -171,7 +181,7 @@ func GetMounts() ([]*MountInfo, error) {
// GetProcMounts retrieves mountinfo information from a processes' `/proc//mountinfo`.
func GetProcMounts(pid int) ([]*MountInfo, error) {
- data, err := util.ReadFileNoStat(fmt.Sprintf("/proc/%d/mountinfo", pid))
+ data, err := readMountInfo(fmt.Sprintf("/proc/%d/mountinfo", pid))
if err != nil {
return nil, err
}
@@ -180,7 +190,7 @@ func GetProcMounts(pid int) ([]*MountInfo, error) {
// GetMounts retrieves mountinfo information from `/proc/self/mountinfo`.
func (fs FS) GetMounts() ([]*MountInfo, error) {
- data, err := util.ReadFileNoStat(fs.proc.Path("self/mountinfo"))
+ data, err := readMountInfo(fs.proc.Path("self/mountinfo"))
if err != nil {
return nil, err
}
@@ -189,7 +199,7 @@ func (fs FS) GetMounts() ([]*MountInfo, error) {
// GetProcMounts retrieves mountinfo information from a processes' `/proc//mountinfo`.
func (fs FS) GetProcMounts(pid int) ([]*MountInfo, error) {
- data, err := util.ReadFileNoStat(fs.proc.Path(fmt.Sprintf("%d/mountinfo", pid)))
+ data, err := readMountInfo(fs.proc.Path(fmt.Sprintf("%d/mountinfo", pid)))
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/prometheus/procfs/net_wireless.go b/vendor/github.com/prometheus/procfs/net_wireless.go
index 69d0794451..f74dd3bed0 100644
--- a/vendor/github.com/prometheus/procfs/net_wireless.go
+++ b/vendor/github.com/prometheus/procfs/net_wireless.go
@@ -114,47 +114,47 @@ func parseWireless(r io.Reader) ([]*Wireless, error) {
qlink, err := strconv.Atoi(strings.TrimSuffix(stats[1], "."))
if err != nil {
- return nil, fmt.Errorf("%w: parse Quality:link as integer %q: %w", ErrFileParse, qlink, err)
+ return nil, fmt.Errorf("%w: parse Quality:link as integer %q: %w", ErrFileParse, stats[1], err)
}
qlevel, err := strconv.Atoi(strings.TrimSuffix(stats[2], "."))
if err != nil {
- return nil, fmt.Errorf("%w: Quality:level as integer %q: %w", ErrFileParse, qlevel, err)
+ return nil, fmt.Errorf("%w: Quality:level as integer %q: %w", ErrFileParse, stats[2], err)
}
qnoise, err := strconv.Atoi(strings.TrimSuffix(stats[3], "."))
if err != nil {
- return nil, fmt.Errorf("%w: Quality:noise as integer %q: %w", ErrFileParse, qnoise, err)
+ return nil, fmt.Errorf("%w: Quality:noise as integer %q: %w", ErrFileParse, stats[3], err)
}
dnwid, err := strconv.Atoi(stats[4])
if err != nil {
- return nil, fmt.Errorf("%w: Discarded:nwid as integer %q: %w", ErrFileParse, dnwid, err)
+ return nil, fmt.Errorf("%w: Discarded:nwid as integer %q: %w", ErrFileParse, stats[4], err)
}
dcrypt, err := strconv.Atoi(stats[5])
if err != nil {
- return nil, fmt.Errorf("%w: Discarded:crypt as integer %q: %w", ErrFileParse, dcrypt, err)
+ return nil, fmt.Errorf("%w: Discarded:crypt as integer %q: %w", ErrFileParse, stats[5], err)
}
dfrag, err := strconv.Atoi(stats[6])
if err != nil {
- return nil, fmt.Errorf("%w: Discarded:frag as integer %q: %w", ErrFileParse, dfrag, err)
+ return nil, fmt.Errorf("%w: Discarded:frag as integer %q: %w", ErrFileParse, stats[6], err)
}
dretry, err := strconv.Atoi(stats[7])
if err != nil {
- return nil, fmt.Errorf("%w: Discarded:retry as integer %q: %w", ErrFileParse, dretry, err)
+ return nil, fmt.Errorf("%w: Discarded:retry as integer %q: %w", ErrFileParse, stats[7], err)
}
dmisc, err := strconv.Atoi(stats[8])
if err != nil {
- return nil, fmt.Errorf("%w: Discarded:misc as integer %q: %w", ErrFileParse, dmisc, err)
+ return nil, fmt.Errorf("%w: Discarded:misc as integer %q: %w", ErrFileParse, stats[8], err)
}
mbeacon, err := strconv.Atoi(stats[9])
if err != nil {
- return nil, fmt.Errorf("%w: Missed:beacon as integer %q: %w", ErrFileParse, mbeacon, err)
+ return nil, fmt.Errorf("%w: Missed:beacon as integer %q: %w", ErrFileParse, stats[9], err)
}
w := &Wireless{
diff --git a/vendor/github.com/prometheus/procfs/proc_cgroup.go b/vendor/github.com/prometheus/procfs/proc_cgroup.go
index 535c08d6fc..7e8a122978 100644
--- a/vendor/github.com/prometheus/procfs/proc_cgroup.go
+++ b/vendor/github.com/prometheus/procfs/proc_cgroup.go
@@ -60,7 +60,7 @@ func parseCgroupString(cgroupStr string) (*Cgroup, error) {
}
cgroup.HierarchyID, err = strconv.Atoi(fields[0])
if err != nil {
- return nil, fmt.Errorf("%w: hierarchy ID: %q", ErrFileParse, cgroup.HierarchyID)
+ return nil, fmt.Errorf("%w: hierarchy ID: %q", ErrFileParse, fields[0])
}
if fields[1] != "" {
ssNames := strings.Split(fields[1], ",")
diff --git a/vendor/github.com/sassoftware/relic/lib/pkcs7/attributes.go b/vendor/github.com/sassoftware/relic/lib/pkcs7/attributes.go
deleted file mode 100644
index 0a2d801f5b..0000000000
--- a/vendor/github.com/sassoftware/relic/lib/pkcs7/attributes.go
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// Copyright (c) SAS Institute Inc.
-//
-// 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 pkcs7
-
-import (
- "encoding/asn1"
- "fmt"
-)
-
-type ErrNoAttribute struct {
- ID asn1.ObjectIdentifier
-}
-
-func (e ErrNoAttribute) Error() string {
- return fmt.Sprintf("attribute not found: %s", e.ID)
-}
-
-// marshal authenticated attributes for digesting
-func (l *AttributeList) Bytes() ([]byte, error) {
- // needs an explicit SET OF tag but not the class-specific tag from the
- // original struct. see RFC 2315 9.3, 2nd paragraph
- encoded, err := asn1.Marshal(struct {
- A []Attribute `asn1:"set"`
- }{A: *l})
- if err != nil {
- return nil, err
- }
- var raw asn1.RawValue
- if _, err := asn1.Unmarshal(encoded, &raw); err != nil {
- return nil, err
- }
- return raw.Bytes, nil
-}
-
-// unmarshal a single attribute, if it exists
-func (l *AttributeList) GetOne(oid asn1.ObjectIdentifier, dest interface{}) error {
- for _, raw := range *l {
- if !raw.Type.Equal(oid) {
- continue
- }
- rest, err := asn1.Unmarshal(raw.Values.Bytes, dest)
- if err != nil {
- return err
- } else if len(rest) != 0 {
- return fmt.Errorf("attribute %s: expected one, found multiple", oid)
- } else {
- return nil
- }
- }
- return ErrNoAttribute{oid}
-}
-
-// create or append to an attribute
-func (l *AttributeList) Add(oid asn1.ObjectIdentifier, obj interface{}) error {
- value, err := asn1.Marshal(obj)
- if err != nil {
- return err
- }
- for _, attr := range *l {
- if attr.Type.Equal(oid) {
- attr.Values.Bytes = append(attr.Values.Bytes, value...)
- return nil
- }
- }
- *l = append(*l, Attribute{
- Type: oid,
- Values: asn1.RawValue{
- Class: asn1.ClassUniversal,
- Tag: asn1.TagSet,
- IsCompound: true,
- Bytes: value,
- }})
- return nil
-}
diff --git a/vendor/github.com/sassoftware/relic/lib/x509tools/names.go b/vendor/github.com/sassoftware/relic/lib/x509tools/names.go
deleted file mode 100644
index 8b8461d131..0000000000
--- a/vendor/github.com/sassoftware/relic/lib/x509tools/names.go
+++ /dev/null
@@ -1,214 +0,0 @@
-//
-// Copyright (c) SAS Institute Inc.
-//
-// 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 x509tools
-
-import (
- "crypto/x509"
- "encoding/asn1"
- "encoding/binary"
- "fmt"
- "strings"
- "unicode/utf16"
-)
-
-type rdnAttr struct {
- Type asn1.ObjectIdentifier
- Value asn1.RawValue
-}
-
-type rdnNameSet []rdnAttr
-
-type NameStyle int
-
-const (
- NameStyleOpenSsl NameStyle = iota
- NameStyleLdap
- NameStyleMsOsco
-)
-
-type attrName struct {
- Type asn1.ObjectIdentifier
- Name string
-}
-
-var nameStyleLdap = []attrName{
- attrName{asn1.ObjectIdentifier{2, 5, 4, 3}, "CN"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 4}, "surname"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 5}, "serialNumber"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 6}, "C"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 7}, "L"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 8}, "ST"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 9}, "street"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 10}, "O"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 11}, "OU"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 12}, "title"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 13}, "description"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 17}, "postalCode"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 18}, "postOfficeBox"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 20}, "telephoneNumber"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 42}, "givenName"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 43}, "initials"},
- attrName{asn1.ObjectIdentifier{0, 9, 2342, 19200300, 100, 1, 25}, "dc"},
- attrName{asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, "emailAddress"},
-}
-
-// Per [MS-OSCO]
-// https://msdn.microsoft.com/en-us/library/dd947276(v=office.12).aspx
-var nameStyleMsOsco = []attrName{
- attrName{asn1.ObjectIdentifier{2, 5, 4, 3}, "CN"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 7}, "L"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 10}, "O"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 11}, "OU"},
- attrName{asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, "E"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 6}, "C"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 8}, "S"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 9}, "STREET"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 12}, "T"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 42}, "G"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 43}, "I"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 4}, "SN"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 5}, "SERIALNUMBER"},
- attrName{asn1.ObjectIdentifier{0, 9, 2342, 19200300, 100, 1, 25}, "DC"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 13}, "Description"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 17}, "PostalCode"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 18}, "POBox"},
- attrName{asn1.ObjectIdentifier{2, 5, 4, 20}, "Phone"},
-}
-
-// returned by the Format* functions in case there's something cripplingly
-// wrong with it
-const InvalidName = ""
-
-// Format the name (RDN sequence) from its raw DER to a readable style.
-func FormatPkixName(der []byte, style NameStyle) string {
- var seq asn1.RawValue
- if _, err := asn1.Unmarshal(der, &seq); err != nil {
- return InvalidName
- }
- seqbytes := seq.Bytes
- var formatted []string
- for len(seqbytes) > 0 {
- var rdnSet rdnNameSet
- var err error
- seqbytes, err = asn1.UnmarshalWithParams(seqbytes, &rdnSet, "set")
- if err != nil {
- return InvalidName
- }
- for _, attr := range rdnSet {
- formatted = append(formatted, fmt.Sprintf("%s=%s", attName(attr.Type, style), attValue(attr.Value, style)))
- }
- }
- if len(formatted) == 0 {
- return ""
- }
- switch style {
- case NameStyleOpenSsl:
- return "/" + strings.Join(formatted, "/") + "/"
- case NameStyleLdap, NameStyleMsOsco:
- // Per RFC 2253 2.1, reverse the order
- for i := 0; i < len(formatted)/2; i++ {
- j := len(formatted) - i - 1
- formatted[i], formatted[j] = formatted[j], formatted[i]
- }
- return strings.Join(formatted, ", ")
- default:
- panic("invalid style argument")
- }
-}
-
-func attName(t asn1.ObjectIdentifier, style NameStyle) string {
- var names []attrName
- var defaultPrefix string
- switch style {
- case NameStyleLdap, NameStyleOpenSsl:
- names = nameStyleLdap
- case NameStyleMsOsco:
- names = nameStyleMsOsco
- defaultPrefix = "OID."
- default:
- panic("invalid style argument")
- }
- for _, name := range names {
- if name.Type.Equal(t) {
- return name.Name
- }
- }
- return defaultPrefix + t.String()
-}
-
-func attValue(raw asn1.RawValue, style NameStyle) string {
- var value string
- switch raw.Tag {
- case asn1.TagUTF8String, asn1.TagIA5String, asn1.TagPrintableString:
- var ret interface{}
- if _, err := asn1.Unmarshal(raw.FullBytes, &ret); err != nil {
- return InvalidName
- }
- value = ret.(string)
- case Asn1TagBMPString:
- value = ParseBMPString(raw)
- default:
- return InvalidName
- }
- switch style {
- case NameStyleOpenSsl:
- value = strings.Replace(value, "/", "\\/", -1)
- case NameStyleLdap, NameStyleMsOsco:
- quote := false
- if len(value) == 0 {
- quote = true
- }
- if strings.HasPrefix(value, " ") || strings.HasSuffix(value, " ") {
- quote = true
- }
- if i := strings.IndexAny(value, ",+=\n<>#;'\""); i >= 0 {
- quote = true
- }
- value = strings.Replace(value, "\"", "\"\"", -1)
- if quote {
- value = "\"" + value + "\""
- }
- }
- return value
-}
-
-func ParseBMPString(raw asn1.RawValue) string {
- runes := make([]uint16, len(raw.Bytes)/2)
- for i := range runes {
- runes[i] = binary.BigEndian.Uint16(raw.Bytes[i*2:])
- }
- return string(utf16.Decode(runes))
-}
-
-func ToBMPString(value string) asn1.RawValue {
- runes := utf16.Encode([]rune(value))
- raw := make([]byte, 2*len(runes))
- for i, r := range runes {
- binary.BigEndian.PutUint16(raw[i*2:], r)
- }
- return asn1.RawValue{Tag: Asn1TagBMPString, Bytes: raw}
-}
-
-// Format the certificate subject name in LDAP style
-func FormatSubject(cert *x509.Certificate) string {
- return FormatPkixName(cert.RawSubject, NameStyleLdap)
-}
-
-// Format the certificate issuer name in LDAP style
-func FormatIssuer(cert *x509.Certificate) string {
- return FormatPkixName(cert.RawIssuer, NameStyleLdap)
-}
diff --git a/vendor/github.com/sassoftware/relic/v8/LICENSE b/vendor/github.com/sassoftware/relic/v8/LICENSE
new file mode 100644
index 0000000000..d645695673
--- /dev/null
+++ b/vendor/github.com/sassoftware/relic/v8/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/github.com/sassoftware/relic/v8/lib/pkcs7/attributes.go b/vendor/github.com/sassoftware/relic/v8/lib/pkcs7/attributes.go
new file mode 100644
index 0000000000..3558a2fe10
--- /dev/null
+++ b/vendor/github.com/sassoftware/relic/v8/lib/pkcs7/attributes.go
@@ -0,0 +1,152 @@
+//
+// Copyright (c) SAS Institute Inc.
+//
+// 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 pkcs7
+
+import (
+ "encoding/asn1"
+ "errors"
+ "fmt"
+ "time"
+)
+
+type ErrNoAttribute struct {
+ ID asn1.ObjectIdentifier
+}
+
+func (e ErrNoAttribute) Error() string {
+ return fmt.Sprintf("attribute not found: %s", e.ID)
+}
+
+// Bytes returns a SET OF form of the attribute list for digesting, per RFC 2315 9.3, 2nd paragraph
+func (l *AttributeList) Bytes() ([]byte, error) {
+ return marshalUnsortedSet(*l)
+}
+
+// Need to marshal authenticated attributes as a SET OF in order to digest them,
+// but since go 1.15 sets get sorted which breaks the digest. Marshal as a
+// sequence and then change the tag.
+func marshalUnsortedSet(v interface{}) ([]byte, error) {
+ encoded, err := asn1.Marshal(v)
+ if err != nil {
+ return nil, err
+ }
+ if len(encoded) > 0 {
+ if encoded[0]&0x1f != asn1.TagSequence {
+ return nil, fmt.Errorf("expected sequence, got %d", encoded[0]&0x1f)
+ }
+ // sequence 16 -> set 17
+ encoded[0] |= 1
+ }
+ return encoded, nil
+}
+
+// GetOne unmarshals a single attribute, if it exists
+func (l *AttributeList) GetOne(oid asn1.ObjectIdentifier, dest interface{}) error {
+ for _, raw := range *l {
+ if !raw.Type.Equal(oid) {
+ continue
+ }
+ rest, err := asn1.Unmarshal(raw.Values.Bytes, dest)
+ if err != nil {
+ return err
+ } else if len(rest) != 0 {
+ return fmt.Errorf("attribute %s: expected one, found multiple", oid)
+ } else {
+ return nil
+ }
+ }
+ return ErrNoAttribute{oid}
+}
+
+// GetAll unmarshals all values for an attribute. dest should be a pointer to a slice.
+func (l *AttributeList) GetAll(oid asn1.ObjectIdentifier, dest interface{}) error {
+ for _, raw := range *l {
+ if raw.Type.Equal(oid) {
+ _, err := asn1.UnmarshalWithParams(raw.Values.FullBytes, dest, "set")
+ return err
+ }
+ }
+ return ErrNoAttribute{oid}
+}
+
+// create or append to an attribute
+func (l *AttributeList) Add(oid asn1.ObjectIdentifier, obj interface{}) error {
+ value, err := asn1.Marshal(obj)
+ if err != nil {
+ return err
+ }
+ *l = appendAttr(*l, oid, value)
+ return nil
+}
+
+func appendAttr(attrList AttributeList, oid asn1.ObjectIdentifier, value []byte) AttributeList {
+ for i, attr := range attrList {
+ if attr.Type.Equal(oid) {
+ attr.Values.Bytes = append(attr.Values.Bytes, value...)
+ attrList[i] = attr
+ return attrList
+ }
+ }
+ return append(attrList, Attribute{
+ Type: oid,
+ Values: asn1.RawValue{
+ Class: asn1.ClassUniversal,
+ Tag: asn1.TagSet,
+ IsCompound: true,
+ Bytes: value,
+ }})
+}
+
+func (l AttributeList) Exists(oid asn1.ObjectIdentifier) bool {
+ for _, attr := range l {
+ if attr.Type.Equal(oid) {
+ return true
+ }
+ }
+ return false
+}
+
+func (i SignerInfo) SigningTime() (time.Time, error) {
+ var raw asn1.RawValue
+ if err := i.AuthenticatedAttributes.GetOne(OidAttributeSigningTime, &raw); err != nil {
+ return time.Time{}, err
+ }
+ return ParseTime(raw)
+}
+
+// AuthenticatedAttributesBytes returns a SET OF form of the attribute list for digesting, per RFC 2315 9.3, 2nd paragraph
+func (i SignerInfo) AuthenticatedAttributesBytes() ([]byte, error) {
+ if i.RawContent == nil {
+ return i.AuthenticatedAttributes.Bytes()
+ }
+ // decode the SignerInfo as a sequence of raw values to extract how the
+ // authenticated attributes were originally encoded extract the original
+ var seq []asn1.RawValue
+ if _, err := asn1.Unmarshal(i.RawContent, &seq); err != nil {
+ return nil, err
+ }
+ if len(seq) < 4 {
+ return nil, errors.New("short sequence in SignerInfo")
+ }
+ raw := seq[3]
+ // tweak the attribute sequence to be a set
+ return marshalUnsortedSet(asn1.RawValue{
+ Tag: asn1.TagSequence,
+ IsCompound: true,
+ Bytes: raw.Bytes,
+ })
+}
diff --git a/vendor/github.com/sassoftware/relic/lib/pkcs7/builder.go b/vendor/github.com/sassoftware/relic/v8/lib/pkcs7/builder.go
similarity index 96%
rename from vendor/github.com/sassoftware/relic/lib/pkcs7/builder.go
rename to vendor/github.com/sassoftware/relic/v8/lib/pkcs7/builder.go
index 652f392996..493b9d676f 100644
--- a/vendor/github.com/sassoftware/relic/lib/pkcs7/builder.go
+++ b/vendor/github.com/sassoftware/relic/v8/lib/pkcs7/builder.go
@@ -25,12 +25,11 @@ import (
"errors"
"fmt"
- "github.com/sassoftware/relic/lib/x509tools"
+ "github.com/sassoftware/relic/v8/lib/x509tools"
)
type SignatureBuilder struct {
contentInfo ContentInfo
- hash crypto.Hash
digest []byte
certs []*x509.Certificate
privateKey crypto.Signer
@@ -99,7 +98,7 @@ func (sb *SignatureBuilder) Sign() (*ContentInfoSignedData, error) {
pubKey := sb.privateKey.Public()
digestAlg, pkeyAlg, err := x509tools.PkixAlgorithms(pubKey, sb.signerOpts)
if err != nil {
- return nil, fmt.Errorf("pkcs7: %s", err)
+ return nil, fmt.Errorf("pkcs7: %w", err)
}
if len(sb.certs) < 1 || !x509tools.SameKey(pubKey, sb.certs[0].PublicKey) {
return nil, errors.New("pkcs7: first certificate must match private key")
@@ -135,7 +134,7 @@ func (sb *SignatureBuilder) Sign() (*ContentInfoSignedData, error) {
ContentInfo: sb.contentInfo,
Certificates: marshalCertificates(sb.certs),
CRLs: nil,
- SignerInfos: []SignerInfo{SignerInfo{
+ SignerInfos: []SignerInfo{{
Version: 1,
IssuerAndSerialNumber: IssuerAndSerial{
IssuerName: asn1.RawValue{FullBytes: sb.certs[0].RawIssuer},
diff --git a/vendor/github.com/sassoftware/relic/lib/pkcs7/content.go b/vendor/github.com/sassoftware/relic/v8/lib/pkcs7/content.go
similarity index 100%
rename from vendor/github.com/sassoftware/relic/lib/pkcs7/content.go
rename to vendor/github.com/sassoftware/relic/v8/lib/pkcs7/content.go
diff --git a/vendor/github.com/sassoftware/relic/lib/pkcs7/marshal.go b/vendor/github.com/sassoftware/relic/v8/lib/pkcs7/marshal.go
similarity index 50%
rename from vendor/github.com/sassoftware/relic/lib/pkcs7/marshal.go
rename to vendor/github.com/sassoftware/relic/v8/lib/pkcs7/marshal.go
index 03c0b82b28..4c450391cb 100644
--- a/vendor/github.com/sassoftware/relic/lib/pkcs7/marshal.go
+++ b/vendor/github.com/sassoftware/relic/v8/lib/pkcs7/marshal.go
@@ -22,6 +22,7 @@ import (
"encoding/asn1"
"errors"
"fmt"
+ "time"
)
// Parse a signature from bytes
@@ -44,7 +45,7 @@ func (psd *ContentInfoSignedData) Marshal() ([]byte, error) {
func (psd *ContentInfoSignedData) Detach() ([]byte, error) {
content, err := psd.Content.ContentInfo.Bytes()
if err != nil {
- return nil, fmt.Errorf("pkcs7: %s", err)
+ return nil, fmt.Errorf("pkcs7: %w", err)
}
psd.Content.ContentInfo, _ = NewContentInfo(psd.Content.ContentInfo.ContentType, nil)
return content, nil
@@ -52,23 +53,63 @@ func (psd *ContentInfoSignedData) Detach() ([]byte, error) {
// dump raw certificates to structure
func marshalCertificates(certs []*x509.Certificate) RawCertificates {
- var buf bytes.Buffer
- for _, cert := range certs {
- buf.Write(cert.Raw)
+ c := make(RawCertificates, len(certs))
+ for i, cert := range certs {
+ c[i] = asn1.RawValue{FullBytes: cert.Raw}
}
- val := asn1.RawValue{Bytes: buf.Bytes(), Class: 2, Tag: 0, IsCompound: true}
- b, _ := asn1.Marshal(val)
- return RawCertificates{Raw: b}
+ return c
}
-// parse raw certificates from structure
+// Parse raw certificates from structure. If any cert is invalid, the remaining valid certs are returned along with a CertificateError.
func (raw RawCertificates) Parse() ([]*x509.Certificate, error) {
- var val asn1.RawValue
- if len(raw.Raw) == 0 {
- return nil, nil
+ var invalid CertificateError
+ var certs []*x509.Certificate
+ for _, rawCert := range raw {
+ cert, err := x509.ParseCertificate(rawCert.FullBytes)
+ if err != nil {
+ invalid.Invalid = append(invalid.Invalid, rawCert.FullBytes)
+ invalid.Err = err
+ } else {
+ certs = append(certs, cert)
+ }
}
- if _, err := asn1.Unmarshal(raw.Raw, &val); err != nil {
- return nil, err
+ if invalid.Err != nil {
+ return certs, invalid
+ }
+ return certs, nil
+}
+
+type CertificateError struct {
+ Invalid [][]byte
+ Err error
+}
+
+func (c CertificateError) Error() string {
+ return c.Err.Error()
+}
+
+func (c CertificateError) Unwrap() error {
+ return c.Err
+}
+
+// ParseTime parses a GeneralizedTime or UTCTime value that potentially has a fractional seconds part
+func ParseTime(raw asn1.RawValue) (ret time.Time, err error) {
+ // as of go 1.12 fractional timestamps fail to parse with a "did not serialize back to the original value" error, so this implementation without the serialize check is needed
+ s := string(raw.Bytes)
+ switch raw.Tag {
+ case asn1.TagGeneralizedTime:
+ formatStr := "20060102150405Z0700"
+ return time.Parse(formatStr, s)
+ case asn1.TagUTCTime:
+ formatStr := "0601021504Z0700"
+ ret, err = time.Parse(formatStr, s)
+ if err != nil {
+ formatStr = "060102150405Z0700"
+ ret, err = time.Parse(formatStr, s)
+ }
+ return
+ default:
+ err = fmt.Errorf("unknown tag %d in timestamp field", raw.Tag)
+ return
}
- return x509.ParseCertificates(val.Bytes)
}
diff --git a/vendor/github.com/sassoftware/relic/lib/pkcs7/structs.go b/vendor/github.com/sassoftware/relic/v8/lib/pkcs7/structs.go
similarity index 97%
rename from vendor/github.com/sassoftware/relic/lib/pkcs7/structs.go
rename to vendor/github.com/sassoftware/relic/v8/lib/pkcs7/structs.go
index 522ed75c22..19d5fcf322 100644
--- a/vendor/github.com/sassoftware/relic/lib/pkcs7/structs.go
+++ b/vendor/github.com/sassoftware/relic/v8/lib/pkcs7/structs.go
@@ -58,9 +58,7 @@ type SignedData struct {
SignerInfos []SignerInfo `asn1:"set"`
}
-type RawCertificates struct {
- Raw asn1.RawContent
-}
+type RawCertificates []asn1.RawValue
type Attribute struct {
Type asn1.ObjectIdentifier
@@ -70,6 +68,8 @@ type Attribute struct {
type AttributeList []Attribute
type SignerInfo struct {
+ RawContent asn1.RawContent
+
Version int `asn1:"default:1"`
IssuerAndSerialNumber IssuerAndSerial ``
DigestAlgorithm pkix.AlgorithmIdentifier ``
diff --git a/vendor/github.com/sassoftware/relic/lib/pkcs7/verify.go b/vendor/github.com/sassoftware/relic/v8/lib/pkcs7/verify.go
similarity index 77%
rename from vendor/github.com/sassoftware/relic/lib/pkcs7/verify.go
rename to vendor/github.com/sassoftware/relic/v8/lib/pkcs7/verify.go
index 4880731d4c..6f8fa3e038 100644
--- a/vendor/github.com/sassoftware/relic/lib/pkcs7/verify.go
+++ b/vendor/github.com/sassoftware/relic/v8/lib/pkcs7/verify.go
@@ -21,17 +21,21 @@ import (
"crypto/hmac"
"crypto/rsa"
"crypto/x509"
+ "encoding/asn1"
+ "errors"
"fmt"
+ "math/big"
"time"
- "github.com/pkg/errors"
- "github.com/sassoftware/relic/lib/x509tools"
+ "github.com/sassoftware/relic/v8/lib/x509tools"
+ "github.com/sassoftware/relic/v8/signers/sigerrors"
)
type Signature struct {
SignerInfo *SignerInfo
Certificate *x509.Certificate
Intermediates []*x509.Certificate
+ CertError error
}
// Verify the content in a SignedData structure. External content may be
@@ -59,20 +63,29 @@ func (sd *SignedData) Verify(externalContent []byte, skipDigests bool) (Signatur
}
}
}
- certs, err := sd.Certificates.Parse()
- if err != nil {
- return Signature{}, fmt.Errorf("pkcs7: %s", err)
- } else if len(certs) == 0 {
- return Signature{}, errors.New("pkcs7: certificate missing from signedData")
+ if len(sd.SignerInfos) == 0 {
+ return Signature{}, sigerrors.NotSignedError{Type: "pkcs7"}
}
+ certs, certErr := sd.Certificates.Parse()
+ // postpone handling of cert parse error until something is actually missing
var cert *x509.Certificate
var sig Signature
for _, si := range sd.SignerInfos {
+ var err error
cert, err = si.Verify(content, skipDigests, certs)
if err != nil {
+ if errors.As(err, &MissingCertificateError{}) && certErr != nil {
+ // now surface the parse error
+ err = certErr
+ }
return Signature{}, err
}
- sig = Signature{&si, cert, certs}
+ sig = Signature{
+ SignerInfo: &si,
+ Certificate: cert,
+ Intermediates: certs,
+ CertError: certErr,
+ }
}
return sig, nil
}
@@ -85,7 +98,17 @@ func (si *SignerInfo) FindCertificate(certs []*x509.Certificate) (*x509.Certific
return cert, nil
}
}
- return nil, errors.New("pkcs7: certificate missing from signedData")
+ return nil, MissingCertificateError{Issuer: is.IssuerName, SerialNumber: is.SerialNumber}
+}
+
+type MissingCertificateError struct {
+ Issuer asn1.RawValue
+ SerialNumber *big.Int
+}
+
+func (e MissingCertificateError) Error() string {
+ name := x509tools.FormatPkixName(e.Issuer.FullBytes, x509tools.NameStyleLdap)
+ return fmt.Sprintf("certificate missing from signedData: serial=%x issuer: %s", e.SerialNumber, name)
}
// Verify the signature contained in this SignerInfo and return the leaf
@@ -93,7 +116,7 @@ func (si *SignerInfo) FindCertificate(certs []*x509.Certificate) (*x509.Certific
func (si *SignerInfo) Verify(content []byte, skipDigests bool, certs []*x509.Certificate) (*x509.Certificate, error) {
hash, err := x509tools.PkixDigestToHashE(si.DigestAlgorithm)
if err != nil {
- return nil, errors.Wrap(err, "pkcs7")
+ return nil, fmt.Errorf("pkcs7: %w", err)
}
var digest []byte
if !skipDigests {
@@ -111,9 +134,9 @@ func (si *SignerInfo) Verify(content []byte, skipDigests bool, certs []*x509.Cer
}
// now pivot to verifying the hash over the authenticated attributes
w := hash.New()
- attrbytes, err := si.AuthenticatedAttributes.Bytes()
+ attrbytes, err := si.AuthenticatedAttributesBytes()
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("verifying authenticated attributes: %w", err)
}
w.Write(attrbytes)
digest = w.Sum(nil)
@@ -158,5 +181,12 @@ func (info Signature) VerifyChain(roots *x509.CertPool, extraCerts []*x509.Certi
KeyUsages: []x509.ExtKeyUsage{usage},
}
_, err := info.Certificate.Verify(opts)
+ if err == nil {
+ return nil
+ }
+ if e := new(x509.UnknownAuthorityError); errors.As(err, e) && info.CertError != nil {
+ // surface a saved cert parse error
+ return fmt.Errorf("%w: after failing to parse a bundled certificate: %s", err, info.CertError)
+ }
return err
}
diff --git a/vendor/github.com/sassoftware/relic/lib/x509tools/certpool.go b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/certpool.go
similarity index 86%
rename from vendor/github.com/sassoftware/relic/lib/x509tools/certpool.go
rename to vendor/github.com/sassoftware/relic/v8/lib/x509tools/certpool.go
index 771d3509e6..21a610a356 100644
--- a/vendor/github.com/sassoftware/relic/lib/x509tools/certpool.go
+++ b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/certpool.go
@@ -21,6 +21,7 @@ import (
"crypto/x509"
"fmt"
"io/ioutil"
+ "strings"
)
// Load a certificate pool from a file and set it as the root CA for a TLS
@@ -40,9 +41,15 @@ func LoadCertPool(path string, tconf *tls.Config) error {
} else {
tconf.RootCAs = x509.NewCertPool()
}
- contents, err := ioutil.ReadFile(path)
- if err != nil {
- return err
+ var contents []byte
+ if strings.Contains(path, "-----BEGIN") {
+ contents = []byte(path)
+ } else {
+ var err error
+ contents, err = ioutil.ReadFile(path)
+ if err != nil {
+ return err
+ }
}
if !tconf.RootCAs.AppendCertsFromPEM(contents) {
return fmt.Errorf("no CA certificates in %s", path)
diff --git a/vendor/github.com/sassoftware/relic/lib/x509tools/digests.go b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/digests.go
similarity index 100%
rename from vendor/github.com/sassoftware/relic/lib/x509tools/digests.go
rename to vendor/github.com/sassoftware/relic/v8/lib/x509tools/digests.go
diff --git a/vendor/github.com/sassoftware/relic/lib/x509tools/ecdsa_curves.go b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/ecdsa_curves.go
similarity index 93%
rename from vendor/github.com/sassoftware/relic/lib/x509tools/ecdsa_curves.go
rename to vendor/github.com/sassoftware/relic/v8/lib/x509tools/ecdsa_curves.go
index 1e3a6fabc8..589a586ac2 100644
--- a/vendor/github.com/sassoftware/relic/lib/x509tools/ecdsa_curves.go
+++ b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/ecdsa_curves.go
@@ -164,7 +164,7 @@ func UnpackEcdsaSignature(packed []byte) (sig EcdsaSignature, err error) {
if len(packed) != byteLen*2 {
err = errors.New("ecdsa signature is incorrect size")
} else {
- sig.R = new(big.Int).SetBytes(packed[:byteLen])
+ sig.R = new(big.Int).SetBytes(packed[0:byteLen])
sig.S = new(big.Int).SetBytes(packed[byteLen:])
}
return
@@ -178,14 +178,15 @@ func (sig EcdsaSignature) Marshal() []byte {
// Pack an ECDSA signature by concatenating the two numbers per IEEE 1363
func (sig EcdsaSignature) Pack() []byte {
- rbytes := sig.R.Bytes()
- sbytes := sig.S.Bytes()
- byteLen := len(rbytes)
- if len(sbytes) > byteLen {
- byteLen = len(sbytes)
+ // allocate space to hold both numbers
+ nbits := sig.R.BitLen()
+ if s := sig.S.BitLen(); s > nbits {
+ nbits = s
}
- ret := make([]byte, byteLen*2)
- copy(ret[byteLen-len(rbytes):], rbytes)
- copy(ret[2*byteLen-len(sbytes):], sbytes)
+ nbytes := (nbits + 7) / 8
+ ret := make([]byte, 2*nbytes)
+ // serialize with padding
+ sig.R.FillBytes(ret[0:nbytes])
+ sig.S.FillBytes(ret[nbytes:])
return ret
}
diff --git a/vendor/github.com/sassoftware/relic/lib/x509tools/keylogfile.go b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/keylogfile.go
similarity index 100%
rename from vendor/github.com/sassoftware/relic/lib/x509tools/keylogfile.go
rename to vendor/github.com/sassoftware/relic/v8/lib/x509tools/keylogfile.go
diff --git a/vendor/github.com/sassoftware/relic/v8/lib/x509tools/names.go b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/names.go
new file mode 100644
index 0000000000..4b096c4a62
--- /dev/null
+++ b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/names.go
@@ -0,0 +1,199 @@
+//
+// Copyright (c) SAS Institute Inc.
+//
+// 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 x509tools
+
+import (
+ "crypto/x509"
+ "crypto/x509/pkix"
+ "encoding/asn1"
+ "encoding/binary"
+ "fmt"
+ "strings"
+ "unicode/utf16"
+)
+
+type NameStyle int
+
+const (
+ NameStyleOpenSsl NameStyle = iota
+ NameStyleLdap
+ NameStyleMsOsco
+)
+
+type attrName struct {
+ Type asn1.ObjectIdentifier
+ Name string
+}
+
+var nameStyleLdap = []attrName{
+ {asn1.ObjectIdentifier{2, 5, 4, 3}, "CN"},
+ {asn1.ObjectIdentifier{2, 5, 4, 4}, "surname"},
+ {asn1.ObjectIdentifier{2, 5, 4, 5}, "serialNumber"},
+ {asn1.ObjectIdentifier{2, 5, 4, 6}, "C"},
+ {asn1.ObjectIdentifier{2, 5, 4, 7}, "L"},
+ {asn1.ObjectIdentifier{2, 5, 4, 8}, "ST"},
+ {asn1.ObjectIdentifier{2, 5, 4, 9}, "street"},
+ {asn1.ObjectIdentifier{2, 5, 4, 10}, "O"},
+ {asn1.ObjectIdentifier{2, 5, 4, 11}, "OU"},
+ {asn1.ObjectIdentifier{2, 5, 4, 12}, "title"},
+ {asn1.ObjectIdentifier{2, 5, 4, 13}, "description"},
+ {asn1.ObjectIdentifier{2, 5, 4, 17}, "postalCode"},
+ {asn1.ObjectIdentifier{2, 5, 4, 18}, "postOfficeBox"},
+ {asn1.ObjectIdentifier{2, 5, 4, 20}, "telephoneNumber"},
+ {asn1.ObjectIdentifier{2, 5, 4, 42}, "givenName"},
+ {asn1.ObjectIdentifier{2, 5, 4, 43}, "initials"},
+ {asn1.ObjectIdentifier{0, 9, 2342, 19200300, 100, 1, 1}, "UID"},
+ {asn1.ObjectIdentifier{0, 9, 2342, 19200300, 100, 1, 25}, "dc"},
+ {asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, "emailAddress"},
+}
+
+// Per [MS-OSCO]
+// https://msdn.microsoft.com/en-us/library/dd947276(v=office.12).aspx
+var nameStyleMsOsco = []attrName{
+ {asn1.ObjectIdentifier{2, 5, 4, 3}, "CN"},
+ {asn1.ObjectIdentifier{2, 5, 4, 7}, "L"},
+ {asn1.ObjectIdentifier{2, 5, 4, 10}, "O"},
+ {asn1.ObjectIdentifier{2, 5, 4, 11}, "OU"},
+ {asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, "E"},
+ {asn1.ObjectIdentifier{2, 5, 4, 6}, "C"},
+ {asn1.ObjectIdentifier{2, 5, 4, 8}, "S"},
+ {asn1.ObjectIdentifier{2, 5, 4, 9}, "STREET"},
+ {asn1.ObjectIdentifier{2, 5, 4, 12}, "T"},
+ {asn1.ObjectIdentifier{2, 5, 4, 42}, "G"},
+ {asn1.ObjectIdentifier{2, 5, 4, 43}, "I"},
+ {asn1.ObjectIdentifier{2, 5, 4, 4}, "SN"},
+ {asn1.ObjectIdentifier{2, 5, 4, 5}, "SERIALNUMBER"},
+ {asn1.ObjectIdentifier{0, 9, 2342, 19200300, 100, 1, 1}, "UID"},
+ {asn1.ObjectIdentifier{0, 9, 2342, 19200300, 100, 1, 25}, "DC"},
+ {asn1.ObjectIdentifier{2, 5, 4, 13}, "Description"},
+ {asn1.ObjectIdentifier{2, 5, 4, 17}, "PostalCode"},
+ {asn1.ObjectIdentifier{2, 5, 4, 18}, "POBox"},
+ {asn1.ObjectIdentifier{2, 5, 4, 20}, "Phone"},
+}
+
+// returned by the Format* functions in case there's something cripplingly
+// wrong with it
+const InvalidName = ""
+
+// Format the name (RDN sequence) from its raw DER to a readable style.
+func FormatPkixName(der []byte, style NameStyle) string {
+ var seq pkix.RDNSequence
+ if _, err := asn1.Unmarshal(der, &seq); err != nil {
+ return InvalidName
+ }
+ var b strings.Builder
+ if style == NameStyleOpenSsl {
+ for _, rdnSet := range seq {
+ for _, attr := range rdnSet {
+ b.WriteByte('/')
+ b.WriteString(attName(attr.Type, style))
+ b.WriteByte('=')
+ b.WriteString(attValue(attr.Value, style))
+ }
+ }
+ } else {
+ // Per RFC 2253 2.1, reverse the order
+ for i := len(seq) - 1; i >= 0; i-- {
+ if i < len(seq)-1 {
+ b.WriteString(", ")
+ }
+ rdnSet := seq[i]
+ for j, attr := range rdnSet {
+ if j > 0 {
+ b.WriteString(" + ")
+ }
+ b.WriteString(attName(attr.Type, style))
+ b.WriteByte('=')
+ b.WriteString(attValue(attr.Value, style))
+ }
+ }
+ }
+ return b.String()
+}
+
+func attName(t asn1.ObjectIdentifier, style NameStyle) string {
+ var names []attrName
+ var defaultPrefix string
+ switch style {
+ case NameStyleLdap, NameStyleOpenSsl:
+ names = nameStyleLdap
+ case NameStyleMsOsco:
+ names = nameStyleMsOsco
+ defaultPrefix = "OID."
+ default:
+ panic("invalid style argument")
+ }
+ for _, name := range names {
+ if name.Type.Equal(t) {
+ return name.Name
+ }
+ }
+ return defaultPrefix + t.String()
+}
+
+func attValue(raw interface{}, style NameStyle) string {
+ var value string
+ switch v := raw.(type) {
+ case string:
+ value = v
+ case fmt.Stringer:
+ value = v.String()
+ case int64:
+ value = fmt.Sprint(v)
+ default:
+ return InvalidName
+ }
+ switch style {
+ case NameStyleOpenSsl:
+ value = strings.ReplaceAll(value, "/", "\\/")
+ case NameStyleLdap, NameStyleMsOsco:
+ quote := false
+ if len(value) == 0 {
+ quote = true
+ }
+ if strings.HasPrefix(value, " ") || strings.HasSuffix(value, " ") {
+ quote = true
+ }
+ if i := strings.IndexAny(value, ",+=\n<>#;'\""); i >= 0 {
+ quote = true
+ }
+ value = strings.ReplaceAll(value, "\"", "\"\"")
+ if quote {
+ value = "\"" + value + "\""
+ }
+ }
+ return value
+}
+
+func ToBMPString(value string) asn1.RawValue {
+ runes := utf16.Encode([]rune(value))
+ raw := make([]byte, 2*len(runes))
+ for i, r := range runes {
+ binary.BigEndian.PutUint16(raw[i*2:], r)
+ }
+ return asn1.RawValue{Tag: asn1.TagBMPString, Bytes: raw}
+}
+
+// Format the certificate subject name in LDAP style
+func FormatSubject(cert *x509.Certificate) string {
+ return FormatPkixName(cert.RawSubject, NameStyleLdap)
+}
+
+// Format the certificate issuer name in LDAP style
+func FormatIssuer(cert *x509.Certificate) string {
+ return FormatPkixName(cert.RawIssuer, NameStyleLdap)
+}
diff --git a/vendor/github.com/sassoftware/relic/lib/x509tools/pkix.go b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/pkix.go
similarity index 94%
rename from vendor/github.com/sassoftware/relic/lib/x509tools/pkix.go
rename to vendor/github.com/sassoftware/relic/v8/lib/x509tools/pkix.go
index 691c189b3e..e436571619 100644
--- a/vendor/github.com/sassoftware/relic/lib/x509tools/pkix.go
+++ b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/pkix.go
@@ -33,7 +33,6 @@ var (
OidPublicKeyDSA = asn1.ObjectIdentifier{1, 2, 840, 10040, 4, 1}
OidPublicKeyECDSA = asn1.ObjectIdentifier{1, 2, 840, 10045, 2, 1}
- oidSignatureMD2WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 2}
oidSignatureMD5WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 4}
oidSignatureSHA1WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5}
oidSignatureSHA256WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 11}
@@ -51,7 +50,12 @@ var (
OidMGF1 = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 8}
OidSignatureRSAPSS = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 10}
- Asn1TagBMPString = 30
+ oidExtensionSubjectKeyId = asn1.ObjectIdentifier{2, 5, 29, 14}
+ oidExtensionKeyUsage = asn1.ObjectIdentifier{2, 5, 29, 15}
+ oidExtensionSubjectAltName = asn1.ObjectIdentifier{2, 5, 29, 17}
+ oidExtensionBasicConstraints = asn1.ObjectIdentifier{2, 5, 29, 19}
+ oidExtensionAuthorityKeyId = asn1.ObjectIdentifier{2, 5, 29, 35}
+ oidExtensionExtendedKeyUsage = asn1.ObjectIdentifier{2, 5, 29, 37}
)
type sigAlgInfo struct {
diff --git a/vendor/github.com/sassoftware/relic/lib/x509tools/printcert.go b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/printcert.go
similarity index 100%
rename from vendor/github.com/sassoftware/relic/lib/x509tools/printcert.go
rename to vendor/github.com/sassoftware/relic/v8/lib/x509tools/printcert.go
diff --git a/vendor/github.com/sassoftware/relic/lib/x509tools/rsapss.go b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/rsapss.go
similarity index 100%
rename from vendor/github.com/sassoftware/relic/lib/x509tools/rsapss.go
rename to vendor/github.com/sassoftware/relic/v8/lib/x509tools/rsapss.go
diff --git a/vendor/github.com/sassoftware/relic/lib/x509tools/util.go b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/util.go
similarity index 93%
rename from vendor/github.com/sassoftware/relic/lib/x509tools/util.go
rename to vendor/github.com/sassoftware/relic/v8/lib/x509tools/util.go
index c26e5a5de1..3bd5d9cf90 100644
--- a/vendor/github.com/sassoftware/relic/lib/x509tools/util.go
+++ b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/util.go
@@ -19,6 +19,7 @@ package x509tools
import (
"crypto"
"crypto/ecdsa"
+ "crypto/elliptic"
"crypto/rand"
"crypto/rsa"
"crypto/sha1"
@@ -34,20 +35,28 @@ import (
func MakeSerial() *big.Int {
blob := make([]byte, 12)
if _, err := io.ReadFull(rand.Reader, blob); err != nil {
- return nil
+ panic(err)
}
return new(big.Int).SetBytes(blob)
}
// Choose a X509 signature algorithm suitable for the specified public key
func X509SignatureAlgorithm(pub crypto.PublicKey) x509.SignatureAlgorithm {
- switch pub.(type) {
+ switch k := pub.(type) {
case *rsa.PublicKey:
if ArgRSAPSS {
return x509.SHA256WithRSAPSS
}
return x509.SHA256WithRSA
case *ecdsa.PublicKey:
+ switch k.Curve {
+ case elliptic.P256():
+ return x509.ECDSAWithSHA256
+ case elliptic.P384():
+ return x509.ECDSAWithSHA384
+ case elliptic.P521():
+ return x509.ECDSAWithSHA512
+ }
return x509.ECDSAWithSHA256
default:
return x509.UnknownSignatureAlgorithm
diff --git a/vendor/github.com/sassoftware/relic/lib/x509tools/x509cmd.go b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/x509cmd.go
similarity index 76%
rename from vendor/github.com/sassoftware/relic/lib/x509tools/x509cmd.go
rename to vendor/github.com/sassoftware/relic/v8/lib/x509tools/x509cmd.go
index ee89eec72b..bdcb6e2df1 100644
--- a/vendor/github.com/sassoftware/relic/lib/x509tools/x509cmd.go
+++ b/vendor/github.com/sassoftware/relic/v8/lib/x509tools/x509cmd.go
@@ -19,7 +19,10 @@ package x509tools
import (
"bytes"
"crypto"
+ "crypto/ecdsa"
+ "crypto/ed25519"
"crypto/rand"
+ "crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
@@ -32,7 +35,7 @@ import (
"time"
"github.com/spf13/cobra"
- "golang.org/x/crypto/ssh/terminal"
+ "golang.org/x/term"
)
var (
@@ -80,7 +83,7 @@ func splitAndTrim(s string) []string {
if s == "" {
return nil
}
- s = strings.Replace(s, ",", " ", -1)
+ s = strings.ReplaceAll(s, ",", " ")
pieces := strings.Split(s, " ")
ret := make([]string, 0, len(pieces))
for _, p := range pieces {
@@ -222,15 +225,30 @@ func SignCSR(csrBytes []byte, rand io.Reader, key crypto.Signer, cacert *x509.Ce
}
csr, err := x509.ParseCertificateRequest(csrBytes)
if err != nil {
- return "", fmt.Errorf("parsing CSR: %s", err)
+ return "", fmt.Errorf("parsing CSR: %w", err)
}
if err := csr.CheckSignature(); err != nil {
- return "", fmt.Errorf("validating CSR: %s", err)
+ return "", fmt.Errorf("validating CSR: %w", err)
}
// update fields
template := &x509.Certificate{Subject: csr.Subject}
if copyExtensions {
- template.ExtraExtensions = csr.Extensions
+ // drop CSR extensions that are overridden or merged with our args
+ for _, ex := range csr.Extensions {
+ switch {
+ case ArgCertAuthority && ex.Id.Equal(oidExtensionBasicConstraints):
+ // arg has set CA constraint
+ case ArgKeyUsage != "" && (ex.Id.Equal(oidExtensionKeyUsage) || ex.Id.Equal(oidExtensionExtendedKeyUsage)):
+ // arg has set key usage
+ case ex.Id.Equal(oidExtensionSubjectKeyId) || ex.Id.Equal(oidExtensionAuthorityKeyId):
+ // we always set this
+ case ex.Id.Equal(oidExtensionSubjectAltName):
+ // these are copied piecemeal below
+ default:
+ // copy the extension as-is
+ template.ExtraExtensions = append(template.ExtraExtensions, ex)
+ }
+ }
template.DNSNames = csr.DNSNames
template.EmailAddresses = csr.EmailAddresses
template.IPAddresses = csr.IPAddresses
@@ -255,7 +273,7 @@ func CrossSign(certBytes []byte, rand io.Reader, key crypto.Signer, cacert *x509
}
template, err := x509.ParseCertificate(certBytes)
if err != nil {
- return "", fmt.Errorf("parsing certificate: %s", err)
+ return "", fmt.Errorf("parsing certificate: %w", err)
}
if err := fillCertFields(template, template.PublicKey, key.Public()); err != nil {
return "", err
@@ -267,50 +285,74 @@ func CrossSign(certBytes []byte, rand io.Reader, key crypto.Signer, cacert *x509
return toPemString(newCert, "CERTIFICATE"), nil
}
-type fakeSigner struct{ pub crypto.PublicKey }
-
-func (f fakeSigner) Public() crypto.PublicKey {
- return f.pub
-}
-
-func (f fakeSigner) Sign(io.Reader, []byte, crypto.SignerOpts) ([]byte, error) {
- return nil, nil
-}
-
-func confirmAndCreate(template, parent *x509.Certificate, pub crypto.PublicKey, priv crypto.PrivateKey) ([]byte, error) {
+func confirmAndCreate(template, parent *x509.Certificate, leafPub crypto.PublicKey, issuerPriv crypto.PrivateKey) ([]byte, error) {
if ArgInteractive {
- // call CreateCertificate with a fake signer to get what the final cert will look like
- pub := priv.(crypto.Signer).Public()
- der, err := x509.CreateCertificate(rand.Reader, template, parent, pub, fakeSigner{pub})
- if err != nil {
- return nil, err
+ origSigner, ok := issuerPriv.(crypto.Signer)
+ if !ok {
+ return nil, errors.New("private key must satisfy crypto.Signer")
}
- cert, err := x509.ParseCertificate(der)
+ ok, err := confirmCertificate(template, parent, leafPub, origSigner.Public())
if err != nil {
- return nil, err
- }
- fmt.Fprintln(os.Stderr, "Signing certificate:")
- fmt.Fprintln(os.Stderr)
- FprintCertificate(os.Stderr, cert)
- fmt.Fprintln(os.Stderr)
- if !promptYN("Sign this cert? [Y/n] ") {
+ return nil, fmt.Errorf("mocking cert for interactive confirmation: %w", err)
+ } else if !ok {
fmt.Fprintln(os.Stderr, "operation canceled")
os.Exit(2)
}
}
- return x509.CreateCertificate(rand.Reader, template, parent, pub, priv)
+ return x509.CreateCertificate(rand.Reader, template, parent, leafPub, issuerPriv)
+}
+
+func confirmCertificate(template, parent *x509.Certificate, leafPub, origSigner crypto.PublicKey) (bool, error) {
+ // generate a key with the same parameters as the real signer
+ fakePriv, err := generateAlike(origSigner)
+ if err != nil {
+ return false, err
+ }
+ // mangle parent cert
+ fakeParent := new(x509.Certificate)
+ *fakeParent = *parent
+ fakeParent.PublicKey = fakePriv.Public()
+ // call CreateCertificate with a fake signer to get what the final cert will look like
+ der, err := x509.CreateCertificate(rand.Reader, template, fakeParent, leafPub, fakePriv)
+ if err != nil {
+ return false, err
+ }
+ cert, err := x509.ParseCertificate(der)
+ if err != nil {
+ return false, err
+ }
+ fmt.Fprintln(os.Stderr, "Signing certificate:")
+ fmt.Fprintln(os.Stderr)
+ FprintCertificate(os.Stderr, cert)
+ fmt.Fprintln(os.Stderr)
+ return promptYN("Sign this cert? [Y/n] "), nil
+}
+
+func generateAlike(pub crypto.PublicKey) (crypto.Signer, error) {
+ // generate a dummy key of the same type as pub
+ switch pub := pub.(type) {
+ case *rsa.PublicKey:
+ return rsa.GenerateKey(rand.Reader, 1024)
+ case *ecdsa.PublicKey:
+ return ecdsa.GenerateKey(pub.Curve, rand.Reader)
+ case ed25519.PublicKey:
+ _, priv, err := ed25519.GenerateKey(rand.Reader)
+ return priv, err
+ default:
+ return nil, fmt.Errorf("unrecognized key type %T", pub)
+ }
}
func promptYN(prompt string) bool {
fmt.Fprint(os.Stderr, prompt)
- if !terminal.IsTerminal(0) {
+ if !term.IsTerminal(0) {
fmt.Fprintln(os.Stderr, "input is not a terminal, assuming true")
return true
}
- state, err := terminal.MakeRaw(0)
+ state, err := term.MakeRaw(0)
if err == nil {
defer fmt.Fprintln(os.Stderr)
- defer terminal.Restore(0, state)
+ defer func() { _ = term.Restore(0, state) }()
}
var d [1]byte
if _, err := os.Stdin.Read(d[:]); err != nil {
diff --git a/vendor/github.com/sassoftware/relic/v8/signers/sigerrors/errors.go b/vendor/github.com/sassoftware/relic/v8/signers/sigerrors/errors.go
new file mode 100644
index 0000000000..28e1af37d3
--- /dev/null
+++ b/vendor/github.com/sassoftware/relic/v8/signers/sigerrors/errors.go
@@ -0,0 +1,53 @@
+//
+// Copyright (c) SAS Institute Inc.
+//
+// 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 sigerrors
+
+import (
+ "errors"
+)
+
+var (
+ ErrExist = errors.New("object already exists in token")
+)
+
+type KeyNotFoundError struct{}
+
+func (KeyNotFoundError) Error() string {
+ return "No object found in token with the specified label"
+}
+
+type PinIncorrectError struct{}
+
+func (PinIncorrectError) Error() string {
+ return "The entered PIN was incorrect"
+}
+
+type ErrNoCertificate struct {
+ Type string
+}
+
+func (e ErrNoCertificate) Error() string {
+ return "no certificate of type \"" + e.Type + "\" defined for this key"
+}
+
+type NotSignedError struct {
+ Type string
+}
+
+func (e NotSignedError) Error() string {
+ return e.Type + " contains no signatures"
+}
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/create_log_entry_parameters.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/create_log_entry_parameters.go
index 5a7418e535..acb0df52ee 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/create_log_entry_parameters.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/create_log_entry_parameters.go
@@ -27,7 +27,6 @@ import (
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
-
"github.com/sigstore/rekor/pkg/generated/models"
)
@@ -38,24 +37,28 @@ import (
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewCreateLogEntryParams() *CreateLogEntryParams {
- return &CreateLogEntryParams{
- timeout: cr.DefaultTimeout,
- }
+ return NewCreateLogEntryParamsWithTimeout(cr.DefaultTimeout)
}
// NewCreateLogEntryParamsWithTimeout creates a new CreateLogEntryParams object
// with the ability to set a timeout on a request.
func NewCreateLogEntryParamsWithTimeout(timeout time.Duration) *CreateLogEntryParams {
return &CreateLogEntryParams{
- timeout: timeout,
+ inner: innerParams{
+ timeout: timeout,
+ },
}
}
// NewCreateLogEntryParamsWithContext creates a new CreateLogEntryParams object
// with the ability to set a context for a request.
+//
+// Deprecated: use the operation call with context to pass the context instead of [CreateLogEntryParams].
func NewCreateLogEntryParamsWithContext(ctx context.Context) *CreateLogEntryParams {
return &CreateLogEntryParams{
- Context: ctx,
+ inner: innerParams{
+ ctx: ctx,
+ },
}
}
@@ -79,9 +82,9 @@ type CreateLogEntryParams struct {
// ProposedEntry.
ProposedEntry models.ProposedEntry
- timeout time.Duration
- Context context.Context
HTTPClient *http.Client
+
+ inner innerParams
}
// WithDefaults hydrates default values in the create log entry params (not the query body).
@@ -99,54 +102,57 @@ func (o *CreateLogEntryParams) SetDefaults() {
// no default values defined for this parameter
}
-// WithTimeout adds the timeout to the create log entry params
+// WithTimeout adds the timeout to the create log entry params.
func (o *CreateLogEntryParams) WithTimeout(timeout time.Duration) *CreateLogEntryParams {
o.SetTimeout(timeout)
return o
}
-// SetTimeout adds the timeout to the create log entry params
+// SetTimeout adds the timeout to the create log entry params.
func (o *CreateLogEntryParams) SetTimeout(timeout time.Duration) {
- o.timeout = timeout
+ o.inner.timeout = timeout
}
-// WithContext adds the context to the create log entry params
+// WithContext adds the context to the create log entry params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [CreateLogEntryParams].
func (o *CreateLogEntryParams) WithContext(ctx context.Context) *CreateLogEntryParams {
o.SetContext(ctx)
return o
}
-// SetContext adds the context to the create log entry params
+// SetContext adds the context to the create log entry params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [CreateLogEntryParams].
func (o *CreateLogEntryParams) SetContext(ctx context.Context) {
- o.Context = ctx
+ o.inner.ctx = ctx
}
-// WithHTTPClient adds the HTTPClient to the create log entry params
+// WithHTTPClient adds the HTTPClient to the create log entry params.
func (o *CreateLogEntryParams) WithHTTPClient(client *http.Client) *CreateLogEntryParams {
o.SetHTTPClient(client)
return o
}
-// SetHTTPClient adds the HTTPClient to the create log entry params
+// SetHTTPClient adds the HTTPClient to the create log entry params.
func (o *CreateLogEntryParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
-// WithProposedEntry adds the proposedEntry to the create log entry params
+// WithProposedEntry adds the proposedEntry to the create log entry params.
func (o *CreateLogEntryParams) WithProposedEntry(proposedEntry models.ProposedEntry) *CreateLogEntryParams {
o.SetProposedEntry(proposedEntry)
return o
}
-// SetProposedEntry adds the proposedEntry to the create log entry params
+// SetProposedEntry adds the proposedEntry to the create log entry params.
func (o *CreateLogEntryParams) SetProposedEntry(proposedEntry models.ProposedEntry) {
o.ProposedEntry = proposedEntry
}
-// WriteToRequest writes these params to a swagger request
+// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *CreateLogEntryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
-
- if err := r.SetTimeout(o.timeout); err != nil {
+ if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/create_log_entry_responses.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/create_log_entry_responses.go
index 198047ed0c..43983e2c58 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/create_log_entry_responses.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/create_log_entry_responses.go
@@ -27,7 +27,6 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
-
"github.com/sigstore/rekor/pkg/generated/models"
)
@@ -74,21 +73,17 @@ func NewCreateLogEntryCreated() *CreateLogEntryCreated {
return &CreateLogEntryCreated{}
}
-/*
-CreateLogEntryCreated describes a response with status code 201, with default header values.
-
-Returns the entry created in the transparency log
-*/
+// CreateLogEntryCreated describes a response with status code 201, with default header values.
+//
+// Returns the entry created in the transparency log
type CreateLogEntryCreated struct {
- /* UUID of log entry
- */
+ // UUID of log entry
ETag string
- /* URI location of log entry
-
- Format: uri
- */
+ // URI location of log entry
+ //
+ // Format: uri
Location strfmt.URI
Payload models.LogEntry
@@ -171,11 +166,9 @@ func NewCreateLogEntryBadRequest() *CreateLogEntryBadRequest {
return &CreateLogEntryBadRequest{}
}
-/*
-CreateLogEntryBadRequest describes a response with status code 400, with default header values.
-
-The content supplied to the server was invalid
-*/
+// CreateLogEntryBadRequest describes a response with status code 400, with default header values.
+//
+// The content supplied to the server was invalid
type CreateLogEntryBadRequest struct {
Payload *models.Error
}
@@ -241,11 +234,9 @@ func NewCreateLogEntryConflict() *CreateLogEntryConflict {
return &CreateLogEntryConflict{}
}
-/*
-CreateLogEntryConflict describes a response with status code 409, with default header values.
-
-The request conflicts with the current state of the transparency log
-*/
+// CreateLogEntryConflict describes a response with status code 409, with default header values.
+//
+// The request conflicts with the current state of the transparency log
type CreateLogEntryConflict struct {
Location strfmt.URI
@@ -326,11 +317,9 @@ func NewCreateLogEntryDefault(code int) *CreateLogEntryDefault {
}
}
-/*
-CreateLogEntryDefault describes a response with status code -1, with default header values.
-
-There was an internal error in the server while processing the request
-*/
+// CreateLogEntryDefault describes a response with status code -1, with default header values.
+//
+// There was an internal error in the server while processing the request
type CreateLogEntryDefault struct {
_statusCode int
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/entries_client.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/entries_client.go
index 713b0ef671..3d17756cb1 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/entries_client.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/entries_client.go
@@ -19,17 +19,21 @@
package entries
import (
+ "context"
+ "time"
+
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// New creates a new entries API client.
-func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
+func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
// New creates a new entries API client with basic auth credentials.
+//
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
@@ -43,6 +47,7 @@ func NewClientWithBasicAuth(host, basePath, scheme, user, password string) Clien
}
// New creates a new entries API client with a bearer token for authentication.
+//
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
@@ -54,40 +59,77 @@ func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) Client
return &Client{transport: transport, formats: strfmt.Default}
}
-/*
-Client for entries API
-*/
+// Client for entries API.
type Client struct {
- transport runtime.ClientTransport
+ transport runtime.ContextualTransport
formats strfmt.Registry
}
// ClientOption may be used to customize the behavior of Client methods.
type ClientOption func(*runtime.ClientOperation)
-// ClientService is the interface for Client methods
+// ClientService is the interface for Client methods.
type ClientService interface {
+
+ // CreateLogEntry creates an entry in the transparency log.
CreateLogEntry(params *CreateLogEntryParams, opts ...ClientOption) (*CreateLogEntryCreated, error)
+ // CreateLogEntryContext creates an entry in the transparency log.
+ CreateLogEntryContext(ctx context.Context, params *CreateLogEntryParams, opts ...ClientOption) (*CreateLogEntryCreated, error)
+
+ // GetLogEntryByIndex retrieves an entry and inclusion proof from the transparency log if it exists by index.
GetLogEntryByIndex(params *GetLogEntryByIndexParams, opts ...ClientOption) (*GetLogEntryByIndexOK, error)
+ // GetLogEntryByIndexContext retrieves an entry and inclusion proof from the transparency log if it exists by index.
+ GetLogEntryByIndexContext(ctx context.Context, params *GetLogEntryByIndexParams, opts ...ClientOption) (*GetLogEntryByIndexOK, error)
+
+ // GetLogEntryByUUID get log entry and information required to generate an inclusion proof for the entry in the transparency log.
GetLogEntryByUUID(params *GetLogEntryByUUIDParams, opts ...ClientOption) (*GetLogEntryByUUIDOK, error)
+ // GetLogEntryByUUIDContext get log entry and information required to generate an inclusion proof for the entry in the transparency log.
+ GetLogEntryByUUIDContext(ctx context.Context, params *GetLogEntryByUUIDParams, opts ...ClientOption) (*GetLogEntryByUUIDOK, error)
+
+ // SearchLogQuery searches transparency log for one or more log entries.
SearchLogQuery(params *SearchLogQueryParams, opts ...ClientOption) (*SearchLogQueryOK, error)
- SetTransport(transport runtime.ClientTransport)
-}
+ // SearchLogQueryContext searches transparency log for one or more log entries.
+ SearchLogQueryContext(ctx context.Context, params *SearchLogQueryParams, opts ...ClientOption) (*SearchLogQueryOK, error)
-/*
-CreateLogEntry creates an entry in the transparency log
+ SetTransport(transport runtime.ContextualTransport)
+}
-Creates an entry in the transparency log for a detached signature, public key, and content.
-*/
+// CreateLogEntry creates an entry in the transparency log.
+//
+// Creates an entry in the transparency log for a detached signature, public key, and content.
+// .
+//
+// This method does not support injected context.
+// However, timeout and opentracing contexts are honored whenever enabled.
+//
+// If you need to pass a specific context, use [Client.CreateLogEntryContext] instead.
func (a *Client) CreateLogEntry(params *CreateLogEntryParams, opts ...ClientOption) (*CreateLogEntryCreated, error) {
+ var ctx context.Context
+ if params != nil && params.inner.ctx != nil {
+ ctx = params.inner.ctx
+ } else {
+ ctx = context.Background()
+ }
+
+ return a.CreateLogEntryContext(ctx, params, opts...)
+}
+
+// CreateLogEntryContext creates an entry in the transparency log.
+//
+// Creates an entry in the transparency log for a detached signature, public key, and content.
+// .
+//
+// Do not use the deprecated [CreateLogEntryParams.Context] with this method: it would be ignored.
+func (a *Client) CreateLogEntryContext(ctx context.Context, params *CreateLogEntryParams, opts ...ClientOption) (*CreateLogEntryCreated, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewCreateLogEntryParams()
}
+
op := &runtime.ClientOperation{
ID: "createLogEntry",
Method: "POST",
@@ -97,13 +139,14 @@ func (a *Client) CreateLogEntry(params *CreateLogEntryParams, opts ...ClientOpti
Schemes: []string{"http"},
Params: params,
Reader: &CreateLogEntryReader{formats: a.formats},
- Context: params.Context,
Client: params.HTTPClient,
}
+
for _, opt := range opts {
opt(op)
}
- result, err := a.transport.Submit(op)
+
+ result, err := a.transport.SubmitContext(ctx, op)
if err != nil {
return nil, err
}
@@ -122,14 +165,32 @@ func (a *Client) CreateLogEntry(params *CreateLogEntryParams, opts ...ClientOpti
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
-/*
-GetLogEntryByIndex retrieves an entry and inclusion proof from the transparency log if it exists by index
-*/
+// GetLogEntryByIndex retrieves an entry and inclusion proof from the transparency log if it exists by index.
+//
+// This method does not support injected context.
+// However, timeout and opentracing contexts are honored whenever enabled.
+//
+// If you need to pass a specific context, use [Client.GetLogEntryByIndexContext] instead.
func (a *Client) GetLogEntryByIndex(params *GetLogEntryByIndexParams, opts ...ClientOption) (*GetLogEntryByIndexOK, error) {
+ var ctx context.Context
+ if params != nil && params.inner.ctx != nil {
+ ctx = params.inner.ctx
+ } else {
+ ctx = context.Background()
+ }
+
+ return a.GetLogEntryByIndexContext(ctx, params, opts...)
+}
+
+// GetLogEntryByIndexContext retrieves an entry and inclusion proof from the transparency log if it exists by index.
+//
+// Do not use the deprecated [GetLogEntryByIndexParams.Context] with this method: it would be ignored.
+func (a *Client) GetLogEntryByIndexContext(ctx context.Context, params *GetLogEntryByIndexParams, opts ...ClientOption) (*GetLogEntryByIndexOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewGetLogEntryByIndexParams()
}
+
op := &runtime.ClientOperation{
ID: "getLogEntryByIndex",
Method: "GET",
@@ -139,13 +200,14 @@ func (a *Client) GetLogEntryByIndex(params *GetLogEntryByIndexParams, opts ...Cl
Schemes: []string{"http"},
Params: params,
Reader: &GetLogEntryByIndexReader{formats: a.formats},
- Context: params.Context,
Client: params.HTTPClient,
}
+
for _, opt := range opts {
opt(op)
}
- result, err := a.transport.Submit(op)
+
+ result, err := a.transport.SubmitContext(ctx, op)
if err != nil {
return nil, err
}
@@ -164,16 +226,36 @@ func (a *Client) GetLogEntryByIndex(params *GetLogEntryByIndexParams, opts ...Cl
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
-/*
-GetLogEntryByUUID gets log entry and information required to generate an inclusion proof for the entry in the transparency log
-
-Returns the entry, root hash, tree size, and a list of hashes that can be used to calculate proof of an entry being included in the transparency log
-*/
+// GetLogEntryByUUID gets log entry and information required to generate an inclusion proof for the entry in the transparency log.
+//
+// Returns the entry, root hash, tree size, and a list of hashes that can be used to calculate proof of an entry being included in the transparency log.
+//
+// This method does not support injected context.
+// However, timeout and opentracing contexts are honored whenever enabled.
+//
+// If you need to pass a specific context, use [Client.GetLogEntryByUUIDContext] instead.
func (a *Client) GetLogEntryByUUID(params *GetLogEntryByUUIDParams, opts ...ClientOption) (*GetLogEntryByUUIDOK, error) {
+ var ctx context.Context
+ if params != nil && params.inner.ctx != nil {
+ ctx = params.inner.ctx
+ } else {
+ ctx = context.Background()
+ }
+
+ return a.GetLogEntryByUUIDContext(ctx, params, opts...)
+}
+
+// GetLogEntryByUUIDContext gets log entry and information required to generate an inclusion proof for the entry in the transparency log.
+//
+// Returns the entry, root hash, tree size, and a list of hashes that can be used to calculate proof of an entry being included in the transparency log.
+//
+// Do not use the deprecated [GetLogEntryByUUIDParams.Context] with this method: it would be ignored.
+func (a *Client) GetLogEntryByUUIDContext(ctx context.Context, params *GetLogEntryByUUIDParams, opts ...ClientOption) (*GetLogEntryByUUIDOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewGetLogEntryByUUIDParams()
}
+
op := &runtime.ClientOperation{
ID: "getLogEntryByUUID",
Method: "GET",
@@ -183,13 +265,14 @@ func (a *Client) GetLogEntryByUUID(params *GetLogEntryByUUIDParams, opts ...Clie
Schemes: []string{"http"},
Params: params,
Reader: &GetLogEntryByUUIDReader{formats: a.formats},
- Context: params.Context,
Client: params.HTTPClient,
}
+
for _, opt := range opts {
opt(op)
}
- result, err := a.transport.Submit(op)
+
+ result, err := a.transport.SubmitContext(ctx, op)
if err != nil {
return nil, err
}
@@ -208,14 +291,32 @@ func (a *Client) GetLogEntryByUUID(params *GetLogEntryByUUIDParams, opts ...Clie
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
-/*
-SearchLogQuery searches transparency log for one or more log entries
-*/
+// SearchLogQuery searches transparency log for one or more log entries.
+//
+// This method does not support injected context.
+// However, timeout and opentracing contexts are honored whenever enabled.
+//
+// If you need to pass a specific context, use [Client.SearchLogQueryContext] instead.
func (a *Client) SearchLogQuery(params *SearchLogQueryParams, opts ...ClientOption) (*SearchLogQueryOK, error) {
+ var ctx context.Context
+ if params != nil && params.inner.ctx != nil {
+ ctx = params.inner.ctx
+ } else {
+ ctx = context.Background()
+ }
+
+ return a.SearchLogQueryContext(ctx, params, opts...)
+}
+
+// SearchLogQueryContext searches transparency log for one or more log entries.
+//
+// Do not use the deprecated [SearchLogQueryParams.Context] with this method: it would be ignored.
+func (a *Client) SearchLogQueryContext(ctx context.Context, params *SearchLogQueryParams, opts ...ClientOption) (*SearchLogQueryOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewSearchLogQueryParams()
}
+
op := &runtime.ClientOperation{
ID: "searchLogQuery",
Method: "POST",
@@ -225,13 +326,14 @@ func (a *Client) SearchLogQuery(params *SearchLogQueryParams, opts ...ClientOpti
Schemes: []string{"http"},
Params: params,
Reader: &SearchLogQueryReader{formats: a.formats},
- Context: params.Context,
Client: params.HTTPClient,
}
+
for _, opt := range opts {
opt(op)
}
- result, err := a.transport.Submit(op)
+
+ result, err := a.transport.SubmitContext(ctx, op)
if err != nil {
return nil, err
}
@@ -251,6 +353,14 @@ func (a *Client) SearchLogQuery(params *SearchLogQueryParams, opts ...ClientOpti
}
// SetTransport changes the transport on the client
-func (a *Client) SetTransport(transport runtime.ClientTransport) {
+func (a *Client) SetTransport(transport runtime.ContextualTransport) {
a.transport = transport
}
+
+// innerParams captures internal fields so they don't conflict with user-supplied parameters.
+type innerParams struct {
+ timeout time.Duration
+
+ // Deprecated: use the operation call with context to pass the context instead of [EntriesParams].
+ ctx context.Context
+}
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_index_parameters.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_index_parameters.go
index 8ec6c28042..2d4b319f5b 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_index_parameters.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_index_parameters.go
@@ -27,7 +27,7 @@ import (
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/conv"
)
// NewGetLogEntryByIndexParams creates a new GetLogEntryByIndexParams object,
@@ -37,24 +37,28 @@ import (
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetLogEntryByIndexParams() *GetLogEntryByIndexParams {
- return &GetLogEntryByIndexParams{
- timeout: cr.DefaultTimeout,
- }
+ return NewGetLogEntryByIndexParamsWithTimeout(cr.DefaultTimeout)
}
// NewGetLogEntryByIndexParamsWithTimeout creates a new GetLogEntryByIndexParams object
// with the ability to set a timeout on a request.
func NewGetLogEntryByIndexParamsWithTimeout(timeout time.Duration) *GetLogEntryByIndexParams {
return &GetLogEntryByIndexParams{
- timeout: timeout,
+ inner: innerParams{
+ timeout: timeout,
+ },
}
}
// NewGetLogEntryByIndexParamsWithContext creates a new GetLogEntryByIndexParams object
// with the ability to set a context for a request.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetLogEntryByIndexParams].
func NewGetLogEntryByIndexParamsWithContext(ctx context.Context) *GetLogEntryByIndexParams {
return &GetLogEntryByIndexParams{
- Context: ctx,
+ inner: innerParams{
+ ctx: ctx,
+ },
}
}
@@ -75,15 +79,14 @@ GetLogEntryByIndexParams contains all the parameters to send to the API endpoint
*/
type GetLogEntryByIndexParams struct {
- /* LogIndex.
-
- specifies the index of the entry in the transparency log to be retrieved
- */
+ // LogIndex.
+ //
+ // specifies the index of the entry in the transparency log to be retrieved
LogIndex int64
- timeout time.Duration
- Context context.Context
HTTPClient *http.Client
+
+ inner innerParams
}
// WithDefaults hydrates default values in the get log entry by index params (not the query body).
@@ -101,61 +104,64 @@ func (o *GetLogEntryByIndexParams) SetDefaults() {
// no default values defined for this parameter
}
-// WithTimeout adds the timeout to the get log entry by index params
+// WithTimeout adds the timeout to the get log entry by index params.
func (o *GetLogEntryByIndexParams) WithTimeout(timeout time.Duration) *GetLogEntryByIndexParams {
o.SetTimeout(timeout)
return o
}
-// SetTimeout adds the timeout to the get log entry by index params
+// SetTimeout adds the timeout to the get log entry by index params.
func (o *GetLogEntryByIndexParams) SetTimeout(timeout time.Duration) {
- o.timeout = timeout
+ o.inner.timeout = timeout
}
-// WithContext adds the context to the get log entry by index params
+// WithContext adds the context to the get log entry by index params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetLogEntryByIndexParams].
func (o *GetLogEntryByIndexParams) WithContext(ctx context.Context) *GetLogEntryByIndexParams {
o.SetContext(ctx)
return o
}
-// SetContext adds the context to the get log entry by index params
+// SetContext adds the context to the get log entry by index params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetLogEntryByIndexParams].
func (o *GetLogEntryByIndexParams) SetContext(ctx context.Context) {
- o.Context = ctx
+ o.inner.ctx = ctx
}
-// WithHTTPClient adds the HTTPClient to the get log entry by index params
+// WithHTTPClient adds the HTTPClient to the get log entry by index params.
func (o *GetLogEntryByIndexParams) WithHTTPClient(client *http.Client) *GetLogEntryByIndexParams {
o.SetHTTPClient(client)
return o
}
-// SetHTTPClient adds the HTTPClient to the get log entry by index params
+// SetHTTPClient adds the HTTPClient to the get log entry by index params.
func (o *GetLogEntryByIndexParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
-// WithLogIndex adds the logIndex to the get log entry by index params
+// WithLogIndex adds the logIndex to the get log entry by index params.
func (o *GetLogEntryByIndexParams) WithLogIndex(logIndex int64) *GetLogEntryByIndexParams {
o.SetLogIndex(logIndex)
return o
}
-// SetLogIndex adds the logIndex to the get log entry by index params
+// SetLogIndex adds the logIndex to the get log entry by index params.
func (o *GetLogEntryByIndexParams) SetLogIndex(logIndex int64) {
o.LogIndex = logIndex
}
-// WriteToRequest writes these params to a swagger request
+// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *GetLogEntryByIndexParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
-
- if err := r.SetTimeout(o.timeout); err != nil {
+ if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
// query param logIndex
qrLogIndex := o.LogIndex
- qLogIndex := swag.FormatInt64(qrLogIndex)
+ qLogIndex := conv.FormatInteger(qrLogIndex)
if qLogIndex != "" {
if err := r.SetQueryParam("logIndex", qLogIndex); err != nil {
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_index_responses.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_index_responses.go
index 6be99b7e40..7f0c3f402a 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_index_responses.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_index_responses.go
@@ -26,7 +26,6 @@ import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
-
"github.com/sigstore/rekor/pkg/generated/models"
)
@@ -67,11 +66,9 @@ func NewGetLogEntryByIndexOK() *GetLogEntryByIndexOK {
return &GetLogEntryByIndexOK{}
}
-/*
-GetLogEntryByIndexOK describes a response with status code 200, with default header values.
-
-the entry in the transparency log requested along with an inclusion proof
-*/
+// GetLogEntryByIndexOK describes a response with status code 200, with default header values.
+//
+// the entry in the transparency log requested along with an inclusion proof
type GetLogEntryByIndexOK struct {
Payload models.LogEntry
}
@@ -135,11 +132,9 @@ func NewGetLogEntryByIndexNotFound() *GetLogEntryByIndexNotFound {
return &GetLogEntryByIndexNotFound{}
}
-/*
-GetLogEntryByIndexNotFound describes a response with status code 404, with default header values.
-
-The content requested could not be found
-*/
+// GetLogEntryByIndexNotFound describes a response with status code 404, with default header values.
+//
+// The content requested could not be found
type GetLogEntryByIndexNotFound struct {
}
@@ -193,11 +188,9 @@ func NewGetLogEntryByIndexDefault(code int) *GetLogEntryByIndexDefault {
}
}
-/*
-GetLogEntryByIndexDefault describes a response with status code -1, with default header values.
-
-There was an internal error in the server while processing the request
-*/
+// GetLogEntryByIndexDefault describes a response with status code -1, with default header values.
+//
+// There was an internal error in the server while processing the request
type GetLogEntryByIndexDefault struct {
_statusCode int
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_uuid_parameters.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_uuid_parameters.go
index ddd769ad9d..970f851ff2 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_uuid_parameters.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_uuid_parameters.go
@@ -36,24 +36,28 @@ import (
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetLogEntryByUUIDParams() *GetLogEntryByUUIDParams {
- return &GetLogEntryByUUIDParams{
- timeout: cr.DefaultTimeout,
- }
+ return NewGetLogEntryByUUIDParamsWithTimeout(cr.DefaultTimeout)
}
// NewGetLogEntryByUUIDParamsWithTimeout creates a new GetLogEntryByUUIDParams object
// with the ability to set a timeout on a request.
func NewGetLogEntryByUUIDParamsWithTimeout(timeout time.Duration) *GetLogEntryByUUIDParams {
return &GetLogEntryByUUIDParams{
- timeout: timeout,
+ inner: innerParams{
+ timeout: timeout,
+ },
}
}
// NewGetLogEntryByUUIDParamsWithContext creates a new GetLogEntryByUUIDParams object
// with the ability to set a context for a request.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetLogEntryByUUIDParams].
func NewGetLogEntryByUUIDParamsWithContext(ctx context.Context) *GetLogEntryByUUIDParams {
return &GetLogEntryByUUIDParams{
- Context: ctx,
+ inner: innerParams{
+ ctx: ctx,
+ },
}
}
@@ -74,15 +78,14 @@ GetLogEntryByUUIDParams contains all the parameters to send to the API endpoint
*/
type GetLogEntryByUUIDParams struct {
- /* EntryUUID.
-
- the UUID of the entry for which the inclusion proof information should be returned
- */
+ // EntryUUID.
+ //
+ // the UUID of the entry for which the inclusion proof information should be returned
EntryUUID string
- timeout time.Duration
- Context context.Context
HTTPClient *http.Client
+
+ inner innerParams
}
// WithDefaults hydrates default values in the get log entry by UUID params (not the query body).
@@ -100,54 +103,57 @@ func (o *GetLogEntryByUUIDParams) SetDefaults() {
// no default values defined for this parameter
}
-// WithTimeout adds the timeout to the get log entry by UUID params
+// WithTimeout adds the timeout to the get log entry by UUID params.
func (o *GetLogEntryByUUIDParams) WithTimeout(timeout time.Duration) *GetLogEntryByUUIDParams {
o.SetTimeout(timeout)
return o
}
-// SetTimeout adds the timeout to the get log entry by UUID params
+// SetTimeout adds the timeout to the get log entry by UUID params.
func (o *GetLogEntryByUUIDParams) SetTimeout(timeout time.Duration) {
- o.timeout = timeout
+ o.inner.timeout = timeout
}
-// WithContext adds the context to the get log entry by UUID params
+// WithContext adds the context to the get log entry by UUID params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetLogEntryByUUIDParams].
func (o *GetLogEntryByUUIDParams) WithContext(ctx context.Context) *GetLogEntryByUUIDParams {
o.SetContext(ctx)
return o
}
-// SetContext adds the context to the get log entry by UUID params
+// SetContext adds the context to the get log entry by UUID params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetLogEntryByUUIDParams].
func (o *GetLogEntryByUUIDParams) SetContext(ctx context.Context) {
- o.Context = ctx
+ o.inner.ctx = ctx
}
-// WithHTTPClient adds the HTTPClient to the get log entry by UUID params
+// WithHTTPClient adds the HTTPClient to the get log entry by UUID params.
func (o *GetLogEntryByUUIDParams) WithHTTPClient(client *http.Client) *GetLogEntryByUUIDParams {
o.SetHTTPClient(client)
return o
}
-// SetHTTPClient adds the HTTPClient to the get log entry by UUID params
+// SetHTTPClient adds the HTTPClient to the get log entry by UUID params.
func (o *GetLogEntryByUUIDParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
-// WithEntryUUID adds the entryUUID to the get log entry by UUID params
+// WithEntryUUID adds the entryUUID to the get log entry by UUID params.
func (o *GetLogEntryByUUIDParams) WithEntryUUID(entryUUID string) *GetLogEntryByUUIDParams {
o.SetEntryUUID(entryUUID)
return o
}
-// SetEntryUUID adds the entryUuid to the get log entry by UUID params
+// SetEntryUUID adds the entryUuid to the get log entry by UUID params.
func (o *GetLogEntryByUUIDParams) SetEntryUUID(entryUUID string) {
o.EntryUUID = entryUUID
}
-// WriteToRequest writes these params to a swagger request
+// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *GetLogEntryByUUIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
-
- if err := r.SetTimeout(o.timeout); err != nil {
+ if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_uuid_responses.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_uuid_responses.go
index 9ea6b57f14..f67c3ce127 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_uuid_responses.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/get_log_entry_by_uuid_responses.go
@@ -26,7 +26,6 @@ import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
-
"github.com/sigstore/rekor/pkg/generated/models"
)
@@ -67,11 +66,9 @@ func NewGetLogEntryByUUIDOK() *GetLogEntryByUUIDOK {
return &GetLogEntryByUUIDOK{}
}
-/*
-GetLogEntryByUUIDOK describes a response with status code 200, with default header values.
-
-Information needed for a client to compute the inclusion proof
-*/
+// GetLogEntryByUUIDOK describes a response with status code 200, with default header values.
+//
+// Information needed for a client to compute the inclusion proof
type GetLogEntryByUUIDOK struct {
Payload models.LogEntry
}
@@ -135,11 +132,9 @@ func NewGetLogEntryByUUIDNotFound() *GetLogEntryByUUIDNotFound {
return &GetLogEntryByUUIDNotFound{}
}
-/*
-GetLogEntryByUUIDNotFound describes a response with status code 404, with default header values.
-
-The content requested could not be found
-*/
+// GetLogEntryByUUIDNotFound describes a response with status code 404, with default header values.
+//
+// The content requested could not be found
type GetLogEntryByUUIDNotFound struct {
}
@@ -193,11 +188,9 @@ func NewGetLogEntryByUUIDDefault(code int) *GetLogEntryByUUIDDefault {
}
}
-/*
-GetLogEntryByUUIDDefault describes a response with status code -1, with default header values.
-
-There was an internal error in the server while processing the request
-*/
+// GetLogEntryByUUIDDefault describes a response with status code -1, with default header values.
+//
+// There was an internal error in the server while processing the request
type GetLogEntryByUUIDDefault struct {
_statusCode int
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/search_log_query_parameters.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/search_log_query_parameters.go
index ce248ff9a7..92ac0859e1 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/search_log_query_parameters.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/search_log_query_parameters.go
@@ -27,7 +27,6 @@ import (
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
-
"github.com/sigstore/rekor/pkg/generated/models"
)
@@ -38,24 +37,28 @@ import (
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewSearchLogQueryParams() *SearchLogQueryParams {
- return &SearchLogQueryParams{
- timeout: cr.DefaultTimeout,
- }
+ return NewSearchLogQueryParamsWithTimeout(cr.DefaultTimeout)
}
// NewSearchLogQueryParamsWithTimeout creates a new SearchLogQueryParams object
// with the ability to set a timeout on a request.
func NewSearchLogQueryParamsWithTimeout(timeout time.Duration) *SearchLogQueryParams {
return &SearchLogQueryParams{
- timeout: timeout,
+ inner: innerParams{
+ timeout: timeout,
+ },
}
}
// NewSearchLogQueryParamsWithContext creates a new SearchLogQueryParams object
// with the ability to set a context for a request.
+//
+// Deprecated: use the operation call with context to pass the context instead of [SearchLogQueryParams].
func NewSearchLogQueryParamsWithContext(ctx context.Context) *SearchLogQueryParams {
return &SearchLogQueryParams{
- Context: ctx,
+ inner: innerParams{
+ ctx: ctx,
+ },
}
}
@@ -79,9 +82,9 @@ type SearchLogQueryParams struct {
// Entry.
Entry *models.SearchLogQuery
- timeout time.Duration
- Context context.Context
HTTPClient *http.Client
+
+ inner innerParams
}
// WithDefaults hydrates default values in the search log query params (not the query body).
@@ -99,54 +102,57 @@ func (o *SearchLogQueryParams) SetDefaults() {
// no default values defined for this parameter
}
-// WithTimeout adds the timeout to the search log query params
+// WithTimeout adds the timeout to the search log query params.
func (o *SearchLogQueryParams) WithTimeout(timeout time.Duration) *SearchLogQueryParams {
o.SetTimeout(timeout)
return o
}
-// SetTimeout adds the timeout to the search log query params
+// SetTimeout adds the timeout to the search log query params.
func (o *SearchLogQueryParams) SetTimeout(timeout time.Duration) {
- o.timeout = timeout
+ o.inner.timeout = timeout
}
-// WithContext adds the context to the search log query params
+// WithContext adds the context to the search log query params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [SearchLogQueryParams].
func (o *SearchLogQueryParams) WithContext(ctx context.Context) *SearchLogQueryParams {
o.SetContext(ctx)
return o
}
-// SetContext adds the context to the search log query params
+// SetContext adds the context to the search log query params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [SearchLogQueryParams].
func (o *SearchLogQueryParams) SetContext(ctx context.Context) {
- o.Context = ctx
+ o.inner.ctx = ctx
}
-// WithHTTPClient adds the HTTPClient to the search log query params
+// WithHTTPClient adds the HTTPClient to the search log query params.
func (o *SearchLogQueryParams) WithHTTPClient(client *http.Client) *SearchLogQueryParams {
o.SetHTTPClient(client)
return o
}
-// SetHTTPClient adds the HTTPClient to the search log query params
+// SetHTTPClient adds the HTTPClient to the search log query params.
func (o *SearchLogQueryParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
-// WithEntry adds the entry to the search log query params
+// WithEntry adds the entry to the search log query params.
func (o *SearchLogQueryParams) WithEntry(entry *models.SearchLogQuery) *SearchLogQueryParams {
o.SetEntry(entry)
return o
}
-// SetEntry adds the entry to the search log query params
+// SetEntry adds the entry to the search log query params.
func (o *SearchLogQueryParams) SetEntry(entry *models.SearchLogQuery) {
o.Entry = entry
}
-// WriteToRequest writes these params to a swagger request
+// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *SearchLogQueryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
-
- if err := r.SetTimeout(o.timeout); err != nil {
+ if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/search_log_query_responses.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/search_log_query_responses.go
index 7891f4b915..c7e76fe799 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/search_log_query_responses.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/entries/search_log_query_responses.go
@@ -26,7 +26,6 @@ import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
-
"github.com/sigstore/rekor/pkg/generated/models"
)
@@ -73,11 +72,9 @@ func NewSearchLogQueryOK() *SearchLogQueryOK {
return &SearchLogQueryOK{}
}
-/*
-SearchLogQueryOK describes a response with status code 200, with default header values.
-
-Returns zero or more entries from the transparency log, according to how many were included in request query
-*/
+// SearchLogQueryOK describes a response with status code 200, with default header values.
+//
+// Returns zero or more entries from the transparency log, according to how many were included in request query
type SearchLogQueryOK struct {
Payload []models.LogEntry
}
@@ -141,11 +138,9 @@ func NewSearchLogQueryBadRequest() *SearchLogQueryBadRequest {
return &SearchLogQueryBadRequest{}
}
-/*
-SearchLogQueryBadRequest describes a response with status code 400, with default header values.
-
-The content supplied to the server was invalid
-*/
+// SearchLogQueryBadRequest describes a response with status code 400, with default header values.
+//
+// The content supplied to the server was invalid
type SearchLogQueryBadRequest struct {
Payload *models.Error
}
@@ -211,11 +206,9 @@ func NewSearchLogQueryUnprocessableEntity() *SearchLogQueryUnprocessableEntity {
return &SearchLogQueryUnprocessableEntity{}
}
-/*
-SearchLogQueryUnprocessableEntity describes a response with status code 422, with default header values.
-
-The server understood the request but is unable to process the contained instructions
-*/
+// SearchLogQueryUnprocessableEntity describes a response with status code 422, with default header values.
+//
+// The server understood the request but is unable to process the contained instructions
type SearchLogQueryUnprocessableEntity struct {
Payload *models.Error
}
@@ -283,11 +276,9 @@ func NewSearchLogQueryDefault(code int) *SearchLogQueryDefault {
}
}
-/*
-SearchLogQueryDefault describes a response with status code -1, with default header values.
-
-There was an internal error in the server while processing the request
-*/
+// SearchLogQueryDefault describes a response with status code -1, with default header values.
+//
+// There was an internal error in the server while processing the request
type SearchLogQueryDefault struct {
_statusCode int
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/index/index_client.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/index/index_client.go
index 8acf59d4df..1b9bae1e00 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/index/index_client.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/index/index_client.go
@@ -19,17 +19,21 @@
package index
import (
+ "context"
+ "time"
+
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// New creates a new index API client.
-func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
+func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
// New creates a new index API client with basic auth credentials.
+//
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
@@ -43,6 +47,7 @@ func NewClientWithBasicAuth(host, basePath, scheme, user, password string) Clien
}
// New creates a new index API client with a bearer token for authentication.
+//
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
@@ -54,36 +59,61 @@ func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) Client
return &Client{transport: transport, formats: strfmt.Default}
}
-/*
-Client for index API
-*/
+// Client for index API.
type Client struct {
- transport runtime.ClientTransport
+ transport runtime.ContextualTransport
formats strfmt.Registry
}
// ClientOption may be used to customize the behavior of Client methods.
type ClientOption func(*runtime.ClientOperation)
-// ClientService is the interface for Client methods
+// ClientService is the interface for Client methods.
type ClientService interface {
+
+ // SearchIndex searches index by entry metadata.
SearchIndex(params *SearchIndexParams, opts ...ClientOption) (*SearchIndexOK, error)
- SetTransport(transport runtime.ClientTransport)
+ // SearchIndexContext searches index by entry metadata.
+ SearchIndexContext(ctx context.Context, params *SearchIndexParams, opts ...ClientOption) (*SearchIndexOK, error)
+
+ SetTransport(transport runtime.ContextualTransport)
}
-/*
- SearchIndex searches index by entry metadata
+// SearchIndex searches index by entry metadata.
+//
+// EXPERIMENTAL - this endpoint is offered as best effort only and may be changed or removed in future releases.
+// The results returned from this endpoint may be incomplete.
+// .
+//
+// This method does not support injected context.
+// However, timeout and opentracing contexts are honored whenever enabled.
+//
+// If you need to pass a specific context, use [Client.SearchIndexContext] instead.
+func (a *Client) SearchIndex(params *SearchIndexParams, opts ...ClientOption) (*SearchIndexOK, error) {
+ var ctx context.Context
+ if params != nil && params.inner.ctx != nil {
+ ctx = params.inner.ctx
+ } else {
+ ctx = context.Background()
+ }
- EXPERIMENTAL - this endpoint is offered as best effort only and may be changed or removed in future releases.
+ return a.SearchIndexContext(ctx, params, opts...)
+}
-The results returned from this endpoint may be incomplete.
-*/
-func (a *Client) SearchIndex(params *SearchIndexParams, opts ...ClientOption) (*SearchIndexOK, error) {
+// SearchIndexContext searches index by entry metadata.
+//
+// EXPERIMENTAL - this endpoint is offered as best effort only and may be changed or removed in future releases.
+// The results returned from this endpoint may be incomplete.
+// .
+//
+// Do not use the deprecated [SearchIndexParams.Context] with this method: it would be ignored.
+func (a *Client) SearchIndexContext(ctx context.Context, params *SearchIndexParams, opts ...ClientOption) (*SearchIndexOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewSearchIndexParams()
}
+
op := &runtime.ClientOperation{
ID: "searchIndex",
Method: "POST",
@@ -93,13 +123,14 @@ func (a *Client) SearchIndex(params *SearchIndexParams, opts ...ClientOption) (*
Schemes: []string{"http"},
Params: params,
Reader: &SearchIndexReader{formats: a.formats},
- Context: params.Context,
Client: params.HTTPClient,
}
+
for _, opt := range opts {
opt(op)
}
- result, err := a.transport.Submit(op)
+
+ result, err := a.transport.SubmitContext(ctx, op)
if err != nil {
return nil, err
}
@@ -119,6 +150,14 @@ func (a *Client) SearchIndex(params *SearchIndexParams, opts ...ClientOption) (*
}
// SetTransport changes the transport on the client
-func (a *Client) SetTransport(transport runtime.ClientTransport) {
+func (a *Client) SetTransport(transport runtime.ContextualTransport) {
a.transport = transport
}
+
+// innerParams captures internal fields so they don't conflict with user-supplied parameters.
+type innerParams struct {
+ timeout time.Duration
+
+ // Deprecated: use the operation call with context to pass the context instead of [IndexParams].
+ ctx context.Context
+}
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/index/search_index_parameters.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/index/search_index_parameters.go
index 90f2e0f325..bb2b977b81 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/index/search_index_parameters.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/index/search_index_parameters.go
@@ -27,7 +27,6 @@ import (
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
-
"github.com/sigstore/rekor/pkg/generated/models"
)
@@ -38,24 +37,28 @@ import (
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewSearchIndexParams() *SearchIndexParams {
- return &SearchIndexParams{
- timeout: cr.DefaultTimeout,
- }
+ return NewSearchIndexParamsWithTimeout(cr.DefaultTimeout)
}
// NewSearchIndexParamsWithTimeout creates a new SearchIndexParams object
// with the ability to set a timeout on a request.
func NewSearchIndexParamsWithTimeout(timeout time.Duration) *SearchIndexParams {
return &SearchIndexParams{
- timeout: timeout,
+ inner: innerParams{
+ timeout: timeout,
+ },
}
}
// NewSearchIndexParamsWithContext creates a new SearchIndexParams object
// with the ability to set a context for a request.
+//
+// Deprecated: use the operation call with context to pass the context instead of [SearchIndexParams].
func NewSearchIndexParamsWithContext(ctx context.Context) *SearchIndexParams {
return &SearchIndexParams{
- Context: ctx,
+ inner: innerParams{
+ ctx: ctx,
+ },
}
}
@@ -79,9 +82,9 @@ type SearchIndexParams struct {
// Query.
Query *models.SearchIndex
- timeout time.Duration
- Context context.Context
HTTPClient *http.Client
+
+ inner innerParams
}
// WithDefaults hydrates default values in the search index params (not the query body).
@@ -99,54 +102,57 @@ func (o *SearchIndexParams) SetDefaults() {
// no default values defined for this parameter
}
-// WithTimeout adds the timeout to the search index params
+// WithTimeout adds the timeout to the search index params.
func (o *SearchIndexParams) WithTimeout(timeout time.Duration) *SearchIndexParams {
o.SetTimeout(timeout)
return o
}
-// SetTimeout adds the timeout to the search index params
+// SetTimeout adds the timeout to the search index params.
func (o *SearchIndexParams) SetTimeout(timeout time.Duration) {
- o.timeout = timeout
+ o.inner.timeout = timeout
}
-// WithContext adds the context to the search index params
+// WithContext adds the context to the search index params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [SearchIndexParams].
func (o *SearchIndexParams) WithContext(ctx context.Context) *SearchIndexParams {
o.SetContext(ctx)
return o
}
-// SetContext adds the context to the search index params
+// SetContext adds the context to the search index params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [SearchIndexParams].
func (o *SearchIndexParams) SetContext(ctx context.Context) {
- o.Context = ctx
+ o.inner.ctx = ctx
}
-// WithHTTPClient adds the HTTPClient to the search index params
+// WithHTTPClient adds the HTTPClient to the search index params.
func (o *SearchIndexParams) WithHTTPClient(client *http.Client) *SearchIndexParams {
o.SetHTTPClient(client)
return o
}
-// SetHTTPClient adds the HTTPClient to the search index params
+// SetHTTPClient adds the HTTPClient to the search index params.
func (o *SearchIndexParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
-// WithQuery adds the query to the search index params
+// WithQuery adds the query to the search index params.
func (o *SearchIndexParams) WithQuery(query *models.SearchIndex) *SearchIndexParams {
o.SetQuery(query)
return o
}
-// SetQuery adds the query to the search index params
+// SetQuery adds the query to the search index params.
func (o *SearchIndexParams) SetQuery(query *models.SearchIndex) {
o.Query = query
}
-// WriteToRequest writes these params to a swagger request
+// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *SearchIndexParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
-
- if err := r.SetTimeout(o.timeout); err != nil {
+ if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/index/search_index_responses.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/index/search_index_responses.go
index 951a1254d3..ced7e61c97 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/index/search_index_responses.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/index/search_index_responses.go
@@ -26,7 +26,6 @@ import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
-
"github.com/sigstore/rekor/pkg/generated/models"
)
@@ -67,11 +66,9 @@ func NewSearchIndexOK() *SearchIndexOK {
return &SearchIndexOK{}
}
-/*
-SearchIndexOK describes a response with status code 200, with default header values.
-
-Returns zero or more entry UUIDs from the transparency log based on search query
-*/
+// SearchIndexOK describes a response with status code 200, with default header values.
+//
+// Returns zero or more entry UUIDs from the transparency log based on search query
type SearchIndexOK struct {
Payload []string
}
@@ -135,11 +132,9 @@ func NewSearchIndexBadRequest() *SearchIndexBadRequest {
return &SearchIndexBadRequest{}
}
-/*
-SearchIndexBadRequest describes a response with status code 400, with default header values.
-
-The content supplied to the server was invalid
-*/
+// SearchIndexBadRequest describes a response with status code 400, with default header values.
+//
+// The content supplied to the server was invalid
type SearchIndexBadRequest struct {
Payload *models.Error
}
@@ -207,11 +202,9 @@ func NewSearchIndexDefault(code int) *SearchIndexDefault {
}
}
-/*
-SearchIndexDefault describes a response with status code -1, with default header values.
-
-There was an internal error in the server while processing the request
-*/
+// SearchIndexDefault describes a response with status code -1, with default header values.
+//
+// There was an internal error in the server while processing the request
type SearchIndexDefault struct {
_statusCode int
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/pubkey/get_public_key_parameters.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/pubkey/get_public_key_parameters.go
index b649e08976..a8722508f2 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/pubkey/get_public_key_parameters.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/pubkey/get_public_key_parameters.go
@@ -36,24 +36,28 @@ import (
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetPublicKeyParams() *GetPublicKeyParams {
- return &GetPublicKeyParams{
- timeout: cr.DefaultTimeout,
- }
+ return NewGetPublicKeyParamsWithTimeout(cr.DefaultTimeout)
}
// NewGetPublicKeyParamsWithTimeout creates a new GetPublicKeyParams object
// with the ability to set a timeout on a request.
func NewGetPublicKeyParamsWithTimeout(timeout time.Duration) *GetPublicKeyParams {
return &GetPublicKeyParams{
- timeout: timeout,
+ inner: innerParams{
+ timeout: timeout,
+ },
}
}
// NewGetPublicKeyParamsWithContext creates a new GetPublicKeyParams object
// with the ability to set a context for a request.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetPublicKeyParams].
func NewGetPublicKeyParamsWithContext(ctx context.Context) *GetPublicKeyParams {
return &GetPublicKeyParams{
- Context: ctx,
+ inner: innerParams{
+ ctx: ctx,
+ },
}
}
@@ -74,15 +78,14 @@ GetPublicKeyParams contains all the parameters to send to the API endpoint
*/
type GetPublicKeyParams struct {
- /* TreeID.
-
- The tree ID of the tree you wish to get a public key for
- */
+ // TreeID.
+ //
+ // The tree ID of the tree you wish to get a public key for
TreeID *string
- timeout time.Duration
- Context context.Context
HTTPClient *http.Client
+
+ inner innerParams
}
// WithDefaults hydrates default values in the get public key params (not the query body).
@@ -100,54 +103,57 @@ func (o *GetPublicKeyParams) SetDefaults() {
// no default values defined for this parameter
}
-// WithTimeout adds the timeout to the get public key params
+// WithTimeout adds the timeout to the get public key params.
func (o *GetPublicKeyParams) WithTimeout(timeout time.Duration) *GetPublicKeyParams {
o.SetTimeout(timeout)
return o
}
-// SetTimeout adds the timeout to the get public key params
+// SetTimeout adds the timeout to the get public key params.
func (o *GetPublicKeyParams) SetTimeout(timeout time.Duration) {
- o.timeout = timeout
+ o.inner.timeout = timeout
}
-// WithContext adds the context to the get public key params
+// WithContext adds the context to the get public key params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetPublicKeyParams].
func (o *GetPublicKeyParams) WithContext(ctx context.Context) *GetPublicKeyParams {
o.SetContext(ctx)
return o
}
-// SetContext adds the context to the get public key params
+// SetContext adds the context to the get public key params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetPublicKeyParams].
func (o *GetPublicKeyParams) SetContext(ctx context.Context) {
- o.Context = ctx
+ o.inner.ctx = ctx
}
-// WithHTTPClient adds the HTTPClient to the get public key params
+// WithHTTPClient adds the HTTPClient to the get public key params.
func (o *GetPublicKeyParams) WithHTTPClient(client *http.Client) *GetPublicKeyParams {
o.SetHTTPClient(client)
return o
}
-// SetHTTPClient adds the HTTPClient to the get public key params
+// SetHTTPClient adds the HTTPClient to the get public key params.
func (o *GetPublicKeyParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
-// WithTreeID adds the treeID to the get public key params
+// WithTreeID adds the treeID to the get public key params.
func (o *GetPublicKeyParams) WithTreeID(treeID *string) *GetPublicKeyParams {
o.SetTreeID(treeID)
return o
}
-// SetTreeID adds the treeId to the get public key params
+// SetTreeID adds the treeId to the get public key params.
func (o *GetPublicKeyParams) SetTreeID(treeID *string) {
o.TreeID = treeID
}
-// WriteToRequest writes these params to a swagger request
+// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *GetPublicKeyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
-
- if err := r.SetTimeout(o.timeout); err != nil {
+ if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/pubkey/get_public_key_responses.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/pubkey/get_public_key_responses.go
index 923ee3cf6e..6384568789 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/pubkey/get_public_key_responses.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/pubkey/get_public_key_responses.go
@@ -26,7 +26,6 @@ import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
-
"github.com/sigstore/rekor/pkg/generated/models"
)
@@ -61,11 +60,9 @@ func NewGetPublicKeyOK() *GetPublicKeyOK {
return &GetPublicKeyOK{}
}
-/*
-GetPublicKeyOK describes a response with status code 200, with default header values.
-
-The public key
-*/
+// GetPublicKeyOK describes a response with status code 200, with default header values.
+//
+// The public key
type GetPublicKeyOK struct {
Payload string
}
@@ -131,11 +128,9 @@ func NewGetPublicKeyDefault(code int) *GetPublicKeyDefault {
}
}
-/*
-GetPublicKeyDefault describes a response with status code -1, with default header values.
-
-There was an internal error in the server while processing the request
-*/
+// GetPublicKeyDefault describes a response with status code -1, with default header values.
+//
+// There was an internal error in the server while processing the request
type GetPublicKeyDefault struct {
_statusCode int
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/pubkey/pubkey_client.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/pubkey/pubkey_client.go
index d2ed8be91f..a2d77007ab 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/pubkey/pubkey_client.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/pubkey/pubkey_client.go
@@ -19,17 +19,21 @@
package pubkey
import (
+ "context"
+ "time"
+
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// New creates a new pubkey API client.
-func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
+func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
// New creates a new pubkey API client with basic auth credentials.
+//
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
@@ -43,6 +47,7 @@ func NewClientWithBasicAuth(host, basePath, scheme, user, password string) Clien
}
// New creates a new pubkey API client with a bearer token for authentication.
+//
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
@@ -54,11 +59,9 @@ func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) Client
return &Client{transport: transport, formats: strfmt.Default}
}
-/*
-Client for pubkey API
-*/
+// Client for pubkey API.
type Client struct {
- transport runtime.ClientTransport
+ transport runtime.ContextualTransport
formats strfmt.Registry
}
@@ -89,23 +92,48 @@ func WithAcceptApplicationxPemFile(r *runtime.ClientOperation) {
r.ProducesMediaTypes = []string{"application/x-pem-file"}
}
-// ClientService is the interface for Client methods
+// ClientService is the interface for Client methods.
type ClientService interface {
+
+ // GetPublicKey retrieve the public key that can be used to validate the signed tree head.
GetPublicKey(params *GetPublicKeyParams, opts ...ClientOption) (*GetPublicKeyOK, error)
- SetTransport(transport runtime.ClientTransport)
-}
+ // GetPublicKeyContext retrieve the public key that can be used to validate the signed tree head.
+ GetPublicKeyContext(ctx context.Context, params *GetPublicKeyParams, opts ...ClientOption) (*GetPublicKeyOK, error)
-/*
-GetPublicKey retrieves the public key that can be used to validate the signed tree head
+ SetTransport(transport runtime.ContextualTransport)
+}
-Returns the public key that can be used to validate the signed tree head
-*/
+// GetPublicKey retrieves the public key that can be used to validate the signed tree head.
+//
+// Returns the public key that can be used to validate the signed tree head.
+//
+// This method does not support injected context.
+// However, timeout and opentracing contexts are honored whenever enabled.
+//
+// If you need to pass a specific context, use [Client.GetPublicKeyContext] instead.
func (a *Client) GetPublicKey(params *GetPublicKeyParams, opts ...ClientOption) (*GetPublicKeyOK, error) {
+ var ctx context.Context
+ if params != nil && params.inner.ctx != nil {
+ ctx = params.inner.ctx
+ } else {
+ ctx = context.Background()
+ }
+
+ return a.GetPublicKeyContext(ctx, params, opts...)
+}
+
+// GetPublicKeyContext retrieves the public key that can be used to validate the signed tree head.
+//
+// Returns the public key that can be used to validate the signed tree head.
+//
+// Do not use the deprecated [GetPublicKeyParams.Context] with this method: it would be ignored.
+func (a *Client) GetPublicKeyContext(ctx context.Context, params *GetPublicKeyParams, opts ...ClientOption) (*GetPublicKeyOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewGetPublicKeyParams()
}
+
op := &runtime.ClientOperation{
ID: "getPublicKey",
Method: "GET",
@@ -115,13 +143,14 @@ func (a *Client) GetPublicKey(params *GetPublicKeyParams, opts ...ClientOption)
Schemes: []string{"http"},
Params: params,
Reader: &GetPublicKeyReader{formats: a.formats},
- Context: params.Context,
Client: params.HTTPClient,
}
+
for _, opt := range opts {
opt(op)
}
- result, err := a.transport.Submit(op)
+
+ result, err := a.transport.SubmitContext(ctx, op)
if err != nil {
return nil, err
}
@@ -141,6 +170,14 @@ func (a *Client) GetPublicKey(params *GetPublicKeyParams, opts ...ClientOption)
}
// SetTransport changes the transport on the client
-func (a *Client) SetTransport(transport runtime.ClientTransport) {
+func (a *Client) SetTransport(transport runtime.ContextualTransport) {
a.transport = transport
}
+
+// innerParams captures internal fields so they don't conflict with user-supplied parameters.
+type innerParams struct {
+ timeout time.Duration
+
+ // Deprecated: use the operation call with context to pass the context instead of [PubkeyParams].
+ ctx context.Context
+}
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/rekor_client.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/rekor_client.go
index 131c7e1639..0459329a3e 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/rekor_client.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/rekor_client.go
@@ -19,10 +19,11 @@
package client
import (
+ "maps"
+
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
-
"github.com/sigstore/rekor/pkg/generated/client/entries"
"github.com/sigstore/rekor/pkg/generated/client/index"
"github.com/sigstore/rekor/pkg/generated/client/pubkey"
@@ -33,15 +34,13 @@ import (
var Default = NewHTTPClient(nil)
const (
- // DefaultHost is the default Host
- // found in Meta (info) section of spec file
+ // DefaultHost is the default Host found in Meta (info) section of spec file.
DefaultHost string = "rekor.sigstore.dev"
- // DefaultBasePath is the default BasePath
- // found in Meta (info) section of spec file
+ // DefaultBasePath is the default BasePath found in Meta (info) section of spec file.
DefaultBasePath string = "/"
)
-// DefaultSchemes are the default schemes found in Meta (info) section of spec file
+// DefaultSchemes are the default schemes found in Meta (info) section of spec file.
var DefaultSchemes = []string{"http"}
// NewHTTPClient creates a new rekor HTTP client.
@@ -57,13 +56,16 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Rek
cfg = DefaultTransportConfig()
}
- // create transport and client
+ // create transport and client.
transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
+ maps.Copy(transport.Producers, cfg.Producers)
+ maps.Copy(transport.Consumers, cfg.Consumers)
+
return New(transport, formats)
}
-// New creates a new rekor client
-func New(transport runtime.ClientTransport, formats strfmt.Registry) *Rekor {
+// New creates a new rekor client.
+func New(transport runtime.ContextualTransport, formats strfmt.Registry) *Rekor {
// ensure nullable parameters have default
if formats == nil {
formats = strfmt.Default
@@ -75,6 +77,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Rekor {
cli.Index = index.New(transport, formats)
cli.Pubkey = pubkey.New(transport, formats)
cli.Tlog = tlog.New(transport, formats)
+
return cli
}
@@ -91,9 +94,11 @@ func DefaultTransportConfig() *TransportConfig {
// TransportConfig contains the transport related info,
// found in the meta section of the spec file.
type TransportConfig struct {
- Host string
- BasePath string
- Schemes []string
+ Host string
+ BasePath string
+ Schemes []string
+ Producers map[string]runtime.Producer
+ Consumers map[string]runtime.Consumer
}
// WithHost overrides the default host,
@@ -117,7 +122,19 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
return cfg
}
-// Rekor is a client for rekor
+// WithProducers overrides the default producers registered by [httptransport.Runtime].
+func (cfg *TransportConfig) WithProducers(producers map[string]runtime.Producer) *TransportConfig {
+ cfg.Producers = producers
+ return cfg
+}
+
+// WithConsumers overrides the default consumers registered by [httptransport.Runtime].
+func (cfg *TransportConfig) WithConsumers(consumers map[string]runtime.Consumer) *TransportConfig {
+ cfg.Consumers = consumers
+ return cfg
+}
+
+// Rekor is a client for rekor.
type Rekor struct {
Entries entries.ClientService
@@ -127,11 +144,11 @@ type Rekor struct {
Tlog tlog.ClientService
- Transport runtime.ClientTransport
+ Transport runtime.ContextualTransport
}
-// SetTransport changes the transport on the client and all its subresources
-func (c *Rekor) SetTransport(transport runtime.ClientTransport) {
+// SetTransport changes the transport on the client and all its subresources.
+func (c *Rekor) SetTransport(transport runtime.ContextualTransport) {
c.Transport = transport
c.Entries.SetTransport(transport)
c.Index.SetTransport(transport)
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_info_parameters.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_info_parameters.go
index 764c2e9d4c..9ef06c1383 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_info_parameters.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_info_parameters.go
@@ -36,24 +36,28 @@ import (
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetLogInfoParams() *GetLogInfoParams {
- return &GetLogInfoParams{
- timeout: cr.DefaultTimeout,
- }
+ return NewGetLogInfoParamsWithTimeout(cr.DefaultTimeout)
}
// NewGetLogInfoParamsWithTimeout creates a new GetLogInfoParams object
// with the ability to set a timeout on a request.
func NewGetLogInfoParamsWithTimeout(timeout time.Duration) *GetLogInfoParams {
return &GetLogInfoParams{
- timeout: timeout,
+ inner: innerParams{
+ timeout: timeout,
+ },
}
}
// NewGetLogInfoParamsWithContext creates a new GetLogInfoParams object
// with the ability to set a context for a request.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetLogInfoParams].
func NewGetLogInfoParamsWithContext(ctx context.Context) *GetLogInfoParams {
return &GetLogInfoParams{
- Context: ctx,
+ inner: innerParams{
+ ctx: ctx,
+ },
}
}
@@ -73,9 +77,9 @@ GetLogInfoParams contains all the parameters to send to the API endpoint
Typically these are written to a http.Request.
*/
type GetLogInfoParams struct {
- timeout time.Duration
- Context context.Context
HTTPClient *http.Client
+
+ inner innerParams
}
// WithDefaults hydrates default values in the get log info params (not the query body).
@@ -93,43 +97,46 @@ func (o *GetLogInfoParams) SetDefaults() {
// no default values defined for this parameter
}
-// WithTimeout adds the timeout to the get log info params
+// WithTimeout adds the timeout to the get log info params.
func (o *GetLogInfoParams) WithTimeout(timeout time.Duration) *GetLogInfoParams {
o.SetTimeout(timeout)
return o
}
-// SetTimeout adds the timeout to the get log info params
+// SetTimeout adds the timeout to the get log info params.
func (o *GetLogInfoParams) SetTimeout(timeout time.Duration) {
- o.timeout = timeout
+ o.inner.timeout = timeout
}
-// WithContext adds the context to the get log info params
+// WithContext adds the context to the get log info params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetLogInfoParams].
func (o *GetLogInfoParams) WithContext(ctx context.Context) *GetLogInfoParams {
o.SetContext(ctx)
return o
}
-// SetContext adds the context to the get log info params
+// SetContext adds the context to the get log info params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetLogInfoParams].
func (o *GetLogInfoParams) SetContext(ctx context.Context) {
- o.Context = ctx
+ o.inner.ctx = ctx
}
-// WithHTTPClient adds the HTTPClient to the get log info params
+// WithHTTPClient adds the HTTPClient to the get log info params.
func (o *GetLogInfoParams) WithHTTPClient(client *http.Client) *GetLogInfoParams {
o.SetHTTPClient(client)
return o
}
-// SetHTTPClient adds the HTTPClient to the get log info params
+// SetHTTPClient adds the HTTPClient to the get log info params.
func (o *GetLogInfoParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
-// WriteToRequest writes these params to a swagger request
+// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *GetLogInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
-
- if err := r.SetTimeout(o.timeout); err != nil {
+ if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_info_responses.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_info_responses.go
index 5b69389dec..0836c5d226 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_info_responses.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_info_responses.go
@@ -26,7 +26,6 @@ import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
-
"github.com/sigstore/rekor/pkg/generated/models"
)
@@ -61,11 +60,9 @@ func NewGetLogInfoOK() *GetLogInfoOK {
return &GetLogInfoOK{}
}
-/*
-GetLogInfoOK describes a response with status code 200, with default header values.
-
-A JSON object with the root hash and tree size as properties
-*/
+// GetLogInfoOK describes a response with status code 200, with default header values.
+//
+// A JSON object with the root hash and tree size as properties
type GetLogInfoOK struct {
Payload *models.LogInfo
}
@@ -133,11 +130,9 @@ func NewGetLogInfoDefault(code int) *GetLogInfoDefault {
}
}
-/*
-GetLogInfoDefault describes a response with status code -1, with default header values.
-
-There was an internal error in the server while processing the request
-*/
+// GetLogInfoDefault describes a response with status code -1, with default header values.
+//
+// There was an internal error in the server while processing the request
type GetLogInfoDefault struct {
_statusCode int
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_proof_parameters.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_proof_parameters.go
index 505ca2cbb3..fb723a2989 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_proof_parameters.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_proof_parameters.go
@@ -27,7 +27,7 @@ import (
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/conv"
)
// NewGetLogProofParams creates a new GetLogProofParams object,
@@ -37,24 +37,28 @@ import (
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetLogProofParams() *GetLogProofParams {
- return &GetLogProofParams{
- timeout: cr.DefaultTimeout,
- }
+ return NewGetLogProofParamsWithTimeout(cr.DefaultTimeout)
}
// NewGetLogProofParamsWithTimeout creates a new GetLogProofParams object
// with the ability to set a timeout on a request.
func NewGetLogProofParamsWithTimeout(timeout time.Duration) *GetLogProofParams {
return &GetLogProofParams{
- timeout: timeout,
+ inner: innerParams{
+ timeout: timeout,
+ },
}
}
// NewGetLogProofParamsWithContext creates a new GetLogProofParams object
// with the ability to set a context for a request.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetLogProofParams].
func NewGetLogProofParamsWithContext(ctx context.Context) *GetLogProofParams {
return &GetLogProofParams{
- Context: ctx,
+ inner: innerParams{
+ ctx: ctx,
+ },
}
}
@@ -75,30 +79,27 @@ GetLogProofParams contains all the parameters to send to the API endpoint
*/
type GetLogProofParams struct {
- /* FirstSize.
-
- The size of the tree that you wish to prove consistency from (1 means the beginning of the log) Defaults to 1 if not specified
-
-
- Default: 1
- */
+ // FirstSize.
+ //
+ // The size of the tree that you wish to prove consistency from (1 means the beginning of the log) Defaults to 1 if not specified
+ //
+ //
+ // Default: 1
FirstSize *int64
- /* LastSize.
-
- The size of the tree that you wish to prove consistency to
- */
+ // LastSize.
+ //
+ // The size of the tree that you wish to prove consistency to
LastSize int64
- /* TreeID.
-
- The tree ID of the tree that you wish to prove consistency for
- */
+ // TreeID.
+ //
+ // The tree ID of the tree that you wish to prove consistency for
TreeID *string
- timeout time.Duration
- Context context.Context
HTTPClient *http.Client
+
+ inner innerParams
}
// WithDefaults hydrates default values in the get log proof params (not the query body).
@@ -121,82 +122,85 @@ func (o *GetLogProofParams) SetDefaults() {
FirstSize: &firstSizeDefault,
}
- val.timeout = o.timeout
- val.Context = o.Context
+ val.inner.timeout = o.inner.timeout
+ val.inner.ctx = o.inner.ctx
val.HTTPClient = o.HTTPClient
*o = val
}
-// WithTimeout adds the timeout to the get log proof params
+// WithTimeout adds the timeout to the get log proof params.
func (o *GetLogProofParams) WithTimeout(timeout time.Duration) *GetLogProofParams {
o.SetTimeout(timeout)
return o
}
-// SetTimeout adds the timeout to the get log proof params
+// SetTimeout adds the timeout to the get log proof params.
func (o *GetLogProofParams) SetTimeout(timeout time.Duration) {
- o.timeout = timeout
+ o.inner.timeout = timeout
}
-// WithContext adds the context to the get log proof params
+// WithContext adds the context to the get log proof params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetLogProofParams].
func (o *GetLogProofParams) WithContext(ctx context.Context) *GetLogProofParams {
o.SetContext(ctx)
return o
}
-// SetContext adds the context to the get log proof params
+// SetContext adds the context to the get log proof params.
+//
+// Deprecated: use the operation call with context to pass the context instead of [GetLogProofParams].
func (o *GetLogProofParams) SetContext(ctx context.Context) {
- o.Context = ctx
+ o.inner.ctx = ctx
}
-// WithHTTPClient adds the HTTPClient to the get log proof params
+// WithHTTPClient adds the HTTPClient to the get log proof params.
func (o *GetLogProofParams) WithHTTPClient(client *http.Client) *GetLogProofParams {
o.SetHTTPClient(client)
return o
}
-// SetHTTPClient adds the HTTPClient to the get log proof params
+// SetHTTPClient adds the HTTPClient to the get log proof params.
func (o *GetLogProofParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
-// WithFirstSize adds the firstSize to the get log proof params
+// WithFirstSize adds the firstSize to the get log proof params.
func (o *GetLogProofParams) WithFirstSize(firstSize *int64) *GetLogProofParams {
o.SetFirstSize(firstSize)
return o
}
-// SetFirstSize adds the firstSize to the get log proof params
+// SetFirstSize adds the firstSize to the get log proof params.
func (o *GetLogProofParams) SetFirstSize(firstSize *int64) {
o.FirstSize = firstSize
}
-// WithLastSize adds the lastSize to the get log proof params
+// WithLastSize adds the lastSize to the get log proof params.
func (o *GetLogProofParams) WithLastSize(lastSize int64) *GetLogProofParams {
o.SetLastSize(lastSize)
return o
}
-// SetLastSize adds the lastSize to the get log proof params
+// SetLastSize adds the lastSize to the get log proof params.
func (o *GetLogProofParams) SetLastSize(lastSize int64) {
o.LastSize = lastSize
}
-// WithTreeID adds the treeID to the get log proof params
+// WithTreeID adds the treeID to the get log proof params.
func (o *GetLogProofParams) WithTreeID(treeID *string) *GetLogProofParams {
o.SetTreeID(treeID)
return o
}
-// SetTreeID adds the treeId to the get log proof params
+// SetTreeID adds the treeId to the get log proof params.
func (o *GetLogProofParams) SetTreeID(treeID *string) {
o.TreeID = treeID
}
-// WriteToRequest writes these params to a swagger request
+// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *GetLogProofParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
-
- if err := r.SetTimeout(o.timeout); err != nil {
+ if err := r.SetTimeout(o.inner.timeout); err != nil {
return err
}
var res []error
@@ -209,7 +213,7 @@ func (o *GetLogProofParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
if o.FirstSize != nil {
qrFirstSize = *o.FirstSize
}
- qFirstSize := swag.FormatInt64(qrFirstSize)
+ qFirstSize := conv.FormatInteger(qrFirstSize)
if qFirstSize != "" {
if err := r.SetQueryParam("firstSize", qFirstSize); err != nil {
@@ -220,7 +224,7 @@ func (o *GetLogProofParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
// query param lastSize
qrLastSize := o.LastSize
- qLastSize := swag.FormatInt64(qrLastSize)
+ qLastSize := conv.FormatInteger(qrLastSize)
if qLastSize != "" {
if err := r.SetQueryParam("lastSize", qLastSize); err != nil {
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_proof_responses.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_proof_responses.go
index d025173d21..28b15da9a3 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_proof_responses.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/get_log_proof_responses.go
@@ -26,7 +26,6 @@ import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
-
"github.com/sigstore/rekor/pkg/generated/models"
)
@@ -67,11 +66,9 @@ func NewGetLogProofOK() *GetLogProofOK {
return &GetLogProofOK{}
}
-/*
-GetLogProofOK describes a response with status code 200, with default header values.
-
-All hashes required to compute the consistency proof
-*/
+// GetLogProofOK describes a response with status code 200, with default header values.
+//
+// All hashes required to compute the consistency proof
type GetLogProofOK struct {
Payload *models.ConsistencyProof
}
@@ -137,11 +134,9 @@ func NewGetLogProofBadRequest() *GetLogProofBadRequest {
return &GetLogProofBadRequest{}
}
-/*
-GetLogProofBadRequest describes a response with status code 400, with default header values.
-
-The content supplied to the server was invalid
-*/
+// GetLogProofBadRequest describes a response with status code 400, with default header values.
+//
+// The content supplied to the server was invalid
type GetLogProofBadRequest struct {
Payload *models.Error
}
@@ -209,11 +204,9 @@ func NewGetLogProofDefault(code int) *GetLogProofDefault {
}
}
-/*
-GetLogProofDefault describes a response with status code -1, with default header values.
-
-There was an internal error in the server while processing the request
-*/
+// GetLogProofDefault describes a response with status code -1, with default header values.
+//
+// There was an internal error in the server while processing the request
type GetLogProofDefault struct {
_statusCode int
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/tlog_client.go b/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/tlog_client.go
index c58fe252c9..cd7f2a657f 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/tlog_client.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/client/tlog/tlog_client.go
@@ -19,17 +19,21 @@
package tlog
import (
+ "context"
+ "time"
+
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// New creates a new tlog API client.
-func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
+func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
// New creates a new tlog API client with basic auth credentials.
+//
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
@@ -43,6 +47,7 @@ func NewClientWithBasicAuth(host, basePath, scheme, user, password string) Clien
}
// New creates a new tlog API client with a bearer token for authentication.
+//
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
@@ -54,36 +59,63 @@ func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) Client
return &Client{transport: transport, formats: strfmt.Default}
}
-/*
-Client for tlog API
-*/
+// Client for tlog API.
type Client struct {
- transport runtime.ClientTransport
+ transport runtime.ContextualTransport
formats strfmt.Registry
}
// ClientOption may be used to customize the behavior of Client methods.
type ClientOption func(*runtime.ClientOperation)
-// ClientService is the interface for Client methods
+// ClientService is the interface for Client methods.
type ClientService interface {
+
+ // GetLogInfo get information about the current state of the transparency log.
GetLogInfo(params *GetLogInfoParams, opts ...ClientOption) (*GetLogInfoOK, error)
+ // GetLogInfoContext get information about the current state of the transparency log.
+ GetLogInfoContext(ctx context.Context, params *GetLogInfoParams, opts ...ClientOption) (*GetLogInfoOK, error)
+
+ // GetLogProof get information required to generate a consistency proof for the transparency log.
GetLogProof(params *GetLogProofParams, opts ...ClientOption) (*GetLogProofOK, error)
- SetTransport(transport runtime.ClientTransport)
-}
+ // GetLogProofContext get information required to generate a consistency proof for the transparency log.
+ GetLogProofContext(ctx context.Context, params *GetLogProofParams, opts ...ClientOption) (*GetLogProofOK, error)
-/*
-GetLogInfo gets information about the current state of the transparency log
+ SetTransport(transport runtime.ContextualTransport)
+}
-Returns the current root hash and size of the merkle tree used to store the log entries.
-*/
+// GetLogInfo gets information about the current state of the transparency log.
+//
+// Returns the current root hash and size of the merkle tree used to store the log entries..
+//
+// This method does not support injected context.
+// However, timeout and opentracing contexts are honored whenever enabled.
+//
+// If you need to pass a specific context, use [Client.GetLogInfoContext] instead.
func (a *Client) GetLogInfo(params *GetLogInfoParams, opts ...ClientOption) (*GetLogInfoOK, error) {
+ var ctx context.Context
+ if params != nil && params.inner.ctx != nil {
+ ctx = params.inner.ctx
+ } else {
+ ctx = context.Background()
+ }
+
+ return a.GetLogInfoContext(ctx, params, opts...)
+}
+
+// GetLogInfoContext gets information about the current state of the transparency log.
+//
+// Returns the current root hash and size of the merkle tree used to store the log entries..
+//
+// Do not use the deprecated [GetLogInfoParams.Context] with this method: it would be ignored.
+func (a *Client) GetLogInfoContext(ctx context.Context, params *GetLogInfoParams, opts ...ClientOption) (*GetLogInfoOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewGetLogInfoParams()
}
+
op := &runtime.ClientOperation{
ID: "getLogInfo",
Method: "GET",
@@ -93,13 +125,14 @@ func (a *Client) GetLogInfo(params *GetLogInfoParams, opts ...ClientOption) (*Ge
Schemes: []string{"http"},
Params: params,
Reader: &GetLogInfoReader{formats: a.formats},
- Context: params.Context,
Client: params.HTTPClient,
}
+
for _, opt := range opts {
opt(op)
}
- result, err := a.transport.Submit(op)
+
+ result, err := a.transport.SubmitContext(ctx, op)
if err != nil {
return nil, err
}
@@ -118,16 +151,36 @@ func (a *Client) GetLogInfo(params *GetLogInfoParams, opts ...ClientOption) (*Ge
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())
}
-/*
-GetLogProof gets information required to generate a consistency proof for the transparency log
-
-Returns a list of hashes for specified tree sizes that can be used to confirm the consistency of the transparency log
-*/
+// GetLogProof gets information required to generate a consistency proof for the transparency log.
+//
+// Returns a list of hashes for specified tree sizes that can be used to confirm the consistency of the transparency log.
+//
+// This method does not support injected context.
+// However, timeout and opentracing contexts are honored whenever enabled.
+//
+// If you need to pass a specific context, use [Client.GetLogProofContext] instead.
func (a *Client) GetLogProof(params *GetLogProofParams, opts ...ClientOption) (*GetLogProofOK, error) {
+ var ctx context.Context
+ if params != nil && params.inner.ctx != nil {
+ ctx = params.inner.ctx
+ } else {
+ ctx = context.Background()
+ }
+
+ return a.GetLogProofContext(ctx, params, opts...)
+}
+
+// GetLogProofContext gets information required to generate a consistency proof for the transparency log.
+//
+// Returns a list of hashes for specified tree sizes that can be used to confirm the consistency of the transparency log.
+//
+// Do not use the deprecated [GetLogProofParams.Context] with this method: it would be ignored.
+func (a *Client) GetLogProofContext(ctx context.Context, params *GetLogProofParams, opts ...ClientOption) (*GetLogProofOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewGetLogProofParams()
}
+
op := &runtime.ClientOperation{
ID: "getLogProof",
Method: "GET",
@@ -137,13 +190,14 @@ func (a *Client) GetLogProof(params *GetLogProofParams, opts ...ClientOption) (*
Schemes: []string{"http"},
Params: params,
Reader: &GetLogProofReader{formats: a.formats},
- Context: params.Context,
Client: params.HTTPClient,
}
+
for _, opt := range opts {
opt(op)
}
- result, err := a.transport.Submit(op)
+
+ result, err := a.transport.SubmitContext(ctx, op)
if err != nil {
return nil, err
}
@@ -163,6 +217,14 @@ func (a *Client) GetLogProof(params *GetLogProofParams, opts ...ClientOption) (*
}
// SetTransport changes the transport on the client
-func (a *Client) SetTransport(transport runtime.ClientTransport) {
+func (a *Client) SetTransport(transport runtime.ContextualTransport) {
a.transport = transport
}
+
+// innerParams captures internal fields so they don't conflict with user-supplied parameters.
+type innerParams struct {
+ timeout time.Duration
+
+ // Deprecated: use the operation call with context to pass the context instead of [TlogParams].
+ ctx context.Context
+}
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine.go
index d3c460e731..894cfab820 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine.go
@@ -25,7 +25,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -135,7 +135,7 @@ func (m Alpine) MarshalJSON() ([]byte, error) {
return nil, err
}
- return swag.ConcatJSON(b1, b2, b3), nil
+ return jsonutils.ConcatJSON(b1, b2, b3), nil
}
// Validate validates this alpine
@@ -193,13 +193,13 @@ func (m *Alpine) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Alpine) UnmarshalBinary(b []byte) error {
var res Alpine
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine_v001_schema.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine_v001_schema.go
index f748022d51..36a07c93b5 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine_v001_schema.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine_v001_schema.go
@@ -25,7 +25,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -176,13 +177,13 @@ func (m *AlpineV001Schema) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *AlpineV001Schema) UnmarshalBinary(b []byte) error {
var res AlpineV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -221,7 +222,7 @@ func (m *AlpineV001SchemaPackage) Validate(formats strfmt.Registry) error {
}
func (m *AlpineV001SchemaPackage) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -265,7 +266,7 @@ func (m *AlpineV001SchemaPackage) contextValidateHash(ctx context.Context, forma
if m.Hash != nil {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -296,13 +297,13 @@ func (m *AlpineV001SchemaPackage) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *AlpineV001SchemaPackage) UnmarshalBinary(b []byte) error {
var res AlpineV001SchemaPackage
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -406,13 +407,13 @@ func (m *AlpineV001SchemaPackageHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *AlpineV001SchemaPackageHash) UnmarshalBinary(b []byte) error {
var res AlpineV001SchemaPackageHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -454,7 +455,7 @@ func (m *AlpineV001SchemaPublicKey) validateContent(formats strfmt.Registry) err
}
// ContextValidate validates this alpine v001 schema public key based on context it is used
-func (m *AlpineV001SchemaPublicKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *AlpineV001SchemaPublicKey) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -463,13 +464,13 @@ func (m *AlpineV001SchemaPublicKey) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *AlpineV001SchemaPublicKey) UnmarshalBinary(b []byte) error {
var res AlpineV001SchemaPublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/consistency_proof.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/consistency_proof.go
index ae87d835ff..dbd722efaf 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/consistency_proof.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/consistency_proof.go
@@ -24,7 +24,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -92,7 +92,7 @@ func (m *ConsistencyProof) validateRootHash(formats strfmt.Registry) error {
}
// ContextValidate validates this consistency proof based on context it is used
-func (m *ConsistencyProof) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *ConsistencyProof) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -101,13 +101,13 @@ func (m *ConsistencyProof) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ConsistencyProof) UnmarshalBinary(b []byte) error {
var res ConsistencyProof
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/cose.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/cose.go
index 58cd4e3b1c..17675abef0 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/cose.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/cose.go
@@ -25,7 +25,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -135,7 +135,7 @@ func (m Cose) MarshalJSON() ([]byte, error) {
return nil, err
}
- return swag.ConcatJSON(b1, b2, b3), nil
+ return jsonutils.ConcatJSON(b1, b2, b3), nil
}
// Validate validates this cose
@@ -193,13 +193,13 @@ func (m *Cose) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Cose) UnmarshalBinary(b []byte) error {
var res Cose
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/cose_v001_schema.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/cose_v001_schema.go
index 69a3c0c65e..aa8378aaf4 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/cose_v001_schema.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/cose_v001_schema.go
@@ -25,7 +25,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -68,7 +69,7 @@ func (m *CoseV001Schema) Validate(formats strfmt.Registry) error {
}
func (m *CoseV001Schema) validateData(formats strfmt.Registry) error {
- if swag.IsZero(m.Data) { // not required
+ if typeutils.IsZero(m.Data) { // not required
return nil
}
@@ -117,7 +118,7 @@ func (m *CoseV001Schema) contextValidateData(ctx context.Context, formats strfmt
if m.Data != nil {
- if swag.IsZero(m.Data) { // not required
+ if typeutils.IsZero(m.Data) { // not required
return nil
}
@@ -143,13 +144,13 @@ func (m *CoseV001Schema) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CoseV001Schema) UnmarshalBinary(b []byte) error {
var res CoseV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -191,7 +192,7 @@ func (m *CoseV001SchemaData) Validate(formats strfmt.Registry) error {
}
func (m *CoseV001SchemaData) validateEnvelopeHash(formats strfmt.Registry) error {
- if swag.IsZero(m.EnvelopeHash) { // not required
+ if typeutils.IsZero(m.EnvelopeHash) { // not required
return nil
}
@@ -214,7 +215,7 @@ func (m *CoseV001SchemaData) validateEnvelopeHash(formats strfmt.Registry) error
}
func (m *CoseV001SchemaData) validatePayloadHash(formats strfmt.Registry) error {
- if swag.IsZero(m.PayloadHash) { // not required
+ if typeutils.IsZero(m.PayloadHash) { // not required
return nil
}
@@ -258,7 +259,7 @@ func (m *CoseV001SchemaData) contextValidateEnvelopeHash(ctx context.Context, fo
if m.EnvelopeHash != nil {
- if swag.IsZero(m.EnvelopeHash) { // not required
+ if typeutils.IsZero(m.EnvelopeHash) { // not required
return nil
}
@@ -283,7 +284,7 @@ func (m *CoseV001SchemaData) contextValidatePayloadHash(ctx context.Context, for
if m.PayloadHash != nil {
- if swag.IsZero(m.PayloadHash) { // not required
+ if typeutils.IsZero(m.PayloadHash) { // not required
return nil
}
@@ -309,13 +310,13 @@ func (m *CoseV001SchemaData) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CoseV001SchemaData) UnmarshalBinary(b []byte) error {
var res CoseV001SchemaData
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -419,13 +420,13 @@ func (m *CoseV001SchemaDataEnvelopeHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CoseV001SchemaDataEnvelopeHash) UnmarshalBinary(b []byte) error {
var res CoseV001SchemaDataEnvelopeHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -529,13 +530,13 @@ func (m *CoseV001SchemaDataPayloadHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CoseV001SchemaDataPayloadHash) UnmarshalBinary(b []byte) error {
var res CoseV001SchemaDataPayloadHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse.go
index 40b48b304e..2b9127fb2c 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse.go
@@ -25,7 +25,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -135,7 +135,7 @@ func (m DSSE) MarshalJSON() ([]byte, error) {
return nil, err
}
- return swag.ConcatJSON(b1, b2, b3), nil
+ return jsonutils.ConcatJSON(b1, b2, b3), nil
}
// Validate validates this dsse
@@ -193,13 +193,13 @@ func (m *DSSE) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DSSE) UnmarshalBinary(b []byte) error {
var res DSSE
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse_v001_schema.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse_v001_schema.go
index efbcff1752..a184cfd4d9 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse_v001_schema.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse_v001_schema.go
@@ -26,7 +26,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -79,7 +80,7 @@ func (m *DSSEV001Schema) Validate(formats strfmt.Registry) error {
}
func (m *DSSEV001Schema) validateEnvelopeHash(formats strfmt.Registry) error {
- if swag.IsZero(m.EnvelopeHash) { // not required
+ if typeutils.IsZero(m.EnvelopeHash) { // not required
return nil
}
@@ -102,7 +103,7 @@ func (m *DSSEV001Schema) validateEnvelopeHash(formats strfmt.Registry) error {
}
func (m *DSSEV001Schema) validatePayloadHash(formats strfmt.Registry) error {
- if swag.IsZero(m.PayloadHash) { // not required
+ if typeutils.IsZero(m.PayloadHash) { // not required
return nil
}
@@ -125,7 +126,7 @@ func (m *DSSEV001Schema) validatePayloadHash(formats strfmt.Registry) error {
}
func (m *DSSEV001Schema) validateProposedContent(formats strfmt.Registry) error {
- if swag.IsZero(m.ProposedContent) { // not required
+ if typeutils.IsZero(m.ProposedContent) { // not required
return nil
}
@@ -148,7 +149,7 @@ func (m *DSSEV001Schema) validateProposedContent(formats strfmt.Registry) error
}
func (m *DSSEV001Schema) validateSignatures(formats strfmt.Registry) error {
- if swag.IsZero(m.Signatures) { // not required
+ if typeutils.IsZero(m.Signatures) { // not required
return nil
}
@@ -159,7 +160,7 @@ func (m *DSSEV001Schema) validateSignatures(formats strfmt.Registry) error {
}
for i := 0; i < len(m.Signatures); i++ {
- if swag.IsZero(m.Signatures[i]) { // not required
+ if typeutils.IsZero(m.Signatures[i]) { // not required
continue
}
@@ -213,7 +214,7 @@ func (m *DSSEV001Schema) contextValidateEnvelopeHash(ctx context.Context, format
if m.EnvelopeHash != nil {
- if swag.IsZero(m.EnvelopeHash) { // not required
+ if typeutils.IsZero(m.EnvelopeHash) { // not required
return nil
}
@@ -238,7 +239,7 @@ func (m *DSSEV001Schema) contextValidatePayloadHash(ctx context.Context, formats
if m.PayloadHash != nil {
- if swag.IsZero(m.PayloadHash) { // not required
+ if typeutils.IsZero(m.PayloadHash) { // not required
return nil
}
@@ -263,7 +264,7 @@ func (m *DSSEV001Schema) contextValidateProposedContent(ctx context.Context, for
if m.ProposedContent != nil {
- if swag.IsZero(m.ProposedContent) { // not required
+ if typeutils.IsZero(m.ProposedContent) { // not required
return nil
}
@@ -294,7 +295,7 @@ func (m *DSSEV001Schema) contextValidateSignatures(ctx context.Context, formats
if m.Signatures[i] != nil {
- if swag.IsZero(m.Signatures[i]) { // not required
+ if typeutils.IsZero(m.Signatures[i]) { // not required
return nil
}
@@ -322,13 +323,13 @@ func (m *DSSEV001Schema) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DSSEV001Schema) UnmarshalBinary(b []byte) error {
var res DSSEV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -432,13 +433,13 @@ func (m *DSSEV001SchemaEnvelopeHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DSSEV001SchemaEnvelopeHash) UnmarshalBinary(b []byte) error {
var res DSSEV001SchemaEnvelopeHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -542,13 +543,13 @@ func (m *DSSEV001SchemaPayloadHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DSSEV001SchemaPayloadHash) UnmarshalBinary(b []byte) error {
var res DSSEV001SchemaPayloadHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -613,7 +614,7 @@ func (m *DSSEV001SchemaProposedContent) validateVerifiers(formats strfmt.Registr
}
// ContextValidate validates this DSSE v001 schema proposed content based on context it is used
-func (m *DSSEV001SchemaProposedContent) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *DSSEV001SchemaProposedContent) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -622,13 +623,13 @@ func (m *DSSEV001SchemaProposedContent) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DSSEV001SchemaProposedContent) UnmarshalBinary(b []byte) error {
var res DSSEV001SchemaProposedContent
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -692,7 +693,7 @@ func (m *DSSEV001SchemaSignaturesItems0) validateVerifier(formats strfmt.Registr
}
// ContextValidate validates this DSSE v001 schema signatures items0 based on context it is used
-func (m *DSSEV001SchemaSignaturesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *DSSEV001SchemaSignaturesItems0) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -701,13 +702,13 @@ func (m *DSSEV001SchemaSignaturesItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DSSEV001SchemaSignaturesItems0) UnmarshalBinary(b []byte) error {
var res DSSEV001SchemaSignaturesItems0
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/error.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/error.go
index 6dcec446cf..4243953998 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/error.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/error.go
@@ -22,7 +22,7 @@ import (
"context"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
)
// Error error
@@ -38,12 +38,12 @@ type Error struct {
}
// Validate validates this error
-func (m *Error) Validate(formats strfmt.Registry) error {
+func (m *Error) Validate(_ strfmt.Registry) error {
return nil
}
// ContextValidate validates this error based on context it is used
-func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *Error) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -52,13 +52,13 @@ func (m *Error) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Error) UnmarshalBinary(b []byte) error {
var res Error
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord.go
index 1c2c48bdb3..c003669893 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord.go
@@ -25,7 +25,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -135,7 +135,7 @@ func (m Hashedrekord) MarshalJSON() ([]byte, error) {
return nil, err
}
- return swag.ConcatJSON(b1, b2, b3), nil
+ return jsonutils.ConcatJSON(b1, b2, b3), nil
}
// Validate validates this hashedrekord
@@ -193,13 +193,13 @@ func (m *Hashedrekord) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Hashedrekord) UnmarshalBinary(b []byte) error {
var res Hashedrekord
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord_v001_schema.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord_v001_schema.go
index 85b3fcbb31..81a7a0adc4 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord_v001_schema.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord_v001_schema.go
@@ -25,7 +25,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -176,13 +177,13 @@ func (m *HashedrekordV001Schema) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *HashedrekordV001Schema) UnmarshalBinary(b []byte) error {
var res HashedrekordV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -213,7 +214,7 @@ func (m *HashedrekordV001SchemaData) Validate(formats strfmt.Registry) error {
}
func (m *HashedrekordV001SchemaData) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -253,7 +254,7 @@ func (m *HashedrekordV001SchemaData) contextValidateHash(ctx context.Context, fo
if m.Hash != nil {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -279,13 +280,13 @@ func (m *HashedrekordV001SchemaData) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *HashedrekordV001SchemaData) UnmarshalBinary(b []byte) error {
var res HashedrekordV001SchemaData
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -381,7 +382,7 @@ func (m *HashedrekordV001SchemaDataHash) validateValue(formats strfmt.Registry)
}
// ContextValidate validates this hashedrekord v001 schema data hash based on context it is used
-func (m *HashedrekordV001SchemaDataHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *HashedrekordV001SchemaDataHash) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -390,13 +391,13 @@ func (m *HashedrekordV001SchemaDataHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *HashedrekordV001SchemaDataHash) UnmarshalBinary(b []byte) error {
var res HashedrekordV001SchemaDataHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -431,7 +432,7 @@ func (m *HashedrekordV001SchemaSignature) Validate(formats strfmt.Registry) erro
}
func (m *HashedrekordV001SchemaSignature) validatePublicKey(formats strfmt.Registry) error {
- if swag.IsZero(m.PublicKey) { // not required
+ if typeutils.IsZero(m.PublicKey) { // not required
return nil
}
@@ -471,7 +472,7 @@ func (m *HashedrekordV001SchemaSignature) contextValidatePublicKey(ctx context.C
if m.PublicKey != nil {
- if swag.IsZero(m.PublicKey) { // not required
+ if typeutils.IsZero(m.PublicKey) { // not required
return nil
}
@@ -497,13 +498,13 @@ func (m *HashedrekordV001SchemaSignature) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *HashedrekordV001SchemaSignature) UnmarshalBinary(b []byte) error {
var res HashedrekordV001SchemaSignature
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -521,12 +522,12 @@ type HashedrekordV001SchemaSignaturePublicKey struct {
}
// Validate validates this hashedrekord v001 schema signature public key
-func (m *HashedrekordV001SchemaSignaturePublicKey) Validate(formats strfmt.Registry) error {
+func (m *HashedrekordV001SchemaSignaturePublicKey) Validate(_ strfmt.Registry) error {
return nil
}
// ContextValidate validates this hashedrekord v001 schema signature public key based on context it is used
-func (m *HashedrekordV001SchemaSignaturePublicKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *HashedrekordV001SchemaSignaturePublicKey) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -535,13 +536,13 @@ func (m *HashedrekordV001SchemaSignaturePublicKey) MarshalBinary() ([]byte, erro
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *HashedrekordV001SchemaSignaturePublicKey) UnmarshalBinary(b []byte) error {
var res HashedrekordV001SchemaSignaturePublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/helm.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/helm.go
index 3cab983af8..1076a0d2b0 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/helm.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/helm.go
@@ -25,7 +25,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -135,7 +135,7 @@ func (m Helm) MarshalJSON() ([]byte, error) {
return nil, err
}
- return swag.ConcatJSON(b1, b2, b3), nil
+ return jsonutils.ConcatJSON(b1, b2, b3), nil
}
// Validate validates this helm
@@ -193,13 +193,13 @@ func (m *Helm) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Helm) UnmarshalBinary(b []byte) error {
var res Helm
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/helm_v001_schema.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/helm_v001_schema.go
index 3274e1d096..d350c7f5db 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/helm_v001_schema.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/helm_v001_schema.go
@@ -25,7 +25,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -176,13 +177,13 @@ func (m *HelmV001Schema) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *HelmV001Schema) UnmarshalBinary(b []byte) error {
var res HelmV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -221,7 +222,7 @@ func (m *HelmV001SchemaChart) Validate(formats strfmt.Registry) error {
}
func (m *HelmV001SchemaChart) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -289,7 +290,7 @@ func (m *HelmV001SchemaChart) contextValidateHash(ctx context.Context, formats s
if m.Hash != nil {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -336,13 +337,13 @@ func (m *HelmV001SchemaChart) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *HelmV001SchemaChart) UnmarshalBinary(b []byte) error {
var res HelmV001SchemaChart
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -446,13 +447,13 @@ func (m *HelmV001SchemaChartHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *HelmV001SchemaChartHash) UnmarshalBinary(b []byte) error {
var res HelmV001SchemaChartHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -487,7 +488,7 @@ func (m *HelmV001SchemaChartProvenance) Validate(formats strfmt.Registry) error
}
func (m *HelmV001SchemaChartProvenance) validateSignature(formats strfmt.Registry) error {
- if swag.IsZero(m.Signature) { // not required
+ if typeutils.IsZero(m.Signature) { // not required
return nil
}
@@ -527,7 +528,7 @@ func (m *HelmV001SchemaChartProvenance) contextValidateSignature(ctx context.Con
if m.Signature != nil {
- if swag.IsZero(m.Signature) { // not required
+ if typeutils.IsZero(m.Signature) { // not required
return nil
}
@@ -553,13 +554,13 @@ func (m *HelmV001SchemaChartProvenance) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *HelmV001SchemaChartProvenance) UnmarshalBinary(b []byte) error {
var res HelmV001SchemaChartProvenance
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -629,13 +630,13 @@ func (m *HelmV001SchemaChartProvenanceSignature) MarshalBinary() ([]byte, error)
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *HelmV001SchemaChartProvenanceSignature) UnmarshalBinary(b []byte) error {
var res HelmV001SchemaChartProvenanceSignature
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -677,7 +678,7 @@ func (m *HelmV001SchemaPublicKey) validateContent(formats strfmt.Registry) error
}
// ContextValidate validates this helm v001 schema public key based on context it is used
-func (m *HelmV001SchemaPublicKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *HelmV001SchemaPublicKey) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -686,13 +687,13 @@ func (m *HelmV001SchemaPublicKey) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *HelmV001SchemaPublicKey) UnmarshalBinary(b []byte) error {
var res HelmV001SchemaPublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/inactive_shard_log_info.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/inactive_shard_log_info.go
index 7cbcdc9c27..ddfec594ac 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/inactive_shard_log_info.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/inactive_shard_log_info.go
@@ -23,7 +23,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -127,7 +127,7 @@ func (m *InactiveShardLogInfo) validateTreeSize(formats strfmt.Registry) error {
}
// ContextValidate validates this inactive shard log info based on context it is used
-func (m *InactiveShardLogInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *InactiveShardLogInfo) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -136,13 +136,13 @@ func (m *InactiveShardLogInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *InactiveShardLogInfo) UnmarshalBinary(b []byte) error {
var res InactiveShardLogInfo
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/inclusion_proof.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/inclusion_proof.go
index a228b27f97..7955d82d75 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/inclusion_proof.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/inclusion_proof.go
@@ -24,7 +24,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -153,7 +153,7 @@ func (m *InclusionProof) validateTreeSize(formats strfmt.Registry) error {
}
// ContextValidate validates this inclusion proof based on context it is used
-func (m *InclusionProof) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *InclusionProof) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -162,13 +162,13 @@ func (m *InclusionProof) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *InclusionProof) UnmarshalBinary(b []byte) error {
var res InclusionProof
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto.go
index 6a79e48686..7b00668eaa 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto.go
@@ -25,7 +25,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -135,7 +135,7 @@ func (m Intoto) MarshalJSON() ([]byte, error) {
return nil, err
}
- return swag.ConcatJSON(b1, b2, b3), nil
+ return jsonutils.ConcatJSON(b1, b2, b3), nil
}
// Validate validates this intoto
@@ -193,13 +193,13 @@ func (m *Intoto) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Intoto) UnmarshalBinary(b []byte) error {
var res Intoto
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v001_schema.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v001_schema.go
index 912a34c522..9deb17b253 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v001_schema.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v001_schema.go
@@ -25,7 +25,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -137,13 +138,13 @@ func (m *IntotoV001Schema) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IntotoV001Schema) UnmarshalBinary(b []byte) error {
var res IntotoV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -184,7 +185,7 @@ func (m *IntotoV001SchemaContent) Validate(formats strfmt.Registry) error {
}
func (m *IntotoV001SchemaContent) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -207,7 +208,7 @@ func (m *IntotoV001SchemaContent) validateHash(formats strfmt.Registry) error {
}
func (m *IntotoV001SchemaContent) validatePayloadHash(formats strfmt.Registry) error {
- if swag.IsZero(m.PayloadHash) { // not required
+ if typeutils.IsZero(m.PayloadHash) { // not required
return nil
}
@@ -251,7 +252,7 @@ func (m *IntotoV001SchemaContent) contextValidateHash(ctx context.Context, forma
if m.Hash != nil {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -276,7 +277,7 @@ func (m *IntotoV001SchemaContent) contextValidatePayloadHash(ctx context.Context
if m.PayloadHash != nil {
- if swag.IsZero(m.PayloadHash) { // not required
+ if typeutils.IsZero(m.PayloadHash) { // not required
return nil
}
@@ -302,13 +303,13 @@ func (m *IntotoV001SchemaContent) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IntotoV001SchemaContent) UnmarshalBinary(b []byte) error {
var res IntotoV001SchemaContent
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -412,13 +413,13 @@ func (m *IntotoV001SchemaContentHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IntotoV001SchemaContentHash) UnmarshalBinary(b []byte) error {
var res IntotoV001SchemaContentHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -522,13 +523,13 @@ func (m *IntotoV001SchemaContentPayloadHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IntotoV001SchemaContentPayloadHash) UnmarshalBinary(b []byte) error {
var res IntotoV001SchemaContentPayloadHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v002_schema.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v002_schema.go
index c3a4c959c5..ba2d96ae44 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v002_schema.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v002_schema.go
@@ -26,7 +26,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -120,13 +121,13 @@ func (m *IntotoV002Schema) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IntotoV002Schema) UnmarshalBinary(b []byte) error {
var res IntotoV002Schema
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -196,7 +197,7 @@ func (m *IntotoV002SchemaContent) validateEnvelope(formats strfmt.Registry) erro
}
func (m *IntotoV002SchemaContent) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -219,7 +220,7 @@ func (m *IntotoV002SchemaContent) validateHash(formats strfmt.Registry) error {
}
func (m *IntotoV002SchemaContent) validatePayloadHash(formats strfmt.Registry) error {
- if swag.IsZero(m.PayloadHash) { // not required
+ if typeutils.IsZero(m.PayloadHash) { // not required
return nil
}
@@ -288,7 +289,7 @@ func (m *IntotoV002SchemaContent) contextValidateHash(ctx context.Context, forma
if m.Hash != nil {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -313,7 +314,7 @@ func (m *IntotoV002SchemaContent) contextValidatePayloadHash(ctx context.Context
if m.PayloadHash != nil {
- if swag.IsZero(m.PayloadHash) { // not required
+ if typeutils.IsZero(m.PayloadHash) { // not required
return nil
}
@@ -339,13 +340,13 @@ func (m *IntotoV002SchemaContent) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IntotoV002SchemaContent) UnmarshalBinary(b []byte) error {
var res IntotoV002SchemaContent
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -411,7 +412,7 @@ func (m *IntotoV002SchemaContentEnvelope) validateSignatures(formats strfmt.Regi
}
for i := 0; i < len(m.Signatures); i++ {
- if swag.IsZero(m.Signatures[i]) { // not required
+ if typeutils.IsZero(m.Signatures[i]) { // not required
continue
}
@@ -455,7 +456,7 @@ func (m *IntotoV002SchemaContentEnvelope) contextValidateSignatures(ctx context.
if m.Signatures[i] != nil {
- if swag.IsZero(m.Signatures[i]) { // not required
+ if typeutils.IsZero(m.Signatures[i]) { // not required
return nil
}
@@ -483,13 +484,13 @@ func (m *IntotoV002SchemaContentEnvelope) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IntotoV002SchemaContentEnvelope) UnmarshalBinary(b []byte) error {
var res IntotoV002SchemaContentEnvelope
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -552,7 +553,7 @@ func (m *IntotoV002SchemaContentEnvelopeSignaturesItems0) validateSig(formats st
}
// ContextValidate validates this intoto v002 schema content envelope signatures items0 based on context it is used
-func (m *IntotoV002SchemaContentEnvelopeSignaturesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *IntotoV002SchemaContentEnvelopeSignaturesItems0) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -561,13 +562,13 @@ func (m *IntotoV002SchemaContentEnvelopeSignaturesItems0) MarshalBinary() ([]byt
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IntotoV002SchemaContentEnvelopeSignaturesItems0) UnmarshalBinary(b []byte) error {
var res IntotoV002SchemaContentEnvelopeSignaturesItems0
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -671,13 +672,13 @@ func (m *IntotoV002SchemaContentHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IntotoV002SchemaContentHash) UnmarshalBinary(b []byte) error {
var res IntotoV002SchemaContentHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -781,13 +782,13 @@ func (m *IntotoV002SchemaContentPayloadHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IntotoV002SchemaContentPayloadHash) UnmarshalBinary(b []byte) error {
var res IntotoV002SchemaContentPayloadHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/jar.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/jar.go
index 71d25cd701..a4fa52ba3e 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/jar.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/jar.go
@@ -25,7 +25,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -135,7 +135,7 @@ func (m Jar) MarshalJSON() ([]byte, error) {
return nil, err
}
- return swag.ConcatJSON(b1, b2, b3), nil
+ return jsonutils.ConcatJSON(b1, b2, b3), nil
}
// Validate validates this jar
@@ -193,13 +193,13 @@ func (m *Jar) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Jar) UnmarshalBinary(b []byte) error {
var res Jar
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/jar_v001_schema.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/jar_v001_schema.go
index f3808966b5..495aeaeaea 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/jar_v001_schema.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/jar_v001_schema.go
@@ -25,7 +25,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -87,7 +88,7 @@ func (m *JarV001Schema) validateArchive(formats strfmt.Registry) error {
}
func (m *JarV001Schema) validateSignature(formats strfmt.Registry) error {
- if swag.IsZero(m.Signature) { // not required
+ if typeutils.IsZero(m.Signature) { // not required
return nil
}
@@ -152,7 +153,7 @@ func (m *JarV001Schema) contextValidateSignature(ctx context.Context, formats st
if m.Signature != nil {
- if swag.IsZero(m.Signature) { // not required
+ if typeutils.IsZero(m.Signature) { // not required
return nil
}
@@ -178,13 +179,13 @@ func (m *JarV001Schema) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *JarV001Schema) UnmarshalBinary(b []byte) error {
var res JarV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -219,7 +220,7 @@ func (m *JarV001SchemaArchive) Validate(formats strfmt.Registry) error {
}
func (m *JarV001SchemaArchive) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -259,7 +260,7 @@ func (m *JarV001SchemaArchive) contextValidateHash(ctx context.Context, formats
if m.Hash != nil {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -285,13 +286,13 @@ func (m *JarV001SchemaArchive) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *JarV001SchemaArchive) UnmarshalBinary(b []byte) error {
var res JarV001SchemaArchive
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -381,7 +382,7 @@ func (m *JarV001SchemaArchiveHash) validateValue(formats strfmt.Registry) error
}
// ContextValidate validates this jar v001 schema archive hash based on context it is used
-func (m *JarV001SchemaArchiveHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *JarV001SchemaArchiveHash) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -390,13 +391,13 @@ func (m *JarV001SchemaArchiveHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *JarV001SchemaArchiveHash) UnmarshalBinary(b []byte) error {
var res JarV001SchemaArchiveHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -523,13 +524,13 @@ func (m *JarV001SchemaSignature) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *JarV001SchemaSignature) UnmarshalBinary(b []byte) error {
var res JarV001SchemaSignature
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -585,13 +586,13 @@ func (m *JarV001SchemaSignaturePublicKey) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *JarV001SchemaSignaturePublicKey) UnmarshalBinary(b []byte) error {
var res JarV001SchemaSignaturePublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/log_entry.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/log_entry.go
index bd25ee7378..1e51b1722c 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/log_entry.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/log_entry.go
@@ -24,7 +24,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -39,7 +40,7 @@ func (m LogEntry) Validate(formats strfmt.Registry) error {
for k := range m {
- if swag.IsZero(m[k]) { // not required
+ if typeutils.IsZero(m[k]) { // not required
continue
}
if val, ok := m[k]; ok {
@@ -150,7 +151,7 @@ func (m *LogEntryAnon) Validate(formats strfmt.Registry) error {
}
func (m *LogEntryAnon) validateAttestation(formats strfmt.Registry) error {
- if swag.IsZero(m.Attestation) { // not required
+ if typeutils.IsZero(m.Attestation) { // not required
return nil
}
@@ -217,7 +218,7 @@ func (m *LogEntryAnon) validateLogIndex(formats strfmt.Registry) error {
}
func (m *LogEntryAnon) validateVerification(formats strfmt.Registry) error {
- if swag.IsZero(m.Verification) { // not required
+ if typeutils.IsZero(m.Verification) { // not required
return nil
}
@@ -261,7 +262,7 @@ func (m *LogEntryAnon) contextValidateAttestation(ctx context.Context, formats s
if m.Attestation != nil {
- if swag.IsZero(m.Attestation) { // not required
+ if typeutils.IsZero(m.Attestation) { // not required
return nil
}
@@ -286,7 +287,7 @@ func (m *LogEntryAnon) contextValidateVerification(ctx context.Context, formats
if m.Verification != nil {
- if swag.IsZero(m.Verification) { // not required
+ if typeutils.IsZero(m.Verification) { // not required
return nil
}
@@ -312,13 +313,13 @@ func (m *LogEntryAnon) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *LogEntryAnon) UnmarshalBinary(b []byte) error {
var res LogEntryAnon
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -336,12 +337,12 @@ type LogEntryAnonAttestation struct {
}
// Validate validates this log entry anon attestation
-func (m *LogEntryAnonAttestation) Validate(formats strfmt.Registry) error {
+func (m *LogEntryAnonAttestation) Validate(_ strfmt.Registry) error {
return nil
}
// ContextValidate validates this log entry anon attestation based on context it is used
-func (m *LogEntryAnonAttestation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *LogEntryAnonAttestation) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -350,13 +351,13 @@ func (m *LogEntryAnonAttestation) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *LogEntryAnonAttestation) UnmarshalBinary(b []byte) error {
var res LogEntryAnonAttestation
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -391,7 +392,7 @@ func (m *LogEntryAnonVerification) Validate(formats strfmt.Registry) error {
}
func (m *LogEntryAnonVerification) validateInclusionProof(formats strfmt.Registry) error {
- if swag.IsZero(m.InclusionProof) { // not required
+ if typeutils.IsZero(m.InclusionProof) { // not required
return nil
}
@@ -431,7 +432,7 @@ func (m *LogEntryAnonVerification) contextValidateInclusionProof(ctx context.Con
if m.InclusionProof != nil {
- if swag.IsZero(m.InclusionProof) { // not required
+ if typeutils.IsZero(m.InclusionProof) { // not required
return nil
}
@@ -457,13 +458,13 @@ func (m *LogEntryAnonVerification) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *LogEntryAnonVerification) UnmarshalBinary(b []byte) error {
var res LogEntryAnonVerification
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/log_info.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/log_info.go
index b42dfbb24f..4ea1035ab6 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/log_info.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/log_info.go
@@ -25,7 +25,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -88,12 +89,12 @@ func (m *LogInfo) Validate(formats strfmt.Registry) error {
}
func (m *LogInfo) validateInactiveShards(formats strfmt.Registry) error {
- if swag.IsZero(m.InactiveShards) { // not required
+ if typeutils.IsZero(m.InactiveShards) { // not required
return nil
}
for i := 0; i < len(m.InactiveShards); i++ {
- if swag.IsZero(m.InactiveShards[i]) { // not required
+ if typeutils.IsZero(m.InactiveShards[i]) { // not required
continue
}
@@ -185,7 +186,7 @@ func (m *LogInfo) contextValidateInactiveShards(ctx context.Context, formats str
if m.InactiveShards[i] != nil {
- if swag.IsZero(m.InactiveShards[i]) { // not required
+ if typeutils.IsZero(m.InactiveShards[i]) { // not required
return nil
}
@@ -213,13 +214,13 @@ func (m *LogInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *LogInfo) UnmarshalBinary(b []byte) error {
var res LogInfo
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/proposed_entry.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/proposed_entry.go
index 141730a18b..1af9a3c406 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/proposed_entry.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/proposed_entry.go
@@ -78,115 +78,73 @@ func UnmarshalProposedEntrySlice(reader io.Reader, consumer runtime.Consumer) ([
}
// UnmarshalProposedEntry unmarshals polymorphic ProposedEntry
-func UnmarshalProposedEntry(reader io.Reader, consumer runtime.Consumer) (ProposedEntry, error) {
- // we need to read this twice, so first into a buffer
- data, err := io.ReadAll(reader)
- if err != nil {
- return nil, err
- }
- return unmarshalProposedEntry(data, consumer)
+func UnmarshalProposedEntry(reader io.Reader, _ runtime.Consumer) (ProposedEntry, error) {
+ return fastUnmarshalTargetedProposedEntryReader(reader)
}
-func unmarshalProposedEntry(data []byte, consumer runtime.Consumer) (ProposedEntry, error) {
- buf := bytes.NewBuffer(data)
- buf2 := bytes.NewBuffer(data)
+type targetedProposedEntry struct {
+ Kind string `json:"kind"`
+ APIVersion *string `json:"apiVersion"`
+ Spec any `json:"spec"`
+}
- // the first time this is read is to fetch the value of the kind property.
- var getType struct {
- Kind string `json:"kind"`
- }
- if err := consumer.Consume(buf, &getType); err != nil {
+func fastUnmarshalTargetedProposedEntryReader(reader io.Reader) (ProposedEntry, error) {
+ var parsed targetedProposedEntry
+ dec := json.NewDecoder(reader)
+ dec.UseNumber()
+
+ if err := dec.Decode(&parsed); err != nil {
return nil, err
}
- if err := validate.RequiredString("kind", "body", getType.Kind); err != nil {
+ if err := validate.RequiredString("kind", "body", parsed.Kind); err != nil {
return nil, err
}
- // The value of kind is used to determine which type to create and unmarshal the data into
- switch getType.Kind {
+ switch parsed.Kind {
case "ProposedEntry":
- var result proposedEntry
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
+ return &proposedEntry{kindField: parsed.Kind}, nil
case "alpine":
- var result Alpine
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
+ return &Alpine{APIVersion: parsed.APIVersion, Spec: parsed.Spec}, nil
case "cose":
- var result Cose
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
+ return &Cose{APIVersion: parsed.APIVersion, Spec: parsed.Spec}, nil
case "dsse":
- var result DSSE
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
+ return &DSSE{APIVersion: parsed.APIVersion, Spec: parsed.Spec}, nil
case "hashedrekord":
- var result Hashedrekord
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
+ return &Hashedrekord{APIVersion: parsed.APIVersion, Spec: parsed.Spec}, nil
case "helm":
- var result Helm
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
+ return &Helm{APIVersion: parsed.APIVersion, Spec: parsed.Spec}, nil
case "intoto":
- var result Intoto
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
+ return &Intoto{APIVersion: parsed.APIVersion, Spec: parsed.Spec}, nil
case "jar":
- var result Jar
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
+ return &Jar{APIVersion: parsed.APIVersion, Spec: parsed.Spec}, nil
case "rekord":
- var result Rekord
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
+ return &Rekord{APIVersion: parsed.APIVersion, Spec: parsed.Spec}, nil
case "rfc3161":
- var result Rfc3161
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
+ return &Rfc3161{APIVersion: parsed.APIVersion, Spec: parsed.Spec}, nil
case "rpm":
- var result Rpm
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
+ return &Rpm{APIVersion: parsed.APIVersion, Spec: parsed.Spec}, nil
case "tuf":
- var result TUF
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
+ return &TUF{APIVersion: parsed.APIVersion, Spec: parsed.Spec}, nil
+ default:
+ return nil, errors.New(422, "invalid kind value: %q", parsed.Kind)
}
- return nil, errors.New(422, "invalid kind value: %q", getType.Kind)
+}
+
+func fastUnmarshalTargetedProposedEntry(data []byte) (ProposedEntry, error) {
+ return fastUnmarshalTargetedProposedEntryReader(bytes.NewReader(data))
+}
+
+func unmarshalProposedEntry(data []byte, _ runtime.Consumer) (ProposedEntry, error) {
+ return fastUnmarshalTargetedProposedEntry(data)
}
// Validate validates this proposed entry
-func (m *proposedEntry) Validate(formats strfmt.Registry) error {
+func (m *proposedEntry) Validate(_ strfmt.Registry) error {
return nil
}
// ContextValidate validates this proposed entry based on context it is used
-func (m *proposedEntry) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *proposedEntry) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord.go
index d862850726..ee53e97211 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord.go
@@ -25,7 +25,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -135,7 +135,7 @@ func (m Rekord) MarshalJSON() ([]byte, error) {
return nil, err
}
- return swag.ConcatJSON(b1, b2, b3), nil
+ return jsonutils.ConcatJSON(b1, b2, b3), nil
}
// Validate validates this rekord
@@ -193,13 +193,13 @@ func (m *Rekord) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Rekord) UnmarshalBinary(b []byte) error {
var res Rekord
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord_v001_schema.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord_v001_schema.go
index ab3a323369..7dc6c56f09 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord_v001_schema.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord_v001_schema.go
@@ -25,7 +25,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -176,13 +177,13 @@ func (m *RekordV001Schema) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RekordV001Schema) UnmarshalBinary(b []byte) error {
var res RekordV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -217,7 +218,7 @@ func (m *RekordV001SchemaData) Validate(formats strfmt.Registry) error {
}
func (m *RekordV001SchemaData) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -257,7 +258,7 @@ func (m *RekordV001SchemaData) contextValidateHash(ctx context.Context, formats
if m.Hash != nil {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -283,13 +284,13 @@ func (m *RekordV001SchemaData) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RekordV001SchemaData) UnmarshalBinary(b []byte) error {
var res RekordV001SchemaData
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -393,13 +394,13 @@ func (m *RekordV001SchemaDataHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RekordV001SchemaDataHash) UnmarshalBinary(b []byte) error {
var res RekordV001SchemaDataHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -570,13 +571,13 @@ func (m *RekordV001SchemaSignature) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RekordV001SchemaSignature) UnmarshalBinary(b []byte) error {
var res RekordV001SchemaSignature
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -618,7 +619,7 @@ func (m *RekordV001SchemaSignaturePublicKey) validateContent(formats strfmt.Regi
}
// ContextValidate validates this rekord v001 schema signature public key based on context it is used
-func (m *RekordV001SchemaSignaturePublicKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *RekordV001SchemaSignaturePublicKey) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -627,13 +628,13 @@ func (m *RekordV001SchemaSignaturePublicKey) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RekordV001SchemaSignaturePublicKey) UnmarshalBinary(b []byte) error {
var res RekordV001SchemaSignaturePublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161.go
index b18aa31a72..29b67da7e0 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161.go
@@ -25,7 +25,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -135,7 +135,7 @@ func (m Rfc3161) MarshalJSON() ([]byte, error) {
return nil, err
}
- return swag.ConcatJSON(b1, b2, b3), nil
+ return jsonutils.ConcatJSON(b1, b2, b3), nil
}
// Validate validates this rfc3161
@@ -193,13 +193,13 @@ func (m *Rfc3161) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Rfc3161) UnmarshalBinary(b []byte) error {
var res Rfc3161
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161_v001_schema.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161_v001_schema.go
index a2d7a3642a..ca328df328 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161_v001_schema.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161_v001_schema.go
@@ -24,7 +24,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -118,13 +118,13 @@ func (m *Rfc3161V001Schema) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Rfc3161V001Schema) UnmarshalBinary(b []byte) error {
var res Rfc3161V001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -166,7 +166,7 @@ func (m *Rfc3161V001SchemaTsr) validateContent(formats strfmt.Registry) error {
}
// ContextValidate validates this rfc3161 v001 schema tsr based on context it is used
-func (m *Rfc3161V001SchemaTsr) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *Rfc3161V001SchemaTsr) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -175,13 +175,13 @@ func (m *Rfc3161V001SchemaTsr) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Rfc3161V001SchemaTsr) UnmarshalBinary(b []byte) error {
var res Rfc3161V001SchemaTsr
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm.go
index 4ff2a264ee..614e5af906 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm.go
@@ -25,7 +25,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -135,7 +135,7 @@ func (m Rpm) MarshalJSON() ([]byte, error) {
return nil, err
}
- return swag.ConcatJSON(b1, b2, b3), nil
+ return jsonutils.ConcatJSON(b1, b2, b3), nil
}
// Validate validates this rpm
@@ -193,13 +193,13 @@ func (m *Rpm) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Rpm) UnmarshalBinary(b []byte) error {
var res Rpm
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm_v001_schema.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm_v001_schema.go
index 4506414a4e..3d53a6015a 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm_v001_schema.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm_v001_schema.go
@@ -25,7 +25,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -176,13 +177,13 @@ func (m *RpmV001Schema) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RpmV001Schema) UnmarshalBinary(b []byte) error {
var res RpmV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -221,7 +222,7 @@ func (m *RpmV001SchemaPackage) Validate(formats strfmt.Registry) error {
}
func (m *RpmV001SchemaPackage) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -265,7 +266,7 @@ func (m *RpmV001SchemaPackage) contextValidateHash(ctx context.Context, formats
if m.Hash != nil {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -296,13 +297,13 @@ func (m *RpmV001SchemaPackage) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RpmV001SchemaPackage) UnmarshalBinary(b []byte) error {
var res RpmV001SchemaPackage
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -392,7 +393,7 @@ func (m *RpmV001SchemaPackageHash) validateValue(formats strfmt.Registry) error
}
// ContextValidate validates this rpm v001 schema package hash based on context it is used
-func (m *RpmV001SchemaPackageHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *RpmV001SchemaPackageHash) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -401,13 +402,13 @@ func (m *RpmV001SchemaPackageHash) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RpmV001SchemaPackageHash) UnmarshalBinary(b []byte) error {
var res RpmV001SchemaPackageHash
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -449,7 +450,7 @@ func (m *RpmV001SchemaPublicKey) validateContent(formats strfmt.Registry) error
}
// ContextValidate validates this rpm v001 schema public key based on context it is used
-func (m *RpmV001SchemaPublicKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *RpmV001SchemaPublicKey) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -458,13 +459,13 @@ func (m *RpmV001SchemaPublicKey) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RpmV001SchemaPublicKey) UnmarshalBinary(b []byte) error {
var res RpmV001SchemaPublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/search_index.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/search_index.go
index ff672558a4..dd08f13e0b 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/search_index.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/search_index.go
@@ -25,7 +25,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -48,6 +49,11 @@ type SearchIndex struct {
// public key
PublicKey *SearchIndexPublicKey `json:"publicKey,omitempty"`
+
+ // A SAN value (URI, DNS, IP, OtherName) as stored on the entry. Lookup is case-insensitive — e.g. a GitHub OIDC SAN such as `https://github.com/owner/repo/.github/workflows/build.yml@refs/heads/main`.
+ // Max Length: 512
+ // Min Length: 1
+ Subject string `json:"subject,omitempty"`
}
// Validate validates this search index
@@ -70,6 +76,10 @@ func (m *SearchIndex) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
+ if err := m.validateSubject(formats); err != nil {
+ res = append(res, err)
+ }
+
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -77,7 +87,7 @@ func (m *SearchIndex) Validate(formats strfmt.Registry) error {
}
func (m *SearchIndex) validateEmail(formats strfmt.Registry) error {
- if swag.IsZero(m.Email) { // not required
+ if typeutils.IsZero(m.Email) { // not required
return nil
}
@@ -89,7 +99,7 @@ func (m *SearchIndex) validateEmail(formats strfmt.Registry) error {
}
func (m *SearchIndex) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
+ if typeutils.IsZero(m.Hash) { // not required
return nil
}
@@ -130,7 +140,7 @@ func (m *SearchIndex) validateOperatorEnum(path, location string, value string)
}
func (m *SearchIndex) validateOperator(formats strfmt.Registry) error {
- if swag.IsZero(m.Operator) { // not required
+ if typeutils.IsZero(m.Operator) { // not required
return nil
}
@@ -143,7 +153,7 @@ func (m *SearchIndex) validateOperator(formats strfmt.Registry) error {
}
func (m *SearchIndex) validatePublicKey(formats strfmt.Registry) error {
- if swag.IsZero(m.PublicKey) { // not required
+ if typeutils.IsZero(m.PublicKey) { // not required
return nil
}
@@ -165,6 +175,22 @@ func (m *SearchIndex) validatePublicKey(formats strfmt.Registry) error {
return nil
}
+func (m *SearchIndex) validateSubject(formats strfmt.Registry) error {
+ if typeutils.IsZero(m.Subject) { // not required
+ return nil
+ }
+
+ if err := validate.MinLength("subject", "body", m.Subject, 1); err != nil {
+ return err
+ }
+
+ if err := validate.MaxLength("subject", "body", m.Subject, 512); err != nil {
+ return err
+ }
+
+ return nil
+}
+
// ContextValidate validate this search index based on the context it is used
func (m *SearchIndex) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
@@ -183,7 +209,7 @@ func (m *SearchIndex) contextValidatePublicKey(ctx context.Context, formats strf
if m.PublicKey != nil {
- if swag.IsZero(m.PublicKey) { // not required
+ if typeutils.IsZero(m.PublicKey) { // not required
return nil
}
@@ -209,13 +235,13 @@ func (m *SearchIndex) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SearchIndex) UnmarshalBinary(b []byte) error {
var res SearchIndex
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -304,7 +330,7 @@ func (m *SearchIndexPublicKey) validateFormat(formats strfmt.Registry) error {
}
// ContextValidate validates this search index public key based on context it is used
-func (m *SearchIndexPublicKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *SearchIndexPublicKey) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -313,13 +339,13 @@ func (m *SearchIndexPublicKey) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SearchIndexPublicKey) UnmarshalBinary(b []byte) error {
var res SearchIndexPublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/search_log_query.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/search_log_query.go
index 874f51f07e..40b97b5046 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/search_log_query.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/search_log_query.go
@@ -29,7 +29,8 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/typeutils"
"github.com/go-openapi/validate"
)
@@ -129,7 +130,7 @@ func (m SearchLogQuery) MarshalJSON() ([]byte, error) {
return nil, err
}
- return swag.ConcatJSON(b1, b2, b3), nil
+ return jsonutils.ConcatJSON(b1, b2, b3), nil
}
// Validate validates this search log query
@@ -155,7 +156,7 @@ func (m *SearchLogQuery) Validate(formats strfmt.Registry) error {
}
func (m *SearchLogQuery) validateEntries(formats strfmt.Registry) error {
- if swag.IsZero(m.Entries()) { // not required
+ if typeutils.IsZero(m.Entries()) { // not required
return nil
}
@@ -190,7 +191,7 @@ func (m *SearchLogQuery) validateEntries(formats strfmt.Registry) error {
}
func (m *SearchLogQuery) validateEntryUUIDs(formats strfmt.Registry) error {
- if swag.IsZero(m.EntryUUIDs) { // not required
+ if typeutils.IsZero(m.EntryUUIDs) { // not required
return nil
}
@@ -216,7 +217,7 @@ func (m *SearchLogQuery) validateEntryUUIDs(formats strfmt.Registry) error {
}
func (m *SearchLogQuery) validateLogIndexes(formats strfmt.Registry) error {
- if swag.IsZero(m.LogIndexes) { // not required
+ if typeutils.IsZero(m.LogIndexes) { // not required
return nil
}
@@ -231,7 +232,7 @@ func (m *SearchLogQuery) validateLogIndexes(formats strfmt.Registry) error {
}
for i := 0; i < len(m.LogIndexes); i++ {
- if swag.IsZero(m.LogIndexes[i]) { // not required
+ if typeutils.IsZero(m.LogIndexes[i]) { // not required
continue
}
@@ -262,7 +263,7 @@ func (m *SearchLogQuery) contextValidateEntries(ctx context.Context, formats str
for i := 0; i < len(m.Entries()); i++ {
- if swag.IsZero(m.entriesField[i]) { // not required
+ if typeutils.IsZero(m.entriesField[i]) { // not required
return nil
}
@@ -289,13 +290,13 @@ func (m *SearchLogQuery) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SearchLogQuery) UnmarshalBinary(b []byte) error {
var res SearchLogQuery
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf.go
index 98997da594..9199656143 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf.go
@@ -25,7 +25,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -135,7 +135,7 @@ func (m TUF) MarshalJSON() ([]byte, error) {
return nil, err
}
- return swag.ConcatJSON(b1, b2, b3), nil
+ return jsonutils.ConcatJSON(b1, b2, b3), nil
}
// Validate validates this tuf
@@ -193,13 +193,13 @@ func (m *TUF) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TUF) UnmarshalBinary(b []byte) error {
var res TUF
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf_v001_schema.go b/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf_v001_schema.go
index b66058702c..3146f7c081 100644
--- a/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf_v001_schema.go
+++ b/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf_v001_schema.go
@@ -24,7 +24,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
+ "github.com/go-openapi/swag/jsonutils"
"github.com/go-openapi/validate"
)
@@ -192,13 +192,13 @@ func (m *TUFV001Schema) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TUFV001Schema) UnmarshalBinary(b []byte) error {
var res TUFV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -239,7 +239,7 @@ func (m *TUFV001SchemaMetadata) validateContent(formats strfmt.Registry) error {
}
// ContextValidate validates this TUF v001 schema metadata based on context it is used
-func (m *TUFV001SchemaMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *TUFV001SchemaMetadata) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -248,13 +248,13 @@ func (m *TUFV001SchemaMetadata) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TUFV001SchemaMetadata) UnmarshalBinary(b []byte) error {
var res TUFV001SchemaMetadata
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
@@ -295,7 +295,7 @@ func (m *TUFV001SchemaRoot) validateContent(formats strfmt.Registry) error {
}
// ContextValidate validates this TUF v001 schema root based on context it is used
-func (m *TUFV001SchemaRoot) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
+func (m *TUFV001SchemaRoot) ContextValidate(_ context.Context, _ strfmt.Registry) error {
return nil
}
@@ -304,13 +304,13 @@ func (m *TUFV001SchemaRoot) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
- return swag.WriteJSON(m)
+ return jsonutils.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TUFV001SchemaRoot) UnmarshalBinary(b []byte) error {
var res TUFV001SchemaRoot
- if err := swag.ReadJSON(b, &res); err != nil {
+ if err := jsonutils.ReadJSON(b, &res); err != nil {
return err
}
*m = res
diff --git a/vendor/github.com/sigstore/rekor/pkg/pki/identity/identity.go b/vendor/github.com/sigstore/rekor/pkg/pki/identity/identity.go
index 4566e1ddfe..6bf0740c71 100644
--- a/vendor/github.com/sigstore/rekor/pkg/pki/identity/identity.go
+++ b/vendor/github.com/sigstore/rekor/pkg/pki/identity/identity.go
@@ -20,7 +20,7 @@ type Identity struct {
// - *ecdsa.PublicKey
// - ed25519.PublicKey
// - *x509.Certificate
- // - openpgp.EntityList (golang.org/x/crypto/openpgp)
+ // - openpgp.EntityList (github.com/ProtonMail/go-crypto/openpgp)
// - *minisign.PublicKey (github.com/jedisct1/go-minisign)
// - ssh.PublicKey (golang.org/x/crypto/ssh)
Crypto any
diff --git a/vendor/github.com/sigstore/rekor/pkg/pki/minisign/minisign.go b/vendor/github.com/sigstore/rekor/pkg/pki/minisign/minisign.go
index df8f847c33..8ed5b75fa6 100644
--- a/vendor/github.com/sigstore/rekor/pkg/pki/minisign/minisign.go
+++ b/vendor/github.com/sigstore/rekor/pkg/pki/minisign/minisign.go
@@ -43,6 +43,10 @@ func NewSignature(r io.Reader) (*Signature, error) {
var s Signature
var inputBuffer bytes.Buffer
+ if r == nil {
+ return nil, errors.New("minisign signature reader cannot be nil")
+ }
+
if _, err := io.Copy(&inputBuffer, r); err != nil {
return nil, fmt.Errorf("unable to read minisign signature: %w", err)
}
@@ -92,13 +96,13 @@ func (s Signature) CanonicalValue() ([]byte, error) {
}
// Verify implements the pki.Signature interface
-func (s Signature) Verify(r io.Reader, k interface{}, opts ...sigsig.VerifyOption) error {
+func (s Signature) Verify(r io.Reader, k any, opts ...sigsig.VerifyOption) error {
if s.signature == nil {
return errors.New("minisign signature has not been initialized")
}
key, ok := k.(*PublicKey)
- if !ok {
+ if !ok || key == nil {
return errors.New("cannot use Verify with a non-minisign key")
}
if key.key == nil {
@@ -112,12 +116,17 @@ func (s Signature) Verify(r io.Reader, k interface{}, opts ...sigsig.VerifyOptio
prehashed := s.signature.SignatureAlgorithm[1] == 0x44
if prehashed {
+ if r == nil {
+ return errors.New("reading minisign data: reader cannot be nil")
+ }
h, _ := blake2b.New512(nil)
_, err := io.Copy(h, r)
if err != nil {
return errors.New("reading minisign data")
}
r = bytes.NewReader(h.Sum(nil))
+ } else if r == nil {
+ return errors.New("reading minisign data: reader cannot be nil")
}
return verifier.VerifySignature(bytes.NewReader(s.signature.Signature[:]), r, opts...)
@@ -133,6 +142,10 @@ func NewPublicKey(r io.Reader) (*PublicKey, error) {
var k PublicKey
var inputBuffer bytes.Buffer
+ if r == nil {
+ return nil, errors.New("minisign public key reader cannot be nil")
+ }
+
if _, err := io.Copy(&inputBuffer, r); err != nil {
return nil, fmt.Errorf("unable to read minisign public key: %w", err)
}
@@ -191,6 +204,9 @@ func (k PublicKey) Subjects() []string {
// Identities implements the pki.PublicKey interface
func (k PublicKey) Identities() ([]identity.Identity, error) {
+ if k.key == nil {
+ return nil, errors.New("minisign public key has not been initialized")
+ }
// PKIX encode ed25519 public key
pkixKey, err := cryptoutils.MarshalPublicKeyToDER(ed25519.PublicKey(k.key.PublicKey[:]))
if err != nil {
diff --git a/vendor/github.com/sigstore/rekor/pkg/pki/pgp/pgp.go b/vendor/github.com/sigstore/rekor/pkg/pki/pgp/pgp.go
index 53bb9fa73b..7a77a4c547 100644
--- a/vendor/github.com/sigstore/rekor/pkg/pki/pgp/pgp.go
+++ b/vendor/github.com/sigstore/rekor/pkg/pki/pgp/pgp.go
@@ -27,14 +27,13 @@ import (
"fmt"
"io"
"net/http"
+ "time"
+ "github.com/ProtonMail/go-crypto/openpgp"
+ "github.com/ProtonMail/go-crypto/openpgp/armor"
+ "github.com/ProtonMail/go-crypto/openpgp/packet"
"github.com/asaskevich/govalidator"
- //TODO: https://github.com/sigstore/rekor/issues/286
- "golang.org/x/crypto/openpgp" //nolint:staticcheck
- "golang.org/x/crypto/openpgp/armor" //nolint:staticcheck
- "golang.org/x/crypto/openpgp/packet" //nolint:staticcheck
-
"github.com/sigstore/rekor/pkg/pki/identity"
"github.com/sigstore/sigstore/pkg/cryptoutils"
sigsig "github.com/sigstore/sigstore/pkg/signature"
@@ -48,6 +47,10 @@ type Signature struct {
// NewSignature creates and validates a PGP signature object
func NewSignature(r io.Reader) (*Signature, error) {
+ if r == nil {
+ return nil, errors.New("nil reader")
+ }
+
var s Signature
var inputBuffer bytes.Buffer
@@ -80,9 +83,7 @@ func NewSignature(r io.Reader) (*Signature, error) {
}
if _, ok := sigPkt.(*packet.Signature); !ok {
- if _, ok := sigPkt.(*packet.SignatureV3); !ok {
- return nil, errors.New("valid PGP signature was not detected")
- }
+ return nil, errors.New("valid PGP signature was not detected")
}
s.signature = inputBuffer.Bytes()
@@ -149,16 +150,48 @@ func (s Signature) Verify(r io.Reader, k interface{}, _ ...sigsig.VerifyOption)
if !ok {
return errors.New("cannot use Verify with a non-PGP signature")
}
- if len(key.key) == 0 {
+ if key == nil || len(key.key) == 0 {
return errors.New("PGP public key has not been initialized")
}
- verifyFn := openpgp.CheckDetachedSignature
+ sigReader := bytes.NewReader(s.signature)
+ var (
+ sigPkt packet.Packet
+ err error
+ )
if s.isArmored {
- verifyFn = openpgp.CheckArmoredDetachedSignature
+ block, decodeErr := armor.Decode(sigReader)
+ if decodeErr != nil {
+ return fmt.Errorf("error decoding armored PGP signature: %w", decodeErr)
+ }
+ sigPkt, err = packet.Read(block.Body)
+ } else {
+ sigPkt, err = packet.Read(sigReader)
+ }
+ if err != nil {
+ return fmt.Errorf("error reading PGP signature: %w", err)
+ }
+ sig, ok := sigPkt.(*packet.Signature)
+ if !ok {
+ return errors.New("valid PGP signature was not detected")
}
- if _, err := verifyFn(key.key, r, bytes.NewReader(s.signature)); err != nil {
+ // ProtonMail's verifier checks key validity against Config.Time (default:
+ // now). Use the signature creation time so historically valid signatures
+ // still verify after key expiry, matching prior x/crypto/openpgp behavior
+ // needed for transparency-log replay and existing fixtures.
+ cfg := &packet.Config{
+ Time: func() time.Time { return sig.CreationTime },
+ }
+ if _, err := sigReader.Seek(0, io.SeekStart); err != nil {
+ return err
+ }
+ if s.isArmored {
+ _, err = openpgp.CheckArmoredDetachedSignature(key.key, r, sigReader, cfg)
+ } else {
+ _, err = openpgp.CheckDetachedSignature(key.key, r, sigReader, cfg)
+ }
+ if err != nil {
return err
}
@@ -172,6 +205,10 @@ type PublicKey struct {
// NewPublicKey implements the pki.PublicKey interface
func NewPublicKey(r io.Reader) (*PublicKey, error) {
+ if r == nil {
+ return nil, errors.New("nil reader")
+ }
+
var k PublicKey
var inputBuffer bytes.Buffer
@@ -215,6 +252,9 @@ func NewPublicKey(r io.Reader) (*PublicKey, error) {
}
}
}
+ if err := scan.Err(); err != nil {
+ return nil, fmt.Errorf("error reading PGP public key: %w", err)
+ }
} else {
// process as binary
k.key, err = openpgp.ReadKeyRing(bufferedReader)
@@ -269,6 +309,9 @@ func (k PublicKey) CanonicalValue() ([]byte, error) {
defer armoredWriter.Close()
for _, entity := range k.key {
+ if entity == nil {
+ return fmt.Errorf("pgp key ring contains a nil entity")
+ }
if err := entity.Serialize(armoredWriter); err != nil {
return fmt.Errorf("error generating canonical value of PGP public key: %w", err)
}
@@ -281,7 +324,8 @@ func (k PublicKey) CanonicalValue() ([]byte, error) {
return canonicalBuffer.Bytes(), nil
}
-func (k PublicKey) KeyRing() (openpgp.KeyRing, error) {
+// Entities returns the underlying OpenPGP entity list.
+func (k PublicKey) Entities() (openpgp.EntityList, error) {
if k.key == nil {
return nil, errors.New("PGP public key has not been initialized")
}
@@ -289,13 +333,21 @@ func (k PublicKey) KeyRing() (openpgp.KeyRing, error) {
return k.key, nil
}
+// KeyRing returns the underlying OpenPGP key ring.
+func (k PublicKey) KeyRing() (openpgp.KeyRing, error) {
+ return k.Entities()
+}
+
// EmailAddresses implements the pki.PublicKey interface
func (k PublicKey) EmailAddresses() []string {
var names []string
// Extract from cert
for _, entity := range k.key {
+ if entity == nil {
+ continue
+ }
for _, identity := range entity.Identities {
- if govalidator.IsEmail(identity.UserId.Email) {
+ if identity != nil && identity.UserId != nil && govalidator.IsEmail(identity.UserId.Email) {
names = append(names, identity.UserId.Email)
}
}
@@ -312,12 +364,22 @@ func (k PublicKey) Subjects() []string {
func (k PublicKey) Identities() ([]identity.Identity, error) {
var ids []identity.Identity
for _, entity := range k.key {
+ if entity == nil {
+ continue
+ }
var keys []*packet.PublicKey
- keys = append(keys, entity.PrimaryKey)
+ if entity.PrimaryKey != nil {
+ keys = append(keys, entity.PrimaryKey)
+ }
for _, subKey := range entity.Subkeys {
- keys = append(keys, subKey.PublicKey)
+ if subKey.PublicKey != nil {
+ keys = append(keys, subKey.PublicKey)
+ }
}
for _, pk := range keys {
+ if pk == nil {
+ continue
+ }
pubKey := pk.PublicKey
// Only process supported types. Will ignore DSA
// and ElGamal keys.
@@ -334,7 +396,7 @@ func (k PublicKey) Identities() ([]identity.Identity, error) {
ids = append(ids, identity.Identity{
Crypto: pubKey,
Raw: pkixKey,
- Fingerprint: hex.EncodeToString(pk.Fingerprint[:]),
+ Fingerprint: hex.EncodeToString(pk.Fingerprint),
})
}
}
diff --git a/vendor/github.com/sigstore/rekor/pkg/pki/pkcs7/pkcs7.go b/vendor/github.com/sigstore/rekor/pkg/pki/pkcs7/pkcs7.go
index c1fae6a706..9cb1b5f98a 100644
--- a/vendor/github.com/sigstore/rekor/pkg/pki/pkcs7/pkcs7.go
+++ b/vendor/github.com/sigstore/rekor/pkg/pki/pkcs7/pkcs7.go
@@ -29,7 +29,7 @@ import (
"io"
"strings"
- "github.com/sassoftware/relic/lib/pkcs7"
+ "github.com/sassoftware/relic/v8/lib/pkcs7"
"github.com/sigstore/rekor/pkg/pki/identity"
"github.com/sigstore/sigstore/pkg/cryptoutils"
sigsig "github.com/sigstore/sigstore/pkg/signature"
@@ -109,8 +109,8 @@ func (s Signature) CanonicalValue() ([]byte, error) {
}
// Verify implements the pki.Signature interface
-func (s Signature) Verify(r io.Reader, _ interface{}, _ ...sigsig.VerifyOption) error {
- if len(*s.raw) == 0 {
+func (s Signature) Verify(r io.Reader, _ any, _ ...sigsig.VerifyOption) error {
+ if s.raw == nil || len(*s.raw) == 0 {
return errors.New("PKCS7 signature has not been initialized")
}
@@ -206,7 +206,9 @@ func (k PublicKey) EmailAddresses() []string {
for _, name := range cert.Subject.Names {
if name.Type.Equal(EmailAddressOID) {
- names = append(names, strings.ToLower(name.Value.(string)))
+ if v, ok := name.Value.(string); ok {
+ names = append(names, strings.ToLower(v))
+ }
}
}
@@ -217,6 +219,9 @@ func (k PublicKey) EmailAddresses() []string {
func (k PublicKey) Subjects() []string {
// combine identities in the subject and SANs
identities := k.EmailAddresses()
+ if len(k.certs) == 0 {
+ return identities
+ }
cert, err := x509.ParseCertificate(k.certs[0].Raw)
if err != nil {
// This should not happen from a valid PublicKey, but fail gracefully.
@@ -228,6 +233,9 @@ func (k PublicKey) Subjects() []string {
// Identities implements the pki.PublicKey interface
func (k PublicKey) Identities() ([]identity.Identity, error) {
+ if k.key == nil || len(k.certs) == 0 {
+ return nil, errors.New("PKCS7 public key has not been initialized")
+ }
// pkcs7 structure may contain both a key and certificate chain
pkixKey, err := cryptoutils.MarshalPublicKeyToDER(k.key)
if err != nil {
diff --git a/vendor/github.com/sigstore/rekor/pkg/pki/ssh/sign.go b/vendor/github.com/sigstore/rekor/pkg/pki/ssh/sign.go
index 8d148f79fe..58de4f43b9 100644
--- a/vendor/github.com/sigstore/rekor/pkg/pki/ssh/sign.go
+++ b/vendor/github.com/sigstore/rekor/pkg/pki/ssh/sign.go
@@ -19,6 +19,7 @@ import (
"crypto/rand"
"crypto/sha256"
"crypto/sha512"
+ "errors"
"hash"
"io"
@@ -92,7 +93,7 @@ func Sign(sshPrivateKey string, data io.Reader) ([]byte, error) {
as, ok := s.(ssh.AlgorithmSigner)
if !ok {
- return nil, err
+ return nil, errors.New("ssh private key does not support algorithm signing")
}
sig, err := sign(as, data)
diff --git a/vendor/github.com/sigstore/rekor/pkg/pki/ssh/ssh.go b/vendor/github.com/sigstore/rekor/pkg/pki/ssh/ssh.go
index 252653a9bc..d275d06e30 100644
--- a/vendor/github.com/sigstore/rekor/pkg/pki/ssh/ssh.go
+++ b/vendor/github.com/sigstore/rekor/pkg/pki/ssh/ssh.go
@@ -54,6 +54,12 @@ func NewSignature(r io.Reader) (*Signature, error) {
// CanonicalValue implements the pki.Signature interface
func (s Signature) CanonicalValue() ([]byte, error) {
+ if s.signature == nil {
+ return nil, errors.New("ssh signature has not been initialized")
+ }
+ if s.pk == nil {
+ return nil, errors.New("ssh signature public key has not been initialized")
+ }
return []byte(Armor(s.signature, s.pk)), nil
}
@@ -64,7 +70,7 @@ func (s Signature) Verify(r io.Reader, k interface{}, _ ...sigsig.VerifyOption)
}
key, ok := k.(*PublicKey)
- if !ok {
+ if !ok || key == nil {
return fmt.Errorf("invalid public key type for: %v", k)
}
@@ -128,15 +134,26 @@ func (k PublicKey) Subjects() []string {
// Identities implements the pki.PublicKey interface
func (k PublicKey) Identities() ([]identity.Identity, error) {
+ if k.key == nil {
+ return nil, errors.New("ssh public key has not been initialized")
+ }
+
// extract key from SSH certificate if present
var sshKey ssh.PublicKey
switch v := k.key.(type) {
case *ssh.Certificate:
+ if v == nil {
+ return nil, errors.New("ssh certificate is nil")
+ }
sshKey = v.Key
default:
sshKey = k.key
}
+ if sshKey == nil {
+ return nil, errors.New("ssh public key is nil")
+ }
+
// Extract crypto.PublicKey from SSH key
// Handle sk public keys which do not implement ssh.CryptoPublicKey
// Inspired by x/ssh/keys.go
diff --git a/vendor/github.com/sigstore/rekor/pkg/pki/tuf/tuf.go b/vendor/github.com/sigstore/rekor/pkg/pki/tuf/tuf.go
index 6b7fefe13f..7cc551ed7a 100644
--- a/vendor/github.com/sigstore/rekor/pkg/pki/tuf/tuf.go
+++ b/vendor/github.com/sigstore/rekor/pkg/pki/tuf/tuf.go
@@ -88,7 +88,7 @@ func (s Signature) CanonicalValue() ([]byte, error) {
// Verify implements the pki.Signature interface
func (s Signature) Verify(_ io.Reader, k interface{}, _ ...sigsig.VerifyOption) error {
key, ok := k.(*PublicKey)
- if !ok {
+ if !ok || key == nil {
return fmt.Errorf("invalid public key type for: %v", k)
}
@@ -126,11 +126,17 @@ func NewPublicKey(r io.Reader) (*PublicKey, error) {
// Now create a verification db that trusts all the keys
db := verify.NewDB()
for id, k := range root.Keys {
+ if k == nil {
+ return nil, errors.New("tuf root contains nil key")
+ }
if err := db.AddKey(id, k); err != nil {
return nil, err
}
}
for name, role := range root.Roles {
+ if role == nil {
+ return nil, errors.New("tuf root contains nil role")
+ }
if err := db.AddRole(name, role); err != nil {
return nil, err
}
@@ -157,6 +163,9 @@ func (k PublicKey) CanonicalValue() (encoded []byte, err error) {
}
func (k PublicKey) SpecVersion() (string, error) {
+ if k.root == nil {
+ return "", errors.New("tuf root has not been initialized")
+ }
// extract role
sm := &signedMeta{}
if err := json.Unmarshal(k.root.Signed, sm); err != nil {
@@ -177,6 +186,9 @@ func (k PublicKey) Subjects() []string {
// Identities implements the pki.PublicKey interface
func (k PublicKey) Identities() ([]identity.Identity, error) {
+ if k.root == nil {
+ return nil, errors.New("tuf root has not been initialized")
+ }
root := &data.Root{}
if err := json.Unmarshal(k.root.Signed, root); err != nil {
return nil, err
diff --git a/vendor/github.com/sigstore/rekor/pkg/pki/x509/x509.go b/vendor/github.com/sigstore/rekor/pkg/pki/x509/x509.go
index 2cfaf81600..e2f18f5fa0 100644
--- a/vendor/github.com/sigstore/rekor/pkg/pki/x509/x509.go
+++ b/vendor/github.com/sigstore/rekor/pkg/pki/x509/x509.go
@@ -48,6 +48,9 @@ func NewSignature(r io.Reader) (*Signature, error) {
}
func NewSignatureWithOpts(r io.Reader, opts ...sigsig.LoadOption) (*Signature, error) {
+ if r == nil {
+ return nil, errors.New("reader cannot be nil")
+ }
b, err := io.ReadAll(r)
if err != nil {
return nil, err
@@ -71,7 +74,7 @@ func (s Signature) Verify(r io.Reader, k interface{}, opts ...sigsig.VerifyOptio
}
key, ok := k.(*PublicKey)
- if !ok {
+ if !ok || key == nil {
return fmt.Errorf("invalid public key type for: %v", k)
}
@@ -111,6 +114,9 @@ type cert struct {
// NewPublicKey implements the pki.PublicKey interface
func NewPublicKey(r io.Reader) (*PublicKey, error) {
+ if r == nil {
+ return nil, errors.New("reader cannot be nil")
+ }
rawPub, err := io.ReadAll(r)
if err != nil {
return nil, err
diff --git a/vendor/github.com/sigstore/rekor/pkg/types/dsse/dsse.go b/vendor/github.com/sigstore/rekor/pkg/types/dsse/dsse.go
index 9b82729672..c17c45e43b 100644
--- a/vendor/github.com/sigstore/rekor/pkg/types/dsse/dsse.go
+++ b/vendor/github.com/sigstore/rekor/pkg/types/dsse/dsse.go
@@ -43,7 +43,7 @@ func New() types.TypeImpl {
return &bit
}
-var VersionMap = types.NewSemVerEntryFactoryMap()
+var VersionMap = types.NewEntryFactoryMap()
func (it BaseDSSEType) UnmarshalEntry(pe models.ProposedEntry) (types.EntryImpl, error) {
if pe == nil {
@@ -54,6 +54,9 @@ func (it BaseDSSEType) UnmarshalEntry(pe models.ProposedEntry) (types.EntryImpl,
if !ok {
return nil, errors.New("cannot unmarshal non-DSSE types")
}
+ if in == nil {
+ return nil, errors.New("proposed entry cannot be nil")
+ }
if in.APIVersion == nil {
return nil, errors.New("api version cannot be nil")
diff --git a/vendor/github.com/sigstore/rekor/pkg/types/dsse/v0.0.1/entry.go b/vendor/github.com/sigstore/rekor/pkg/types/dsse/v0.0.1/entry.go
index 2d43793309..3703adc20b 100644
--- a/vendor/github.com/sigstore/rekor/pkg/types/dsse/v0.0.1/entry.go
+++ b/vendor/github.com/sigstore/rekor/pkg/types/dsse/v0.0.1/entry.go
@@ -111,12 +111,12 @@ func (v V001Entry) IndexKeys() ([]string, error) {
result = append(result, keyObj.Subjects()...)
}
- if v.DSSEObj.PayloadHash != nil {
+ if v.DSSEObj.PayloadHash != nil && v.DSSEObj.PayloadHash.Algorithm != nil && v.DSSEObj.PayloadHash.Value != nil {
payloadHashKey := strings.ToLower(fmt.Sprintf("%s:%s", *v.DSSEObj.PayloadHash.Algorithm, *v.DSSEObj.PayloadHash.Value))
result = append(result, payloadHashKey)
}
- if v.DSSEObj.EnvelopeHash != nil {
+ if v.DSSEObj.EnvelopeHash != nil && v.DSSEObj.EnvelopeHash.Algorithm != nil && v.DSSEObj.EnvelopeHash.Value != nil {
envelopeHashKey := strings.ToLower(fmt.Sprintf("%s:%s", *v.DSSEObj.EnvelopeHash.Algorithm, *v.DSSEObj.EnvelopeHash.Value))
result = append(result, envelopeHashKey)
}
@@ -238,6 +238,9 @@ func (v *V001Entry) Unmarshal(pe models.ProposedEntry) error {
if !ok {
return errors.New("cannot unmarshal non DSSE v0.0.1 type")
}
+ if it == nil {
+ return errors.New("proposed entry cannot be nil")
+ }
dsseObj := &models.DSSEV001Schema{}
@@ -285,7 +288,7 @@ func (v *V001Entry) Unmarshal(pe models.ProposedEntry) error {
allPubKeyBytes = append(allPubKeyBytes, publicKey)
}
- sigToKeyMap, err := verifyEnvelope(allPubKeyBytes, env)
+ sigToKeyMap, decodedPayload, err := verifyEnvelope(allPubKeyBytes, env)
if err != nil {
return err
}
@@ -311,12 +314,6 @@ func (v *V001Entry) Unmarshal(pe models.ProposedEntry) error {
})
}
- decodedPayload, err := env.DecodeB64Payload()
- if err != nil {
- // this shouldn't happen because failure would have occurred in verifyEnvelope call above
- return err
- }
-
// extraction of index keys - done here so we can clear the huge strings from memory
if env.PayloadType == in_toto.PayloadType {
var extract indexKeyExtract
@@ -429,6 +426,9 @@ func (v V001Entry) CreateFromArtifactProperties(_ context.Context, props types.A
if len(props.PublicKeyPaths) > 0 {
for _, path := range props.PublicKeyPaths {
+ if path == nil {
+ return nil, errors.New("public key path cannot be nil")
+ }
if path.IsAbs() {
return nil, errors.New("dsse public keys cannot be fetched over HTTP(S)")
}
@@ -442,7 +442,7 @@ func (v V001Entry) CreateFromArtifactProperties(_ context.Context, props types.A
}
}
- keysBySig, err := verifyEnvelope(allPubKeyBytes, env)
+ keysBySig, _, err := verifyEnvelope(allPubKeyBytes, env)
if err != nil {
return nil, err
}
@@ -464,7 +464,7 @@ func (v V001Entry) CreateFromArtifactProperties(_ context.Context, props types.A
// verifyEnvelope takes in an array of possible key bytes and attempts to parse them as x509 public keys.
// it then uses these to verify the envelope and makes sure that every signature on the envelope is verified.
// it returns a map of verifiers indexed by the signature the verifier corresponds to.
-func verifyEnvelope(allPubKeyBytes [][]byte, env *dsse.Envelope) (map[string]*x509.PublicKey, error) {
+func verifyEnvelope(allPubKeyBytes [][]byte, env *dsse.Envelope) (map[string]*x509.PublicKey, []byte, error) {
// generate a fake id for these keys so we can get back to the key bytes and match them to their corresponding signature
verifierBySig := make(map[string]*x509.PublicKey)
allSigs := make(map[string]struct{})
@@ -472,28 +472,33 @@ func verifyEnvelope(allPubKeyBytes [][]byte, env *dsse.Envelope) (map[string]*x5
allSigs[sig.Sig] = struct{}{}
}
+ var verifiedPayload []byte
for _, pubKeyBytes := range allPubKeyBytes {
if len(allSigs) == 0 {
break // if all signatures have been verified, do not attempt anymore
}
key, err := x509.NewPublicKey(bytes.NewReader(pubKeyBytes))
if err != nil {
- return nil, fmt.Errorf("could not parse public key as x509: %w", err)
+ return nil, nil, fmt.Errorf("could not parse public key as x509: %w", err)
}
vfr, err := signature.LoadVerifier(key.CryptoPubKey(), crypto.SHA256)
if err != nil {
- return nil, fmt.Errorf("could not load verifier: %w", err)
+ return nil, nil, fmt.Errorf("could not load verifier: %w", err)
}
dsseVfr, err := dsse.NewEnvelopeVerifier(&sigdsse.VerifierAdapter{SignatureVerifier: vfr})
if err != nil {
- return nil, fmt.Errorf("could not use public key as a dsse verifier: %w", err)
+ return nil, nil, fmt.Errorf("could not use public key as a dsse verifier: %w", err)
}
- accepted, err := dsseVfr.Verify(context.Background(), env)
+ accepted, payload, err := dsseVfr.VerifyAndDecode(context.Background(), env)
if err != nil {
- return nil, fmt.Errorf("could not verify envelope: %w", err)
+ return nil, nil, fmt.Errorf("could not verify envelope: %w", err)
+ }
+
+ if len(accepted) > 0 {
+ verifiedPayload = payload
}
for _, accept := range accepted {
@@ -503,10 +508,10 @@ func verifyEnvelope(allPubKeyBytes [][]byte, env *dsse.Envelope) (map[string]*x5
}
if len(allSigs) > 0 {
- return nil, errors.New("all signatures must have a key that verifies it")
+ return nil, nil, errors.New("all signatures must have a key that verifies it")
}
- return verifierBySig, nil
+ return verifierBySig, verifiedPayload, nil
}
func (v V001Entry) Verifiers() ([]pkitypes.PublicKey, error) {
@@ -516,6 +521,9 @@ func (v V001Entry) Verifiers() ([]pkitypes.PublicKey, error) {
var keys []pkitypes.PublicKey
for _, s := range v.DSSEObj.Signatures {
+ if s == nil || s.Verifier == nil {
+ return nil, errors.New("dsse v0.0.1 entry not initialized")
+ }
key, err := x509.NewPublicKey(bytes.NewReader(*s.Verifier))
if err != nil {
return nil, err
diff --git a/vendor/github.com/sigstore/rekor/pkg/types/hashedrekord/hashedrekord.go b/vendor/github.com/sigstore/rekor/pkg/types/hashedrekord/hashedrekord.go
index 778d9e5b44..6bbbc1f275 100644
--- a/vendor/github.com/sigstore/rekor/pkg/types/hashedrekord/hashedrekord.go
+++ b/vendor/github.com/sigstore/rekor/pkg/types/hashedrekord/hashedrekord.go
@@ -43,7 +43,7 @@ func New() types.TypeImpl {
return &brt
}
-var VersionMap = types.NewSemVerEntryFactoryMap()
+var VersionMap = types.NewEntryFactoryMap()
func (rt BaseRekordType) UnmarshalEntry(pe models.ProposedEntry) (types.EntryImpl, error) {
if pe == nil {
@@ -54,6 +54,9 @@ func (rt BaseRekordType) UnmarshalEntry(pe models.ProposedEntry) (types.EntryImp
if !ok {
return nil, fmt.Errorf("cannot unmarshal non-hashed Rekord types: %s", pe.Kind())
}
+ if rekord == nil {
+ return nil, errors.New("proposed entry cannot be nil")
+ }
if rekord.APIVersion == nil {
return nil, errors.New("api version cannot be nil")
diff --git a/vendor/github.com/sigstore/rekor/pkg/types/hashedrekord/v0.0.1/entry.go b/vendor/github.com/sigstore/rekor/pkg/types/hashedrekord/v0.0.1/entry.go
index 7d0ef04e61..e1c3092a3e 100644
--- a/vendor/github.com/sigstore/rekor/pkg/types/hashedrekord/v0.0.1/entry.go
+++ b/vendor/github.com/sigstore/rekor/pkg/types/hashedrekord/v0.0.1/entry.go
@@ -67,6 +67,13 @@ func NewEntry() types.EntryImpl {
func (v V001Entry) IndexKeys() ([]string, error) {
var result []string
+ if v.HashedRekordObj.Signature == nil {
+ return nil, errors.New("hashedrekord v0.0.1 entry not initialized")
+ }
+ if v.HashedRekordObj.Signature.PublicKey == nil {
+ return nil, errors.New("hashedrekord v0.0.1 entry not initialized")
+ }
+
key := v.HashedRekordObj.Signature.PublicKey.Content
keyHash := sha256.Sum256(key)
result = append(result, strings.ToLower(hex.EncodeToString(keyHash[:])))
@@ -77,7 +84,8 @@ func (v V001Entry) IndexKeys() ([]string, error) {
}
result = append(result, pub.Subjects()...)
- if v.HashedRekordObj.Data.Hash != nil {
+ if v.HashedRekordObj.Data != nil && v.HashedRekordObj.Data.Hash != nil &&
+ v.HashedRekordObj.Data.Hash.Algorithm != nil && v.HashedRekordObj.Data.Hash.Value != nil {
hashKey := strings.ToLower(fmt.Sprintf("%s:%s", *v.HashedRekordObj.Data.Hash.Algorithm, *v.HashedRekordObj.Data.Hash.Value))
result = append(result, hashKey)
}
@@ -150,6 +158,9 @@ func (v *V001Entry) Unmarshal(pe models.ProposedEntry) error {
if !ok {
return errors.New("cannot unmarshal non Rekord v0.0.1 type")
}
+ if rekord == nil {
+ return errors.New("proposed entry cannot be nil")
+ }
if err := DecodeEntry(rekord.Spec, &v.HashedRekordObj); err != nil {
return err
@@ -231,6 +242,10 @@ func (v *V001Entry) validate() (pkitypes.Signature, pkitypes.PublicKey, error) {
return nil, nil, &types.InputValidationError{Err: errors.New("missing hash")}
}
+ if hash.Value == nil {
+ return nil, nil, &types.InputValidationError{Err: errors.New("missing hash value")}
+ }
+
var alg crypto.Hash
switch conv.Value(hash.Algorithm) {
case models.HashedrekordV001SchemaDataHashAlgorithmSha384:
@@ -301,7 +316,7 @@ func (v V001Entry) CreateFromArtifactProperties(_ context.Context, props types.A
re.HashedRekordObj.Signature.PublicKey = &models.HashedrekordV001SchemaSignaturePublicKey{}
publicKeyBytes := props.PublicKeyBytes
if len(publicKeyBytes) == 0 {
- if len(props.PublicKeyPaths) != 1 {
+ if len(props.PublicKeyPaths) != 1 || props.PublicKeyPaths[0] == nil {
return nil, errors.New("only one public key must be provided to verify detached signature")
}
keyBytes, err := os.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path))
diff --git a/vendor/github.com/sigstore/rekor/pkg/types/intoto/intoto.go b/vendor/github.com/sigstore/rekor/pkg/types/intoto/intoto.go
index 8aa2b8ddc9..b4d0234cbe 100644
--- a/vendor/github.com/sigstore/rekor/pkg/types/intoto/intoto.go
+++ b/vendor/github.com/sigstore/rekor/pkg/types/intoto/intoto.go
@@ -45,7 +45,7 @@ func New() types.TypeImpl {
return &bit
}
-var VersionMap = types.NewSemVerEntryFactoryMap()
+var VersionMap = types.NewEntryFactoryMap()
func (it BaseIntotoType) UnmarshalEntry(pe models.ProposedEntry) (types.EntryImpl, error) {
if pe == nil {
@@ -54,7 +54,7 @@ func (it BaseIntotoType) UnmarshalEntry(pe models.ProposedEntry) (types.EntryImp
in, ok := pe.(*models.Intoto)
if !ok {
- return nil, errors.New("cannot unmarshal non-Rekord types")
+ return nil, errors.New("cannot unmarshal non-Intoto types")
}
if in.APIVersion == nil {
diff --git a/vendor/github.com/sigstore/rekor/pkg/types/intoto/v0.0.1/entry.go b/vendor/github.com/sigstore/rekor/pkg/types/intoto/v0.0.1/entry.go
index 7f16911881..b150bd5ba6 100644
--- a/vendor/github.com/sigstore/rekor/pkg/types/intoto/v0.0.1/entry.go
+++ b/vendor/github.com/sigstore/rekor/pkg/types/intoto/v0.0.1/entry.go
@@ -140,8 +140,17 @@ func (v V001Entry) IndexKeys() ([]string, error) {
return result, nil
}
-func parseStatement(p string) (*in_toto.Statement, error) {
- ps := in_toto.Statement{}
+// indexKeyExtract captures only the fields of an in-toto statement that are
+// used to derive index keys; it intentionally uses encoding/json semantics so
+// that payloads accepted today continue to parse identically.
+type indexKeyExtract struct {
+ Subject []struct {
+ Digest map[string]string `json:"digest"`
+ } `json:"subject"`
+}
+
+func parseStatement(p string) (*indexKeyExtract, error) {
+ ps := indexKeyExtract{}
payload, err := base64.StdEncoding.DecodeString(p)
if err != nil {
return nil, err
@@ -238,6 +247,9 @@ func (v *V001Entry) Unmarshal(pe models.ProposedEntry) error {
return err
}
+ if v.IntotoObj.PublicKey == nil {
+ return errors.New("missing public key in intoto v0.0.1 entry")
+ }
v.keyObj, err = x509.NewPublicKey(bytes.NewReader(*v.IntotoObj.PublicKey))
if err != nil {
return err
@@ -291,7 +303,14 @@ func (v *V001Entry) Canonicalize(_ context.Context) ([]byte, error) {
// validate performs cross-field validation for fields in object
func (v *V001Entry) validate() error {
// TODO handle multiple
- pk := v.keyObj.(*x509.PublicKey)
+ pk, ok := v.keyObj.(*x509.PublicKey)
+ if !ok {
+ return errors.New("public key is not of type *x509.PublicKey")
+ }
+
+ if v.IntotoObj.Content == nil {
+ return errors.New("missing content in intoto v0.0.1 entry")
+ }
// one of two cases must be true:
// - ProposedEntry: client gives an envelope; (client provided hash/payloadhash are ignored as they are computed server-side) OR
@@ -346,7 +365,7 @@ func (v *V001Entry) validate() error {
// AttestationKey returns the digest of the attestation that was uploaded, to be used to lookup the attestation from storage
func (v *V001Entry) AttestationKey() string {
- if v.IntotoObj.Content != nil && v.IntotoObj.Content.PayloadHash != nil {
+ if v.IntotoObj.Content != nil && v.IntotoObj.Content.PayloadHash != nil && v.IntotoObj.Content.PayloadHash.Algorithm != nil && v.IntotoObj.Content.PayloadHash.Value != nil {
return fmt.Sprintf("%s:%s", *v.IntotoObj.Content.PayloadHash.Algorithm, *v.IntotoObj.Content.PayloadHash.Value)
}
return ""
@@ -385,6 +404,9 @@ func (v V001Entry) CreateFromArtifactProperties(_ context.Context, props types.A
if len(props.PublicKeyPaths) != 1 {
return nil, errors.New("only one public key must be provided to verify signature")
}
+ if props.PublicKeyPaths[0] == nil {
+ return nil, errors.New("public key path cannot be nil")
+ }
keyBytes, err := os.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path))
if err != nil {
return nil, fmt.Errorf("error reading public key file: %w", err)
@@ -429,7 +451,7 @@ func (v V001Entry) Verifiers() ([]pkitypes.PublicKey, error) {
func (v V001Entry) ArtifactHash() (string, error) {
if v.IntotoObj.Content == nil || v.IntotoObj.Content.PayloadHash == nil || v.IntotoObj.Content.PayloadHash.Algorithm == nil || v.IntotoObj.Content.PayloadHash.Value == nil {
- return "", errors.New("hashedrekord v0.0.1 entry not initialized")
+ return "", errors.New("intoto v0.0.1 entry not initialized")
}
return strings.ToLower(fmt.Sprintf("%s:%s", *v.IntotoObj.Content.PayloadHash.Algorithm, *v.IntotoObj.Content.PayloadHash.Value)), nil
}
diff --git a/vendor/github.com/sigstore/rekor/pkg/types/intoto/v0.0.2/entry.go b/vendor/github.com/sigstore/rekor/pkg/types/intoto/v0.0.2/entry.go
index ef895151c3..e5cfff1eab 100644
--- a/vendor/github.com/sigstore/rekor/pkg/types/intoto/v0.0.2/entry.go
+++ b/vendor/github.com/sigstore/rekor/pkg/types/intoto/v0.0.2/entry.go
@@ -103,54 +103,69 @@ func (v V002Entry) IndexKeys() ([]string, error) {
result = append(result, keyObj.Subjects()...)
}
- payloadKey := strings.ToLower(fmt.Sprintf("%s:%s", *v.IntotoObj.Content.PayloadHash.Algorithm, *v.IntotoObj.Content.PayloadHash.Value))
- result = append(result, payloadKey)
+ if v.IntotoObj.Content.PayloadHash != nil && v.IntotoObj.Content.PayloadHash.Algorithm != nil && v.IntotoObj.Content.PayloadHash.Value != nil {
+ payloadKey := strings.ToLower(fmt.Sprintf("%s:%s", *v.IntotoObj.Content.PayloadHash.Algorithm, *v.IntotoObj.Content.PayloadHash.Value))
+ result = append(result, payloadKey)
+ }
// since we can't deterministically calculate this server-side (due to public keys being added inline, and also canonicalization being potentially different),
// we'll just skip adding this index key
// hashkey := strings.ToLower(fmt.Sprintf("%s:%s", *v.IntotoObj.Content.Hash.Algorithm, *v.IntotoObj.Content.Hash.Value))
// result = append(result, hashkey)
- switch *v.IntotoObj.Content.Envelope.PayloadType {
- case in_toto.PayloadType:
+ if v.IntotoObj.Content.Envelope.PayloadType != nil {
+ switch *v.IntotoObj.Content.Envelope.PayloadType {
+ case in_toto.PayloadType:
- if v.IntotoObj.Content.Envelope.Payload == nil {
- log.Logger.Info("IntotoObj DSSE payload is empty")
- return result, nil
- }
- decodedPayload, err := base64.StdEncoding.DecodeString(string(v.IntotoObj.Content.Envelope.Payload))
- if err != nil {
- return result, fmt.Errorf("could not decode envelope payload: %w", err)
- }
- statement, err := parseStatement(decodedPayload)
- if err != nil {
- return result, err
- }
- for _, s := range statement.Subject {
- for alg, ds := range s.Digest {
- result = append(result, alg+":"+ds)
+ if v.IntotoObj.Content.Envelope.Payload == nil {
+ log.Logger.Info("IntotoObj DSSE payload is empty")
+ return result, nil
}
- }
- // Not all in-toto statements will contain a SLSA provenance predicate.
- // See https://github.com/in-toto/attestation/blob/main/spec/README.md#predicate
- // for other predicates.
- if predicate, err := parseSlsaPredicate(decodedPayload); err == nil {
- if predicate.Predicate.Materials != nil {
- for _, s := range predicate.Predicate.Materials {
- for alg, ds := range s.Digest {
- result = append(result, alg+":"+ds)
+ decodedPayload, err := base64.StdEncoding.DecodeString(string(v.IntotoObj.Content.Envelope.Payload))
+ if err != nil {
+ return result, fmt.Errorf("could not decode envelope payload: %w", err)
+ }
+ statement, err := parseStatement(decodedPayload)
+ if err != nil {
+ return result, err
+ }
+ for _, s := range statement.Subject {
+ for alg, ds := range s.Digest {
+ result = append(result, alg+":"+ds)
+ }
+ }
+ // Not all in-toto statements will contain a SLSA provenance predicate.
+ // See https://github.com/in-toto/attestation/blob/main/spec/README.md#predicate
+ // for other predicates.
+ if predicate, err := parseSlsaPredicate(decodedPayload); err == nil {
+ if predicate.Predicate.Materials != nil {
+ for _, s := range predicate.Predicate.Materials {
+ for alg, ds := range s.Digest {
+ result = append(result, alg+":"+ds)
+ }
}
}
}
+ default:
+ log.Logger.Infof("Unknown in_toto DSSE envelope Type: %s", *v.IntotoObj.Content.Envelope.PayloadType)
}
- default:
- log.Logger.Infof("Unknown in_toto DSSE envelope Type: %s", *v.IntotoObj.Content.Envelope.PayloadType)
+ } else {
+ log.Logger.Info("IntotoObj DSSE payloadType is nil")
}
return result, nil
}
-func parseStatement(p []byte) (*in_toto.Statement, error) {
- ps := in_toto.Statement{}
+// indexKeyExtract captures only the fields of an in-toto statement that are
+// used to derive index keys; it intentionally uses encoding/json semantics so
+// that payloads accepted today continue to parse identically.
+type indexKeyExtract struct {
+ Subject []struct {
+ Digest map[string]string `json:"digest"`
+ } `json:"subject"`
+}
+
+func parseStatement(p []byte) (*indexKeyExtract, error) {
+ ps := indexKeyExtract{}
if err := json.Unmarshal(p, &ps); err != nil {
return nil, err
}
@@ -301,10 +316,18 @@ func (v *V002Entry) Unmarshal(pe models.ProposedEntry) error {
return err
}
+ if v.IntotoObj.Content == nil || v.IntotoObj.Content.Envelope == nil {
+ return errors.New("missing content or envelope in intoto v0.0.2 entry")
+ }
+
if string(v.IntotoObj.Content.Envelope.Payload) == "" {
return nil
}
+ if v.IntotoObj.Content.Envelope.PayloadType == nil {
+ return errors.New("missing payload type in intoto v0.0.2 entry")
+ }
+
env := &dsse.Envelope{
Payload: string(v.IntotoObj.Content.Envelope.Payload),
PayloadType: *v.IntotoObj.Content.Envelope.PayloadType,
@@ -388,7 +411,7 @@ func (v *V002Entry) Canonicalize(_ context.Context) ([]byte, error) {
// AttestationKey returns the digest of the attestation that was uploaded, to be used to lookup the attestation from storage
func (v *V002Entry) AttestationKey() string {
- if v.IntotoObj.Content != nil && v.IntotoObj.Content.PayloadHash != nil {
+ if v.IntotoObj.Content != nil && v.IntotoObj.Content.PayloadHash != nil && v.IntotoObj.Content.PayloadHash.Algorithm != nil && v.IntotoObj.Content.PayloadHash.Value != nil {
return fmt.Sprintf("%s:%s", *v.IntotoObj.Content.PayloadHash.Algorithm, *v.IntotoObj.Content.PayloadHash.Value)
}
return ""
@@ -480,6 +503,9 @@ func (v V002Entry) CreateFromArtifactProperties(_ context.Context, props types.A
if len(props.PublicKeyPaths) > 0 {
for _, path := range props.PublicKeyPaths {
+ if path == nil {
+ return nil, errors.New("public key path cannot be nil")
+ }
if path.IsAbs() {
return nil, errors.New("dsse public keys cannot be fetched over HTTP(S)")
}
@@ -594,6 +620,9 @@ func (v V002Entry) Verifiers() ([]pkitypes.PublicKey, error) {
var keys []pkitypes.PublicKey
for _, s := range v.IntotoObj.Content.Envelope.Signatures {
+ if s == nil || s.PublicKey == nil {
+ return nil, errors.New("malformed or missing signature")
+ }
key, err := x509.NewPublicKey(bytes.NewReader(*s.PublicKey))
if err != nil {
return nil, err
diff --git a/vendor/github.com/sigstore/rekor/pkg/types/rekord/rekord.go b/vendor/github.com/sigstore/rekor/pkg/types/rekord/rekord.go
index c02d05d73e..e659146e9f 100644
--- a/vendor/github.com/sigstore/rekor/pkg/types/rekord/rekord.go
+++ b/vendor/github.com/sigstore/rekor/pkg/types/rekord/rekord.go
@@ -43,7 +43,7 @@ func New() types.TypeImpl {
return &brt
}
-var VersionMap = types.NewSemVerEntryFactoryMap()
+var VersionMap = types.NewEntryFactoryMap()
func (rt BaseRekordType) UnmarshalEntry(pe models.ProposedEntry) (types.EntryImpl, error) {
if pe == nil {
@@ -51,7 +51,7 @@ func (rt BaseRekordType) UnmarshalEntry(pe models.ProposedEntry) (types.EntryImp
}
rekord, ok := pe.(*models.Rekord)
- if !ok {
+ if !ok || rekord == nil {
return nil, errors.New("cannot unmarshal non-Rekord types")
}
diff --git a/vendor/github.com/sigstore/rekor/pkg/types/rekord/v0.0.1/entry.go b/vendor/github.com/sigstore/rekor/pkg/types/rekord/v0.0.1/entry.go
index 319dcdffff..bd1f8304a6 100644
--- a/vendor/github.com/sigstore/rekor/pkg/types/rekord/v0.0.1/entry.go
+++ b/vendor/github.com/sigstore/rekor/pkg/types/rekord/v0.0.1/entry.go
@@ -68,6 +68,18 @@ func NewEntry() types.EntryImpl {
}
func (v V001Entry) IndexKeys() ([]string, error) {
+ if v.RekordObj.Signature == nil || v.RekordObj.Signature.Format == nil || v.RekordObj.Signature.PublicKey == nil || v.RekordObj.Signature.PublicKey.Content == nil {
+ return nil, errors.New("missing signature properties")
+ }
+ if v.RekordObj.Data == nil {
+ return nil, errors.New("missing data property")
+ }
+ if v.RekordObj.Data.Hash != nil {
+ if v.RekordObj.Data.Hash.Algorithm == nil || v.RekordObj.Data.Hash.Value == nil {
+ return nil, errors.New("missing hash properties")
+ }
+ }
+
var result []string
af, err := pki.NewArtifactFactory(pki.Format(*v.RekordObj.Signature.Format))
@@ -99,7 +111,7 @@ func (v V001Entry) IndexKeys() ([]string, error) {
func (v *V001Entry) Unmarshal(pe models.ProposedEntry) error {
rekord, ok := pe.(*models.Rekord)
- if !ok {
+ if !ok || rekord == nil {
return errors.New("cannot unmarshal non Rekord v0.0.1 type")
}
@@ -193,6 +205,13 @@ func DecodeEntry(input any, output *models.RekordV001Schema) error {
}
func (v *V001Entry) fetchExternalEntities(_ context.Context) (pki.PublicKey, pki.Signature, error) {
+ if v.RekordObj.Signature == nil || v.RekordObj.Signature.Format == nil {
+ return nil, nil, &types.InputValidationError{Err: errors.New("missing signature format")}
+ }
+ if v.RekordObj.Data == nil {
+ return nil, nil, &types.InputValidationError{Err: errors.New("missing data")}
+ }
+
af, err := pki.NewArtifactFactory(pki.Format(*v.RekordObj.Signature.Format))
if err != nil {
return nil, nil, err
@@ -240,6 +259,10 @@ func (v *V001Entry) fetchExternalEntities(_ context.Context) (pki.PublicKey, pki
}
func (v *V001Entry) Canonicalize(ctx context.Context) ([]byte, error) {
+ if v.RekordObj.Data == nil {
+ return nil, &types.InputValidationError{Err: errors.New("missing data")}
+ }
+
keyObj, sigObj, err := v.fetchExternalEntities(ctx)
if err != nil {
return nil, err
@@ -289,9 +312,12 @@ func (v *V001Entry) Canonicalize(ctx context.Context) ([]byte, error) {
// validate performs cross-field validation for fields in object
func (v V001Entry) validate() error {
sig := v.RekordObj.Signature
- if v.RekordObj.Signature == nil {
+ if sig == nil {
return errors.New("missing signature")
}
+ if sig.Format == nil || len(*sig.Format) == 0 {
+ return errors.New("missing signature format")
+ }
if sig.Content == nil || len(*sig.Content) == 0 {
return errors.New("'content' must be specified for signature")
}
@@ -311,8 +337,14 @@ func (v V001Entry) validate() error {
hash := data.Hash
if hash != nil {
+ if hash.Algorithm == nil || *hash.Algorithm == "" {
+ return errors.New("missing hash algorithm")
+ }
+ if hash.Value == nil || len(*hash.Value) == 0 {
+ return errors.New("missing hash value")
+ }
// Rekord v0.0.1 schema enumerates sha256; enforce length accordingly.
- if hash.Value == nil || len(*hash.Value) != crypto.SHA256.Size()*2 {
+ if len(*hash.Value) != crypto.SHA256.Size()*2 {
return errors.New("invalid value for hash")
}
if _, err := hex.DecodeString(*hash.Value); err != nil {
@@ -390,6 +422,9 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types
if len(props.PublicKeyPaths) != 1 {
return nil, errors.New("only one public key must be provided to verify detached signature")
}
+ if props.PublicKeyPaths[0] == nil {
+ return nil, errors.New("public key path cannot be nil")
+ }
keyBytes, err := os.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path))
if err != nil {
return nil, fmt.Errorf("error reading public key file: %w", err)
@@ -416,8 +451,8 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types
}
func (v V001Entry) Verifiers() ([]pki.PublicKey, error) {
- if v.RekordObj.Signature == nil || v.RekordObj.Signature.PublicKey == nil || v.RekordObj.Signature.PublicKey.Content == nil {
- return nil, errors.New("rekord v0.0.1 entry not initialized")
+ if v.RekordObj.Signature == nil || v.RekordObj.Signature.Format == nil || v.RekordObj.Signature.PublicKey == nil || v.RekordObj.Signature.PublicKey.Content == nil {
+ return nil, errors.New("missing signature properties")
}
var key pki.PublicKey
@@ -441,8 +476,16 @@ func (v V001Entry) Verifiers() ([]pki.PublicKey, error) {
}
func (v V001Entry) ArtifactHash() (string, error) {
- if v.RekordObj.Data == nil || v.RekordObj.Data.Hash == nil || v.RekordObj.Data.Hash.Value == nil || v.RekordObj.Data.Hash.Algorithm == nil {
- return "", errors.New("rekord v0.0.1 entry not initialized")
+ if v.RekordObj.Data == nil {
+ return "", errors.New("missing data property")
+ }
+ if v.RekordObj.Data.Hash != nil {
+ if v.RekordObj.Data.Hash.Algorithm == nil || v.RekordObj.Data.Hash.Value == nil {
+ return "", errors.New("missing hash properties")
+ }
+ }
+ if v.RekordObj.Data.Hash == nil {
+ return "", errors.New("rekord v0.0.1 entry not initialized (missing hash)")
}
return strings.ToLower(fmt.Sprintf("%s:%s", *v.RekordObj.Data.Hash.Algorithm, *v.RekordObj.Data.Hash.Value)), nil
}
diff --git a/vendor/github.com/sigstore/rekor/pkg/types/versionmap.go b/vendor/github.com/sigstore/rekor/pkg/types/versionmap.go
index d271637099..2417e3a5df 100644
--- a/vendor/github.com/sigstore/rekor/pkg/types/versionmap.go
+++ b/vendor/github.com/sigstore/rekor/pkg/types/versionmap.go
@@ -19,12 +19,11 @@ import (
"fmt"
"sync"
- "github.com/blang/semver"
"github.com/sigstore/rekor/pkg/internal/log"
)
// VersionEntryFactoryMap defines a map-like interface to find the correct implementation for a version string
-// This could be a simple map[string][EntryFactory], or something more elegant (e.g. semver)
+// This could be a simple map[string][EntryFactory], or something more elegant
type VersionEntryFactoryMap interface {
GetEntryFactory(string) (EntryFactory, error) // return the entry factory for the specified version
SetEntryFactory(string, EntryFactory) error // set the entry factory for the specified version
@@ -32,63 +31,53 @@ type VersionEntryFactoryMap interface {
SupportedVersions() []string // return a list of versions currently stored in the map
}
-// SemVerEntryFactoryMap implements a map that allows implementations to specify their supported versions using
-// semver-compliant strings
-type SemVerEntryFactoryMap struct {
+// EntryFactoryMap implements a thread-safe map of version strings to EntryFactory functions
+type EntryFactoryMap struct {
factoryMap map[string]EntryFactory
sync.RWMutex
}
-func NewSemVerEntryFactoryMap() VersionEntryFactoryMap {
- s := SemVerEntryFactoryMap{}
+func NewEntryFactoryMap() VersionEntryFactoryMap {
+ s := EntryFactoryMap{}
s.factoryMap = make(map[string]EntryFactory)
return &s
}
-func (s *SemVerEntryFactoryMap) Count() int {
+func (s *EntryFactoryMap) Count() int {
+ s.RLock()
+ defer s.RUnlock()
return len(s.factoryMap)
}
-func (s *SemVerEntryFactoryMap) GetEntryFactory(version string) (EntryFactory, error) {
+func (s *EntryFactoryMap) GetEntryFactory(version string) (EntryFactory, error) {
s.RLock()
defer s.RUnlock()
- semverToMatch, err := semver.Parse(version)
- if err != nil {
- log.Logger.Error(err)
- return nil, err
+ if ef, ok := s.factoryMap[version]; ok {
+ return ef, nil
}
- // will return first function that matches
- for k, v := range s.factoryMap {
- semverRange, err := semver.ParseRange(k)
- if err != nil {
- log.Logger.Error(err)
- return nil, err
- }
-
- if semverRange(semverToMatch) {
- return v, nil
- }
- }
return nil, fmt.Errorf("unable to locate entry for version %s", version)
}
-func (s *SemVerEntryFactoryMap) SetEntryFactory(constraint string, ef EntryFactory) error {
+func (s *EntryFactoryMap) SetEntryFactory(version string, ef EntryFactory) error {
s.Lock()
defer s.Unlock()
- if _, err := semver.ParseRange(constraint); err != nil {
+ if version == "" {
+ err := fmt.Errorf("empty version string")
log.Logger.Error(err)
return err
}
- s.factoryMap[constraint] = ef
+ s.factoryMap[version] = ef
return nil
}
-func (s *SemVerEntryFactoryMap) SupportedVersions() []string {
+func (s *EntryFactoryMap) SupportedVersions() []string {
+ s.RLock()
+ defer s.RUnlock()
var versions []string
for k := range s.factoryMap {
versions = append(versions, k)
diff --git a/vendor/github.com/sigstore/rekor/pkg/util/signed_note.go b/vendor/github.com/sigstore/rekor/pkg/util/signed_note.go
index 4c9c8f8a70..1f291ce3e2 100644
--- a/vendor/github.com/sigstore/rekor/pkg/util/signed_note.go
+++ b/vendor/github.com/sigstore/rekor/pkg/util/signed_note.go
@@ -186,6 +186,10 @@ func (s *SignedNote) UnmarshalText(data []byte) error {
sn.Signatures = append(sn.Signatures, sig)
}
+ if err := b.Err(); err != nil {
+ return fmt.Errorf("reading signed note: %w", err)
+ }
+
if len(sn.Signatures) == 0 {
return errors.New("no signatures found in input")
}
diff --git a/vendor/github.com/sigstore/rekor/pkg/verify/verify.go b/vendor/github.com/sigstore/rekor/pkg/verify/verify.go
index 5f25ed871b..05623e362c 100644
--- a/vendor/github.com/sigstore/rekor/pkg/verify/verify.go
+++ b/vendor/github.com/sigstore/rekor/pkg/verify/verify.go
@@ -48,11 +48,11 @@ func ProveConsistency(ctx context.Context, rClient *client.Rekor,
return errors.New("old root hash does not match STH hash")
}
case oldTreeSize < int64(newSTH.Size): // nolint: gosec
- consistencyParams := tlog.NewGetLogProofParamsWithContext(ctx)
+ consistencyParams := tlog.NewGetLogProofParams()
consistencyParams.FirstSize = &oldTreeSize // Root size at the old, or trusted state.
consistencyParams.LastSize = int64(newSTH.Size) // nolint: gosec // Root size at the new state to verify against.
consistencyParams.TreeID = &treeID
- consistencyProof, err := rClient.Tlog.GetLogProof(consistencyParams)
+ consistencyProof, err := rClient.Tlog.GetLogProofContext(ctx, consistencyParams)
if err != nil {
return err
}
@@ -86,8 +86,8 @@ func VerifyCurrentCheckpoint(ctx context.Context, rClient *client.Rekor, verifie
}
// Get and verify against the current STH.
- infoParams := tlog.NewGetLogInfoParamsWithContext(ctx)
- result, err := rClient.Tlog.GetLogInfo(infoParams)
+ infoParams := tlog.NewGetLogInfoParams()
+ result, err := rClient.Tlog.GetLogInfoContext(ctx, infoParams)
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/stretchr/objx/README.md b/vendor/github.com/stretchr/objx/README.md
index 78dc1f8b03..e9ba830735 100644
--- a/vendor/github.com/stretchr/objx/README.md
+++ b/vendor/github.com/stretchr/objx/README.md
@@ -1,8 +1,6 @@
# Objx
[](https://travis-ci.org/stretchr/objx)
[](https://goreportcard.com/report/github.com/stretchr/objx)
-[](https://codeclimate.com/github/stretchr/objx/maintainability)
-[](https://codeclimate.com/github/stretchr/objx/test_coverage)
[](https://sourcegraph.com/github.com/stretchr/objx)
[](https://pkg.go.dev/github.com/stretchr/objx)
@@ -19,49 +17,62 @@ Objx provides the `objx.Map` type, which is a `map[string]interface{}` that expo
### Pattern
Objx uses a predictable pattern to make access data from within `map[string]interface{}` easy. Call one of the `objx.` functions to create your `objx.Map` to get going:
- m, err := objx.FromJSON(json)
+```go
+m, err := objx.FromJSON(json)
+```
NOTE: Any methods or functions with the `Must` prefix will panic if something goes wrong, the rest will be optimistic and try to figure things out without panicking.
Use `Get` to access the value you're interested in. You can use dot and array
notation too:
- m.Get("places[0].latlng")
+```go
+m.Get("places[0].latlng")
+```
Once you have sought the `Value` you're interested in, you can use the `Is*` methods to determine its type.
- if m.Get("code").IsStr() { // Your code... }
+```go
+if m.Get("code").IsStr() { // Your code... }
+```
Or you can just assume the type, and use one of the strong type methods to extract the real value:
- m.Get("code").Int()
+```go
+m.Get("code").Int()
+```
If there's no value there (or if it's the wrong type) then a default value will be returned, or you can be explicit about the default value.
- Get("code").Int(-1)
-
+```go
+Get("code").Int(-1)
+```
If you're dealing with a slice of data as a value, Objx provides many useful methods for iterating, manipulating and selecting that data. You can find out more by exploring the index below.
### Reading data
A simple example of how to use Objx:
- // Use MustFromJSON to make an objx.Map from some JSON
- m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`)
+```go
+// Use MustFromJSON to make an objx.Map from some JSON
+m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`)
- // Get the details
- name := m.Get("name").Str()
- age := m.Get("age").Int()
+// Get the details
+name := m.Get("name").Str()
+age := m.Get("age").Int()
- // Get their nickname (or use their name if they don't have one)
- nickname := m.Get("nickname").Str(name)
+// Get their nickname (or use their name if they don't have one)
+nickname := m.Get("nickname").Str(name)
+```
### Ranging
Since `objx.Map` is a `map[string]interface{}` you can treat it as such. For example, to `range` the data, do what you would expect:
- m := objx.MustFromJSON(json)
- for key, value := range m {
- // Your code...
- }
+```go
+m := objx.MustFromJSON(json)
+for key, value := range m {
+ // Your code...
+}
+```
## Installation
To install Objx, use go get:
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_format.go b/vendor/github.com/stretchr/testify/assert/assertion_format.go
index c592f6ad5f..a19a89279c 100644
--- a/vendor/github.com/stretchr/testify/assert/assertion_format.go
+++ b/vendor/github.com/stretchr/testify/assert/assertion_format.go
@@ -84,7 +84,7 @@ func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, ar
return Equal(t, expected, actual, append([]interface{}{msg}, args...)...)
}
-// EqualErrorf asserts that a function returned an error (i.e. not `nil`)
+// EqualErrorf asserts that a function returned a non-nil error (i.e. an error)
// and that it is equal to the provided error.
//
// actualObj, err := SomeFunction()
@@ -124,7 +124,7 @@ func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg stri
return EqualValues(t, expected, actual, append([]interface{}{msg}, args...)...)
}
-// Errorf asserts that a function returned an error (i.e. not `nil`).
+// Errorf asserts that a function returned a non-nil error (ie. an error).
//
// actualObj, err := SomeFunction()
// assert.Errorf(t, err, "error message %s", "formatted")
@@ -144,8 +144,8 @@ func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...int
return ErrorAs(t, err, target, append([]interface{}{msg}, args...)...)
}
-// ErrorContainsf asserts that a function returned an error (i.e. not `nil`)
-// and that the error contains the specified substring.
+// ErrorContainsf asserts that a function returned a non-nil error (i.e. an
+// error) and that the error contains the specified substring.
//
// actualObj, err := SomeFunction()
// assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted")
@@ -190,10 +190,10 @@ func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick
// time.Sleep(8*time.Second)
// externalValue = true
// }()
-// assert.EventuallyWithTf(t, func(c *assert.CollectT, "error message %s", "formatted") {
+// assert.EventuallyWithTf(t, func(c *assert.CollectT) {
// // add assertions as needed; any assertion failure will fail the current tick
// assert.True(c, externalValue, "expected 'externalValue' to be true")
-// }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false")
+// }, 10*time.Second, 1*time.Second, "error message %s", "formatted")
func EventuallyWithTf(t TestingT, condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -552,7 +552,7 @@ func NoDirExistsf(t TestingT, path string, msg string, args ...interface{}) bool
return NoDirExists(t, path, append([]interface{}{msg}, args...)...)
}
-// NoErrorf asserts that a function returned no error (i.e. `nil`).
+// NoErrorf asserts that a function returned a nil error (ie. no error).
//
// actualObj, err := SomeFunction()
// if assert.NoErrorf(t, err, "error message %s", "formatted") {
@@ -849,7 +849,19 @@ func WithinRangef(t TestingT, actual time.Time, start time.Time, end time.Time,
return WithinRange(t, actual, start, end, append([]interface{}{msg}, args...)...)
}
-// YAMLEqf asserts that two YAML strings are equivalent.
+// YAMLEqf asserts that the first documents in the two YAML strings are equivalent.
+//
+// expected := `---
+// key: value
+// ---
+// key: this is a second document, it is not evaluated
+// `
+// actual := `---
+// key: value
+// ---
+// key: this is a subsequent document, it is not evaluated
+// `
+// assert.YAMLEqf(t, expected, actual, "error message %s", "formatted")
func YAMLEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_forward.go b/vendor/github.com/stretchr/testify/assert/assertion_forward.go
index 58db928450..cd2a86061c 100644
--- a/vendor/github.com/stretchr/testify/assert/assertion_forward.go
+++ b/vendor/github.com/stretchr/testify/assert/assertion_forward.go
@@ -146,7 +146,7 @@ func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs
return Equal(a.t, expected, actual, msgAndArgs...)
}
-// EqualError asserts that a function returned an error (i.e. not `nil`)
+// EqualError asserts that a function returned a non-nil error (i.e. an error)
// and that it is equal to the provided error.
//
// actualObj, err := SomeFunction()
@@ -158,7 +158,7 @@ func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...
return EqualError(a.t, theError, errString, msgAndArgs...)
}
-// EqualErrorf asserts that a function returned an error (i.e. not `nil`)
+// EqualErrorf asserts that a function returned a non-nil error (i.e. an error)
// and that it is equal to the provided error.
//
// actualObj, err := SomeFunction()
@@ -240,7 +240,7 @@ func (a *Assertions) Equalf(expected interface{}, actual interface{}, msg string
return Equalf(a.t, expected, actual, msg, args...)
}
-// Error asserts that a function returned an error (i.e. not `nil`).
+// Error asserts that a function returned a non-nil error (ie. an error).
//
// actualObj, err := SomeFunction()
// a.Error(err)
@@ -269,8 +269,8 @@ func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ..
return ErrorAsf(a.t, err, target, msg, args...)
}
-// ErrorContains asserts that a function returned an error (i.e. not `nil`)
-// and that the error contains the specified substring.
+// ErrorContains asserts that a function returned a non-nil error (i.e. an
+// error) and that the error contains the specified substring.
//
// actualObj, err := SomeFunction()
// a.ErrorContains(err, expectedErrorSubString)
@@ -281,8 +281,8 @@ func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs .
return ErrorContains(a.t, theError, contains, msgAndArgs...)
}
-// ErrorContainsf asserts that a function returned an error (i.e. not `nil`)
-// and that the error contains the specified substring.
+// ErrorContainsf asserts that a function returned a non-nil error (i.e. an
+// error) and that the error contains the specified substring.
//
// actualObj, err := SomeFunction()
// a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted")
@@ -311,7 +311,7 @@ func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...inter
return ErrorIsf(a.t, err, target, msg, args...)
}
-// Errorf asserts that a function returned an error (i.e. not `nil`).
+// Errorf asserts that a function returned a non-nil error (ie. an error).
//
// actualObj, err := SomeFunction()
// a.Errorf(err, "error message %s", "formatted")
@@ -372,10 +372,10 @@ func (a *Assertions) EventuallyWithT(condition func(collect *CollectT), waitFor
// time.Sleep(8*time.Second)
// externalValue = true
// }()
-// a.EventuallyWithTf(func(c *assert.CollectT, "error message %s", "formatted") {
+// a.EventuallyWithTf(func(c *assert.CollectT) {
// // add assertions as needed; any assertion failure will fail the current tick
// assert.True(c, externalValue, "expected 'externalValue' to be true")
-// }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false")
+// }, 10*time.Second, 1*time.Second, "error message %s", "formatted")
func (a *Assertions) EventuallyWithTf(condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1096,7 +1096,7 @@ func (a *Assertions) NoDirExistsf(path string, msg string, args ...interface{})
return NoDirExistsf(a.t, path, msg, args...)
}
-// NoError asserts that a function returned no error (i.e. `nil`).
+// NoError asserts that a function returned a nil error (ie. no error).
//
// actualObj, err := SomeFunction()
// if a.NoError(err) {
@@ -1109,7 +1109,7 @@ func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) bool {
return NoError(a.t, err, msgAndArgs...)
}
-// NoErrorf asserts that a function returned no error (i.e. `nil`).
+// NoErrorf asserts that a function returned a nil error (ie. no error).
//
// actualObj, err := SomeFunction()
// if a.NoErrorf(err, "error message %s", "formatted") {
@@ -1690,7 +1690,19 @@ func (a *Assertions) WithinRangef(actual time.Time, start time.Time, end time.Ti
return WithinRangef(a.t, actual, start, end, msg, args...)
}
-// YAMLEq asserts that two YAML strings are equivalent.
+// YAMLEq asserts that the first documents in the two YAML strings are equivalent.
+//
+// expected := `---
+// key: value
+// ---
+// key: this is a second document, it is not evaluated
+// `
+// actual := `---
+// key: value
+// ---
+// key: this is a subsequent document, it is not evaluated
+// `
+// a.YAMLEq(expected, actual)
func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1698,7 +1710,19 @@ func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interf
return YAMLEq(a.t, expected, actual, msgAndArgs...)
}
-// YAMLEqf asserts that two YAML strings are equivalent.
+// YAMLEqf asserts that the first documents in the two YAML strings are equivalent.
+//
+// expected := `---
+// key: value
+// ---
+// key: this is a second document, it is not evaluated
+// `
+// actual := `---
+// key: value
+// ---
+// key: this is a subsequent document, it is not evaluated
+// `
+// a.YAMLEqf(expected, actual, "error message %s", "formatted")
func (a *Assertions) YAMLEqf(expected string, actual string, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_order.go b/vendor/github.com/stretchr/testify/assert/assertion_order.go
index 2fdf80fdd3..a44b40ed3f 100644
--- a/vendor/github.com/stretchr/testify/assert/assertion_order.go
+++ b/vendor/github.com/stretchr/testify/assert/assertion_order.go
@@ -9,7 +9,7 @@ import (
func isOrdered(t TestingT, object interface{}, allowedComparesResults []compareResult, failMessage string, msgAndArgs ...interface{}) bool {
objKind := reflect.TypeOf(object).Kind()
if objKind != reflect.Slice && objKind != reflect.Array {
- return false
+ return Fail(t, fmt.Sprintf("object %T is not an ordered collection", object), msgAndArgs...)
}
objValue := reflect.ValueOf(object)
@@ -50,6 +50,9 @@ func isOrdered(t TestingT, object interface{}, allowedComparesResults []compareR
// assert.IsIncreasing(t, []float{1, 2})
// assert.IsIncreasing(t, []string{"a", "b"})
func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
return isOrdered(t, object, []compareResult{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs...)
}
@@ -59,6 +62,9 @@ func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) boo
// assert.IsNonIncreasing(t, []float{2, 1})
// assert.IsNonIncreasing(t, []string{"b", "a"})
func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
return isOrdered(t, object, []compareResult{compareEqual, compareGreater}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs...)
}
@@ -68,6 +74,9 @@ func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{})
// assert.IsDecreasing(t, []float{2, 1})
// assert.IsDecreasing(t, []string{"b", "a"})
func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
return isOrdered(t, object, []compareResult{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs...)
}
@@ -77,5 +86,8 @@ func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) boo
// assert.IsNonDecreasing(t, []float{1, 2})
// assert.IsNonDecreasing(t, []string{"a", "b"})
func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
return isOrdered(t, object, []compareResult{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs...)
}
diff --git a/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/stretchr/testify/assert/assertions.go
index de8de0cb6c..1419e47761 100644
--- a/vendor/github.com/stretchr/testify/assert/assertions.go
+++ b/vendor/github.com/stretchr/testify/assert/assertions.go
@@ -17,11 +17,10 @@ import (
"unicode"
"unicode/utf8"
- "github.com/davecgh/go-spew/spew"
- "github.com/pmezard/go-difflib/difflib"
-
// Wrapper around gopkg.in/yaml.v3
"github.com/stretchr/testify/assert/yaml"
+ "github.com/stretchr/testify/internal/difflib"
+ "github.com/stretchr/testify/internal/spew"
)
//go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_format.go.tmpl"
@@ -33,19 +32,19 @@ type TestingT interface {
// ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful
// for table driven tests.
-type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{}) bool
+type ComparisonAssertionFunc = func(TestingT, interface{}, interface{}, ...interface{}) bool
// ValueAssertionFunc is a common function prototype when validating a single value. Can be useful
// for table driven tests.
-type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) bool
+type ValueAssertionFunc = func(TestingT, interface{}, ...interface{}) bool
// BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful
// for table driven tests.
-type BoolAssertionFunc func(TestingT, bool, ...interface{}) bool
+type BoolAssertionFunc = func(TestingT, bool, ...interface{}) bool
// ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful
// for table driven tests.
-type ErrorAssertionFunc func(TestingT, error, ...interface{}) bool
+type ErrorAssertionFunc = func(TestingT, error, ...interface{}) bool
// PanicAssertionFunc is a common function prototype when validating a panic value. Can be useful
// for table driven tests.
@@ -325,13 +324,15 @@ func messageFromMsgAndArgs(msgAndArgs ...interface{}) string {
func indentMessageLines(message string, longestLabelLen int) string {
outBuf := new(bytes.Buffer)
- for i, scanner := 0, bufio.NewScanner(strings.NewReader(message)); scanner.Scan(); i++ {
- // no need to align first line because it starts at the correct location (after the label)
- if i != 0 {
- // append alignLen+1 spaces to align with "{{longestLabel}}:" before adding tab
- outBuf.WriteString("\n\t" + strings.Repeat(" ", longestLabelLen+1) + "\t")
+ scanner := bufio.NewScanner(strings.NewReader(message))
+ for firstLine := true; scanner.Scan(); firstLine = false {
+ if !firstLine {
+ fmt.Fprint(outBuf, "\n\t"+strings.Repeat(" ", longestLabelLen+1)+"\t")
}
- outBuf.WriteString(scanner.Text())
+ fmt.Fprint(outBuf, scanner.Text())
+ }
+ if err := scanner.Err(); err != nil {
+ return fmt.Sprintf("cannot display message: %s", err)
}
return outBuf.String()
@@ -544,9 +545,8 @@ func Same(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) b
if !same {
// both are pointers but not the same type & pointing to the same address
return Fail(t, fmt.Sprintf("Not same: \n"+
- "expected: %p %#[1]v\n"+
- "actual : %p %#[2]v",
- expected, actual), msgAndArgs...)
+ "expected: %[2]s (%[1]T)(%[1]p)\n"+
+ "actual : %[4]s (%[3]T)(%[3]p)", expected, truncatingFormat("%#v", expected), actual, truncatingFormat("%#v", actual)), msgAndArgs...)
}
return true
@@ -571,8 +571,8 @@ func NotSame(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}
if same {
return Fail(t, fmt.Sprintf(
- "Expected and actual point to the same object: %p %#[1]v",
- expected), msgAndArgs...)
+ "Expected and actual point to the same object: %p %s",
+ expected, truncatingFormat("%#v", expected)), msgAndArgs...)
}
return true
}
@@ -604,25 +604,26 @@ func samePointers(first, second interface{}) (same bool, ok bool) {
// to a type conversion in the Go grammar.
func formatUnequalValues(expected, actual interface{}) (e string, a string) {
if reflect.TypeOf(expected) != reflect.TypeOf(actual) {
- return fmt.Sprintf("%T(%s)", expected, truncatingFormat(expected)),
- fmt.Sprintf("%T(%s)", actual, truncatingFormat(actual))
+ return fmt.Sprintf("%T(%s)", expected, truncatingFormat("%#v", expected)),
+ fmt.Sprintf("%T(%s)", actual, truncatingFormat("%#v", actual))
}
switch expected.(type) {
case time.Duration:
return fmt.Sprintf("%v", expected), fmt.Sprintf("%v", actual)
}
- return truncatingFormat(expected), truncatingFormat(actual)
+ return truncatingFormat("%#v", expected), truncatingFormat("%#v", actual)
}
// truncatingFormat formats the data and truncates it if it's too long.
//
// This helps keep formatted error messages lines from exceeding the
// bufio.MaxScanTokenSize max line length that the go testing framework imposes.
-func truncatingFormat(data interface{}) string {
- value := fmt.Sprintf("%#v", data)
- max := bufio.MaxScanTokenSize - 100 // Give us some space the type info too if needed.
- if len(value) > max {
- value = value[0:max] + "<... truncated>"
+func truncatingFormat(format string, data interface{}) string {
+ value := fmt.Sprintf(format, data)
+ // Give us space for two truncated objects and the surrounding sentence.
+ maxMessageSize := bufio.MaxScanTokenSize/2 - 100
+ if len(value) > maxMessageSize {
+ value = value[0:maxMessageSize] + "<... truncated>"
}
return value
}
@@ -743,7 +744,7 @@ func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
}
- return Fail(t, fmt.Sprintf("Expected nil, but got: %#v", object), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("Expected nil, but got: %s", truncatingFormat("%#v", object)), msgAndArgs...)
}
// isEmpty gets whether the specified object is considered empty or not.
@@ -793,7 +794,7 @@ func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
}
- Fail(t, fmt.Sprintf("Should be empty, but was %v", object), msgAndArgs...)
+ Fail(t, fmt.Sprintf("Should be empty, but was %s", truncatingFormat("%v", object)), msgAndArgs...)
}
return pass
@@ -836,11 +837,11 @@ func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{})
}
l, ok := getLen(object)
if !ok {
- return Fail(t, fmt.Sprintf("\"%v\" could not be applied builtin len()", object), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%q could not be applied builtin len()", truncatingFormat("%v", object)), msgAndArgs...)
}
if l != length {
- return Fail(t, fmt.Sprintf("\"%v\" should have %d item(s), but has %d", object, length, l), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%q should have %d item(s), but has %d", truncatingFormat("%v", object), length, l), msgAndArgs...)
}
return true
}
@@ -889,7 +890,7 @@ func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{
}
if ObjectsAreEqual(expected, actual) {
- return Fail(t, fmt.Sprintf("Should not be: %#v\n", actual), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("Should not be: %s\n", truncatingFormat("%#v", actual)), msgAndArgs...)
}
return true
@@ -904,7 +905,7 @@ func NotEqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...inte
}
if ObjectsAreEqualValues(expected, actual) {
- return Fail(t, fmt.Sprintf("Should not be: %#v\n", actual), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("Should not be: %s\n", truncatingFormat("%#v", actual)), msgAndArgs...)
}
return true
@@ -964,10 +965,10 @@ func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bo
ok, found := containsElement(s, contains)
if !ok {
- return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%s could not be applied builtin len()", truncatingFormat("%#v", s)), msgAndArgs...)
}
if !found {
- return Fail(t, fmt.Sprintf("%#v does not contain %#v", s, contains), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%s does not contain %#v", truncatingFormat("%#v", s), contains), msgAndArgs...)
}
return true
@@ -986,10 +987,10 @@ func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{})
ok, found := containsElement(s, contains)
if !ok {
- return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%s could not be applied builtin len()", truncatingFormat("%#v", s)), msgAndArgs...)
}
if found {
- return Fail(t, fmt.Sprintf("%#v should not contain %#v", s, contains), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%s should not contain %#v", truncatingFormat("%#v", s), contains), msgAndArgs...)
}
return true
@@ -1031,10 +1032,10 @@ func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok
av := actualMap.MapIndex(k)
if !av.IsValid() {
- return Fail(t, fmt.Sprintf("%#v does not contain %#v", list, subset), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%s does not contain %s", truncatingFormat("%#v", list), truncatingFormat("%#v", subset)), msgAndArgs...)
}
if !ObjectsAreEqual(ev.Interface(), av.Interface()) {
- return Fail(t, fmt.Sprintf("%#v does not contain %#v", list, subset), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%s does not contain %s", truncatingFormat("%#v", list), truncatingFormat("%#v", subset)), msgAndArgs...)
}
}
@@ -1056,7 +1057,7 @@ func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok
return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", list), msgAndArgs...)
}
if !found {
- return Fail(t, fmt.Sprintf("%#v does not contain %#v", list, element), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%s does not contain %#v", truncatingFormat("%#v", list), element), msgAndArgs...)
}
}
@@ -1082,12 +1083,12 @@ func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{})
listKind := reflect.TypeOf(list).Kind()
if listKind != reflect.Array && listKind != reflect.Slice && listKind != reflect.Map {
- return Fail(t, fmt.Sprintf("%q has an unsupported type %s", list, listKind), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%#v has an unsupported type %s", list, listKind), msgAndArgs...)
}
subsetKind := reflect.TypeOf(subset).Kind()
if subsetKind != reflect.Array && subsetKind != reflect.Slice && subsetKind != reflect.Map {
- return Fail(t, fmt.Sprintf("%q has an unsupported type %s", subset, subsetKind), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%#v has an unsupported type %s", subset, subsetKind), msgAndArgs...)
}
if subsetKind == reflect.Map && listKind == reflect.Map {
@@ -1106,7 +1107,7 @@ func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{})
}
}
- return Fail(t, fmt.Sprintf("%q is a subset of %q", subset, list), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%s is a subset of %s", truncatingFormat("%#v", subset), truncatingFormat("%#v", list)), msgAndArgs...)
}
subsetList := reflect.ValueOf(subset)
@@ -1121,14 +1122,14 @@ func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{})
element := subsetList.Index(i).Interface()
ok, found := containsElement(list, element)
if !ok {
- return Fail(t, fmt.Sprintf("%q could not be applied builtin len()", list), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", list), msgAndArgs...)
}
if !found {
return true
}
}
- return Fail(t, fmt.Sprintf("%q is a subset of %q", subset, list), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%s is a subset of %s", truncatingFormat("%#v", subset), truncatingFormat("%#v", list)), msgAndArgs...)
}
// ElementsMatch asserts that the specified listA(array, slice...) is equal to specified
@@ -1343,9 +1344,15 @@ func PanicsWithError(t TestingT, errString string, f PanicTestFunc, msgAndArgs .
if !funcDidPanic {
return Fail(t, fmt.Sprintf("func %#v should panic\n\tPanic value:\t%#v", f, panicValue), msgAndArgs...)
}
- panicErr, ok := panicValue.(error)
- if !ok || panicErr.Error() != errString {
- return Fail(t, fmt.Sprintf("func %#v should panic with error message:\t%#v\n\tPanic value:\t%#v\n\tPanic stack:\t%s", f, errString, panicValue, panickedStack), msgAndArgs...)
+ panicErr, isError := panicValue.(error)
+ if !isError || panicErr.Error() != errString {
+ msg := fmt.Sprintf("func %#v should panic with error message:\t%#v\n", f, errString)
+ if isError {
+ msg += fmt.Sprintf("\tError message:\t%#v\n", panicErr.Error())
+ }
+ msg += fmt.Sprintf("\tPanic value:\t%#v\n", panicValue)
+ msg += fmt.Sprintf("\tPanic stack:\t%s\n", panickedStack)
+ return Fail(t, msg, msgAndArgs...)
}
return true
@@ -1624,7 +1631,7 @@ func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, m
Errors
*/
-// NoError asserts that a function returned no error (i.e. `nil`).
+// NoError asserts that a function returned a nil error (ie. no error).
//
// actualObj, err := SomeFunction()
// if assert.NoError(t, err) {
@@ -1635,13 +1642,13 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
}
- return Fail(t, fmt.Sprintf("Received unexpected error:\n%+v", err), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("Received unexpected error:\n%s", truncatingFormat("%+v", err)), msgAndArgs...)
}
return true
}
-// Error asserts that a function returned an error (i.e. not `nil`).
+// Error asserts that a function returned a non-nil error (ie. an error).
//
// actualObj, err := SomeFunction()
// assert.Error(t, err)
@@ -1656,7 +1663,7 @@ func Error(t TestingT, err error, msgAndArgs ...interface{}) bool {
return true
}
-// EqualError asserts that a function returned an error (i.e. not `nil`)
+// EqualError asserts that a function returned a non-nil error (i.e. an error)
// and that it is equal to the provided error.
//
// actualObj, err := SomeFunction()
@@ -1674,13 +1681,13 @@ func EqualError(t TestingT, theError error, errString string, msgAndArgs ...inte
if expected != actual {
return Fail(t, fmt.Sprintf("Error message not equal:\n"+
"expected: %q\n"+
- "actual : %q", expected, actual), msgAndArgs...)
+ "actual : %s", expected, truncatingFormat("%q", actual)), msgAndArgs...)
}
return true
}
-// ErrorContains asserts that a function returned an error (i.e. not `nil`)
-// and that the error contains the specified substring.
+// ErrorContains asserts that a function returned a non-nil error (i.e. an
+// error) and that the error contains the specified substring.
//
// actualObj, err := SomeFunction()
// assert.ErrorContains(t, err, expectedErrorSubString)
@@ -1694,7 +1701,7 @@ func ErrorContains(t TestingT, theError error, contains string, msgAndArgs ...in
actual := theError.Error()
if !strings.Contains(actual, contains) {
- return Fail(t, fmt.Sprintf("Error %#v does not contain %#v", actual, contains), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("Error %s does not contain %#v", truncatingFormat("%#v", actual), contains), msgAndArgs...)
}
return true
@@ -1760,7 +1767,7 @@ func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool {
h.Helper()
}
if i != nil && !reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) {
- return Fail(t, fmt.Sprintf("Should be zero, but was %v", i), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("Should be zero, but was %s", truncatingFormat("%v", i)), msgAndArgs...)
}
return true
}
@@ -1874,7 +1881,19 @@ func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{
return Equal(t, expectedJSONAsInterface, actualJSONAsInterface, msgAndArgs...)
}
-// YAMLEq asserts that two YAML strings are equivalent.
+// YAMLEq asserts that the first documents in the two YAML strings are equivalent.
+//
+// expected := `---
+// key: value
+// ---
+// key: this is a second document, it is not evaluated
+// `
+// actual := `---
+// key: value
+// ---
+// key: this is a subsequent document, it is not evaluated
+// `
+// assert.YAMLEq(t, expected, actual)
func YAMLEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -2188,8 +2207,8 @@ func ErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool {
chain := buildErrorChainString(err, false)
return Fail(t, fmt.Sprintf("Target error should be in err chain:\n"+
- "expected: %q\n"+
- "in chain: %s", expectedText, chain,
+ "expected: %s\n"+
+ "in chain: %s", truncatingFormat("%q", expectedText), truncatingFormat("%s", chain),
), msgAndArgs...)
}
@@ -2211,8 +2230,8 @@ func NotErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool {
chain := buildErrorChainString(err, false)
return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+
- "found: %q\n"+
- "in chain: %s", expectedText, chain,
+ "found: %s\n"+
+ "in chain: %s", truncatingFormat("%q", expectedText), truncatingFormat("%s", chain),
), msgAndArgs...)
}
@@ -2236,7 +2255,7 @@ func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{
return Fail(t, fmt.Sprintf("Should be in error chain:\n"+
"expected: %s\n"+
- "in chain: %s", expectedType, chain,
+ "in chain: %s", expectedType, truncatingFormat("%s", chain),
), msgAndArgs...)
}
@@ -2254,7 +2273,7 @@ func NotErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interfa
return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+
"found: %s\n"+
- "in chain: %s", reflect.TypeOf(target).Elem().String(), chain,
+ "in chain: %s", reflect.TypeOf(target).Elem().String(), truncatingFormat("%s", chain),
), msgAndArgs...)
}
diff --git a/vendor/github.com/stretchr/testify/assert/doc.go b/vendor/github.com/stretchr/testify/assert/doc.go
index a0b953aa5c..c111589c7e 100644
--- a/vendor/github.com/stretchr/testify/assert/doc.go
+++ b/vendor/github.com/stretchr/testify/assert/doc.go
@@ -40,8 +40,8 @@
//
// # Assertions
//
-// Assertions allow you to easily write test code, and are global funcs in the `assert` package.
-// All assertion functions take, as the first argument, the `*testing.T` object provided by the
+// Assertions allow you to easily write test code, and are global funcs in the assert package.
+// All assertion functions take, as the first argument, the [*testing.T] object provided by the
// testing framework. This allows the assertion funcs to write the failings and other details to
// the correct place.
//
diff --git a/vendor/github.com/stretchr/testify/internal/difflib/LICENSE b/vendor/github.com/stretchr/testify/internal/difflib/LICENSE
new file mode 100644
index 0000000000..485be13c67
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/internal/difflib/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2013, Patrick Mezard
+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.
+ The names of its contributors may not 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
+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.
\ No newline at end of file
diff --git a/vendor/github.com/stretchr/testify/internal/difflib/difflib.go b/vendor/github.com/stretchr/testify/internal/difflib/difflib.go
new file mode 100644
index 0000000000..9984599b4f
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/internal/difflib/difflib.go
@@ -0,0 +1,592 @@
+// Package difflib is a partial port of Python difflib module.
+//
+// It provides tools to compare sequences of strings and generate textual diffs.
+//
+// The following class and functions have been ported:
+//
+// - SequenceMatcher
+//
+// - unified_diff
+//
+// Getting unified diffs was the main goal of the port. Keep in mind this code
+// is mostly suitable to output text differences in a human friendly way, there
+// are no guarantees generated diffs are consumable by patch(1).
+//
+// This package was adopted from [github.com/pmezard/go-difflib] which
+// is no longer maintained.
+//
+// [github.com/pmezard/go-difflib]: https://github.com/pmezard/go-difflib
+package difflib
+
+import (
+ "bufio"
+ "bytes"
+ "fmt"
+ "io"
+ "strings"
+)
+
+func min(a, b int) int {
+ if a < b {
+ return a
+ }
+ return b
+}
+
+func max(a, b int) int {
+ if a > b {
+ return a
+ }
+ return b
+}
+
+type Match struct {
+ A int
+ B int
+ Size int
+}
+
+type OpCode struct {
+ Tag byte
+ I1 int
+ I2 int
+ J1 int
+ J2 int
+}
+
+// SequenceMatcher compares sequence of strings. The basic
+// algorithm predates, and is a little fancier than, an algorithm
+// published in the late 1980's by Ratcliff and Obershelp under the
+// hyperbolic name "gestalt pattern matching". The basic idea is to find
+// the longest contiguous matching subsequence that contains no "junk"
+// elements (R-O doesn't address junk). The same idea is then applied
+// recursively to the pieces of the sequences to the left and to the right
+// of the matching subsequence. This does not yield minimal edit
+// sequences, but does tend to yield matches that "look right" to people.
+//
+// SequenceMatcher tries to compute a "human-friendly diff" between two
+// sequences. Unlike e.g. UNIX(tm) diff, the fundamental notion is the
+// longest *contiguous* & junk-free matching subsequence. That's what
+// catches peoples' eyes. The Windows(tm) windiff has another interesting
+// notion, pairing up elements that appear uniquely in each sequence.
+// That, and the method here, appear to yield more intuitive difference
+// reports than does diff. This method appears to be the least vulnerable
+// to synching up on blocks of "junk lines", though (like blank lines in
+// ordinary text files, or maybe "" lines in HTML files). That may be
+// because this is the only method of the 3 that has a *concept* of
+// "junk" .
+//
+// Timing: Basic R-O is cubic time worst case and quadratic time expected
+// case. SequenceMatcher is quadratic time for the worst case and has
+// expected-case behavior dependent in a complicated way on how many
+// elements the sequences have in common; best case time is linear.
+type SequenceMatcher struct {
+ a []string
+ b []string
+ b2j map[string][]int
+ IsJunk func(string) bool
+ autoJunk bool
+ bJunk map[string]struct{}
+ matchingBlocks []Match
+ fullBCount map[string]int
+ bPopular map[string]struct{}
+ opCodes []OpCode
+}
+
+func NewMatcher(a, b []string) *SequenceMatcher {
+ m := SequenceMatcher{autoJunk: true}
+ m.SetSeqs(a, b)
+ return &m
+}
+
+// Set two sequences to be compared.
+func (m *SequenceMatcher) SetSeqs(a, b []string) {
+ m.SetSeq1(a)
+ m.SetSeq2(b)
+}
+
+// Set the first sequence to be compared. The second sequence to be compared is
+// not changed.
+//
+// SequenceMatcher computes and caches detailed information about the second
+// sequence, so if you want to compare one sequence S against many sequences,
+// use .SetSeq2(s) once and call .SetSeq1(x) repeatedly for each of the other
+// sequences.
+//
+// See also SetSeqs() and SetSeq2().
+func (m *SequenceMatcher) SetSeq1(a []string) {
+ if &a == &m.a {
+ return
+ }
+ m.a = a
+ m.matchingBlocks = nil
+ m.opCodes = nil
+}
+
+// Set the second sequence to be compared. The first sequence to be compared is
+// not changed.
+func (m *SequenceMatcher) SetSeq2(b []string) {
+ if &b == &m.b {
+ return
+ }
+ m.b = b
+ m.matchingBlocks = nil
+ m.opCodes = nil
+ m.fullBCount = nil
+ m.chainB()
+}
+
+func (m *SequenceMatcher) chainB() {
+ // Populate line -> index mapping
+ b2j := map[string][]int{}
+ for i, s := range m.b {
+ indices := b2j[s]
+ indices = append(indices, i)
+ b2j[s] = indices
+ }
+
+ // Purge junk elements
+ m.bJunk = map[string]struct{}{}
+ if m.IsJunk != nil {
+ junk := m.bJunk
+ for s, _ := range b2j {
+ if m.IsJunk(s) {
+ junk[s] = struct{}{}
+ }
+ }
+ for s, _ := range junk {
+ delete(b2j, s)
+ }
+ }
+
+ // Purge remaining popular elements
+ popular := map[string]struct{}{}
+ n := len(m.b)
+ if m.autoJunk && n >= 200 {
+ ntest := n/100 + 1
+ for s, indices := range b2j {
+ if len(indices) > ntest {
+ popular[s] = struct{}{}
+ }
+ }
+ for s, _ := range popular {
+ delete(b2j, s)
+ }
+ }
+ m.bPopular = popular
+ m.b2j = b2j
+}
+
+func (m *SequenceMatcher) isBJunk(s string) bool {
+ _, ok := m.bJunk[s]
+ return ok
+}
+
+// Find longest matching block in a[alo:ahi] and b[blo:bhi].
+//
+// If IsJunk is not defined:
+//
+// Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where
+//
+// alo <= i <= i+k <= ahi
+// blo <= j <= j+k <= bhi
+//
+// and for all (i',j',k') meeting those conditions,
+//
+// k >= k'
+// i <= i'
+// and if i == i', j <= j'
+//
+// In other words, of all maximal matching blocks, return one that
+// starts earliest in a, and of all those maximal matching blocks that
+// start earliest in a, return the one that starts earliest in b.
+//
+// If IsJunk is defined, first the longest matching block is
+// determined as above, but with the additional restriction that no
+// junk element appears in the block. Then that block is extended as
+// far as possible by matching (only) junk elements on both sides. So
+// the resulting block never matches on junk except as identical junk
+// happens to be adjacent to an "interesting" match.
+//
+// If no blocks match, return (alo, blo, 0).
+func (m *SequenceMatcher) findLongestMatch(alo, ahi, blo, bhi int) Match {
+ // CAUTION: stripping common prefix or suffix would be incorrect.
+ // E.g.,
+ // ab
+ // acab
+ // Longest matching block is "ab", but if common prefix is
+ // stripped, it's "a" (tied with "b"). UNIX(tm) diff does so
+ // strip, so ends up claiming that ab is changed to acab by
+ // inserting "ca" in the middle. That's minimal but unintuitive:
+ // "it's obvious" that someone inserted "ac" at the front.
+ // Windiff ends up at the same place as diff, but by pairing up
+ // the unique 'b's and then matching the first two 'a's.
+ besti, bestj, bestsize := alo, blo, 0
+
+ // find longest junk-free match
+ // during an iteration of the loop, j2len[j] = length of longest
+ // junk-free match ending with a[i-1] and b[j]
+ j2len := map[int]int{}
+ for i := alo; i != ahi; i++ {
+ // look at all instances of a[i] in b; note that because
+ // b2j has no junk keys, the loop is skipped if a[i] is junk
+ newj2len := map[int]int{}
+ for _, j := range m.b2j[m.a[i]] {
+ // a[i] matches b[j]
+ if j < blo {
+ continue
+ }
+ if j >= bhi {
+ break
+ }
+ k := j2len[j-1] + 1
+ newj2len[j] = k
+ if k > bestsize {
+ besti, bestj, bestsize = i-k+1, j-k+1, k
+ }
+ }
+ j2len = newj2len
+ }
+
+ // Extend the best by non-junk elements on each end. In particular,
+ // "popular" non-junk elements aren't in b2j, which greatly speeds
+ // the inner loop above, but also means "the best" match so far
+ // doesn't contain any junk *or* popular non-junk elements.
+ for besti > alo && bestj > blo && !m.isBJunk(m.b[bestj-1]) &&
+ m.a[besti-1] == m.b[bestj-1] {
+ besti, bestj, bestsize = besti-1, bestj-1, bestsize+1
+ }
+ for besti+bestsize < ahi && bestj+bestsize < bhi &&
+ !m.isBJunk(m.b[bestj+bestsize]) &&
+ m.a[besti+bestsize] == m.b[bestj+bestsize] {
+ bestsize += 1
+ }
+
+ // Now that we have a wholly interesting match (albeit possibly
+ // empty!), we may as well suck up the matching junk on each
+ // side of it too. Can't think of a good reason not to, and it
+ // saves post-processing the (possibly considerable) expense of
+ // figuring out what to do with it. In the case of an empty
+ // interesting match, this is clearly the right thing to do,
+ // because no other kind of match is possible in the regions.
+ for besti > alo && bestj > blo && m.isBJunk(m.b[bestj-1]) &&
+ m.a[besti-1] == m.b[bestj-1] {
+ besti, bestj, bestsize = besti-1, bestj-1, bestsize+1
+ }
+ for besti+bestsize < ahi && bestj+bestsize < bhi &&
+ m.isBJunk(m.b[bestj+bestsize]) &&
+ m.a[besti+bestsize] == m.b[bestj+bestsize] {
+ bestsize += 1
+ }
+
+ return Match{A: besti, B: bestj, Size: bestsize}
+}
+
+// Return list of triples describing matching subsequences.
+//
+// Each triple is of the form (i, j, n), and means that
+// a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in
+// i and in j. It's also guaranteed that if (i, j, n) and (i', j', n') are
+// adjacent triples in the list, and the second is not the last triple in the
+// list, then i+n != i' or j+n != j'. IOW, adjacent triples never describe
+// adjacent equal blocks.
+//
+// The last triple is a dummy, (len(a), len(b), 0), and is the only
+// triple with n==0.
+func (m *SequenceMatcher) GetMatchingBlocks() []Match {
+ if m.matchingBlocks != nil {
+ return m.matchingBlocks
+ }
+
+ var matchBlocks func(alo, ahi, blo, bhi int, matched []Match) []Match
+ matchBlocks = func(alo, ahi, blo, bhi int, matched []Match) []Match {
+ match := m.findLongestMatch(alo, ahi, blo, bhi)
+ i, j, k := match.A, match.B, match.Size
+ if match.Size > 0 {
+ if alo < i && blo < j {
+ matched = matchBlocks(alo, i, blo, j, matched)
+ }
+ matched = append(matched, match)
+ if i+k < ahi && j+k < bhi {
+ matched = matchBlocks(i+k, ahi, j+k, bhi, matched)
+ }
+ }
+ return matched
+ }
+ matched := matchBlocks(0, len(m.a), 0, len(m.b), nil)
+
+ // It's possible that we have adjacent equal blocks in the
+ // matching_blocks list now.
+ nonAdjacent := []Match{}
+ i1, j1, k1 := 0, 0, 0
+ for _, b := range matched {
+ // Is this block adjacent to i1, j1, k1?
+ i2, j2, k2 := b.A, b.B, b.Size
+ if i1+k1 == i2 && j1+k1 == j2 {
+ // Yes, so collapse them -- this just increases the length of
+ // the first block by the length of the second, and the first
+ // block so lengthened remains the block to compare against.
+ k1 += k2
+ } else {
+ // Not adjacent. Remember the first block (k1==0 means it's
+ // the dummy we started with), and make the second block the
+ // new block to compare against.
+ if k1 > 0 {
+ nonAdjacent = append(nonAdjacent, Match{i1, j1, k1})
+ }
+ i1, j1, k1 = i2, j2, k2
+ }
+ }
+ if k1 > 0 {
+ nonAdjacent = append(nonAdjacent, Match{i1, j1, k1})
+ }
+
+ nonAdjacent = append(nonAdjacent, Match{len(m.a), len(m.b), 0})
+ m.matchingBlocks = nonAdjacent
+ return m.matchingBlocks
+}
+
+// Return list of 5-tuples describing how to turn a into b.
+//
+// Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple
+// has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the
+// tuple preceding it, and likewise for j1 == the previous j2.
+//
+// The tags are characters, with these meanings:
+//
+// 'r' (replace): a[i1:i2] should be replaced by b[j1:j2]
+//
+// 'd' (delete): a[i1:i2] should be deleted, j1==j2 in this case.
+//
+// 'i' (insert): b[j1:j2] should be inserted at a[i1:i1], i1==i2 in this case.
+//
+// 'e' (equal): a[i1:i2] == b[j1:j2]
+func (m *SequenceMatcher) GetOpCodes() []OpCode {
+ if m.opCodes != nil {
+ return m.opCodes
+ }
+ i, j := 0, 0
+ matching := m.GetMatchingBlocks()
+ opCodes := make([]OpCode, 0, len(matching))
+ for _, m := range matching {
+ // invariant: we've pumped out correct diffs to change
+ // a[:i] into b[:j], and the next matching block is
+ // a[ai:ai+size] == b[bj:bj+size]. So we need to pump
+ // out a diff to change a[i:ai] into b[j:bj], pump out
+ // the matching block, and move (i,j) beyond the match
+ ai, bj, size := m.A, m.B, m.Size
+ tag := byte(0)
+ if i < ai && j < bj {
+ tag = 'r'
+ } else if i < ai {
+ tag = 'd'
+ } else if j < bj {
+ tag = 'i'
+ }
+ if tag > 0 {
+ opCodes = append(opCodes, OpCode{tag, i, ai, j, bj})
+ }
+ i, j = ai+size, bj+size
+ // the list of matching blocks is terminated by a
+ // sentinel with size 0
+ if size > 0 {
+ opCodes = append(opCodes, OpCode{'e', ai, i, bj, j})
+ }
+ }
+ m.opCodes = opCodes
+ return m.opCodes
+}
+
+// Isolate change clusters by eliminating ranges with no changes.
+//
+// Return a generator of groups with up to n lines of context.
+// Each group is in the same format as returned by GetOpCodes().
+func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode {
+ if n < 0 {
+ n = 3
+ }
+ codes := m.GetOpCodes()
+ if len(codes) == 0 {
+ codes = []OpCode{OpCode{'e', 0, 1, 0, 1}}
+ }
+ // Fixup leading and trailing groups if they show no changes.
+ if codes[0].Tag == 'e' {
+ c := codes[0]
+ i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2
+ codes[0] = OpCode{c.Tag, max(i1, i2-n), i2, max(j1, j2-n), j2}
+ }
+ if codes[len(codes)-1].Tag == 'e' {
+ c := codes[len(codes)-1]
+ i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2
+ codes[len(codes)-1] = OpCode{c.Tag, i1, min(i2, i1+n), j1, min(j2, j1+n)}
+ }
+ nn := n + n
+ groups := [][]OpCode{}
+ group := []OpCode{}
+ for _, c := range codes {
+ i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2
+ // End the current group and start a new one whenever
+ // there is a large range with no changes.
+ if c.Tag == 'e' && i2-i1 > nn {
+ group = append(group, OpCode{c.Tag, i1, min(i2, i1+n),
+ j1, min(j2, j1+n)})
+ groups = append(groups, group)
+ group = []OpCode{}
+ i1, j1 = max(i1, i2-n), max(j1, j2-n)
+ }
+ group = append(group, OpCode{c.Tag, i1, i2, j1, j2})
+ }
+ if len(group) > 0 && !(len(group) == 1 && group[0].Tag == 'e') {
+ groups = append(groups, group)
+ }
+ return groups
+}
+
+// Convert range to the "ed" format
+func formatRangeUnified(start, stop int) string {
+ // Per the diff spec at http://www.unix.org/single_unix_specification/
+ beginning := start + 1 // lines start numbering with one
+ length := stop - start
+ if length == 1 {
+ return fmt.Sprintf("%d", beginning)
+ }
+ if length == 0 {
+ beginning -= 1 // empty ranges begin at line just before the range
+ }
+ return fmt.Sprintf("%d,%d", beginning, length)
+}
+
+// Unified diff parameters
+type UnifiedDiff struct {
+ A []string // First sequence lines
+ FromFile string // First file name
+ FromDate string // First file time
+ B []string // Second sequence lines
+ ToFile string // Second file name
+ ToDate string // Second file time
+ Eol string // Headers end of line, defaults to LF
+ Context int // Number of context lines
+}
+
+// Compare two sequences of lines; generate the delta as a unified diff.
+//
+// Unified diffs are a compact way of showing line changes and a few
+// lines of context. The number of context lines is set by 'n' which
+// defaults to three.
+//
+// By default, the diff control lines (those with ---, +++, or @@) are
+// created with a trailing newline. This is helpful so that inputs
+// created from file.readlines() result in diffs that are suitable for
+// file.writelines() since both the inputs and outputs have trailing
+// newlines.
+//
+// For inputs that do not have trailing newlines, set the lineterm
+// argument to "" so that the output will be uniformly newline free.
+//
+// The unidiff format normally has a header for filenames and modification
+// times. Any or all of these may be specified using strings for
+// 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
+// The modification times are normally expressed in the ISO 8601 format.
+func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error {
+ buf := bufio.NewWriter(writer)
+ defer buf.Flush()
+ wf := func(format string, args ...interface{}) error {
+ _, err := buf.WriteString(fmt.Sprintf(format, args...))
+ return err
+ }
+ ws := func(s string) error {
+ _, err := buf.WriteString(s)
+ return err
+ }
+
+ if len(diff.Eol) == 0 {
+ diff.Eol = "\n"
+ }
+
+ started := false
+ m := NewMatcher(diff.A, diff.B)
+ for _, g := range m.GetGroupedOpCodes(diff.Context) {
+ if !started {
+ started = true
+ fromDate := ""
+ if len(diff.FromDate) > 0 {
+ fromDate = "\t" + diff.FromDate
+ }
+ toDate := ""
+ if len(diff.ToDate) > 0 {
+ toDate = "\t" + diff.ToDate
+ }
+ if diff.FromFile != "" || diff.ToFile != "" {
+ err := wf("--- %s%s%s", diff.FromFile, fromDate, diff.Eol)
+ if err != nil {
+ return err
+ }
+ err = wf("+++ %s%s%s", diff.ToFile, toDate, diff.Eol)
+ if err != nil {
+ return err
+ }
+ }
+ }
+ first, last := g[0], g[len(g)-1]
+ range1 := formatRangeUnified(first.I1, last.I2)
+ range2 := formatRangeUnified(first.J1, last.J2)
+ if err := wf("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil {
+ return err
+ }
+ for _, c := range g {
+ i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2
+ if c.Tag == 'e' {
+ for _, line := range diff.A[i1:i2] {
+ if err := ws(" " + line); err != nil {
+ return err
+ }
+ }
+ continue
+ }
+ if c.Tag == 'r' || c.Tag == 'd' {
+ for _, line := range diff.A[i1:i2] {
+ if err := ws("-" + line); err != nil {
+ return err
+ }
+ }
+ }
+ if c.Tag == 'r' || c.Tag == 'i' {
+ for _, line := range diff.B[j1:j2] {
+ if err := ws("+" + line); err != nil {
+ return err
+ }
+ }
+ }
+ }
+ }
+ return nil
+}
+
+// Like WriteUnifiedDiff but returns the diff a string.
+func GetUnifiedDiffString(diff UnifiedDiff) (string, error) {
+ w := &bytes.Buffer{}
+ err := WriteUnifiedDiff(w, diff)
+ return string(w.Bytes()), err
+}
+
+// Convert range to the "ed" format.
+func formatRangeContext(start, stop int) string {
+ // Per the diff spec at http://www.unix.org/single_unix_specification/
+ beginning := start + 1 // lines start numbering with one
+ length := stop - start
+ if length == 0 {
+ beginning -= 1 // empty ranges begin at line just before the range
+ }
+ if length <= 1 {
+ return fmt.Sprintf("%d", beginning)
+ }
+ return fmt.Sprintf("%d,%d", beginning, beginning+length-1)
+}
+
+// Split a string on "\n" while preserving them. The output can be used
+// as input for UnifiedDiff and ContextDiff structures.
+func SplitLines(s string) []string {
+ lines := strings.SplitAfter(s, "\n")
+ lines[len(lines)-1] += "\n"
+ return lines
+}
diff --git a/vendor/github.com/stretchr/testify/internal/spew/LICENSE b/vendor/github.com/stretchr/testify/internal/spew/LICENSE
new file mode 100644
index 0000000000..bc52e96f2b
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/internal/spew/LICENSE
@@ -0,0 +1,15 @@
+ISC License
+
+Copyright (c) 2012-2016 Dave Collins
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/vendor/github.com/stretchr/testify/internal/spew/README.md b/vendor/github.com/stretchr/testify/internal/spew/README.md
new file mode 100644
index 0000000000..51a909e2ef
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/internal/spew/README.md
@@ -0,0 +1,12 @@
+go-spew
+=======
+
+[](http://copyfree.org)
+
+Go-spew implements a deep pretty printer for Go data structures to aid in
+debugging. A comprehensive suite of tests with 100% test coverage is provided
+to ensure proper functionality.
+
+## License
+
+Go-spew is licensed under the [copyfree](http://copyfree.org) ISC License.
diff --git a/vendor/github.com/stretchr/testify/internal/spew/bypass.go b/vendor/github.com/stretchr/testify/internal/spew/bypass.go
new file mode 100644
index 0000000000..70ddeaad3e
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/internal/spew/bypass.go
@@ -0,0 +1,146 @@
+// Copyright (c) 2015-2016 Dave Collins
+//
+// Permission to use, copy, modify, and distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+// NOTE: Due to the following build constraints, this file will only be compiled
+// when the code is not running on Google App Engine, compiled by GopherJS, and
+// "-tags safe" is not added to the go build command line. The "disableunsafe"
+// tag is deprecated and thus should not be used.
+// Go versions prior to 1.4 are disabled because they use a different layout
+// for interfaces which make the implementation of unsafeReflectValue more complex.
+//go:build !js && !appengine && !safe && !disableunsafe && go1.4
+// +build !js,!appengine,!safe,!disableunsafe,go1.4
+
+package spew
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+const (
+ // UnsafeDisabled is a build-time constant which specifies whether or
+ // not access to the unsafe package is available.
+ UnsafeDisabled = false
+
+ // ptrSize is the size of a pointer on the current arch.
+ ptrSize = unsafe.Sizeof((*byte)(nil))
+)
+
+type flag uintptr
+
+var (
+ // flagRO indicates whether the value field of a reflect.Value
+ // is read-only.
+ flagRO flag
+
+ // flagAddr indicates whether the address of the reflect.Value's
+ // value may be taken.
+ flagAddr flag
+)
+
+// flagKindMask holds the bits that make up the kind
+// part of the flags field. In all the supported versions,
+// it is in the lower 5 bits.
+const flagKindMask = flag(0x1f)
+
+// Different versions of Go have used different
+// bit layouts for the flags type. This table
+// records the known combinations.
+var okFlags = []struct {
+ ro, addr flag
+}{{
+ // From Go 1.4 to 1.5
+ ro: 1 << 5,
+ addr: 1 << 7,
+}, {
+ // Up to Go tip.
+ ro: 1<<5 | 1<<6,
+ addr: 1 << 8,
+}}
+
+var flagValOffset = func() uintptr {
+ field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag")
+ if !ok {
+ panic("reflect.Value has no flag field")
+ }
+ return field.Offset
+}()
+
+// flagField returns a pointer to the flag field of a reflect.Value.
+func flagField(v *reflect.Value) *flag {
+ return (*flag)(unsafe.Pointer(uintptr(unsafe.Pointer(v)) + flagValOffset))
+}
+
+// unsafeReflectValue converts the passed reflect.Value into a one that bypasses
+// the typical safety restrictions preventing access to unaddressable and
+// unexported data. It works by digging the raw pointer to the underlying
+// value out of the protected value and generating a new unprotected (unsafe)
+// reflect.Value to it.
+//
+// This allows us to check for implementations of the Stringer and error
+// interfaces to be used for pretty printing ordinarily unaddressable and
+// inaccessible values such as unexported struct fields.
+func unsafeReflectValue(v reflect.Value) reflect.Value {
+ if !v.IsValid() || (v.CanInterface() && v.CanAddr()) {
+ return v
+ }
+ flagFieldPtr := flagField(&v)
+ *flagFieldPtr &^= flagRO
+ *flagFieldPtr |= flagAddr
+ return v
+}
+
+// Sanity checks against future reflect package changes
+// to the type or semantics of the Value.flag field.
+func init() {
+ field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag")
+ if !ok {
+ panic("reflect.Value has no flag field")
+ }
+ if field.Type.Kind() != reflect.TypeOf(flag(0)).Kind() {
+ panic("reflect.Value flag field has changed kind")
+ }
+ type t0 int
+ var t struct {
+ A t0
+ // t0 will have flagEmbedRO set.
+ t0
+ // a will have flagStickyRO set
+ a t0
+ }
+ vA := reflect.ValueOf(t).FieldByName("A")
+ va := reflect.ValueOf(t).FieldByName("a")
+ vt0 := reflect.ValueOf(t).FieldByName("t0")
+
+ // Infer flagRO from the difference between the flags
+ // for the (otherwise identical) fields in t.
+ flagPublic := *flagField(&vA)
+ flagWithRO := *flagField(&va) | *flagField(&vt0)
+ flagRO = flagPublic ^ flagWithRO
+
+ // Infer flagAddr from the difference between a value
+ // taken from a pointer and not.
+ vPtrA := reflect.ValueOf(&t).Elem().FieldByName("A")
+ flagNoPtr := *flagField(&vA)
+ flagPtr := *flagField(&vPtrA)
+ flagAddr = flagNoPtr ^ flagPtr
+
+ // Check that the inferred flags tally with one of the known versions.
+ for _, f := range okFlags {
+ if flagRO == f.ro && flagAddr == f.addr {
+ return
+ }
+ }
+ panic("reflect.Value read-only flag has changed semantics")
+}
diff --git a/vendor/github.com/stretchr/testify/internal/spew/bypasssafe.go b/vendor/github.com/stretchr/testify/internal/spew/bypasssafe.go
new file mode 100644
index 0000000000..5e2d890d6a
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/internal/spew/bypasssafe.go
@@ -0,0 +1,39 @@
+// Copyright (c) 2015-2016 Dave Collins
+//
+// Permission to use, copy, modify, and distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+// NOTE: Due to the following build constraints, this file will only be compiled
+// when the code is running on Google App Engine, compiled by GopherJS, or
+// "-tags safe" is added to the go build command line. The "disableunsafe"
+// tag is deprecated and thus should not be used.
+//go:build js || appengine || safe || disableunsafe || !go1.4
+// +build js appengine safe disableunsafe !go1.4
+
+package spew
+
+import "reflect"
+
+const (
+ // UnsafeDisabled is a build-time constant which specifies whether or
+ // not access to the unsafe package is available.
+ UnsafeDisabled = true
+)
+
+// unsafeReflectValue typically converts the passed reflect.Value into a one
+// that bypasses the typical safety restrictions preventing access to
+// unaddressable and unexported data. However, doing this relies on access to
+// the unsafe package. This is a stub version which simply returns the passed
+// reflect.Value when the unsafe package is not available.
+func unsafeReflectValue(v reflect.Value) reflect.Value {
+ return v
+}
diff --git a/vendor/github.com/stretchr/testify/internal/spew/common.go b/vendor/github.com/stretchr/testify/internal/spew/common.go
new file mode 100644
index 0000000000..1be8ce9457
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/internal/spew/common.go
@@ -0,0 +1,341 @@
+/*
+ * Copyright (c) 2013-2016 Dave Collins
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+package spew
+
+import (
+ "bytes"
+ "fmt"
+ "io"
+ "reflect"
+ "sort"
+ "strconv"
+)
+
+// Some constants in the form of bytes to avoid string overhead. This mirrors
+// the technique used in the fmt package.
+var (
+ panicBytes = []byte("(PANIC=")
+ plusBytes = []byte("+")
+ iBytes = []byte("i")
+ trueBytes = []byte("true")
+ falseBytes = []byte("false")
+ interfaceBytes = []byte("(interface {})")
+ commaNewlineBytes = []byte(",\n")
+ newlineBytes = []byte("\n")
+ openBraceBytes = []byte("{")
+ openBraceNewlineBytes = []byte("{\n")
+ closeBraceBytes = []byte("}")
+ asteriskBytes = []byte("*")
+ colonBytes = []byte(":")
+ colonSpaceBytes = []byte(": ")
+ openParenBytes = []byte("(")
+ closeParenBytes = []byte(")")
+ spaceBytes = []byte(" ")
+ pointerChainBytes = []byte("->")
+ nilAngleBytes = []byte("")
+ maxNewlineBytes = []byte("\n")
+ maxShortBytes = []byte("")
+ circularBytes = []byte("")
+ circularShortBytes = []byte("")
+ invalidAngleBytes = []byte("")
+ openBracketBytes = []byte("[")
+ closeBracketBytes = []byte("]")
+ percentBytes = []byte("%")
+ precisionBytes = []byte(".")
+ openAngleBytes = []byte("<")
+ closeAngleBytes = []byte(">")
+ openMapBytes = []byte("map[")
+ closeMapBytes = []byte("]")
+ lenEqualsBytes = []byte("len=")
+ capEqualsBytes = []byte("cap=")
+)
+
+// hexDigits is used to map a decimal value to a hex digit.
+var hexDigits = "0123456789abcdef"
+
+// catchPanic handles any panics that might occur during the handleMethods
+// calls.
+func catchPanic(w io.Writer, v reflect.Value) {
+ if err := recover(); err != nil {
+ w.Write(panicBytes)
+ fmt.Fprintf(w, "%v", err)
+ w.Write(closeParenBytes)
+ }
+}
+
+// handleMethods attempts to call the Error and String methods on the underlying
+// type the passed reflect.Value represents and outputes the result to Writer w.
+//
+// It handles panics in any called methods by catching and displaying the error
+// as the formatted value.
+func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool) {
+ // We need an interface to check if the type implements the error or
+ // Stringer interface. However, the reflect package won't give us an
+ // interface on certain things like unexported struct fields in order
+ // to enforce visibility rules. We use unsafe, when it's available,
+ // to bypass these restrictions since this package does not mutate the
+ // values.
+ if !v.CanInterface() {
+ if UnsafeDisabled {
+ return false
+ }
+
+ v = unsafeReflectValue(v)
+ }
+
+ // Choose whether or not to do error and Stringer interface lookups against
+ // the base type or a pointer to the base type depending on settings.
+ // Technically calling one of these methods with a pointer receiver can
+ // mutate the value, however, types which choose to satisify an error or
+ // Stringer interface with a pointer receiver should not be mutating their
+ // state inside these interface methods.
+ if !cs.DisablePointerMethods && !UnsafeDisabled && !v.CanAddr() {
+ v = unsafeReflectValue(v)
+ }
+ if v.CanAddr() {
+ v = v.Addr()
+ }
+
+ // Is it an error or Stringer?
+ switch iface := v.Interface().(type) {
+ case error:
+ defer catchPanic(w, v)
+ if cs.ContinueOnMethod {
+ w.Write(openParenBytes)
+ w.Write([]byte(iface.Error()))
+ w.Write(closeParenBytes)
+ w.Write(spaceBytes)
+ return false
+ }
+
+ w.Write([]byte(iface.Error()))
+ return true
+
+ case fmt.Stringer:
+ defer catchPanic(w, v)
+ if cs.ContinueOnMethod {
+ w.Write(openParenBytes)
+ w.Write([]byte(iface.String()))
+ w.Write(closeParenBytes)
+ w.Write(spaceBytes)
+ return false
+ }
+ w.Write([]byte(iface.String()))
+ return true
+ }
+ return false
+}
+
+// printBool outputs a boolean value as true or false to Writer w.
+func printBool(w io.Writer, val bool) {
+ if val {
+ w.Write(trueBytes)
+ } else {
+ w.Write(falseBytes)
+ }
+}
+
+// printInt outputs a signed integer value to Writer w.
+func printInt(w io.Writer, val int64, base int) {
+ w.Write([]byte(strconv.FormatInt(val, base)))
+}
+
+// printUint outputs an unsigned integer value to Writer w.
+func printUint(w io.Writer, val uint64, base int) {
+ w.Write([]byte(strconv.FormatUint(val, base)))
+}
+
+// printFloat outputs a floating point value using the specified precision,
+// which is expected to be 32 or 64bit, to Writer w.
+func printFloat(w io.Writer, val float64, precision int) {
+ w.Write([]byte(strconv.FormatFloat(val, 'g', -1, precision)))
+}
+
+// printComplex outputs a complex value using the specified float precision
+// for the real and imaginary parts to Writer w.
+func printComplex(w io.Writer, c complex128, floatPrecision int) {
+ r := real(c)
+ w.Write(openParenBytes)
+ w.Write([]byte(strconv.FormatFloat(r, 'g', -1, floatPrecision)))
+ i := imag(c)
+ if i >= 0 {
+ w.Write(plusBytes)
+ }
+ w.Write([]byte(strconv.FormatFloat(i, 'g', -1, floatPrecision)))
+ w.Write(iBytes)
+ w.Write(closeParenBytes)
+}
+
+// printHexPtr outputs a uintptr formatted as hexadecimal with a leading '0x'
+// prefix to Writer w.
+func printHexPtr(w io.Writer, p uintptr) {
+ // Null pointer.
+ num := uint64(p)
+ if num == 0 {
+ w.Write(nilAngleBytes)
+ return
+ }
+
+ // Max uint64 is 16 bytes in hex + 2 bytes for '0x' prefix
+ buf := make([]byte, 18)
+
+ // It's simpler to construct the hex string right to left.
+ base := uint64(16)
+ i := len(buf) - 1
+ for num >= base {
+ buf[i] = hexDigits[num%base]
+ num /= base
+ i--
+ }
+ buf[i] = hexDigits[num]
+
+ // Add '0x' prefix.
+ i--
+ buf[i] = 'x'
+ i--
+ buf[i] = '0'
+
+ // Strip unused leading bytes.
+ buf = buf[i:]
+ w.Write(buf)
+}
+
+// valuesSorter implements sort.Interface to allow a slice of reflect.Value
+// elements to be sorted.
+type valuesSorter struct {
+ values []reflect.Value
+ strings []string // either nil or same len and values
+ cs *ConfigState
+}
+
+// newValuesSorter initializes a valuesSorter instance, which holds a set of
+// surrogate keys on which the data should be sorted. It uses flags in
+// ConfigState to decide if and how to populate those surrogate keys.
+func newValuesSorter(values []reflect.Value, cs *ConfigState) sort.Interface {
+ vs := &valuesSorter{values: values, cs: cs}
+ if canSortSimply(vs.values[0].Kind()) {
+ return vs
+ }
+ if !cs.DisableMethods {
+ vs.strings = make([]string, len(values))
+ for i := range vs.values {
+ b := bytes.Buffer{}
+ if !handleMethods(cs, &b, vs.values[i]) {
+ vs.strings = nil
+ break
+ }
+ vs.strings[i] = b.String()
+ }
+ }
+ if vs.strings == nil && cs.SpewKeys {
+ vs.strings = make([]string, len(values))
+ for i := range vs.values {
+ vs.strings[i] = Sprintf("%#v", vs.values[i].Interface())
+ }
+ }
+ return vs
+}
+
+// canSortSimply tests whether a reflect.Kind is a primitive that can be sorted
+// directly, or whether it should be considered for sorting by surrogate keys
+// (if the ConfigState allows it).
+func canSortSimply(kind reflect.Kind) bool {
+ // This switch parallels valueSortLess, except for the default case.
+ switch kind {
+ case reflect.Bool:
+ return true
+ case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
+ return true
+ case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
+ return true
+ case reflect.Float32, reflect.Float64:
+ return true
+ case reflect.String:
+ return true
+ case reflect.Uintptr:
+ return true
+ case reflect.Array:
+ return true
+ }
+ return false
+}
+
+// Len returns the number of values in the slice. It is part of the
+// sort.Interface implementation.
+func (s *valuesSorter) Len() int {
+ return len(s.values)
+}
+
+// Swap swaps the values at the passed indices. It is part of the
+// sort.Interface implementation.
+func (s *valuesSorter) Swap(i, j int) {
+ s.values[i], s.values[j] = s.values[j], s.values[i]
+ if s.strings != nil {
+ s.strings[i], s.strings[j] = s.strings[j], s.strings[i]
+ }
+}
+
+// valueSortLess returns whether the first value should sort before the second
+// value. It is used by valueSorter.Less as part of the sort.Interface
+// implementation.
+func valueSortLess(a, b reflect.Value) bool {
+ switch a.Kind() {
+ case reflect.Bool:
+ return !a.Bool() && b.Bool()
+ case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
+ return a.Int() < b.Int()
+ case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
+ return a.Uint() < b.Uint()
+ case reflect.Float32, reflect.Float64:
+ return a.Float() < b.Float()
+ case reflect.String:
+ return a.String() < b.String()
+ case reflect.Uintptr:
+ return a.Uint() < b.Uint()
+ case reflect.Array:
+ // Compare the contents of both arrays.
+ l := a.Len()
+ for i := 0; i < l; i++ {
+ av := a.Index(i)
+ bv := b.Index(i)
+ if av.Interface() == bv.Interface() {
+ continue
+ }
+ return valueSortLess(av, bv)
+ }
+ }
+ return a.String() < b.String()
+}
+
+// Less returns whether the value at index i should sort before the
+// value at index j. It is part of the sort.Interface implementation.
+func (s *valuesSorter) Less(i, j int) bool {
+ if s.strings == nil {
+ return valueSortLess(s.values[i], s.values[j])
+ }
+ return s.strings[i] < s.strings[j]
+}
+
+// sortValues is a sort function that handles both native types and any type that
+// can be converted to error or Stringer. Other inputs are sorted according to
+// their Value.String() value to ensure display stability.
+func sortValues(values []reflect.Value, cs *ConfigState) {
+ if len(values) == 0 {
+ return
+ }
+ sort.Sort(newValuesSorter(values, cs))
+}
diff --git a/vendor/github.com/stretchr/testify/internal/spew/config.go b/vendor/github.com/stretchr/testify/internal/spew/config.go
new file mode 100644
index 0000000000..161895fc6d
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/internal/spew/config.go
@@ -0,0 +1,306 @@
+/*
+ * Copyright (c) 2013-2016 Dave Collins
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+package spew
+
+import (
+ "bytes"
+ "fmt"
+ "io"
+ "os"
+)
+
+// ConfigState houses the configuration options used by spew to format and
+// display values. There is a global instance, Config, that is used to control
+// all top-level Formatter and Dump functionality. Each ConfigState instance
+// provides methods equivalent to the top-level functions.
+//
+// The zero value for ConfigState provides no indentation. You would typically
+// want to set it to a space or a tab.
+//
+// Alternatively, you can use NewDefaultConfig to get a ConfigState instance
+// with default settings. See the documentation of NewDefaultConfig for default
+// values.
+type ConfigState struct {
+ // Indent specifies the string to use for each indentation level. The
+ // global config instance that all top-level functions use set this to a
+ // single space by default. If you would like more indentation, you might
+ // set this to a tab with "\t" or perhaps two spaces with " ".
+ Indent string
+
+ // MaxDepth controls the maximum number of levels to descend into nested
+ // data structures. The default, 0, means there is no limit.
+ //
+ // NOTE: Circular data structures are properly detected, so it is not
+ // necessary to set this value unless you specifically want to limit deeply
+ // nested data structures.
+ MaxDepth int
+
+ // DisableMethods specifies whether or not error and Stringer interfaces are
+ // invoked for types that implement them.
+ DisableMethods bool
+
+ // DisablePointerMethods specifies whether or not to check for and invoke
+ // error and Stringer interfaces on types which only accept a pointer
+ // receiver when the current type is not a pointer.
+ //
+ // NOTE: This might be an unsafe action since calling one of these methods
+ // with a pointer receiver could technically mutate the value, however,
+ // in practice, types which choose to satisify an error or Stringer
+ // interface with a pointer receiver should not be mutating their state
+ // inside these interface methods. As a result, this option relies on
+ // access to the unsafe package, so it will not have any effect when
+ // running in environments without access to the unsafe package such as
+ // Google App Engine or with the "safe" build tag specified.
+ DisablePointerMethods bool
+
+ // DisablePointerAddresses specifies whether to disable the printing of
+ // pointer addresses. This is useful when diffing data structures in tests.
+ DisablePointerAddresses bool
+
+ // DisableCapacities specifies whether to disable the printing of capacities
+ // for arrays, slices, maps and channels. This is useful when diffing
+ // data structures in tests.
+ DisableCapacities bool
+
+ // ContinueOnMethod specifies whether or not recursion should continue once
+ // a custom error or Stringer interface is invoked. The default, false,
+ // means it will print the results of invoking the custom error or Stringer
+ // interface and return immediately instead of continuing to recurse into
+ // the internals of the data type.
+ //
+ // NOTE: This flag does not have any effect if method invocation is disabled
+ // via the DisableMethods or DisablePointerMethods options.
+ ContinueOnMethod bool
+
+ // SortKeys specifies map keys should be sorted before being printed. Use
+ // this to have a more deterministic, diffable output. Note that only
+ // native types (bool, int, uint, floats, uintptr and string) and types
+ // that support the error or Stringer interfaces (if methods are
+ // enabled) are supported, with other types sorted according to the
+ // reflect.Value.String() output which guarantees display stability.
+ SortKeys bool
+
+ // SpewKeys specifies that, as a last resort attempt, map keys should
+ // be spewed to strings and sorted by those strings. This is only
+ // considered if SortKeys is true.
+ SpewKeys bool
+}
+
+// Config is the active configuration of the top-level functions.
+// The configuration can be changed by modifying the contents of spew.Config.
+var Config = ConfigState{Indent: " "}
+
+// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were
+// passed with a Formatter interface returned by c.NewFormatter. It returns
+// the formatted string as a value that satisfies error. See NewFormatter
+// for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Errorf(format, c.NewFormatter(a), c.NewFormatter(b))
+func (c *ConfigState) Errorf(format string, a ...interface{}) (err error) {
+ return fmt.Errorf(format, c.convertArgs(a)...)
+}
+
+// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were
+// passed with a Formatter interface returned by c.NewFormatter. It returns
+// the number of bytes written and any write error encountered. See
+// NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Fprint(w, c.NewFormatter(a), c.NewFormatter(b))
+func (c *ConfigState) Fprint(w io.Writer, a ...interface{}) (n int, err error) {
+ return fmt.Fprint(w, c.convertArgs(a)...)
+}
+
+// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were
+// passed with a Formatter interface returned by c.NewFormatter. It returns
+// the number of bytes written and any write error encountered. See
+// NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Fprintf(w, format, c.NewFormatter(a), c.NewFormatter(b))
+func (c *ConfigState) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) {
+ return fmt.Fprintf(w, format, c.convertArgs(a)...)
+}
+
+// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it
+// passed with a Formatter interface returned by c.NewFormatter. See
+// NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Fprintln(w, c.NewFormatter(a), c.NewFormatter(b))
+func (c *ConfigState) Fprintln(w io.Writer, a ...interface{}) (n int, err error) {
+ return fmt.Fprintln(w, c.convertArgs(a)...)
+}
+
+// Print is a wrapper for fmt.Print that treats each argument as if it were
+// passed with a Formatter interface returned by c.NewFormatter. It returns
+// the number of bytes written and any write error encountered. See
+// NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Print(c.NewFormatter(a), c.NewFormatter(b))
+func (c *ConfigState) Print(a ...interface{}) (n int, err error) {
+ return fmt.Print(c.convertArgs(a)...)
+}
+
+// Printf is a wrapper for fmt.Printf that treats each argument as if it were
+// passed with a Formatter interface returned by c.NewFormatter. It returns
+// the number of bytes written and any write error encountered. See
+// NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Printf(format, c.NewFormatter(a), c.NewFormatter(b))
+func (c *ConfigState) Printf(format string, a ...interface{}) (n int, err error) {
+ return fmt.Printf(format, c.convertArgs(a)...)
+}
+
+// Println is a wrapper for fmt.Println that treats each argument as if it were
+// passed with a Formatter interface returned by c.NewFormatter. It returns
+// the number of bytes written and any write error encountered. See
+// NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Println(c.NewFormatter(a), c.NewFormatter(b))
+func (c *ConfigState) Println(a ...interface{}) (n int, err error) {
+ return fmt.Println(c.convertArgs(a)...)
+}
+
+// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were
+// passed with a Formatter interface returned by c.NewFormatter. It returns
+// the resulting string. See NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Sprint(c.NewFormatter(a), c.NewFormatter(b))
+func (c *ConfigState) Sprint(a ...interface{}) string {
+ return fmt.Sprint(c.convertArgs(a)...)
+}
+
+// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were
+// passed with a Formatter interface returned by c.NewFormatter. It returns
+// the resulting string. See NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Sprintf(format, c.NewFormatter(a), c.NewFormatter(b))
+func (c *ConfigState) Sprintf(format string, a ...interface{}) string {
+ return fmt.Sprintf(format, c.convertArgs(a)...)
+}
+
+// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it
+// were passed with a Formatter interface returned by c.NewFormatter. It
+// returns the resulting string. See NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Sprintln(c.NewFormatter(a), c.NewFormatter(b))
+func (c *ConfigState) Sprintln(a ...interface{}) string {
+ return fmt.Sprintln(c.convertArgs(a)...)
+}
+
+/*
+NewFormatter returns a custom formatter that satisfies the fmt.Formatter
+interface. As a result, it integrates cleanly with standard fmt package
+printing functions. The formatter is useful for inline printing of smaller data
+types similar to the standard %v format specifier.
+
+The custom formatter only responds to the %v (most compact), %+v (adds pointer
+addresses), %#v (adds types), and %#+v (adds types and pointer addresses) verb
+combinations. Any other verbs such as %x and %q will be sent to the the
+standard fmt package for formatting. In addition, the custom formatter ignores
+the width and precision arguments (however they will still work on the format
+specifiers not handled by the custom formatter).
+
+Typically this function shouldn't be called directly. It is much easier to make
+use of the custom formatter by calling one of the convenience functions such as
+c.Printf, c.Println, or c.Printf.
+*/
+func (c *ConfigState) NewFormatter(v interface{}) fmt.Formatter {
+ return newFormatter(c, v)
+}
+
+// Fdump formats and displays the passed arguments to io.Writer w. It formats
+// exactly the same as Dump.
+func (c *ConfigState) Fdump(w io.Writer, a ...interface{}) {
+ fdump(c, w, a...)
+}
+
+/*
+Dump displays the passed parameters to standard out with newlines, customizable
+indentation, and additional debug information such as complete types and all
+pointer addresses used to indirect to the final value. It provides the
+following features over the built-in printing facilities provided by the fmt
+package:
+
+ - Pointers are dereferenced and followed
+ - Circular data structures are detected and handled properly
+ - Custom Stringer/error interfaces are optionally invoked, including
+ on unexported types
+ - Custom types which only implement the Stringer/error interfaces via
+ a pointer receiver are optionally invoked when passing non-pointer
+ variables
+ - Byte arrays and slices are dumped like the hexdump -C command which
+ includes offsets, byte values in hex, and ASCII output
+
+The configuration options are controlled by modifying the public members
+of c. See ConfigState for options documentation.
+
+See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to
+get the formatted result as a string.
+*/
+func (c *ConfigState) Dump(a ...interface{}) {
+ fdump(c, os.Stdout, a...)
+}
+
+// Sdump returns a string with the passed arguments formatted exactly the same
+// as Dump.
+func (c *ConfigState) Sdump(a ...interface{}) string {
+ var buf bytes.Buffer
+ fdump(c, &buf, a...)
+ return buf.String()
+}
+
+// convertArgs accepts a slice of arguments and returns a slice of the same
+// length with each argument converted to a spew Formatter interface using
+// the ConfigState associated with s.
+func (c *ConfigState) convertArgs(args []interface{}) (formatters []interface{}) {
+ formatters = make([]interface{}, len(args))
+ for index, arg := range args {
+ formatters[index] = newFormatter(c, arg)
+ }
+ return formatters
+}
+
+// NewDefaultConfig returns a ConfigState with the following default settings.
+//
+// Indent: " "
+// MaxDepth: 0
+// DisableMethods: false
+// DisablePointerMethods: false
+// ContinueOnMethod: false
+// SortKeys: false
+func NewDefaultConfig() *ConfigState {
+ return &ConfigState{Indent: " "}
+}
diff --git a/vendor/github.com/stretchr/testify/internal/spew/doc.go b/vendor/github.com/stretchr/testify/internal/spew/doc.go
new file mode 100644
index 0000000000..722e9aa791
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/internal/spew/doc.go
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2013-2016 Dave Collins
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+Package spew implements a deep pretty printer for Go data structures to aid in
+debugging.
+
+A quick overview of the additional features spew provides over the built-in
+printing facilities for Go data types are as follows:
+
+ - Pointers are dereferenced and followed
+ - Circular data structures are detected and handled properly
+ - Custom Stringer/error interfaces are optionally invoked, including
+ on unexported types
+ - Custom types which only implement the Stringer/error interfaces via
+ a pointer receiver are optionally invoked when passing non-pointer
+ variables
+ - Byte arrays and slices are dumped like the hexdump -C command which
+ includes offsets, byte values in hex, and ASCII output (only when using
+ Dump style)
+
+There are two different approaches spew allows for dumping Go data structures:
+
+ - Dump style which prints with newlines, customizable indentation,
+ and additional debug information such as types and all pointer addresses
+ used to indirect to the final value
+ - A custom Formatter interface that integrates cleanly with the standard fmt
+ package and replaces %v, %+v, %#v, and %#+v to provide inline printing
+ similar to the default %v while providing the additional functionality
+ outlined above and passing unsupported format verbs such as %x and %q
+ along to fmt
+
+# Quick Start
+
+This section demonstrates how to quickly get started with spew. See the
+sections below for further details on formatting and configuration options.
+
+To dump a variable with full newlines, indentation, type, and pointer
+information use Dump, Fdump, or Sdump:
+
+ spew.Dump(myVar1, myVar2, ...)
+ spew.Fdump(someWriter, myVar1, myVar2, ...)
+ str := spew.Sdump(myVar1, myVar2, ...)
+
+Alternatively, if you would prefer to use format strings with a compacted inline
+printing style, use the convenience wrappers Printf, Fprintf, etc with
+%v (most compact), %+v (adds pointer addresses), %#v (adds types), or
+%#+v (adds types and pointer addresses):
+
+ spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2)
+ spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
+ spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2)
+ spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
+
+# Configuration Options
+
+Configuration of spew is handled by fields in the ConfigState type. For
+convenience, all of the top-level functions use a global state available
+via the spew.Config global.
+
+It is also possible to create a ConfigState instance that provides methods
+equivalent to the top-level functions. This allows concurrent configuration
+options. See the ConfigState documentation for more details.
+
+The following configuration options are available:
+
+ - Indent
+ String to use for each indentation level for Dump functions.
+ It is a single space by default. A popular alternative is "\t".
+
+ - MaxDepth
+ Maximum number of levels to descend into nested data structures.
+ There is no limit by default.
+
+ - DisableMethods
+ Disables invocation of error and Stringer interface methods.
+ Method invocation is enabled by default.
+
+ - DisablePointerMethods
+ Disables invocation of error and Stringer interface methods on types
+ which only accept pointer receivers from non-pointer variables.
+ Pointer method invocation is enabled by default.
+
+ - DisablePointerAddresses
+ DisablePointerAddresses specifies whether to disable the printing of
+ pointer addresses. This is useful when diffing data structures in tests.
+
+ - DisableCapacities
+ DisableCapacities specifies whether to disable the printing of
+ capacities for arrays, slices, maps and channels. This is useful when
+ diffing data structures in tests.
+
+ - ContinueOnMethod
+ Enables recursion into types after invoking error and Stringer interface
+ methods. Recursion after method invocation is disabled by default.
+
+ - SortKeys
+ Specifies map keys should be sorted before being printed. Use
+ this to have a more deterministic, diffable output. Note that
+ only native types (bool, int, uint, floats, uintptr and string)
+ and types which implement error or Stringer interfaces are
+ supported with other types sorted according to the
+ reflect.Value.String() output which guarantees display
+ stability. Natural map order is used by default.
+
+ - SpewKeys
+ Specifies that, as a last resort attempt, map keys should be
+ spewed to strings and sorted by those strings. This is only
+ considered if SortKeys is true.
+
+# Dump Usage
+
+Simply call spew.Dump with a list of variables you want to dump:
+
+ spew.Dump(myVar1, myVar2, ...)
+
+You may also call spew.Fdump if you would prefer to output to an arbitrary
+io.Writer. For example, to dump to standard error:
+
+ spew.Fdump(os.Stderr, myVar1, myVar2, ...)
+
+A third option is to call spew.Sdump to get the formatted output as a string:
+
+ str := spew.Sdump(myVar1, myVar2, ...)
+
+# Sample Dump Output
+
+See the Dump example for details on the setup of the types and variables being
+shown here.
+
+ (main.Foo) {
+ unexportedField: (*main.Bar)(0xf84002e210)({
+ flag: (main.Flag) flagTwo,
+ data: (uintptr)
+ }),
+ ExportedField: (map[interface {}]interface {}) (len=1) {
+ (string) (len=3) "one": (bool) true
+ }
+ }
+
+Byte (and uint8) arrays and slices are displayed uniquely like the hexdump -C
+command as shown.
+
+ ([]uint8) (len=32 cap=32) {
+ 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... |
+ 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0|
+ 00000020 31 32 |12|
+ }
+
+# Custom Formatter
+
+Spew provides a custom formatter that implements the fmt.Formatter interface
+so that it integrates cleanly with standard fmt package printing functions. The
+formatter is useful for inline printing of smaller data types similar to the
+standard %v format specifier.
+
+The custom formatter only responds to the %v (most compact), %+v (adds pointer
+addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb
+combinations. Any other verbs such as %x and %q will be sent to the the
+standard fmt package for formatting. In addition, the custom formatter ignores
+the width and precision arguments (however they will still work on the format
+specifiers not handled by the custom formatter).
+
+# Custom Formatter Usage
+
+The simplest way to make use of the spew custom formatter is to call one of the
+convenience functions such as spew.Printf, spew.Println, or spew.Printf. The
+functions have syntax you are most likely already familiar with:
+
+ spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2)
+ spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
+ spew.Println(myVar, myVar2)
+ spew.Fprintf(os.Stderr, "myVar1: %v -- myVar2: %+v", myVar1, myVar2)
+ spew.Fprintf(os.Stderr, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
+
+See the Index for the full list convenience functions.
+
+# Sample Formatter Output
+
+Double pointer to a uint8:
+
+ %v: <**>5
+ %+v: <**>(0xf8400420d0->0xf8400420c8)5
+ %#v: (**uint8)5
+ %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5
+
+Pointer to circular struct with a uint8 field and a pointer to itself:
+
+ %v: <*>{1 <*>}
+ %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)}
+ %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)}
+ %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)}
+
+See the Printf example for details on the setup of variables being shown
+here.
+
+# Errors
+
+Since it is possible for custom Stringer/error interfaces to panic, spew
+detects them and handles them internally by printing the panic information
+inline with the output. Since spew is intended to provide deep pretty printing
+capabilities on structures, it intentionally does not return any errors.
+*/
+package spew
diff --git a/vendor/github.com/stretchr/testify/internal/spew/dump.go b/vendor/github.com/stretchr/testify/internal/spew/dump.go
new file mode 100644
index 0000000000..8323041a48
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/internal/spew/dump.go
@@ -0,0 +1,509 @@
+/*
+ * Copyright (c) 2013-2016 Dave Collins
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+package spew
+
+import (
+ "bytes"
+ "encoding/hex"
+ "fmt"
+ "io"
+ "os"
+ "reflect"
+ "regexp"
+ "strconv"
+ "strings"
+)
+
+var (
+ // uint8Type is a reflect.Type representing a uint8. It is used to
+ // convert cgo types to uint8 slices for hexdumping.
+ uint8Type = reflect.TypeOf(uint8(0))
+
+ // cCharRE is a regular expression that matches a cgo char.
+ // It is used to detect character arrays to hexdump them.
+ cCharRE = regexp.MustCompile(`^.*\._Ctype_char$`)
+
+ // cUnsignedCharRE is a regular expression that matches a cgo unsigned
+ // char. It is used to detect unsigned character arrays to hexdump
+ // them.
+ cUnsignedCharRE = regexp.MustCompile(`^.*\._Ctype_unsignedchar$`)
+
+ // cUint8tCharRE is a regular expression that matches a cgo uint8_t.
+ // It is used to detect uint8_t arrays to hexdump them.
+ cUint8tCharRE = regexp.MustCompile(`^.*\._Ctype_uint8_t$`)
+)
+
+// dumpState contains information about the state of a dump operation.
+type dumpState struct {
+ w io.Writer
+ depth int
+ pointers map[uintptr]int
+ ignoreNextType bool
+ ignoreNextIndent bool
+ cs *ConfigState
+}
+
+// indent performs indentation according to the depth level and cs.Indent
+// option.
+func (d *dumpState) indent() {
+ if d.ignoreNextIndent {
+ d.ignoreNextIndent = false
+ return
+ }
+ d.w.Write(bytes.Repeat([]byte(d.cs.Indent), d.depth))
+}
+
+// unpackValue returns values inside of non-nil interfaces when possible.
+// This is useful for data types like structs, arrays, slices, and maps which
+// can contain varying types packed inside an interface.
+func (d *dumpState) unpackValue(v reflect.Value) reflect.Value {
+ if v.Kind() == reflect.Interface && !v.IsNil() {
+ v = v.Elem()
+ }
+ return v
+}
+
+// dumpPtr handles formatting of pointers by indirecting them as necessary.
+func (d *dumpState) dumpPtr(v reflect.Value) {
+ // Remove pointers at or below the current depth from map used to detect
+ // circular refs.
+ for k, depth := range d.pointers {
+ if depth >= d.depth {
+ delete(d.pointers, k)
+ }
+ }
+
+ // Keep list of all dereferenced pointers to show later.
+ pointerChain := make([]uintptr, 0)
+
+ // Figure out how many levels of indirection there are by dereferencing
+ // pointers and unpacking interfaces down the chain while detecting circular
+ // references.
+ nilFound := false
+ cycleFound := false
+ indirects := 0
+ ve := v
+ for ve.Kind() == reflect.Ptr {
+ if ve.IsNil() {
+ nilFound = true
+ break
+ }
+ indirects++
+ addr := ve.Pointer()
+ pointerChain = append(pointerChain, addr)
+ if pd, ok := d.pointers[addr]; ok && pd < d.depth {
+ cycleFound = true
+ indirects--
+ break
+ }
+ d.pointers[addr] = d.depth
+
+ ve = ve.Elem()
+ if ve.Kind() == reflect.Interface {
+ if ve.IsNil() {
+ nilFound = true
+ break
+ }
+ ve = ve.Elem()
+ }
+ }
+
+ // Display type information.
+ d.w.Write(openParenBytes)
+ d.w.Write(bytes.Repeat(asteriskBytes, indirects))
+ d.w.Write([]byte(ve.Type().String()))
+ d.w.Write(closeParenBytes)
+
+ // Display pointer information.
+ if !d.cs.DisablePointerAddresses && len(pointerChain) > 0 {
+ d.w.Write(openParenBytes)
+ for i, addr := range pointerChain {
+ if i > 0 {
+ d.w.Write(pointerChainBytes)
+ }
+ printHexPtr(d.w, addr)
+ }
+ d.w.Write(closeParenBytes)
+ }
+
+ // Display dereferenced value.
+ d.w.Write(openParenBytes)
+ switch {
+ case nilFound:
+ d.w.Write(nilAngleBytes)
+
+ case cycleFound:
+ d.w.Write(circularBytes)
+
+ default:
+ d.ignoreNextType = true
+ d.dump(ve)
+ }
+ d.w.Write(closeParenBytes)
+}
+
+// dumpSlice handles formatting of arrays and slices. Byte (uint8 under
+// reflection) arrays and slices are dumped in hexdump -C fashion.
+func (d *dumpState) dumpSlice(v reflect.Value) {
+ // Determine whether this type should be hex dumped or not. Also,
+ // for types which should be hexdumped, try to use the underlying data
+ // first, then fall back to trying to convert them to a uint8 slice.
+ var buf []uint8
+ doConvert := false
+ doHexDump := false
+ numEntries := v.Len()
+ if numEntries > 0 {
+ vt := v.Index(0).Type()
+ vts := vt.String()
+ switch {
+ // C types that need to be converted.
+ case cCharRE.MatchString(vts):
+ fallthrough
+ case cUnsignedCharRE.MatchString(vts):
+ fallthrough
+ case cUint8tCharRE.MatchString(vts):
+ doConvert = true
+
+ // Try to use existing uint8 slices and fall back to converting
+ // and copying if that fails.
+ case vt.Kind() == reflect.Uint8:
+ // We need an addressable interface to convert the type
+ // to a byte slice. However, the reflect package won't
+ // give us an interface on certain things like
+ // unexported struct fields in order to enforce
+ // visibility rules. We use unsafe, when available, to
+ // bypass these restrictions since this package does not
+ // mutate the values.
+ vs := v
+ if !vs.CanInterface() || !vs.CanAddr() {
+ vs = unsafeReflectValue(vs)
+ }
+ if !UnsafeDisabled {
+ vs = vs.Slice(0, numEntries)
+
+ // Use the existing uint8 slice if it can be
+ // type asserted.
+ iface := vs.Interface()
+ if slice, ok := iface.([]uint8); ok {
+ buf = slice
+ doHexDump = true
+ break
+ }
+ }
+
+ // The underlying data needs to be converted if it can't
+ // be type asserted to a uint8 slice.
+ doConvert = true
+ }
+
+ // Copy and convert the underlying type if needed.
+ if doConvert && vt.ConvertibleTo(uint8Type) {
+ // Convert and copy each element into a uint8 byte
+ // slice.
+ buf = make([]uint8, numEntries)
+ for i := 0; i < numEntries; i++ {
+ vv := v.Index(i)
+ buf[i] = uint8(vv.Convert(uint8Type).Uint())
+ }
+ doHexDump = true
+ }
+ }
+
+ // Hexdump the entire slice as needed.
+ if doHexDump {
+ indent := strings.Repeat(d.cs.Indent, d.depth)
+ str := indent + hex.Dump(buf)
+ str = strings.Replace(str, "\n", "\n"+indent, -1)
+ str = strings.TrimRight(str, d.cs.Indent)
+ d.w.Write([]byte(str))
+ return
+ }
+
+ // Recursively call dump for each item.
+ for i := 0; i < numEntries; i++ {
+ d.dump(d.unpackValue(v.Index(i)))
+ if i < (numEntries - 1) {
+ d.w.Write(commaNewlineBytes)
+ } else {
+ d.w.Write(newlineBytes)
+ }
+ }
+}
+
+// dump is the main workhorse for dumping a value. It uses the passed reflect
+// value to figure out what kind of object we are dealing with and formats it
+// appropriately. It is a recursive function, however circular data structures
+// are detected and handled properly.
+func (d *dumpState) dump(v reflect.Value) {
+ // Handle invalid reflect values immediately.
+ kind := v.Kind()
+ if kind == reflect.Invalid {
+ d.w.Write(invalidAngleBytes)
+ return
+ }
+
+ // Handle pointers specially.
+ if kind == reflect.Ptr {
+ d.indent()
+ d.dumpPtr(v)
+ return
+ }
+
+ // Print type information unless already handled elsewhere.
+ if !d.ignoreNextType {
+ d.indent()
+ d.w.Write(openParenBytes)
+ d.w.Write([]byte(v.Type().String()))
+ d.w.Write(closeParenBytes)
+ d.w.Write(spaceBytes)
+ }
+ d.ignoreNextType = false
+
+ // Display length and capacity if the built-in len and cap functions
+ // work with the value's kind and the len/cap itself is non-zero.
+ valueLen, valueCap := 0, 0
+ switch v.Kind() {
+ case reflect.Array, reflect.Slice, reflect.Chan:
+ valueLen, valueCap = v.Len(), v.Cap()
+ case reflect.Map, reflect.String:
+ valueLen = v.Len()
+ }
+ if valueLen != 0 || !d.cs.DisableCapacities && valueCap != 0 {
+ d.w.Write(openParenBytes)
+ if valueLen != 0 {
+ d.w.Write(lenEqualsBytes)
+ printInt(d.w, int64(valueLen), 10)
+ }
+ if !d.cs.DisableCapacities && valueCap != 0 {
+ if valueLen != 0 {
+ d.w.Write(spaceBytes)
+ }
+ d.w.Write(capEqualsBytes)
+ printInt(d.w, int64(valueCap), 10)
+ }
+ d.w.Write(closeParenBytes)
+ d.w.Write(spaceBytes)
+ }
+
+ // Call Stringer/error interfaces if they exist and the handle methods flag
+ // is enabled
+ if !d.cs.DisableMethods {
+ if (kind != reflect.Invalid) && (kind != reflect.Interface) {
+ if handled := handleMethods(d.cs, d.w, v); handled {
+ return
+ }
+ }
+ }
+
+ switch kind {
+ case reflect.Invalid:
+ // Do nothing. We should never get here since invalid has already
+ // been handled above.
+
+ case reflect.Bool:
+ printBool(d.w, v.Bool())
+
+ case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
+ printInt(d.w, v.Int(), 10)
+
+ case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
+ printUint(d.w, v.Uint(), 10)
+
+ case reflect.Float32:
+ printFloat(d.w, v.Float(), 32)
+
+ case reflect.Float64:
+ printFloat(d.w, v.Float(), 64)
+
+ case reflect.Complex64:
+ printComplex(d.w, v.Complex(), 32)
+
+ case reflect.Complex128:
+ printComplex(d.w, v.Complex(), 64)
+
+ case reflect.Slice:
+ if v.IsNil() {
+ d.w.Write(nilAngleBytes)
+ break
+ }
+ fallthrough
+
+ case reflect.Array:
+ d.w.Write(openBraceNewlineBytes)
+ d.depth++
+ if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) {
+ d.indent()
+ d.w.Write(maxNewlineBytes)
+ } else {
+ d.dumpSlice(v)
+ }
+ d.depth--
+ d.indent()
+ d.w.Write(closeBraceBytes)
+
+ case reflect.String:
+ d.w.Write([]byte(strconv.Quote(v.String())))
+
+ case reflect.Interface:
+ // The only time we should get here is for nil interfaces due to
+ // unpackValue calls.
+ if v.IsNil() {
+ d.w.Write(nilAngleBytes)
+ }
+
+ case reflect.Ptr:
+ // Do nothing. We should never get here since pointers have already
+ // been handled above.
+
+ case reflect.Map:
+ // nil maps should be indicated as different than empty maps
+ if v.IsNil() {
+ d.w.Write(nilAngleBytes)
+ break
+ }
+
+ d.w.Write(openBraceNewlineBytes)
+ d.depth++
+ if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) {
+ d.indent()
+ d.w.Write(maxNewlineBytes)
+ } else {
+ numEntries := v.Len()
+ keys := v.MapKeys()
+ if d.cs.SortKeys {
+ sortValues(keys, d.cs)
+ }
+ for i, key := range keys {
+ d.dump(d.unpackValue(key))
+ d.w.Write(colonSpaceBytes)
+ d.ignoreNextIndent = true
+ d.dump(d.unpackValue(v.MapIndex(key)))
+ if i < (numEntries - 1) {
+ d.w.Write(commaNewlineBytes)
+ } else {
+ d.w.Write(newlineBytes)
+ }
+ }
+ }
+ d.depth--
+ d.indent()
+ d.w.Write(closeBraceBytes)
+
+ case reflect.Struct:
+ d.w.Write(openBraceNewlineBytes)
+ d.depth++
+ if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) {
+ d.indent()
+ d.w.Write(maxNewlineBytes)
+ } else {
+ vt := v.Type()
+ numFields := v.NumField()
+ for i := 0; i < numFields; i++ {
+ d.indent()
+ vtf := vt.Field(i)
+ d.w.Write([]byte(vtf.Name))
+ d.w.Write(colonSpaceBytes)
+ d.ignoreNextIndent = true
+ d.dump(d.unpackValue(v.Field(i)))
+ if i < (numFields - 1) {
+ d.w.Write(commaNewlineBytes)
+ } else {
+ d.w.Write(newlineBytes)
+ }
+ }
+ }
+ d.depth--
+ d.indent()
+ d.w.Write(closeBraceBytes)
+
+ case reflect.Uintptr:
+ printHexPtr(d.w, uintptr(v.Uint()))
+
+ case reflect.UnsafePointer, reflect.Chan, reflect.Func:
+ printHexPtr(d.w, v.Pointer())
+
+ // There were not any other types at the time this code was written, but
+ // fall back to letting the default fmt package handle it in case any new
+ // types are added.
+ default:
+ if v.CanInterface() {
+ fmt.Fprintf(d.w, "%v", v.Interface())
+ } else {
+ fmt.Fprintf(d.w, "%v", v.String())
+ }
+ }
+}
+
+// fdump is a helper function to consolidate the logic from the various public
+// methods which take varying writers and config states.
+func fdump(cs *ConfigState, w io.Writer, a ...interface{}) {
+ for _, arg := range a {
+ if arg == nil {
+ w.Write(interfaceBytes)
+ w.Write(spaceBytes)
+ w.Write(nilAngleBytes)
+ w.Write(newlineBytes)
+ continue
+ }
+
+ d := dumpState{w: w, cs: cs}
+ d.pointers = make(map[uintptr]int)
+ d.dump(reflect.ValueOf(arg))
+ d.w.Write(newlineBytes)
+ }
+}
+
+// Fdump formats and displays the passed arguments to io.Writer w. It formats
+// exactly the same as Dump.
+func Fdump(w io.Writer, a ...interface{}) {
+ fdump(&Config, w, a...)
+}
+
+// Sdump returns a string with the passed arguments formatted exactly the same
+// as Dump.
+func Sdump(a ...interface{}) string {
+ var buf bytes.Buffer
+ fdump(&Config, &buf, a...)
+ return buf.String()
+}
+
+/*
+Dump displays the passed parameters to standard out with newlines, customizable
+indentation, and additional debug information such as complete types and all
+pointer addresses used to indirect to the final value. It provides the
+following features over the built-in printing facilities provided by the fmt
+package:
+
+ - Pointers are dereferenced and followed
+ - Circular data structures are detected and handled properly
+ - Custom Stringer/error interfaces are optionally invoked, including
+ on unexported types
+ - Custom types which only implement the Stringer/error interfaces via
+ a pointer receiver are optionally invoked when passing non-pointer
+ variables
+ - Byte arrays and slices are dumped like the hexdump -C command which
+ includes offsets, byte values in hex, and ASCII output
+
+The configuration options are controlled by an exported package global,
+spew.Config. See ConfigState for options documentation.
+
+See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to
+get the formatted result as a string.
+*/
+func Dump(a ...interface{}) {
+ fdump(&Config, os.Stdout, a...)
+}
diff --git a/vendor/github.com/stretchr/testify/internal/spew/format.go b/vendor/github.com/stretchr/testify/internal/spew/format.go
new file mode 100644
index 0000000000..b04edb7d7a
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/internal/spew/format.go
@@ -0,0 +1,419 @@
+/*
+ * Copyright (c) 2013-2016 Dave Collins
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+package spew
+
+import (
+ "bytes"
+ "fmt"
+ "reflect"
+ "strconv"
+ "strings"
+)
+
+// supportedFlags is a list of all the character flags supported by fmt package.
+const supportedFlags = "0-+# "
+
+// formatState implements the fmt.Formatter interface and contains information
+// about the state of a formatting operation. The NewFormatter function can
+// be used to get a new Formatter which can be used directly as arguments
+// in standard fmt package printing calls.
+type formatState struct {
+ value interface{}
+ fs fmt.State
+ depth int
+ pointers map[uintptr]int
+ ignoreNextType bool
+ cs *ConfigState
+}
+
+// buildDefaultFormat recreates the original format string without precision
+// and width information to pass in to fmt.Sprintf in the case of an
+// unrecognized type. Unless new types are added to the language, this
+// function won't ever be called.
+func (f *formatState) buildDefaultFormat() (format string) {
+ buf := bytes.NewBuffer(percentBytes)
+
+ for _, flag := range supportedFlags {
+ if f.fs.Flag(int(flag)) {
+ buf.WriteRune(flag)
+ }
+ }
+
+ buf.WriteRune('v')
+
+ format = buf.String()
+ return format
+}
+
+// constructOrigFormat recreates the original format string including precision
+// and width information to pass along to the standard fmt package. This allows
+// automatic deferral of all format strings this package doesn't support.
+func (f *formatState) constructOrigFormat(verb rune) (format string) {
+ buf := bytes.NewBuffer(percentBytes)
+
+ for _, flag := range supportedFlags {
+ if f.fs.Flag(int(flag)) {
+ buf.WriteRune(flag)
+ }
+ }
+
+ if width, ok := f.fs.Width(); ok {
+ buf.WriteString(strconv.Itoa(width))
+ }
+
+ if precision, ok := f.fs.Precision(); ok {
+ buf.Write(precisionBytes)
+ buf.WriteString(strconv.Itoa(precision))
+ }
+
+ buf.WriteRune(verb)
+
+ format = buf.String()
+ return format
+}
+
+// unpackValue returns values inside of non-nil interfaces when possible and
+// ensures that types for values which have been unpacked from an interface
+// are displayed when the show types flag is also set.
+// This is useful for data types like structs, arrays, slices, and maps which
+// can contain varying types packed inside an interface.
+func (f *formatState) unpackValue(v reflect.Value) reflect.Value {
+ if v.Kind() == reflect.Interface {
+ f.ignoreNextType = false
+ if !v.IsNil() {
+ v = v.Elem()
+ }
+ }
+ return v
+}
+
+// formatPtr handles formatting of pointers by indirecting them as necessary.
+func (f *formatState) formatPtr(v reflect.Value) {
+ // Display nil if top level pointer is nil.
+ showTypes := f.fs.Flag('#')
+ if v.IsNil() && (!showTypes || f.ignoreNextType) {
+ f.fs.Write(nilAngleBytes)
+ return
+ }
+
+ // Remove pointers at or below the current depth from map used to detect
+ // circular refs.
+ for k, depth := range f.pointers {
+ if depth >= f.depth {
+ delete(f.pointers, k)
+ }
+ }
+
+ // Keep list of all dereferenced pointers to possibly show later.
+ pointerChain := make([]uintptr, 0)
+
+ // Figure out how many levels of indirection there are by derferencing
+ // pointers and unpacking interfaces down the chain while detecting circular
+ // references.
+ nilFound := false
+ cycleFound := false
+ indirects := 0
+ ve := v
+ for ve.Kind() == reflect.Ptr {
+ if ve.IsNil() {
+ nilFound = true
+ break
+ }
+ indirects++
+ addr := ve.Pointer()
+ pointerChain = append(pointerChain, addr)
+ if pd, ok := f.pointers[addr]; ok && pd < f.depth {
+ cycleFound = true
+ indirects--
+ break
+ }
+ f.pointers[addr] = f.depth
+
+ ve = ve.Elem()
+ if ve.Kind() == reflect.Interface {
+ if ve.IsNil() {
+ nilFound = true
+ break
+ }
+ ve = ve.Elem()
+ }
+ }
+
+ // Display type or indirection level depending on flags.
+ if showTypes && !f.ignoreNextType {
+ f.fs.Write(openParenBytes)
+ f.fs.Write(bytes.Repeat(asteriskBytes, indirects))
+ f.fs.Write([]byte(ve.Type().String()))
+ f.fs.Write(closeParenBytes)
+ } else {
+ if nilFound || cycleFound {
+ indirects += strings.Count(ve.Type().String(), "*")
+ }
+ f.fs.Write(openAngleBytes)
+ f.fs.Write([]byte(strings.Repeat("*", indirects)))
+ f.fs.Write(closeAngleBytes)
+ }
+
+ // Display pointer information depending on flags.
+ if f.fs.Flag('+') && (len(pointerChain) > 0) {
+ f.fs.Write(openParenBytes)
+ for i, addr := range pointerChain {
+ if i > 0 {
+ f.fs.Write(pointerChainBytes)
+ }
+ printHexPtr(f.fs, addr)
+ }
+ f.fs.Write(closeParenBytes)
+ }
+
+ // Display dereferenced value.
+ switch {
+ case nilFound:
+ f.fs.Write(nilAngleBytes)
+
+ case cycleFound:
+ f.fs.Write(circularShortBytes)
+
+ default:
+ f.ignoreNextType = true
+ f.format(ve)
+ }
+}
+
+// format is the main workhorse for providing the Formatter interface. It
+// uses the passed reflect value to figure out what kind of object we are
+// dealing with and formats it appropriately. It is a recursive function,
+// however circular data structures are detected and handled properly.
+func (f *formatState) format(v reflect.Value) {
+ // Handle invalid reflect values immediately.
+ kind := v.Kind()
+ if kind == reflect.Invalid {
+ f.fs.Write(invalidAngleBytes)
+ return
+ }
+
+ // Handle pointers specially.
+ if kind == reflect.Ptr {
+ f.formatPtr(v)
+ return
+ }
+
+ // Print type information unless already handled elsewhere.
+ if !f.ignoreNextType && f.fs.Flag('#') {
+ f.fs.Write(openParenBytes)
+ f.fs.Write([]byte(v.Type().String()))
+ f.fs.Write(closeParenBytes)
+ }
+ f.ignoreNextType = false
+
+ // Call Stringer/error interfaces if they exist and the handle methods
+ // flag is enabled.
+ if !f.cs.DisableMethods {
+ if (kind != reflect.Invalid) && (kind != reflect.Interface) {
+ if handled := handleMethods(f.cs, f.fs, v); handled {
+ return
+ }
+ }
+ }
+
+ switch kind {
+ case reflect.Invalid:
+ // Do nothing. We should never get here since invalid has already
+ // been handled above.
+
+ case reflect.Bool:
+ printBool(f.fs, v.Bool())
+
+ case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
+ printInt(f.fs, v.Int(), 10)
+
+ case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
+ printUint(f.fs, v.Uint(), 10)
+
+ case reflect.Float32:
+ printFloat(f.fs, v.Float(), 32)
+
+ case reflect.Float64:
+ printFloat(f.fs, v.Float(), 64)
+
+ case reflect.Complex64:
+ printComplex(f.fs, v.Complex(), 32)
+
+ case reflect.Complex128:
+ printComplex(f.fs, v.Complex(), 64)
+
+ case reflect.Slice:
+ if v.IsNil() {
+ f.fs.Write(nilAngleBytes)
+ break
+ }
+ fallthrough
+
+ case reflect.Array:
+ f.fs.Write(openBracketBytes)
+ f.depth++
+ if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) {
+ f.fs.Write(maxShortBytes)
+ } else {
+ numEntries := v.Len()
+ for i := 0; i < numEntries; i++ {
+ if i > 0 {
+ f.fs.Write(spaceBytes)
+ }
+ f.ignoreNextType = true
+ f.format(f.unpackValue(v.Index(i)))
+ }
+ }
+ f.depth--
+ f.fs.Write(closeBracketBytes)
+
+ case reflect.String:
+ f.fs.Write([]byte(v.String()))
+
+ case reflect.Interface:
+ // The only time we should get here is for nil interfaces due to
+ // unpackValue calls.
+ if v.IsNil() {
+ f.fs.Write(nilAngleBytes)
+ }
+
+ case reflect.Ptr:
+ // Do nothing. We should never get here since pointers have already
+ // been handled above.
+
+ case reflect.Map:
+ // nil maps should be indicated as different than empty maps
+ if v.IsNil() {
+ f.fs.Write(nilAngleBytes)
+ break
+ }
+
+ f.fs.Write(openMapBytes)
+ f.depth++
+ if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) {
+ f.fs.Write(maxShortBytes)
+ } else {
+ keys := v.MapKeys()
+ if f.cs.SortKeys {
+ sortValues(keys, f.cs)
+ }
+ for i, key := range keys {
+ if i > 0 {
+ f.fs.Write(spaceBytes)
+ }
+ f.ignoreNextType = true
+ f.format(f.unpackValue(key))
+ f.fs.Write(colonBytes)
+ f.ignoreNextType = true
+ f.format(f.unpackValue(v.MapIndex(key)))
+ }
+ }
+ f.depth--
+ f.fs.Write(closeMapBytes)
+
+ case reflect.Struct:
+ numFields := v.NumField()
+ f.fs.Write(openBraceBytes)
+ f.depth++
+ if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) {
+ f.fs.Write(maxShortBytes)
+ } else {
+ vt := v.Type()
+ for i := 0; i < numFields; i++ {
+ if i > 0 {
+ f.fs.Write(spaceBytes)
+ }
+ vtf := vt.Field(i)
+ if f.fs.Flag('+') || f.fs.Flag('#') {
+ f.fs.Write([]byte(vtf.Name))
+ f.fs.Write(colonBytes)
+ }
+ f.format(f.unpackValue(v.Field(i)))
+ }
+ }
+ f.depth--
+ f.fs.Write(closeBraceBytes)
+
+ case reflect.Uintptr:
+ printHexPtr(f.fs, uintptr(v.Uint()))
+
+ case reflect.UnsafePointer, reflect.Chan, reflect.Func:
+ printHexPtr(f.fs, v.Pointer())
+
+ // There were not any other types at the time this code was written, but
+ // fall back to letting the default fmt package handle it if any get added.
+ default:
+ format := f.buildDefaultFormat()
+ if v.CanInterface() {
+ fmt.Fprintf(f.fs, format, v.Interface())
+ } else {
+ fmt.Fprintf(f.fs, format, v.String())
+ }
+ }
+}
+
+// Format satisfies the fmt.Formatter interface. See NewFormatter for usage
+// details.
+func (f *formatState) Format(fs fmt.State, verb rune) {
+ f.fs = fs
+
+ // Use standard formatting for verbs that are not v.
+ if verb != 'v' {
+ format := f.constructOrigFormat(verb)
+ fmt.Fprintf(fs, format, f.value)
+ return
+ }
+
+ if f.value == nil {
+ if fs.Flag('#') {
+ fs.Write(interfaceBytes)
+ }
+ fs.Write(nilAngleBytes)
+ return
+ }
+
+ f.format(reflect.ValueOf(f.value))
+}
+
+// newFormatter is a helper function to consolidate the logic from the various
+// public methods which take varying config states.
+func newFormatter(cs *ConfigState, v interface{}) fmt.Formatter {
+ fs := &formatState{value: v, cs: cs}
+ fs.pointers = make(map[uintptr]int)
+ return fs
+}
+
+/*
+NewFormatter returns a custom formatter that satisfies the fmt.Formatter
+interface. As a result, it integrates cleanly with standard fmt package
+printing functions. The formatter is useful for inline printing of smaller data
+types similar to the standard %v format specifier.
+
+The custom formatter only responds to the %v (most compact), %+v (adds pointer
+addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb
+combinations. Any other verbs such as %x and %q will be sent to the the
+standard fmt package for formatting. In addition, the custom formatter ignores
+the width and precision arguments (however they will still work on the format
+specifiers not handled by the custom formatter).
+
+Typically this function shouldn't be called directly. It is much easier to make
+use of the custom formatter by calling one of the convenience functions such as
+Printf, Println, or Fprintf.
+*/
+func NewFormatter(v interface{}) fmt.Formatter {
+ return newFormatter(&Config, v)
+}
diff --git a/vendor/github.com/stretchr/testify/internal/spew/spew.go b/vendor/github.com/stretchr/testify/internal/spew/spew.go
new file mode 100644
index 0000000000..32c0e33882
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/internal/spew/spew.go
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2013-2016 Dave Collins
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+package spew
+
+import (
+ "fmt"
+ "io"
+)
+
+// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were
+// passed with a default Formatter interface returned by NewFormatter. It
+// returns the formatted string as a value that satisfies error. See
+// NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Errorf(format, spew.NewFormatter(a), spew.NewFormatter(b))
+func Errorf(format string, a ...interface{}) (err error) {
+ return fmt.Errorf(format, convertArgs(a)...)
+}
+
+// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were
+// passed with a default Formatter interface returned by NewFormatter. It
+// returns the number of bytes written and any write error encountered. See
+// NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Fprint(w, spew.NewFormatter(a), spew.NewFormatter(b))
+func Fprint(w io.Writer, a ...interface{}) (n int, err error) {
+ return fmt.Fprint(w, convertArgs(a)...)
+}
+
+// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were
+// passed with a default Formatter interface returned by NewFormatter. It
+// returns the number of bytes written and any write error encountered. See
+// NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Fprintf(w, format, spew.NewFormatter(a), spew.NewFormatter(b))
+func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) {
+ return fmt.Fprintf(w, format, convertArgs(a)...)
+}
+
+// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it
+// passed with a default Formatter interface returned by NewFormatter. See
+// NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Fprintln(w, spew.NewFormatter(a), spew.NewFormatter(b))
+func Fprintln(w io.Writer, a ...interface{}) (n int, err error) {
+ return fmt.Fprintln(w, convertArgs(a)...)
+}
+
+// Print is a wrapper for fmt.Print that treats each argument as if it were
+// passed with a default Formatter interface returned by NewFormatter. It
+// returns the number of bytes written and any write error encountered. See
+// NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Print(spew.NewFormatter(a), spew.NewFormatter(b))
+func Print(a ...interface{}) (n int, err error) {
+ return fmt.Print(convertArgs(a)...)
+}
+
+// Printf is a wrapper for fmt.Printf that treats each argument as if it were
+// passed with a default Formatter interface returned by NewFormatter. It
+// returns the number of bytes written and any write error encountered. See
+// NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Printf(format, spew.NewFormatter(a), spew.NewFormatter(b))
+func Printf(format string, a ...interface{}) (n int, err error) {
+ return fmt.Printf(format, convertArgs(a)...)
+}
+
+// Println is a wrapper for fmt.Println that treats each argument as if it were
+// passed with a default Formatter interface returned by NewFormatter. It
+// returns the number of bytes written and any write error encountered. See
+// NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Println(spew.NewFormatter(a), spew.NewFormatter(b))
+func Println(a ...interface{}) (n int, err error) {
+ return fmt.Println(convertArgs(a)...)
+}
+
+// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were
+// passed with a default Formatter interface returned by NewFormatter. It
+// returns the resulting string. See NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Sprint(spew.NewFormatter(a), spew.NewFormatter(b))
+func Sprint(a ...interface{}) string {
+ return fmt.Sprint(convertArgs(a)...)
+}
+
+// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were
+// passed with a default Formatter interface returned by NewFormatter. It
+// returns the resulting string. See NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Sprintf(format, spew.NewFormatter(a), spew.NewFormatter(b))
+func Sprintf(format string, a ...interface{}) string {
+ return fmt.Sprintf(format, convertArgs(a)...)
+}
+
+// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it
+// were passed with a default Formatter interface returned by NewFormatter. It
+// returns the resulting string. See NewFormatter for formatting details.
+//
+// This function is shorthand for the following syntax:
+//
+// fmt.Sprintln(spew.NewFormatter(a), spew.NewFormatter(b))
+func Sprintln(a ...interface{}) string {
+ return fmt.Sprintln(convertArgs(a)...)
+}
+
+// convertArgs accepts a slice of arguments and returns a slice of the same
+// length with each argument converted to a default spew Formatter interface.
+func convertArgs(args []interface{}) (formatters []interface{}) {
+ formatters = make([]interface{}, len(args))
+ for index, arg := range args {
+ formatters[index] = NewFormatter(arg)
+ }
+ return formatters
+}
diff --git a/vendor/github.com/stretchr/testify/mock/mock.go b/vendor/github.com/stretchr/testify/mock/mock.go
index efc89deff3..7f4d28d5ee 100644
--- a/vendor/github.com/stretchr/testify/mock/mock.go
+++ b/vendor/github.com/stretchr/testify/mock/mock.go
@@ -11,11 +11,11 @@ import (
"sync"
"time"
- "github.com/davecgh/go-spew/spew"
- "github.com/pmezard/go-difflib/difflib"
"github.com/stretchr/objx"
"github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/internal/difflib"
+ "github.com/stretchr/testify/internal/spew"
)
// regex for GCCGO functions
@@ -470,7 +470,7 @@ func callString(method string, arguments Arguments, includeArgumentValues bool)
// Called tells the mock object that a method has been called, and gets an array
// of arguments to return. Panics if the call is unexpected (i.e. not preceded by
-// appropriate .On .Return() calls)
+// appropriate [Mock.On] calls)
// If Call.WaitFor is set, blocks until the channel is closed or receives a message.
func (m *Mock) Called(arguments ...interface{}) Arguments {
// get the calling function's name
@@ -493,7 +493,7 @@ func (m *Mock) Called(arguments ...interface{}) Arguments {
// MethodCalled tells the mock object that the given method has been called, and gets
// an array of arguments to return. Panics if the call is unexpected (i.e. not preceded
-// by appropriate .On .Return() calls)
+// by appropriate [Mock.On] calls)
// If Call.WaitFor is set, blocks until the channel is closed or receives a message.
func (m *Mock) MethodCalled(methodName string, arguments ...interface{}) Arguments {
m.mutex.Lock()
@@ -510,8 +510,7 @@ func (m *Mock) MethodCalled(methodName string, arguments ...interface{}) Argumen
// as the return arguments. This is because:
//
// a) this is a totally unexpected call to this method,
- // b) the arguments are not what was expected, or
- // c) the developer has forgotten to add an accompanying On...Return pair.
+ // b) the arguments are not what was expected
closestCall, mismatch := m.findClosestCall(methodName, arguments...)
m.mutex.Unlock()
@@ -595,7 +594,7 @@ type assertExpectationiser interface {
AssertExpectations(TestingT) bool
}
-// AssertExpectationsForObjects asserts that everything specified with On and Return
+// AssertExpectationsForObjects asserts that everything specified with [Mock.On]
// of the specified objects was in fact called as expected.
//
// Calls may have occurred in any order.
@@ -604,11 +603,12 @@ func AssertExpectationsForObjects(t TestingT, testObjects ...interface{}) bool {
h.Helper()
}
for _, obj := range testObjects {
- if m, ok := obj.(*Mock); ok {
- t.Logf("Deprecated mock.AssertExpectationsForObjects(myMock.Mock) use mock.AssertExpectationsForObjects(myMock)")
- obj = m
+ m, ok := obj.(assertExpectationiser)
+ if !ok {
+ t.Errorf("Invalid test object type %T. Expected reference to a mock.Mock, eg: 'AssertExpectationsForObjects(t, myMock)' or 'AssertExpectationsForObjects(t, &myMock.Mock)'", obj)
+ continue
+
}
- m := obj.(assertExpectationiser)
if !m.AssertExpectations(t) {
t.Logf("Expectations didn't match for Mock: %+v", reflect.TypeOf(m))
return false
@@ -617,7 +617,7 @@ func AssertExpectationsForObjects(t TestingT, testObjects ...interface{}) bool {
return true
}
-// AssertExpectations asserts that everything specified with On and Return was
+// AssertExpectations asserts that everything specified with [Mock.On] was
// in fact called as expected. Calls may have occurred in any order.
func (m *Mock) AssertExpectations(t TestingT) bool {
if s, ok := t.(interface{ Skipped() bool }); ok && s.Skipped() {
@@ -712,8 +712,8 @@ func (m *Mock) AssertNotCalled(t TestingT, methodName string, arguments ...inter
return true
}
-// IsMethodCallable checking that the method can be called
-// If the method was called more than `Repeatability` return false
+// IsMethodCallable returns true if given methodName and arguments have an
+// unsatisfied expected call registered in the Mock.
func (m *Mock) IsMethodCallable(t TestingT, methodName string, arguments ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -833,6 +833,10 @@ type IsTypeArgument struct {
// For example:
//
// args.Assert(t, IsType(""), IsType(0))
+//
+// Mock cannot match interface types because the contained type will be passed
+// to both IsType and Mock.Called, for the zero value of all interfaces this
+// will be type.
func IsType(t interface{}) *IsTypeArgument {
return &IsTypeArgument{t: reflect.TypeOf(t)}
}
@@ -1012,7 +1016,7 @@ func (args Arguments) Diff(objects []interface{}) (string, int) {
actualT := reflect.TypeOf(actual)
if actualT != expected.t {
differences++
- output = fmt.Sprintf("%s\t%d: FAIL: type %s != type %s - %s\n", output, i, expected.t.Name(), actualT.Name(), actualFmt)
+ output = fmt.Sprintf("%s\t%d: FAIL: type %s != type %s - %s\n", output, i, safeTypeName(expected.t), safeTypeName(actualT), actualFmt)
}
case *FunctionalOptionsArgument:
var name string
@@ -1141,6 +1145,15 @@ func (args Arguments) Bool(index int) bool {
return s
}
+// safeTypeName returns the reflect.Type's name without causing a panic.
+// If the provided reflect.Type is nil, it returns the placeholder string ""
+func safeTypeName(t reflect.Type) string {
+ if t == nil {
+ return ""
+ }
+ return t.Name()
+}
+
func typeAndKind(v interface{}) (reflect.Type, reflect.Kind) {
t := reflect.TypeOf(v)
k := t.Kind()
diff --git a/vendor/go.yaml.in/yaml/v3/parserc.go b/vendor/go.yaml.in/yaml/v3/parserc.go
index 25fe823637..f35829db4d 100644
--- a/vendor/go.yaml.in/yaml/v3/parserc.go
+++ b/vendor/go.yaml.in/yaml/v3/parserc.go
@@ -226,9 +226,9 @@ func yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool
}
// Parse the production:
-// stream ::= STREAM-START implicit_document? explicit_document* STREAM-END
//
-// ************
+// stream ::= STREAM-START implicit_document? explicit_document* STREAM-END
+// ************
func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool {
token := peek_token(parser)
if token == nil {
@@ -249,13 +249,11 @@ func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t)
}
// Parse the productions:
-// implicit_document ::= block_node DOCUMENT-END*
-//
-// *
//
-// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
-//
-// *************************
+// implicit_document ::= block_node DOCUMENT-END*
+// *
+// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+// *************************
func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t, implicit bool) bool {
token := peek_token(parser)
@@ -359,9 +357,9 @@ func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t
}
// Parse the productions:
-// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
//
-// ***********
+// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+// ***********
func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool {
token := peek_token(parser)
if token == nil {
@@ -382,11 +380,10 @@ func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event
}
// Parse the productions:
-// implicit_document ::= block_node DOCUMENT-END*
-//
-// *************
//
-// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
+// implicit_document ::= block_node DOCUMENT-END*
+// *************
+// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
func yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) bool {
token := peek_token(parser)
if token == nil {
@@ -432,42 +429,32 @@ func yaml_parser_set_event_comments(parser *yaml_parser_t, event *yaml_event_t)
}
// Parse the productions:
-// block_node_or_indentless_sequence ::=
-//
-// ALIAS
-// *****
-// | properties (block_content | indentless_block_sequence)?
-// ********** *
-// | block_content | indentless_block_sequence
-// *
-//
-// block_node ::= ALIAS
-//
-// *****
-// | properties block_content?
-// ********** *
-// | block_content
-// *
-//
-// flow_node ::= ALIAS
-//
-// *****
-// | properties flow_content?
-// ********** *
-// | flow_content
-// *
-//
-// properties ::= TAG ANCHOR? | ANCHOR TAG?
-//
-// *************************
-//
-// block_content ::= block_collection | flow_collection | SCALAR
-//
-// ******
//
-// flow_content ::= flow_collection | SCALAR
-//
-// ******
+// block_node_or_indentless_sequence ::=
+// ALIAS
+// *****
+// | properties (block_content | indentless_block_sequence)?
+// ********** *
+// | block_content | indentless_block_sequence
+// *
+// block_node ::= ALIAS
+// *****
+// | properties block_content?
+// ********** *
+// | block_content
+// *
+// flow_node ::= ALIAS
+// *****
+// | properties flow_content?
+// ********** *
+// | flow_content
+// *
+// properties ::= TAG ANCHOR? | ANCHOR TAG?
+// *************************
+// block_content ::= block_collection | flow_collection | SCALAR
+// ******
+// flow_content ::= flow_collection | SCALAR
+// ******
func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, indentless_sequence bool) bool {
//defer trace("yaml_parser_parse_node", "block:", block, "indentless_sequence:", indentless_sequence)()
@@ -697,9 +684,9 @@ func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, i
}
// Parse the productions:
-// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END
//
-// ******************** *********** * *********
+// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END
+// ******************** *********** * *********
func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {
if first {
token := peek_token(parser)
@@ -755,9 +742,9 @@ func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_e
}
// Parse the productions:
-// indentless_sequence ::= (BLOCK-ENTRY block_node?)+
//
-// *********** *
+// indentless_sequence ::= (BLOCK-ENTRY block_node?)+
+// *********** *
func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *yaml_event_t) bool {
token := peek_token(parser)
if token == nil {
@@ -821,15 +808,15 @@ func yaml_parser_split_stem_comment(parser *yaml_parser_t, stem_len int) {
}
// Parse the productions:
-// block_mapping ::= BLOCK-MAPPING_START
//
-// *******************
-// ((KEY block_node_or_indentless_sequence?)?
-// *** *
-// (VALUE block_node_or_indentless_sequence?)?)*
+// block_mapping ::= BLOCK-MAPPING_START
+// *******************
+// ((KEY block_node_or_indentless_sequence?)?
+// *** *
+// (VALUE block_node_or_indentless_sequence?)?)*
//
-// BLOCK-END
-// *********
+// BLOCK-END
+// *********
func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {
if first {
token := peek_token(parser)
@@ -896,13 +883,14 @@ func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_even
}
// Parse the productions:
-// block_mapping ::= BLOCK-MAPPING_START
//
-// ((KEY block_node_or_indentless_sequence?)?
+// block_mapping ::= BLOCK-MAPPING_START
+//
+// ((KEY block_node_or_indentless_sequence?)?
//
-// (VALUE block_node_or_indentless_sequence?)?)*
-// ***** *
-// BLOCK-END
+// (VALUE block_node_or_indentless_sequence?)?)*
+// ***** *
+// BLOCK-END
func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool {
token := peek_token(parser)
if token == nil {
@@ -929,19 +917,17 @@ func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_ev
}
// Parse the productions:
-// flow_sequence ::= FLOW-SEQUENCE-START
-//
-// *******************
-// (flow_sequence_entry FLOW-ENTRY)*
-// * **********
-// flow_sequence_entry?
-// *
-// FLOW-SEQUENCE-END
-// *****************
//
-// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
-//
-// *
+// flow_sequence ::= FLOW-SEQUENCE-START
+// *******************
+// (flow_sequence_entry FLOW-ENTRY)*
+// * **********
+// flow_sequence_entry?
+// *
+// FLOW-SEQUENCE-END
+// *****************
+// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+// *
func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {
if first {
token := peek_token(parser)
@@ -1005,9 +991,9 @@ func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_ev
}
// Parse the productions:
-// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
//
-// *** *
+// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+// *** *
func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, event *yaml_event_t) bool {
token := peek_token(parser)
if token == nil {
@@ -1026,9 +1012,9 @@ func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, ev
}
// Parse the productions:
-// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
//
-// ***** *
+// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+// ***** *
func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool {
token := peek_token(parser)
if token == nil {
@@ -1050,9 +1036,9 @@ func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t,
}
// Parse the productions:
-// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
//
-// *
+// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+// *
func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, event *yaml_event_t) bool {
token := peek_token(parser)
if token == nil {
@@ -1068,18 +1054,17 @@ func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, ev
}
// Parse the productions:
-// flow_mapping ::= FLOW-MAPPING-START
-//
-// ******************
-// (flow_mapping_entry FLOW-ENTRY)*
-// * **********
-// flow_mapping_entry?
-// ******************
-// FLOW-MAPPING-END
-// ****************
//
-// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
-// - *** *
+// flow_mapping ::= FLOW-MAPPING-START
+// ******************
+// (flow_mapping_entry FLOW-ENTRY)*
+// * **********
+// flow_mapping_entry?
+// ******************
+// FLOW-MAPPING-END
+// ****************
+// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+// * *** *
func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool {
if first {
token := peek_token(parser)
@@ -1144,8 +1129,9 @@ func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event
}
// Parse the productions:
-// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
-// - ***** *
+//
+// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)?
+// * ***** *
func yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t, event *yaml_event_t, empty bool) bool {
token := peek_token(parser)
if token == nil {
diff --git a/vendor/go.yaml.in/yaml/v3/yamlh.go b/vendor/go.yaml.in/yaml/v3/yamlh.go
index f59aa40f64..07c442361c 100644
--- a/vendor/go.yaml.in/yaml/v3/yamlh.go
+++ b/vendor/go.yaml.in/yaml/v3/yamlh.go
@@ -433,21 +433,19 @@ type yaml_document_t struct {
// The prototype of a read handler.
//
-// The read handler is called when the parser needs to read more bytes from the
-// source. The handler should write not more than size bytes to the buffer.
-// The number of written bytes should be set to the size_read variable.
+// The read handler is called when the parser needs to read more bytes from the
+// source. The handler should write not more than size bytes to the buffer.
+// The number of written bytes should be set to the size_read variable.
//
-// [in,out] data A pointer to an application data specified by
+// [in,out] data A pointer to an application data specified by
+// yaml_parser_set_input().
+// [out] buffer The buffer to write the data from the source.
+// [in] size The size of the buffer.
+// [out] size_read The actual number of bytes read from the source.
//
-// yaml_parser_set_input().
-//
-// [out] buffer The buffer to write the data from the source.
-// [in] size The size of the buffer.
-// [out] size_read The actual number of bytes read from the source.
-//
-// On success, the handler should return 1. If the handler failed,
-// the returned value should be 0. On EOF, the handler should set the
-// size_read to 0 and return 1.
+// On success, the handler should return 1. If the handler failed,
+// the returned value should be 0. On EOF, the handler should set the
+// size_read to 0 and return 1.
type yaml_read_handler_t func(parser *yaml_parser_t, buffer []byte) (n int, err error)
// This structure holds information about a potential simple key.
@@ -655,19 +653,17 @@ type yaml_comment_t struct {
// The prototype of a write handler.
//
-// The write handler is called when the emitter needs to flush the accumulated
-// characters to the output. The handler should write @a size bytes of the
-// @a buffer to the output.
-//
-// @param[in,out] data A pointer to an application data specified by
-//
-// yaml_emitter_set_output().
+// The write handler is called when the emitter needs to flush the accumulated
+// characters to the output. The handler should write @a size bytes of the
+// @a buffer to the output.
//
-// @param[in] buffer The buffer with bytes to be written.
-// @param[in] size The size of the buffer.
+// @param[in,out] data A pointer to an application data specified by
+// yaml_emitter_set_output().
+// @param[in] buffer The buffer with bytes to be written.
+// @param[in] size The size of the buffer.
//
-// @returns On success, the handler should return @c 1. If the handler failed,
-// the returned value should be @c 0.
+// @returns On success, the handler should return @c 1. If the handler failed,
+// the returned value should be @c 0.
type yaml_write_handler_t func(emitter *yaml_emitter_t, buffer []byte) error
type yaml_emitter_state_t int
diff --git a/vendor/gocloud.dev/aws/aws.go b/vendor/gocloud.dev/aws/aws.go
index d70bec5291..df6f065cd1 100644
--- a/vendor/gocloud.dev/aws/aws.go
+++ b/vendor/gocloud.dev/aws/aws.go
@@ -26,6 +26,8 @@ import (
"github.com/aws/aws-sdk-go-v2/aws/ratelimit"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/config"
+ "github.com/aws/aws-sdk-go-v2/credentials/stscreds"
+ "github.com/aws/aws-sdk-go-v2/service/sts"
)
const (
@@ -78,6 +80,7 @@ func NewDefaultV2Config(ctx context.Context) (aws.Config, error) {
// - region: The AWS region for requests; sets WithRegion.
// - anonymous: A value of "true" forces use of anonymous credentials.
// - profile: The shared config profile to use; sets SharedConfigProfile.
+// - role: An IAM role ARN to assume via STS.
// - endpoint: The AWS service endpoint to send HTTP request.
// - hostname_immutable: Make the hostname immutable, only works if endpoint is also set.
// - dualstack: A value of "true" enables dual stack (IPv4 and IPv6) endpoints.
@@ -137,6 +140,22 @@ func V2ConfigFromURLParams(ctx context.Context, q url.Values) (aws.Config, error
if anon {
opts = append(opts, config.WithCredentialsProvider(aws.AnonymousCredentials{}))
}
+ case "role":
+ if !strings.HasPrefix(value, "arn:") {
+ return aws.Config{}, fmt.Errorf("invalid value for role: must be a valid ARN (starts with 'arn:'): %s", value)
+ }
+ baseConfig, err := config.LoadDefaultConfig(ctx, opts...)
+ if err != nil {
+ return aws.Config{}, fmt.Errorf("failed to load default AWS config: %w", err)
+ }
+ stsClient := sts.NewFromConfig(baseConfig)
+ provider := stscreds.NewAssumeRoleProvider(stsClient, value)
+ opts = []func(*config.LoadOptions) error{
+ config.WithCredentialsProvider(provider),
+ }
+ if baseConfig.Region != "" {
+ opts = append(opts, config.WithRegion(baseConfig.Region))
+ }
case requestChecksumCalculationParamKey:
value, err := parseRequestChecksumCalculation(value)
if err != nil {
diff --git a/vendor/gocloud.dev/docstore/doc.go b/vendor/gocloud.dev/docstore/doc.go
index 485c075879..9fb5617bf4 100644
--- a/vendor/gocloud.dev/docstore/doc.go
+++ b/vendor/gocloud.dev/docstore/doc.go
@@ -246,12 +246,12 @@
//
// The errors returned from this package can be inspected in several ways:
//
-// The Code function from https://gocloud.dev/gcerrors will return an error code, also
-// defined in that package, when invoked on an error.
+// The Code function from gocloud.dev/gcerrors will return an error code, also
+// defined in that package, when invoked on an error. Alternatively, errors.Is
+// can be used with the code-specific errors from the same package (e.g., ErrInternal).
//
-// The Collection.ErrorAs method can retrieve the underlying driver error from
-// the returned error. See the specific driver's package doc for the supported
-// types.
+// The Collection.ErrorAs method can retrieve the driver error underlying the returned
+// error. Alternatively, errors.As can be used in the same way.
//
// # OpenTelemetry Integration
//
diff --git a/vendor/gocloud.dev/docstore/docstore.go b/vendor/gocloud.dev/docstore/docstore.go
index 617b3e0e42..812d67c47b 100644
--- a/vendor/gocloud.dev/docstore/docstore.go
+++ b/vendor/gocloud.dev/docstore/docstore.go
@@ -296,16 +296,13 @@ func (e ActionListError) Error() string {
return strings.Join(s, "; ")
}
-// Unwrap returns the error in e, if there is exactly one. If there is more than one
-// error, Unwrap returns nil, since there is no way to determine which should be
-// returned.
-func (e ActionListError) Unwrap() error {
- if len(e) == 1 {
- return e[0].Err
- }
- // Return nil when e is nil, or has more than one error.
- // When there are multiple errors, it doesn't make sense to return any of them.
- return nil
+// Unwrap returns all underlying errors from e.
+func (e ActionListError) Unwrap() []error {
+ errs := []error{}
+ for _, err := range e {
+ errs = append(errs, err.Err)
+ }
+ return errs
}
// BeforeDo takes a callback function that will be called before the ActionList is
@@ -558,55 +555,37 @@ func (a *Action) String() string {
// Create is a convenience for building and running a single-element action list.
// See ActionList.Create.
func (c *Collection) Create(ctx context.Context, doc Document) error {
- if err := c.Actions().Create(doc).Do(ctx); err != nil {
- return err.(ActionListError).Unwrap()
- }
- return nil
+ return c.Actions().Create(doc).Do(ctx)
}
// Replace is a convenience for building and running a single-element action list.
// See ActionList.Replace.
func (c *Collection) Replace(ctx context.Context, doc Document) error {
- if err := c.Actions().Replace(doc).Do(ctx); err != nil {
- return err.(ActionListError).Unwrap()
- }
- return nil
+ return c.Actions().Replace(doc).Do(ctx)
}
// Put is a convenience for building and running a single-element action list.
// See ActionList.Put.
func (c *Collection) Put(ctx context.Context, doc Document) error {
- if err := c.Actions().Put(doc).Do(ctx); err != nil {
- return err.(ActionListError).Unwrap()
- }
- return nil
+ return c.Actions().Put(doc).Do(ctx)
}
// Delete is a convenience for building and running a single-element action list.
// See ActionList.Delete.
func (c *Collection) Delete(ctx context.Context, doc Document) error {
- if err := c.Actions().Delete(doc).Do(ctx); err != nil {
- return err.(ActionListError).Unwrap()
- }
- return nil
+ return c.Actions().Delete(doc).Do(ctx)
}
// Get is a convenience for building and running a single-element action list.
// See ActionList.Get.
func (c *Collection) Get(ctx context.Context, doc Document, fps ...FieldPath) error {
- if err := c.Actions().Get(doc, fps...).Do(ctx); err != nil {
- return err.(ActionListError).Unwrap()
- }
- return nil
+ return c.Actions().Get(doc, fps...).Do(ctx)
}
// Update is a convenience for building and running a single-element action list.
// See ActionList.Update.
func (c *Collection) Update(ctx context.Context, doc Document, mods Mods) error {
- if err := c.Actions().Update(doc, mods).Do(ctx); err != nil {
- return err.(ActionListError).Unwrap()
- }
- return nil
+ return c.Actions().Update(doc, mods).Do(ctx)
}
func parseFieldPath(fp FieldPath) ([]string, error) {
diff --git a/vendor/gocloud.dev/docstore/gcpfirestore/fs.go b/vendor/gocloud.dev/docstore/gcpfirestore/fs.go
index 493d2ab882..05482c6c16 100644
--- a/vendor/gocloud.dev/docstore/gcpfirestore/fs.go
+++ b/vendor/gocloud.dev/docstore/gcpfirestore/fs.go
@@ -43,7 +43,7 @@
// - ActionList.BeforeDo: *pb.BatchGetDocumentsRequest or *pb.CommitRequest.
// - Query.BeforeQuery: *pb.RunQueryRequest
// - DocumentIterator: firestore.Firestore_RunQueryClient
-// - Error: *google.golang.org/grpc/status.Status
+// - Error: *google.golang.org/grpc/status.Status (note: does not work with errors.As, because it's not an error)
//
// # Queries
//
diff --git a/vendor/gocloud.dev/gcerrors/errors.go b/vendor/gocloud.dev/gcerrors/errors.go
index 2b5bd4141d..5e0c6252c5 100644
--- a/vendor/gocloud.dev/gcerrors/errors.go
+++ b/vendor/gocloud.dev/gcerrors/errors.go
@@ -41,7 +41,7 @@ const (
// AlreadyExists means that the resource exists, but it should not.
AlreadyExists ErrorCode = gcerr.AlreadyExists
- // InvalidArguments means that a value given to a Go CDK API is incorrect.
+ // InvalidArgument means that a value given to a Go CDK API is incorrect.
InvalidArgument ErrorCode = gcerr.InvalidArgument
// Internal means that something unexpected happened. Internal errors always indicate
@@ -68,6 +68,43 @@ const (
DeadlineExceeded ErrorCode = gcerr.DeadlineExceeded
)
+var (
+ // ErrUnknown means that the error could not be categorized.
+ ErrUnknown = gcerr.ErrUnknown
+
+ // ErrNotFound means that the resource was not found.
+ ErrNotFound = gcerr.ErrNotFound
+
+ // ErrAlreadyExists means that the resource exists, but it should not.
+ ErrAlreadyExists = gcerr.ErrAlreadyExists
+
+ // ErrInvalidArgument means that a value given to a Go CDK API is incorrect.
+ ErrInvalidArgument = gcerr.ErrInvalidArgument
+
+ // ErrInternal means that something unexpected happened. Internal errors always indicate
+ // bugs in the Go CDK (or possibly the underlying service).
+ ErrInternal = gcerr.ErrInternal
+
+ // ErrUnimplemented means that the feature is not implemented.
+ ErrUnimplemented = gcerr.ErrUnimplemented
+
+ // ErrFailedPrecondition means that the system was in the wrong state.
+ ErrFailedPrecondition = gcerr.ErrFailedPrecondition
+
+ // ErrPermissionDenied means that the caller does not have permission to execute the specified operation.
+ ErrPermissionDenied = gcerr.ErrPermissionDenied
+
+ // ErrResourceExhausted means that some resource has been exhausted, typically because a service resource limit
+ // has been reached.
+ ErrResourceExhausted = gcerr.ErrResourceExhausted
+
+ // ErrCanceled means that the operation was canceled.
+ ErrCanceled = gcerr.ErrCanceled
+
+ // ErrDeadlinedExceeded means that the operation timed out.
+ ErrDeadlineExceeded = gcerr.ErrDeadlineExceeded
+)
+
// Code returns the ErrorCode of err if it, or some error it wraps, is an *Error.
// If err is context.Canceled or context.DeadlineExceeded, or wraps one of those errors,
// it returns the Canceled or DeadlineExceeded codes, respectively.
diff --git a/vendor/gocloud.dev/internal/gcerr/gcerr.go b/vendor/gocloud.dev/internal/gcerr/gcerr.go
index 263846827e..e780577f11 100644
--- a/vendor/gocloud.dev/internal/gcerr/gcerr.go
+++ b/vendor/gocloud.dev/internal/gcerr/gcerr.go
@@ -45,7 +45,7 @@ const (
// AlreadyExists means that the resource exists, but it should not.
AlreadyExists ErrorCode = 3
- // InvalidArguments means that a value given to a Go CDK API is incorrect.
+ // InvalidArgument means that a value given to a Go CDK API is incorrect.
InvalidArgument ErrorCode = 4
// Internal means that something unexpected happened. Internal errors always indicate
@@ -72,11 +72,50 @@ const (
DeadlineExceeded ErrorCode = 11
)
-// When adding a new error code, try to use the names defined in google.golang.org/grpc/codes.
+var (
+ // ErrUnknown means that the error could not be categorized.
+ ErrUnknown = errors.New("Unknown")
+
+ // ErrNotFound means that the resource was not found.
+ ErrNotFound = errors.New("NotFound")
+
+ // ErrAlreadyExists means that the resource exists, but it should not.
+ ErrAlreadyExists = errors.New("AlreadyExists")
+
+ // ErrInvalidArgument means that a value given to a Go CDK API is incorrect.
+ ErrInvalidArgument = errors.New("InvalidArgument")
+
+ // ErrInternal means that something unexpected happened. Internal errors always indicate
+ // bugs in the Go CDK (or possibly the underlying service).
+ ErrInternal = errors.New("Internal")
+
+ // ErrUnimplemented means that the feature is not implemented.
+ ErrUnimplemented = errors.New("Unimplemented")
+
+ // ErrFailedPrecondition means that the system was in the wrong state.
+ ErrFailedPrecondition = errors.New("FailedPrecondition")
-// Do not change the numbers assigned to codes: past values may be stored in metric databases.
+ // ErrPermissionDenied means that the caller does not have permission to execute the specified operation.
+ ErrPermissionDenied = errors.New("PermissionDenied")
+
+ // ErrResourceExhausted means that some resource has been exhausted, typically because a service resource limit
+ // has been reached.
+ ErrResourceExhausted = errors.New("ResourceExhausted")
-// Call "go generate" whenever you change the above list of error codes.
+ // ErrCanceled means that the operation was canceled.
+ ErrCanceled = errors.New("Canceled")
+
+ // ErrDeadlineExceeded means that The operation timed out.
+ ErrDeadlineExceeded = errors.New("DeadlineExceeded")
+)
+
+// When adding a new error code, try to use the names defined in google.golang.org/grpc/codes.
+
+// * Do not change the numbers assigned to codes: past values may be stored in metric databases.
+// * Add a typed error struct to match (e.g., ErrInternal).
+// * Add aliases for the error code and typed error to the public gcerrors package.
+// * Call "go generate" whenever you change the above list of error codes.
+//
// To get stringer:
// go get golang.org/x/tools/cmd/stringer
// Make sure $GOPATH/bin or $GOBIN in on your path.
@@ -114,8 +153,37 @@ func (e *Error) FormatError(p xerrors.Printer) (next error) {
}
// Unwrap returns the error underlying the receiver, which may be nil.
-func (e *Error) Unwrap() error {
- return e.err
+func (e *Error) Unwrap() []error {
+ errs := []error{e.err}
+ var coded error
+ switch e.Code {
+ case Unknown:
+ coded = ErrUnknown
+ case NotFound:
+ coded = ErrNotFound
+ case AlreadyExists:
+ coded = ErrAlreadyExists
+ case InvalidArgument:
+ coded = ErrInvalidArgument
+ case Internal:
+ coded = ErrInternal
+ case Unimplemented:
+ coded = ErrUnimplemented
+ case FailedPrecondition:
+ coded = ErrFailedPrecondition
+ case PermissionDenied:
+ coded = ErrPermissionDenied
+ case ResourceExhausted:
+ coded = ErrResourceExhausted
+ case Canceled:
+ coded = ErrCanceled
+ case DeadlineExceeded:
+ coded = ErrDeadlineExceeded
+ }
+ if coded != nil {
+ errs = append(errs, coded)
+ }
+ return errs
}
// New returns a new error with the given code, underlying error and message. Pass 1
@@ -199,7 +267,7 @@ func ErrorAs(err error, target any, errorAs func(error, any) bool) bool {
panic("ErrorAs target must be a non-nil pointer")
}
if e, ok := err.(*Error); ok {
- err = e.Unwrap()
+ err = e.Unwrap()[0] // return the real error, ignore the possible coded one
}
return errorAs(err, target)
}
diff --git a/vendor/gocloud.dev/internal/useragent/useragent.go b/vendor/gocloud.dev/internal/useragent/useragent.go
index 6f789bbb59..d5a0315eca 100644
--- a/vendor/gocloud.dev/internal/useragent/useragent.go
+++ b/vendor/gocloud.dev/internal/useragent/useragent.go
@@ -27,7 +27,7 @@ import (
const (
prefix = "go-cloud"
- version = "0.45.0"
+ version = "0.46.0"
)
// ClientOption returns an option.ClientOption that sets a Go CDK User-Agent.
diff --git a/vendor/gocloud.dev/pubsub/pubsub.go b/vendor/gocloud.dev/pubsub/pubsub.go
index 6fd49fd1b2..4cb38569f1 100644
--- a/vendor/gocloud.dev/pubsub/pubsub.go
+++ b/vendor/gocloud.dev/pubsub/pubsub.go
@@ -38,6 +38,17 @@
// - For some drivers, Nack is not supported and will panic; you can call
// Message.Nackable to see.
//
+// # Errors
+//
+// The errors returned from this package can be inspected in several ways:
+//
+// The Code function from gocloud.dev/gcerrors will return an error code, also
+// defined in that package, when invoked on an error. Alternatively, errors.Is
+// can be used with the code-specific errors from the same package (e.g., ErrInternal).
+//
+// The Topic/Subscription.ErrorAs methods can retrieve the driver error underlying the returned
+// error. Alternatively, errors.As can be used in the same way.
+//
// # OpenTelemetry Integration.
//
// OpenTelemetry supports tracing and metric collection for multiple languages and
@@ -493,19 +504,18 @@ func (s *Subscription) updateBatchSize() int {
//
// Receive retries retryable errors from the underlying driver forever.
// Therefore, if Receive returns an error, either:
-// 1. It is a non-retryable error from the underlying driver, either from
-//
-// an attempt to fetch more messages or from an attempt to ack messages.
-// Operator intervention may be required (e.g., invalid resource, quota
-// error, etc.). Receive will return the same error from then on, so the
-// application should log the error and either recreate the Subscription,
-// or exit.
-//
-// 2. The provided ctx is Done. Error() on the returned error will include both
//
-// the ctx error and the underlying driver error, and ErrorAs on it
-// can access the underlying driver error type if needed. Receive may
-// be called again with a fresh ctx.
+// 1. It is a non-retryable error from the underlying driver, either from
+// an attempt to fetch more messages or from an attempt to ack messages.
+// Operator intervention may be required (e.g., invalid resource, quota
+// error, etc.). Receive will return the same error from then on, so the
+// application should log the error and either recreate the Subscription,
+// or exit.
+//
+// 2. The provided ctx is Done. Error() on the returned error will include both
+// the ctx error and the underlying driver error, and ErrorAs on it
+// can access the underlying driver error type if needed. Receive may
+// be called again with a fresh ctx.
//
// Callers can distinguish between the two by checking if the ctx they passed
// is Done, or via xerrors.Is(err, context.DeadlineExceeded or context.Canceled)
diff --git a/vendor/golang.org/x/crypto/argon2/argon2.go b/vendor/golang.org/x/crypto/argon2/argon2.go
new file mode 100644
index 0000000000..57ab8371cb
--- /dev/null
+++ b/vendor/golang.org/x/crypto/argon2/argon2.go
@@ -0,0 +1,288 @@
+// 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 argon2 implements the key derivation function Argon2.
+// Argon2 was selected as the winner of the Password Hashing Competition and can
+// be used to derive cryptographic keys from passwords.
+//
+// For a detailed specification of Argon2 see [argon2-specs.pdf].
+//
+// If you aren't sure which function you need, use Argon2id (IDKey) and
+// the parameter recommendations for your scenario.
+//
+// # Argon2i
+//
+// Argon2i (implemented by Key) is the side-channel resistant version of Argon2.
+// It uses data-independent memory access, which is preferred for password
+// hashing and password-based key derivation. Argon2i requires more passes over
+// memory than Argon2id to protect from trade-off attacks. The recommended
+// parameters (taken from [RFC 9106 Section 7.3]) for non-interactive
+// operations are time=3 and to use the maximum available memory.
+//
+// # Argon2id
+//
+// Argon2id (implemented by IDKey) is a hybrid version of Argon2 combining
+// Argon2i and Argon2d. It uses data-independent memory access for the first
+// half of the first iteration over the memory and data-dependent memory access
+// for the rest. Argon2id is side-channel resistant and provides better brute-
+// force cost savings due to time-memory tradeoffs than Argon2i. [RFC 9106
+// Section 4] recommends time=1, memory=2*1024*1024 KiB (2 GiB), and threads=4
+// as the first recommended option. If much less memory is available, it
+// recommends time=3, memory=64*1024 KiB (64 MiB), and threads=4 as the second
+// recommended option.
+//
+// [argon2-specs.pdf]: https://github.com/P-H-C/phc-winner-argon2/blob/master/argon2-specs.pdf
+// [RFC 9106 Section 4]: https://www.rfc-editor.org/rfc/rfc9106.html#section-4
+// [RFC 9106 Section 7.3]: https://www.rfc-editor.org/rfc/rfc9106.html#section-7.3
+package argon2
+
+import (
+ "encoding/binary"
+ "sync"
+
+ "golang.org/x/crypto/blake2b"
+)
+
+// The Argon2 version implemented by this package.
+const Version = 0x13
+
+const (
+ argon2d = iota
+ argon2i
+ argon2id
+)
+
+// Key derives a key from the password, salt, and cost parameters using Argon2i
+// returning a byte slice of length keyLen that can be used as cryptographic
+// key. The CPU cost and parallelism degree must be greater than zero.
+//
+// For example, you can get a derived key for e.g. AES-256 (which needs a
+// 32-byte key) by doing:
+//
+// key := argon2.Key([]byte("some password"), salt, 3, 32*1024, 4, 32)
+//
+// The example above uses time=3 and memory=32*1024. Argon2i generally
+// requires more passes over memory than Argon2id. If in doubt, prefer IDKey
+// and its Argon2id parameter recommendations.
+//
+// The time parameter specifies the number of passes over the memory and the
+// memory parameter specifies the size of the memory in KiB. For example
+// memory=32*1024 sets the memory cost to ~32 MB. The number of threads can be
+// adjusted to the number of available CPUs. The cost parameters should be
+// increased as memory latency and CPU parallelism increases. Remember to get a
+// good random salt.
+func Key(password, salt []byte, time, memory uint32, threads uint8, keyLen uint32) []byte {
+ return deriveKey(argon2i, password, salt, nil, nil, time, memory, threads, keyLen)
+}
+
+// IDKey derives a key from the password, salt, and cost parameters using
+// Argon2id returning a byte slice of length keyLen that can be used as
+// cryptographic key. The CPU cost and parallelism degree must be greater than
+// zero.
+//
+// For example, you can get a derived key for e.g. AES-256 (which needs a
+// 32-byte key) by doing:
+//
+// key := argon2.IDKey([]byte("some password"), salt, 1, 2*1024*1024, 4, 32)
+//
+// The example above uses the first [RFC 9106 Section 4] recommended option.
+// If much less memory is available, the second recommended option is time=3,
+// memory=64*1024 KiB (64 MiB), and threads=4.
+//
+// The time parameter specifies the number of passes over the memory and the
+// memory parameter specifies the size of the memory in KiB. For example
+// memory=2*1024*1024 sets the memory cost to ~2 GiB. The number of threads can
+// be adjusted to the numbers of available CPUs. The cost parameters should be
+// increased as memory latency and CPU parallelism increases. Remember to get a
+// good random salt.
+//
+// [RFC 9106 Section 4]: https://www.rfc-editor.org/rfc/rfc9106.html#section-4
+func IDKey(password, salt []byte, time, memory uint32, threads uint8, keyLen uint32) []byte {
+ return deriveKey(argon2id, password, salt, nil, nil, time, memory, threads, keyLen)
+}
+
+func deriveKey(mode int, password, salt, secret, data []byte, time, memory uint32, threads uint8, keyLen uint32) []byte {
+ if time < 1 {
+ panic("argon2: number of rounds too small")
+ }
+ if threads < 1 {
+ panic("argon2: parallelism degree too low")
+ }
+ h0 := initHash(password, salt, secret, data, time, memory, uint32(threads), keyLen, mode)
+
+ memory = memory / (syncPoints * uint32(threads)) * (syncPoints * uint32(threads))
+ if memory < 2*syncPoints*uint32(threads) {
+ memory = 2 * syncPoints * uint32(threads)
+ }
+ B := initBlocks(&h0, memory, uint32(threads))
+ processBlocks(B, time, memory, uint32(threads), mode)
+ return extractKey(B, memory, uint32(threads), keyLen)
+}
+
+const (
+ blockLength = 128
+ syncPoints = 4
+)
+
+type block [blockLength]uint64
+
+func initHash(password, salt, key, data []byte, time, memory, threads, keyLen uint32, mode int) [blake2b.Size + 8]byte {
+ var (
+ h0 [blake2b.Size + 8]byte
+ params [24]byte
+ tmp [4]byte
+ )
+
+ b2, _ := blake2b.New512(nil)
+ binary.LittleEndian.PutUint32(params[0:4], threads)
+ binary.LittleEndian.PutUint32(params[4:8], keyLen)
+ binary.LittleEndian.PutUint32(params[8:12], memory)
+ binary.LittleEndian.PutUint32(params[12:16], time)
+ binary.LittleEndian.PutUint32(params[16:20], uint32(Version))
+ binary.LittleEndian.PutUint32(params[20:24], uint32(mode))
+ b2.Write(params[:])
+ binary.LittleEndian.PutUint32(tmp[:], uint32(len(password)))
+ b2.Write(tmp[:])
+ b2.Write(password)
+ binary.LittleEndian.PutUint32(tmp[:], uint32(len(salt)))
+ b2.Write(tmp[:])
+ b2.Write(salt)
+ binary.LittleEndian.PutUint32(tmp[:], uint32(len(key)))
+ b2.Write(tmp[:])
+ b2.Write(key)
+ binary.LittleEndian.PutUint32(tmp[:], uint32(len(data)))
+ b2.Write(tmp[:])
+ b2.Write(data)
+ b2.Sum(h0[:0])
+ return h0
+}
+
+func initBlocks(h0 *[blake2b.Size + 8]byte, memory, threads uint32) []block {
+ var block0 [1024]byte
+ B := make([]block, memory)
+ for lane := uint32(0); lane < threads; lane++ {
+ j := lane * (memory / threads)
+ binary.LittleEndian.PutUint32(h0[blake2b.Size+4:], lane)
+
+ binary.LittleEndian.PutUint32(h0[blake2b.Size:], 0)
+ blake2bHash(block0[:], h0[:])
+ for i := range B[j+0] {
+ B[j+0][i] = binary.LittleEndian.Uint64(block0[i*8:])
+ }
+
+ binary.LittleEndian.PutUint32(h0[blake2b.Size:], 1)
+ blake2bHash(block0[:], h0[:])
+ for i := range B[j+1] {
+ B[j+1][i] = binary.LittleEndian.Uint64(block0[i*8:])
+ }
+ }
+ return B
+}
+
+func processBlocks(B []block, time, memory, threads uint32, mode int) {
+ lanes := memory / threads
+ segments := lanes / syncPoints
+
+ processSegment := func(n, slice, lane uint32, wg *sync.WaitGroup) {
+ var addresses, in, zero block
+ if mode == argon2i || (mode == argon2id && n == 0 && slice < syncPoints/2) {
+ in[0] = uint64(n)
+ in[1] = uint64(lane)
+ in[2] = uint64(slice)
+ in[3] = uint64(memory)
+ in[4] = uint64(time)
+ in[5] = uint64(mode)
+ }
+
+ index := uint32(0)
+ if n == 0 && slice == 0 {
+ index = 2 // we have already generated the first two blocks
+ if mode == argon2i || mode == argon2id {
+ in[6]++
+ processBlock(&addresses, &in, &zero)
+ processBlock(&addresses, &addresses, &zero)
+ }
+ }
+
+ offset := lane*lanes + slice*segments + index
+ var random uint64
+ for index < segments {
+ prev := offset - 1
+ if index == 0 && slice == 0 {
+ prev += lanes // last block in lane
+ }
+ if mode == argon2i || (mode == argon2id && n == 0 && slice < syncPoints/2) {
+ if index%blockLength == 0 {
+ in[6]++
+ processBlock(&addresses, &in, &zero)
+ processBlock(&addresses, &addresses, &zero)
+ }
+ random = addresses[index%blockLength]
+ } else {
+ random = B[prev][0]
+ }
+ newOffset := indexAlpha(random, lanes, segments, threads, n, slice, lane, index)
+ processBlockXOR(&B[offset], &B[prev], &B[newOffset])
+ index, offset = index+1, offset+1
+ }
+ wg.Done()
+ }
+
+ for n := uint32(0); n < time; n++ {
+ for slice := uint32(0); slice < syncPoints; slice++ {
+ var wg sync.WaitGroup
+ for lane := uint32(0); lane < threads; lane++ {
+ wg.Add(1)
+ go processSegment(n, slice, lane, &wg)
+ }
+ wg.Wait()
+ }
+ }
+
+}
+
+func extractKey(B []block, memory, threads, keyLen uint32) []byte {
+ lanes := memory / threads
+ for lane := uint32(0); lane < threads-1; lane++ {
+ for i, v := range B[(lane*lanes)+lanes-1] {
+ B[memory-1][i] ^= v
+ }
+ }
+
+ var block [1024]byte
+ for i, v := range B[memory-1] {
+ binary.LittleEndian.PutUint64(block[i*8:], v)
+ }
+ key := make([]byte, keyLen)
+ blake2bHash(key, block[:])
+ return key
+}
+
+func indexAlpha(rand uint64, lanes, segments, threads, n, slice, lane, index uint32) uint32 {
+ refLane := uint32(rand>>32) % threads
+ if n == 0 && slice == 0 {
+ refLane = lane
+ }
+ m, s := 3*segments, ((slice+1)%syncPoints)*segments
+ if lane == refLane {
+ m += index
+ }
+ if n == 0 {
+ m, s = slice*segments, 0
+ if slice == 0 || lane == refLane {
+ m += index
+ }
+ }
+ if index == 0 || lane == refLane {
+ m--
+ }
+ return phi(rand, uint64(m), uint64(s), refLane, lanes)
+}
+
+func phi(rand, m, s uint64, lane, lanes uint32) uint32 {
+ p := rand & 0xFFFFFFFF
+ p = (p * p) >> 32
+ p = (p * m) >> 32
+ return lane*lanes + uint32((s+m-(p+1))%uint64(lanes))
+}
diff --git a/vendor/golang.org/x/crypto/argon2/blake2b.go b/vendor/golang.org/x/crypto/argon2/blake2b.go
new file mode 100644
index 0000000000..10f46948dc
--- /dev/null
+++ b/vendor/golang.org/x/crypto/argon2/blake2b.go
@@ -0,0 +1,53 @@
+// 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 argon2
+
+import (
+ "encoding/binary"
+ "hash"
+
+ "golang.org/x/crypto/blake2b"
+)
+
+// blake2bHash computes an arbitrary long hash value of in
+// and writes the hash to out.
+func blake2bHash(out []byte, in []byte) {
+ var b2 hash.Hash
+ if n := len(out); n < blake2b.Size {
+ b2, _ = blake2b.New(n, nil)
+ } else {
+ b2, _ = blake2b.New512(nil)
+ }
+
+ var buffer [blake2b.Size]byte
+ binary.LittleEndian.PutUint32(buffer[:4], uint32(len(out)))
+ b2.Write(buffer[:4])
+ b2.Write(in)
+
+ if len(out) <= blake2b.Size {
+ b2.Sum(out[:0])
+ return
+ }
+
+ outLen := len(out)
+ b2.Sum(buffer[:0])
+ b2.Reset()
+ copy(out, buffer[:32])
+ out = out[32:]
+ for len(out) > blake2b.Size {
+ b2.Write(buffer[:])
+ b2.Sum(buffer[:0])
+ copy(out, buffer[:32])
+ out = out[32:]
+ b2.Reset()
+ }
+
+ if outLen%blake2b.Size > 0 { // outLen > 64
+ r := ((outLen + 31) / 32) - 2 // ⌈τ /32⌉-2
+ b2, _ = blake2b.New(outLen-32*r, nil)
+ }
+ b2.Write(buffer[:])
+ b2.Sum(out[:0])
+}
diff --git a/vendor/golang.org/x/crypto/argon2/blamka_amd64.go b/vendor/golang.org/x/crypto/argon2/blamka_amd64.go
new file mode 100644
index 0000000000..063e7784f8
--- /dev/null
+++ b/vendor/golang.org/x/crypto/argon2/blamka_amd64.go
@@ -0,0 +1,60 @@
+// 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.
+
+//go:build amd64 && gc && !purego
+
+package argon2
+
+import "golang.org/x/sys/cpu"
+
+func init() {
+ useSSE4 = cpu.X86.HasSSE41
+}
+
+//go:noescape
+func mixBlocksSSE2(out, a, b, c *block)
+
+//go:noescape
+func xorBlocksSSE2(out, a, b, c *block)
+
+//go:noescape
+func blamkaSSE4(b *block)
+
+func processBlockSSE(out, in1, in2 *block, xor bool) {
+ var t block
+ mixBlocksSSE2(&t, in1, in2, &t)
+ if useSSE4 {
+ blamkaSSE4(&t)
+ } else {
+ for i := 0; i < blockLength; i += 16 {
+ blamkaGeneric(
+ &t[i+0], &t[i+1], &t[i+2], &t[i+3],
+ &t[i+4], &t[i+5], &t[i+6], &t[i+7],
+ &t[i+8], &t[i+9], &t[i+10], &t[i+11],
+ &t[i+12], &t[i+13], &t[i+14], &t[i+15],
+ )
+ }
+ for i := 0; i < blockLength/8; i += 2 {
+ blamkaGeneric(
+ &t[i], &t[i+1], &t[16+i], &t[16+i+1],
+ &t[32+i], &t[32+i+1], &t[48+i], &t[48+i+1],
+ &t[64+i], &t[64+i+1], &t[80+i], &t[80+i+1],
+ &t[96+i], &t[96+i+1], &t[112+i], &t[112+i+1],
+ )
+ }
+ }
+ if xor {
+ xorBlocksSSE2(out, in1, in2, &t)
+ } else {
+ mixBlocksSSE2(out, in1, in2, &t)
+ }
+}
+
+func processBlock(out, in1, in2 *block) {
+ processBlockSSE(out, in1, in2, false)
+}
+
+func processBlockXOR(out, in1, in2 *block) {
+ processBlockSSE(out, in1, in2, true)
+}
diff --git a/vendor/golang.org/x/crypto/argon2/blamka_amd64.s b/vendor/golang.org/x/crypto/argon2/blamka_amd64.s
new file mode 100644
index 0000000000..c3895478ed
--- /dev/null
+++ b/vendor/golang.org/x/crypto/argon2/blamka_amd64.s
@@ -0,0 +1,2791 @@
+// Code generated by command: go run blamka_amd64.go -out ../blamka_amd64.s -pkg argon2. DO NOT EDIT.
+
+//go:build amd64 && gc && !purego
+
+#include "textflag.h"
+
+// func blamkaSSE4(b *block)
+// Requires: SSE2, SSSE3
+TEXT ·blamkaSSE4(SB), NOSPLIT, $0-8
+ MOVQ b+0(FP), AX
+ MOVOU ·c40<>+0(SB), X10
+ MOVOU ·c48<>+0(SB), X11
+ MOVOU (AX), X0
+ MOVOU 16(AX), X1
+ MOVOU 32(AX), X2
+ MOVOU 48(AX), X3
+ MOVOU 64(AX), X4
+ MOVOU 80(AX), X5
+ MOVOU 96(AX), X6
+ MOVOU 112(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, (AX)
+ MOVOU X1, 16(AX)
+ MOVOU X2, 32(AX)
+ MOVOU X3, 48(AX)
+ MOVOU X4, 64(AX)
+ MOVOU X5, 80(AX)
+ MOVOU X6, 96(AX)
+ MOVOU X7, 112(AX)
+ MOVOU 128(AX), X0
+ MOVOU 144(AX), X1
+ MOVOU 160(AX), X2
+ MOVOU 176(AX), X3
+ MOVOU 192(AX), X4
+ MOVOU 208(AX), X5
+ MOVOU 224(AX), X6
+ MOVOU 240(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 128(AX)
+ MOVOU X1, 144(AX)
+ MOVOU X2, 160(AX)
+ MOVOU X3, 176(AX)
+ MOVOU X4, 192(AX)
+ MOVOU X5, 208(AX)
+ MOVOU X6, 224(AX)
+ MOVOU X7, 240(AX)
+ MOVOU 256(AX), X0
+ MOVOU 272(AX), X1
+ MOVOU 288(AX), X2
+ MOVOU 304(AX), X3
+ MOVOU 320(AX), X4
+ MOVOU 336(AX), X5
+ MOVOU 352(AX), X6
+ MOVOU 368(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 256(AX)
+ MOVOU X1, 272(AX)
+ MOVOU X2, 288(AX)
+ MOVOU X3, 304(AX)
+ MOVOU X4, 320(AX)
+ MOVOU X5, 336(AX)
+ MOVOU X6, 352(AX)
+ MOVOU X7, 368(AX)
+ MOVOU 384(AX), X0
+ MOVOU 400(AX), X1
+ MOVOU 416(AX), X2
+ MOVOU 432(AX), X3
+ MOVOU 448(AX), X4
+ MOVOU 464(AX), X5
+ MOVOU 480(AX), X6
+ MOVOU 496(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 384(AX)
+ MOVOU X1, 400(AX)
+ MOVOU X2, 416(AX)
+ MOVOU X3, 432(AX)
+ MOVOU X4, 448(AX)
+ MOVOU X5, 464(AX)
+ MOVOU X6, 480(AX)
+ MOVOU X7, 496(AX)
+ MOVOU 512(AX), X0
+ MOVOU 528(AX), X1
+ MOVOU 544(AX), X2
+ MOVOU 560(AX), X3
+ MOVOU 576(AX), X4
+ MOVOU 592(AX), X5
+ MOVOU 608(AX), X6
+ MOVOU 624(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 512(AX)
+ MOVOU X1, 528(AX)
+ MOVOU X2, 544(AX)
+ MOVOU X3, 560(AX)
+ MOVOU X4, 576(AX)
+ MOVOU X5, 592(AX)
+ MOVOU X6, 608(AX)
+ MOVOU X7, 624(AX)
+ MOVOU 640(AX), X0
+ MOVOU 656(AX), X1
+ MOVOU 672(AX), X2
+ MOVOU 688(AX), X3
+ MOVOU 704(AX), X4
+ MOVOU 720(AX), X5
+ MOVOU 736(AX), X6
+ MOVOU 752(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 640(AX)
+ MOVOU X1, 656(AX)
+ MOVOU X2, 672(AX)
+ MOVOU X3, 688(AX)
+ MOVOU X4, 704(AX)
+ MOVOU X5, 720(AX)
+ MOVOU X6, 736(AX)
+ MOVOU X7, 752(AX)
+ MOVOU 768(AX), X0
+ MOVOU 784(AX), X1
+ MOVOU 800(AX), X2
+ MOVOU 816(AX), X3
+ MOVOU 832(AX), X4
+ MOVOU 848(AX), X5
+ MOVOU 864(AX), X6
+ MOVOU 880(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 768(AX)
+ MOVOU X1, 784(AX)
+ MOVOU X2, 800(AX)
+ MOVOU X3, 816(AX)
+ MOVOU X4, 832(AX)
+ MOVOU X5, 848(AX)
+ MOVOU X6, 864(AX)
+ MOVOU X7, 880(AX)
+ MOVOU 896(AX), X0
+ MOVOU 912(AX), X1
+ MOVOU 928(AX), X2
+ MOVOU 944(AX), X3
+ MOVOU 960(AX), X4
+ MOVOU 976(AX), X5
+ MOVOU 992(AX), X6
+ MOVOU 1008(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 896(AX)
+ MOVOU X1, 912(AX)
+ MOVOU X2, 928(AX)
+ MOVOU X3, 944(AX)
+ MOVOU X4, 960(AX)
+ MOVOU X5, 976(AX)
+ MOVOU X6, 992(AX)
+ MOVOU X7, 1008(AX)
+ MOVOU (AX), X0
+ MOVOU 128(AX), X1
+ MOVOU 256(AX), X2
+ MOVOU 384(AX), X3
+ MOVOU 512(AX), X4
+ MOVOU 640(AX), X5
+ MOVOU 768(AX), X6
+ MOVOU 896(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, (AX)
+ MOVOU X1, 128(AX)
+ MOVOU X2, 256(AX)
+ MOVOU X3, 384(AX)
+ MOVOU X4, 512(AX)
+ MOVOU X5, 640(AX)
+ MOVOU X6, 768(AX)
+ MOVOU X7, 896(AX)
+ MOVOU 16(AX), X0
+ MOVOU 144(AX), X1
+ MOVOU 272(AX), X2
+ MOVOU 400(AX), X3
+ MOVOU 528(AX), X4
+ MOVOU 656(AX), X5
+ MOVOU 784(AX), X6
+ MOVOU 912(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 16(AX)
+ MOVOU X1, 144(AX)
+ MOVOU X2, 272(AX)
+ MOVOU X3, 400(AX)
+ MOVOU X4, 528(AX)
+ MOVOU X5, 656(AX)
+ MOVOU X6, 784(AX)
+ MOVOU X7, 912(AX)
+ MOVOU 32(AX), X0
+ MOVOU 160(AX), X1
+ MOVOU 288(AX), X2
+ MOVOU 416(AX), X3
+ MOVOU 544(AX), X4
+ MOVOU 672(AX), X5
+ MOVOU 800(AX), X6
+ MOVOU 928(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 32(AX)
+ MOVOU X1, 160(AX)
+ MOVOU X2, 288(AX)
+ MOVOU X3, 416(AX)
+ MOVOU X4, 544(AX)
+ MOVOU X5, 672(AX)
+ MOVOU X6, 800(AX)
+ MOVOU X7, 928(AX)
+ MOVOU 48(AX), X0
+ MOVOU 176(AX), X1
+ MOVOU 304(AX), X2
+ MOVOU 432(AX), X3
+ MOVOU 560(AX), X4
+ MOVOU 688(AX), X5
+ MOVOU 816(AX), X6
+ MOVOU 944(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 48(AX)
+ MOVOU X1, 176(AX)
+ MOVOU X2, 304(AX)
+ MOVOU X3, 432(AX)
+ MOVOU X4, 560(AX)
+ MOVOU X5, 688(AX)
+ MOVOU X6, 816(AX)
+ MOVOU X7, 944(AX)
+ MOVOU 64(AX), X0
+ MOVOU 192(AX), X1
+ MOVOU 320(AX), X2
+ MOVOU 448(AX), X3
+ MOVOU 576(AX), X4
+ MOVOU 704(AX), X5
+ MOVOU 832(AX), X6
+ MOVOU 960(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 64(AX)
+ MOVOU X1, 192(AX)
+ MOVOU X2, 320(AX)
+ MOVOU X3, 448(AX)
+ MOVOU X4, 576(AX)
+ MOVOU X5, 704(AX)
+ MOVOU X6, 832(AX)
+ MOVOU X7, 960(AX)
+ MOVOU 80(AX), X0
+ MOVOU 208(AX), X1
+ MOVOU 336(AX), X2
+ MOVOU 464(AX), X3
+ MOVOU 592(AX), X4
+ MOVOU 720(AX), X5
+ MOVOU 848(AX), X6
+ MOVOU 976(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 80(AX)
+ MOVOU X1, 208(AX)
+ MOVOU X2, 336(AX)
+ MOVOU X3, 464(AX)
+ MOVOU X4, 592(AX)
+ MOVOU X5, 720(AX)
+ MOVOU X6, 848(AX)
+ MOVOU X7, 976(AX)
+ MOVOU 96(AX), X0
+ MOVOU 224(AX), X1
+ MOVOU 352(AX), X2
+ MOVOU 480(AX), X3
+ MOVOU 608(AX), X4
+ MOVOU 736(AX), X5
+ MOVOU 864(AX), X6
+ MOVOU 992(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 96(AX)
+ MOVOU X1, 224(AX)
+ MOVOU X2, 352(AX)
+ MOVOU X3, 480(AX)
+ MOVOU X4, 608(AX)
+ MOVOU X5, 736(AX)
+ MOVOU X6, 864(AX)
+ MOVOU X7, 992(AX)
+ MOVOU 112(AX), X0
+ MOVOU 240(AX), X1
+ MOVOU 368(AX), X2
+ MOVOU 496(AX), X3
+ MOVOU 624(AX), X4
+ MOVOU 752(AX), X5
+ MOVOU 880(AX), X6
+ MOVOU 1008(AX), X7
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X6, X8
+ PUNPCKLQDQ X6, X9
+ PUNPCKHQDQ X7, X6
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X7, X9
+ MOVO X8, X7
+ MOVO X2, X8
+ PUNPCKHQDQ X9, X7
+ PUNPCKLQDQ X3, X9
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X3
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFD $0xb1, X6, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ PSHUFB X10, X2
+ MOVO X0, X8
+ PMULULQ X2, X8
+ PADDQ X2, X0
+ PADDQ X8, X0
+ PADDQ X8, X0
+ PXOR X0, X6
+ PSHUFB X11, X6
+ MOVO X4, X8
+ PMULULQ X6, X8
+ PADDQ X6, X4
+ PADDQ X8, X4
+ PADDQ X8, X4
+ PXOR X4, X2
+ MOVO X2, X8
+ PADDQ X2, X8
+ PSRLQ $0x3f, X2
+ PXOR X8, X2
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFD $0xb1, X7, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ PSHUFB X10, X3
+ MOVO X1, X8
+ PMULULQ X3, X8
+ PADDQ X3, X1
+ PADDQ X8, X1
+ PADDQ X8, X1
+ PXOR X1, X7
+ PSHUFB X11, X7
+ MOVO X5, X8
+ PMULULQ X7, X8
+ PADDQ X7, X5
+ PADDQ X8, X5
+ PADDQ X8, X5
+ PXOR X5, X3
+ MOVO X3, X8
+ PADDQ X3, X8
+ PSRLQ $0x3f, X3
+ PXOR X8, X3
+ MOVO X4, X8
+ MOVO X5, X4
+ MOVO X8, X5
+ MOVO X2, X8
+ PUNPCKLQDQ X2, X9
+ PUNPCKHQDQ X3, X2
+ PUNPCKHQDQ X9, X2
+ PUNPCKLQDQ X3, X9
+ MOVO X8, X3
+ MOVO X6, X8
+ PUNPCKHQDQ X9, X3
+ PUNPCKLQDQ X7, X9
+ PUNPCKHQDQ X9, X6
+ PUNPCKLQDQ X8, X9
+ PUNPCKHQDQ X9, X7
+ MOVOU X0, 112(AX)
+ MOVOU X1, 240(AX)
+ MOVOU X2, 368(AX)
+ MOVOU X3, 496(AX)
+ MOVOU X4, 624(AX)
+ MOVOU X5, 752(AX)
+ MOVOU X6, 880(AX)
+ MOVOU X7, 1008(AX)
+ RET
+
+DATA ·c40<>+0(SB)/8, $0x0201000706050403
+DATA ·c40<>+8(SB)/8, $0x0a09080f0e0d0c0b
+GLOBL ·c40<>(SB), RODATA|NOPTR, $16
+
+DATA ·c48<>+0(SB)/8, $0x0100070605040302
+DATA ·c48<>+8(SB)/8, $0x09080f0e0d0c0b0a
+GLOBL ·c48<>(SB), RODATA|NOPTR, $16
+
+// func mixBlocksSSE2(out *block, a *block, b *block, c *block)
+// Requires: SSE2
+TEXT ·mixBlocksSSE2(SB), NOSPLIT, $0-32
+ MOVQ out+0(FP), DX
+ MOVQ a+8(FP), AX
+ MOVQ b+16(FP), BX
+ MOVQ c+24(FP), CX
+ MOVQ $0x00000080, DI
+
+loop:
+ MOVOU (AX), X0
+ MOVOU (BX), X1
+ MOVOU (CX), X2
+ PXOR X1, X0
+ PXOR X2, X0
+ MOVOU X0, (DX)
+ ADDQ $0x10, AX
+ ADDQ $0x10, BX
+ ADDQ $0x10, CX
+ ADDQ $0x10, DX
+ SUBQ $0x02, DI
+ JA loop
+ RET
+
+// func xorBlocksSSE2(out *block, a *block, b *block, c *block)
+// Requires: SSE2
+TEXT ·xorBlocksSSE2(SB), NOSPLIT, $0-32
+ MOVQ out+0(FP), DX
+ MOVQ a+8(FP), AX
+ MOVQ b+16(FP), BX
+ MOVQ c+24(FP), CX
+ MOVQ $0x00000080, DI
+
+loop:
+ MOVOU (AX), X0
+ MOVOU (BX), X1
+ MOVOU (CX), X2
+ MOVOU (DX), X3
+ PXOR X1, X0
+ PXOR X2, X0
+ PXOR X3, X0
+ MOVOU X0, (DX)
+ ADDQ $0x10, AX
+ ADDQ $0x10, BX
+ ADDQ $0x10, CX
+ ADDQ $0x10, DX
+ SUBQ $0x02, DI
+ JA loop
+ RET
diff --git a/vendor/golang.org/x/crypto/argon2/blamka_generic.go b/vendor/golang.org/x/crypto/argon2/blamka_generic.go
new file mode 100644
index 0000000000..a481b2243f
--- /dev/null
+++ b/vendor/golang.org/x/crypto/argon2/blamka_generic.go
@@ -0,0 +1,163 @@
+// 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 argon2
+
+var useSSE4 bool
+
+func processBlockGeneric(out, in1, in2 *block, xor bool) {
+ var t block
+ for i := range t {
+ t[i] = in1[i] ^ in2[i]
+ }
+ for i := 0; i < blockLength; i += 16 {
+ blamkaGeneric(
+ &t[i+0], &t[i+1], &t[i+2], &t[i+3],
+ &t[i+4], &t[i+5], &t[i+6], &t[i+7],
+ &t[i+8], &t[i+9], &t[i+10], &t[i+11],
+ &t[i+12], &t[i+13], &t[i+14], &t[i+15],
+ )
+ }
+ for i := 0; i < blockLength/8; i += 2 {
+ blamkaGeneric(
+ &t[i], &t[i+1], &t[16+i], &t[16+i+1],
+ &t[32+i], &t[32+i+1], &t[48+i], &t[48+i+1],
+ &t[64+i], &t[64+i+1], &t[80+i], &t[80+i+1],
+ &t[96+i], &t[96+i+1], &t[112+i], &t[112+i+1],
+ )
+ }
+ if xor {
+ for i := range t {
+ out[i] ^= in1[i] ^ in2[i] ^ t[i]
+ }
+ } else {
+ for i := range t {
+ out[i] = in1[i] ^ in2[i] ^ t[i]
+ }
+ }
+}
+
+func blamkaGeneric(t00, t01, t02, t03, t04, t05, t06, t07, t08, t09, t10, t11, t12, t13, t14, t15 *uint64) {
+ v00, v01, v02, v03 := *t00, *t01, *t02, *t03
+ v04, v05, v06, v07 := *t04, *t05, *t06, *t07
+ v08, v09, v10, v11 := *t08, *t09, *t10, *t11
+ v12, v13, v14, v15 := *t12, *t13, *t14, *t15
+
+ v00 += v04 + 2*uint64(uint32(v00))*uint64(uint32(v04))
+ v12 ^= v00
+ v12 = v12>>32 | v12<<32
+ v08 += v12 + 2*uint64(uint32(v08))*uint64(uint32(v12))
+ v04 ^= v08
+ v04 = v04>>24 | v04<<40
+
+ v00 += v04 + 2*uint64(uint32(v00))*uint64(uint32(v04))
+ v12 ^= v00
+ v12 = v12>>16 | v12<<48
+ v08 += v12 + 2*uint64(uint32(v08))*uint64(uint32(v12))
+ v04 ^= v08
+ v04 = v04>>63 | v04<<1
+
+ v01 += v05 + 2*uint64(uint32(v01))*uint64(uint32(v05))
+ v13 ^= v01
+ v13 = v13>>32 | v13<<32
+ v09 += v13 + 2*uint64(uint32(v09))*uint64(uint32(v13))
+ v05 ^= v09
+ v05 = v05>>24 | v05<<40
+
+ v01 += v05 + 2*uint64(uint32(v01))*uint64(uint32(v05))
+ v13 ^= v01
+ v13 = v13>>16 | v13<<48
+ v09 += v13 + 2*uint64(uint32(v09))*uint64(uint32(v13))
+ v05 ^= v09
+ v05 = v05>>63 | v05<<1
+
+ v02 += v06 + 2*uint64(uint32(v02))*uint64(uint32(v06))
+ v14 ^= v02
+ v14 = v14>>32 | v14<<32
+ v10 += v14 + 2*uint64(uint32(v10))*uint64(uint32(v14))
+ v06 ^= v10
+ v06 = v06>>24 | v06<<40
+
+ v02 += v06 + 2*uint64(uint32(v02))*uint64(uint32(v06))
+ v14 ^= v02
+ v14 = v14>>16 | v14<<48
+ v10 += v14 + 2*uint64(uint32(v10))*uint64(uint32(v14))
+ v06 ^= v10
+ v06 = v06>>63 | v06<<1
+
+ v03 += v07 + 2*uint64(uint32(v03))*uint64(uint32(v07))
+ v15 ^= v03
+ v15 = v15>>32 | v15<<32
+ v11 += v15 + 2*uint64(uint32(v11))*uint64(uint32(v15))
+ v07 ^= v11
+ v07 = v07>>24 | v07<<40
+
+ v03 += v07 + 2*uint64(uint32(v03))*uint64(uint32(v07))
+ v15 ^= v03
+ v15 = v15>>16 | v15<<48
+ v11 += v15 + 2*uint64(uint32(v11))*uint64(uint32(v15))
+ v07 ^= v11
+ v07 = v07>>63 | v07<<1
+
+ v00 += v05 + 2*uint64(uint32(v00))*uint64(uint32(v05))
+ v15 ^= v00
+ v15 = v15>>32 | v15<<32
+ v10 += v15 + 2*uint64(uint32(v10))*uint64(uint32(v15))
+ v05 ^= v10
+ v05 = v05>>24 | v05<<40
+
+ v00 += v05 + 2*uint64(uint32(v00))*uint64(uint32(v05))
+ v15 ^= v00
+ v15 = v15>>16 | v15<<48
+ v10 += v15 + 2*uint64(uint32(v10))*uint64(uint32(v15))
+ v05 ^= v10
+ v05 = v05>>63 | v05<<1
+
+ v01 += v06 + 2*uint64(uint32(v01))*uint64(uint32(v06))
+ v12 ^= v01
+ v12 = v12>>32 | v12<<32
+ v11 += v12 + 2*uint64(uint32(v11))*uint64(uint32(v12))
+ v06 ^= v11
+ v06 = v06>>24 | v06<<40
+
+ v01 += v06 + 2*uint64(uint32(v01))*uint64(uint32(v06))
+ v12 ^= v01
+ v12 = v12>>16 | v12<<48
+ v11 += v12 + 2*uint64(uint32(v11))*uint64(uint32(v12))
+ v06 ^= v11
+ v06 = v06>>63 | v06<<1
+
+ v02 += v07 + 2*uint64(uint32(v02))*uint64(uint32(v07))
+ v13 ^= v02
+ v13 = v13>>32 | v13<<32
+ v08 += v13 + 2*uint64(uint32(v08))*uint64(uint32(v13))
+ v07 ^= v08
+ v07 = v07>>24 | v07<<40
+
+ v02 += v07 + 2*uint64(uint32(v02))*uint64(uint32(v07))
+ v13 ^= v02
+ v13 = v13>>16 | v13<<48
+ v08 += v13 + 2*uint64(uint32(v08))*uint64(uint32(v13))
+ v07 ^= v08
+ v07 = v07>>63 | v07<<1
+
+ v03 += v04 + 2*uint64(uint32(v03))*uint64(uint32(v04))
+ v14 ^= v03
+ v14 = v14>>32 | v14<<32
+ v09 += v14 + 2*uint64(uint32(v09))*uint64(uint32(v14))
+ v04 ^= v09
+ v04 = v04>>24 | v04<<40
+
+ v03 += v04 + 2*uint64(uint32(v03))*uint64(uint32(v04))
+ v14 ^= v03
+ v14 = v14>>16 | v14<<48
+ v09 += v14 + 2*uint64(uint32(v09))*uint64(uint32(v14))
+ v04 ^= v09
+ v04 = v04>>63 | v04<<1
+
+ *t00, *t01, *t02, *t03 = v00, v01, v02, v03
+ *t04, *t05, *t06, *t07 = v04, v05, v06, v07
+ *t08, *t09, *t10, *t11 = v08, v09, v10, v11
+ *t12, *t13, *t14, *t15 = v12, v13, v14, v15
+}
diff --git a/vendor/golang.org/x/crypto/argon2/blamka_ref.go b/vendor/golang.org/x/crypto/argon2/blamka_ref.go
new file mode 100644
index 0000000000..16d58c650e
--- /dev/null
+++ b/vendor/golang.org/x/crypto/argon2/blamka_ref.go
@@ -0,0 +1,15 @@
+// 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.
+
+//go:build !amd64 || purego || !gc
+
+package argon2
+
+func processBlock(out, in1, in2 *block) {
+ processBlockGeneric(out, in1, in2, false)
+}
+
+func processBlockXOR(out, in1, in2 *block) {
+ processBlockGeneric(out, in1, in2, true)
+}
diff --git a/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go b/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go
index 8d99551fee..b1da45687c 100644
--- a/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go
+++ b/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build (!amd64 && !loong64 && !ppc64le && !ppc64 && !s390x) || !gc || purego
+//go:build (!amd64 && !loong64 && !ppc64le && !ppc64 && !riscv64 && !s390x) || !gc || purego
package poly1305
diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_asm.go b/vendor/golang.org/x/crypto/internal/poly1305/sum_asm.go
index 315b84ac39..55041bf51d 100644
--- a/vendor/golang.org/x/crypto/internal/poly1305/sum_asm.go
+++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_asm.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build gc && !purego && (amd64 || loong64 || ppc64 || ppc64le)
+//go:build gc && !purego && (amd64 || loong64 || ppc64 || ppc64le || riscv64)
package poly1305
diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_riscv64.s b/vendor/golang.org/x/crypto/internal/poly1305/sum_riscv64.s
new file mode 100644
index 0000000000..ce5eb3d43d
--- /dev/null
+++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_riscv64.s
@@ -0,0 +1,158 @@
+// Copyright 2026 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build gc && !purego
+
+#define LOAD64U(base, offset, t0, t1, t2, t3, dst) \
+ MOVBU (offset+0*1)(base), t0; \
+ MOVBU (offset+1*1)(base), t1; \
+ MOVBU (offset+2*1)(base), t2; \
+ MOVBU (offset+3*1)(base), t3; \
+ SLL $8, t1; \
+ SLL $16, t2; \
+ SLL $24, t3; \
+ OR t1, t0; \
+ OR t3, t2; \
+ OR t2, t0, dst; \
+ MOVBU (offset+4*1)(base), t0; \
+ MOVBU (offset+5*1)(base), t1; \
+ MOVBU (offset+6*1)(base), t2; \
+ MOVBU (offset+7*1)(base), t3; \
+ SLL $32, t0; \
+ SLL $40, t1; \
+ SLL $48, t2; \
+ SLL $56, t3; \
+ OR t1, t0; \
+ OR t3, t2; \
+ OR t2, t0; \
+ OR t0, dst
+
+// func update(state *macState, msg []byte)
+TEXT ·update(SB), $0-32
+ MOV state+0(FP), X5
+ MOV msg_base+8(FP), X6
+ MOV msg_len+16(FP), X7
+
+ MOV $16, X8
+
+ AND $7, X6, X28
+
+ MOV (0*8)(X5), X9 // h0
+ MOV (1*8)(X5), X10 // h1
+ MOV (2*8)(X5), X11 // h2
+ MOV (3*8)(X5), X12 // r0
+ MOV (4*8)(X5), X13 // r1
+
+ BLT X7, X8, tail
+
+loop:
+ BEQZ X28, aligned_load
+
+ LOAD64U(X6, 0*8, X16, X18, X19, X20, X15) // msg[0:8]
+ LOAD64U(X6, 1*8, X16, X18, X19, X20, X17) // msg[8:16]
+ JMP block
+
+aligned_load:
+ MOV (0*8)(X6), X15 // msg[0:8]
+ MOV (1*8)(X6), X17 // msg[8:16]
+
+block:
+ ADD X15, X9 // h0 (x1 + y1 = z1', if z1' < x1 then z1' overflow)
+ SLTU X15, X9, X19 // h0.carry
+ ADD X17, X10, X22
+ SLTU X17, X22, X23
+ ADD X22, X19, X10 // h1
+ SLTU X22, X10, X19
+ OR X23, X19 // h1.carry
+ ADD $1, X19
+ ADD X19, X11 // h2
+
+ ADD $16, X6 // msg = msg[16:]
+
+multiply:
+ MULHU X9, X12, X16 // h0r0.hi
+ MUL X9, X12, X15 // h0r0.lo
+ MULHU X10, X12, X17 // h1r0.hi
+ MUL X10, X12, X14 // h1r0.lo
+ ADD X14, X16
+ SLTU X14, X16, X19
+ ADD X19, X17
+ MUL X11, X12, X20
+ ADD X17, X20
+ MULHU X9, X13, X17 // h0r1.hi
+ MUL X9, X13, X14 // h0r1.lo
+ ADD X14, X16
+ SLTU X14, X16, X19
+ ADD X19, X17
+ MOV X17, X9
+ MUL X11, X13, X21 // h2r1
+ MULHU X10, X13, X17 // h1r1.hi
+ MUL X10, X13, X14 // h1r1.lo
+ ADD X14, X20
+ ADD X17, X21, X22
+ SLTU X14, X20, X19
+ ADD X22, X19, X21
+ ADD X9, X20
+ SLTU X9, X20, X19
+ ADD X19, X21
+ AND $3, X20, X11
+ AND $-4, X20, X18
+ ADD X18, X15, X9
+ ADD X21, X16, X22
+ SLTU X18, X9, X19
+ SLTU X21, X22, X23
+ ADD X22, X19, X10
+ SLTU X22, X10, X19
+ OR X19, X23, X19
+ ADD X19, X11
+ SLL $62, X21, X22
+ SRL $2, X20, X23
+ SRL $2, X21, X21
+ OR X22, X23, X20
+ ADD X20, X9, X9
+ ADD X21, X10, X22
+ SLTU X20, X9, X19
+ SLTU X21, X22, X23
+ ADD X22, X19, X10
+ SLTU X22, X10, X19
+ OR X19, X23, X19
+ ADD X19, X11, X11
+
+ SUB $16, X7, X7
+ BGE X7, X8, loop
+
+tail:
+ BEQ X7, X0, done
+ MOV $1, X15
+ MOV $0, X16
+ ADD X7, X6, X6
+
+flush_buffer:
+ MOVBU -1(X6), X20
+ SRL $56, X15, X19
+ SLL $8, X16, X23
+ SLL $8, X15, X15
+ OR X19, X23, X16
+ XOR X20, X15
+ SUB $1, X7, X7
+ SUB $1, X6, X6
+ BNE X7, X0, flush_buffer
+
+ ADD X15, X9
+ SLTU X15, X9, X19
+ ADD X16, X10, X22
+ SLTU X16, X22, X23
+ ADD X22, X19, X10
+ SLTU X22, X10, X19
+ OR X23, X19
+ ADD X19, X11
+
+ MOV $16, X7
+ JMP multiply
+
+done:
+ MOV X9, (0*8)(X5) // h0
+ MOV X10, (1*8)(X5)
+ MOV X11, (2*8)(X5)
+ RET
diff --git a/vendor/golang.org/x/crypto/ocsp/ocsp.go b/vendor/golang.org/x/crypto/ocsp/ocsp.go
index e6c645e7ce..23c39e7377 100644
--- a/vendor/golang.org/x/crypto/ocsp/ocsp.go
+++ b/vendor/golang.org/x/crypto/ocsp/ocsp.go
@@ -85,7 +85,8 @@ type certID struct {
// https://tools.ietf.org/html/rfc2560#section-4.1.1
type ocspRequest struct {
- TBSRequest tbsRequest
+ TBSRequest tbsRequest
+ OptionalSignature asn1.RawValue `asn1:"explicit,tag:0,optional"`
}
type tbsRequest struct {
@@ -321,10 +322,10 @@ type Request struct {
func (req *Request) Marshal() ([]byte, error) {
hashAlg := getOIDFromHashAlgorithm(req.HashAlgorithm)
if hashAlg == nil {
- return nil, errors.New("Unknown hash algorithm")
+ return nil, errors.New("unknown hash algorithm")
}
return asn1.Marshal(ocspRequest{
- tbsRequest{
+ TBSRequest: tbsRequest{
Version: 0,
RequestList: []request{
{
@@ -418,8 +419,10 @@ func (p ParseError) Error() string {
}
// ParseRequest parses an OCSP request in DER form. It only supports
-// requests for a single certificate. Signed requests are not supported.
-// If a request includes a signature, it will result in a ParseError.
+// requests for a single certificate identifier. If a request includes
+// multiple certificate identifiers, only the first will be included in
+// the parsed Request. Signed requests are not supported. If a request
+// includes a signature, it will result in a ParseError.
func ParseRequest(bytes []byte) (*Request, error) {
var req ocspRequest
rest, err := asn1.Unmarshal(bytes, &req)
@@ -430,6 +433,10 @@ func ParseRequest(bytes []byte) (*Request, error) {
return nil, ParseError("trailing data in OCSP request")
}
+ if len(req.OptionalSignature.FullBytes) > 0 {
+ return nil, ParseError("signed OCSP requests are not supported")
+ }
+
if len(req.TBSRequest.RequestList) == 0 {
return nil, ParseError("OCSP request contains no request body")
}
diff --git a/vendor/golang.org/x/crypto/sha3/hashes.go b/vendor/golang.org/x/crypto/sha3/hashes.go
new file mode 100644
index 0000000000..a51269d91a
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/hashes.go
@@ -0,0 +1,95 @@
+// 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 sha3 implements the SHA-3 hash algorithms and the SHAKE extendable
+// output functions defined in FIPS 202.
+//
+// Most of this package is a wrapper around the crypto/sha3 package in the
+// standard library. The only exception is the legacy Keccak hash functions.
+package sha3
+
+import (
+ "crypto/sha3"
+ "hash"
+)
+
+// New224 creates a new SHA3-224 hash.
+// Its generic security strength is 224 bits against preimage attacks,
+// and 112 bits against collision attacks.
+//
+// It is a wrapper for the [sha3.New224] function in the standard library.
+//
+//go:fix inline
+func New224() hash.Hash {
+ return sha3.New224()
+}
+
+// New256 creates a new SHA3-256 hash.
+// Its generic security strength is 256 bits against preimage attacks,
+// and 128 bits against collision attacks.
+//
+// It is a wrapper for the [sha3.New256] function in the standard library.
+//
+//go:fix inline
+func New256() hash.Hash {
+ return sha3.New256()
+}
+
+// New384 creates a new SHA3-384 hash.
+// Its generic security strength is 384 bits against preimage attacks,
+// and 192 bits against collision attacks.
+//
+// It is a wrapper for the [sha3.New384] function in the standard library.
+//
+//go:fix inline
+func New384() hash.Hash {
+ return sha3.New384()
+}
+
+// New512 creates a new SHA3-512 hash.
+// Its generic security strength is 512 bits against preimage attacks,
+// and 256 bits against collision attacks.
+//
+// It is a wrapper for the [sha3.New512] function in the standard library.
+//
+//go:fix inline
+func New512() hash.Hash {
+ return sha3.New512()
+}
+
+// Sum224 returns the SHA3-224 digest of the data.
+//
+// It is a wrapper for the [sha3.Sum224] function in the standard library.
+//
+//go:fix inline
+func Sum224(data []byte) [28]byte {
+ return sha3.Sum224(data)
+}
+
+// Sum256 returns the SHA3-256 digest of the data.
+//
+// It is a wrapper for the [sha3.Sum256] function in the standard library.
+//
+//go:fix inline
+func Sum256(data []byte) [32]byte {
+ return sha3.Sum256(data)
+}
+
+// Sum384 returns the SHA3-384 digest of the data.
+//
+// It is a wrapper for the [sha3.Sum384] function in the standard library.
+//
+//go:fix inline
+func Sum384(data []byte) [48]byte {
+ return sha3.Sum384(data)
+}
+
+// Sum512 returns the SHA3-512 digest of the data.
+//
+// It is a wrapper for the [sha3.Sum512] function in the standard library.
+//
+//go:fix inline
+func Sum512(data []byte) [64]byte {
+ return sha3.Sum512(data)
+}
diff --git a/vendor/golang.org/x/crypto/sha3/legacy_hash.go b/vendor/golang.org/x/crypto/sha3/legacy_hash.go
new file mode 100644
index 0000000000..b8784536e0
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/legacy_hash.go
@@ -0,0 +1,263 @@
+// 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 sha3
+
+// This implementation is only used for NewLegacyKeccak256 and
+// NewLegacyKeccak512, which are not implemented by crypto/sha3.
+// All other functions in this package are wrappers around crypto/sha3.
+
+import (
+ "crypto/subtle"
+ "encoding/binary"
+ "errors"
+ "hash"
+ "unsafe"
+
+ "golang.org/x/sys/cpu"
+)
+
+const (
+ dsbyteKeccak = 0b00000001
+
+ // rateK[c] is the rate in bytes for Keccak[c] where c is the capacity in
+ // bits. Given the sponge size is 1600 bits, the rate is 1600 - c bits.
+ rateK256 = (1600 - 256) / 8
+ rateK512 = (1600 - 512) / 8
+ rateK1024 = (1600 - 1024) / 8
+)
+
+// NewLegacyKeccak256 creates a new Keccak-256 hash.
+//
+// Only use this function if you require compatibility with an existing cryptosystem
+// that uses non-standard padding. All other users should use New256 instead.
+func NewLegacyKeccak256() hash.Hash {
+ return &state{rate: rateK512, outputLen: 32, dsbyte: dsbyteKeccak}
+}
+
+// NewLegacyKeccak512 creates a new Keccak-512 hash.
+//
+// Only use this function if you require compatibility with an existing cryptosystem
+// that uses non-standard padding. All other users should use New512 instead.
+func NewLegacyKeccak512() hash.Hash {
+ return &state{rate: rateK1024, outputLen: 64, dsbyte: dsbyteKeccak}
+}
+
+// spongeDirection indicates the direction bytes are flowing through the sponge.
+type spongeDirection int
+
+const (
+ // spongeAbsorbing indicates that the sponge is absorbing input.
+ spongeAbsorbing spongeDirection = iota
+ // spongeSqueezing indicates that the sponge is being squeezed.
+ spongeSqueezing
+)
+
+type state struct {
+ a [1600 / 8]byte // main state of the hash
+
+ // a[n:rate] is the buffer. If absorbing, it's the remaining space to XOR
+ // into before running the permutation. If squeezing, it's the remaining
+ // output to produce before running the permutation.
+ n, rate int
+
+ // dsbyte contains the "domain separation" bits and the first bit of
+ // the padding. Sections 6.1 and 6.2 of [1] separate the outputs of the
+ // SHA-3 and SHAKE functions by appending bitstrings to the message.
+ // Using a little-endian bit-ordering convention, these are "01" for SHA-3
+ // and "1111" for SHAKE, or 00000010b and 00001111b, respectively. Then the
+ // padding rule from section 5.1 is applied to pad the message to a multiple
+ // of the rate, which involves adding a "1" bit, zero or more "0" bits, and
+ // a final "1" bit. We merge the first "1" bit from the padding into dsbyte,
+ // giving 00000110b (0x06) and 00011111b (0x1f).
+ // [1] http://csrc.nist.gov/publications/drafts/fips-202/fips_202_draft.pdf
+ // "Draft FIPS 202: SHA-3 Standard: Permutation-Based Hash and
+ // Extendable-Output Functions (May 2014)"
+ dsbyte byte
+
+ outputLen int // the default output size in bytes
+ state spongeDirection // whether the sponge is absorbing or squeezing
+}
+
+// BlockSize returns the rate of sponge underlying this hash function.
+func (d *state) BlockSize() int { return d.rate }
+
+// Size returns the output size of the hash function in bytes.
+func (d *state) Size() int { return d.outputLen }
+
+// Reset clears the internal state by zeroing the sponge state and
+// the buffer indexes, and setting Sponge.state to absorbing.
+func (d *state) Reset() {
+ // Zero the permutation's state.
+ for i := range d.a {
+ d.a[i] = 0
+ }
+ d.state = spongeAbsorbing
+ d.n = 0
+}
+
+func (d *state) clone() *state {
+ ret := *d
+ return &ret
+}
+
+// permute applies the KeccakF-1600 permutation.
+func (d *state) permute() {
+ var a *[25]uint64
+ if cpu.IsBigEndian {
+ a = new([25]uint64)
+ for i := range a {
+ a[i] = binary.LittleEndian.Uint64(d.a[i*8:])
+ }
+ } else {
+ a = (*[25]uint64)(unsafe.Pointer(&d.a))
+ }
+
+ keccakF1600(a)
+ d.n = 0
+
+ if cpu.IsBigEndian {
+ for i := range a {
+ binary.LittleEndian.PutUint64(d.a[i*8:], a[i])
+ }
+ }
+}
+
+// pads appends the domain separation bits in dsbyte, applies
+// the multi-bitrate 10..1 padding rule, and permutes the state.
+func (d *state) padAndPermute() {
+ // Pad with this instance's domain-separator bits. We know that there's
+ // at least one byte of space in the sponge because, if it were full,
+ // permute would have been called to empty it. dsbyte also contains the
+ // first one bit for the padding. See the comment in the state struct.
+ d.a[d.n] ^= d.dsbyte
+ // This adds the final one bit for the padding. Because of the way that
+ // bits are numbered from the LSB upwards, the final bit is the MSB of
+ // the last byte.
+ d.a[d.rate-1] ^= 0x80
+ // Apply the permutation
+ d.permute()
+ d.state = spongeSqueezing
+}
+
+// Write absorbs more data into the hash's state. It panics if any
+// output has already been read.
+func (d *state) Write(p []byte) (n int, err error) {
+ if d.state != spongeAbsorbing {
+ panic("sha3: Write after Read")
+ }
+
+ n = len(p)
+
+ for len(p) > 0 {
+ x := subtle.XORBytes(d.a[d.n:d.rate], d.a[d.n:d.rate], p)
+ d.n += x
+ p = p[x:]
+
+ // If the sponge is full, apply the permutation.
+ if d.n == d.rate {
+ d.permute()
+ }
+ }
+
+ return
+}
+
+// Read squeezes an arbitrary number of bytes from the sponge.
+func (d *state) Read(out []byte) (n int, err error) {
+ // If we're still absorbing, pad and apply the permutation.
+ if d.state == spongeAbsorbing {
+ d.padAndPermute()
+ }
+
+ n = len(out)
+
+ // Now, do the squeezing.
+ for len(out) > 0 {
+ // Apply the permutation if we've squeezed the sponge dry.
+ if d.n == d.rate {
+ d.permute()
+ }
+
+ x := copy(out, d.a[d.n:d.rate])
+ d.n += x
+ out = out[x:]
+ }
+
+ return
+}
+
+// Sum applies padding to the hash state and then squeezes out the desired
+// number of output bytes. It panics if any output has already been read.
+func (d *state) Sum(in []byte) []byte {
+ if d.state != spongeAbsorbing {
+ panic("sha3: Sum after Read")
+ }
+
+ // Make a copy of the original hash so that caller can keep writing
+ // and summing.
+ dup := d.clone()
+ hash := make([]byte, dup.outputLen, 64) // explicit cap to allow stack allocation
+ dup.Read(hash)
+ return append(in, hash...)
+}
+
+const (
+ magicKeccak = "sha\x0b"
+ // magic || rate || main state || n || sponge direction
+ marshaledSize = len(magicKeccak) + 1 + 200 + 1 + 1
+)
+
+func (d *state) MarshalBinary() ([]byte, error) {
+ return d.AppendBinary(make([]byte, 0, marshaledSize))
+}
+
+func (d *state) AppendBinary(b []byte) ([]byte, error) {
+ switch d.dsbyte {
+ case dsbyteKeccak:
+ b = append(b, magicKeccak...)
+ default:
+ panic("unknown dsbyte")
+ }
+ // rate is at most 168, and n is at most rate.
+ b = append(b, byte(d.rate))
+ b = append(b, d.a[:]...)
+ b = append(b, byte(d.n), byte(d.state))
+ return b, nil
+}
+
+func (d *state) UnmarshalBinary(b []byte) error {
+ if len(b) != marshaledSize {
+ return errors.New("sha3: invalid hash state")
+ }
+
+ magic := string(b[:len(magicKeccak)])
+ b = b[len(magicKeccak):]
+ switch {
+ case magic == magicKeccak && d.dsbyte == dsbyteKeccak:
+ default:
+ return errors.New("sha3: invalid hash state identifier")
+ }
+
+ rate := int(b[0])
+ b = b[1:]
+ if rate != d.rate {
+ return errors.New("sha3: invalid hash state function")
+ }
+
+ copy(d.a[:], b)
+ b = b[len(d.a):]
+
+ n, state := int(b[0]), spongeDirection(b[1])
+ if n > d.rate {
+ return errors.New("sha3: invalid hash state")
+ }
+ d.n = n
+ if state != spongeAbsorbing && state != spongeSqueezing {
+ return errors.New("sha3: invalid hash state")
+ }
+ d.state = state
+
+ return nil
+}
diff --git a/vendor/golang.org/x/crypto/sha3/legacy_keccakf.go b/vendor/golang.org/x/crypto/sha3/legacy_keccakf.go
new file mode 100644
index 0000000000..101588c16c
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/legacy_keccakf.go
@@ -0,0 +1,416 @@
+// 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 sha3
+
+// This implementation is only used for NewLegacyKeccak256 and
+// NewLegacyKeccak512, which are not implemented by crypto/sha3.
+// All other functions in this package are wrappers around crypto/sha3.
+
+import "math/bits"
+
+// rc stores the round constants for use in the ι step.
+var rc = [24]uint64{
+ 0x0000000000000001,
+ 0x0000000000008082,
+ 0x800000000000808A,
+ 0x8000000080008000,
+ 0x000000000000808B,
+ 0x0000000080000001,
+ 0x8000000080008081,
+ 0x8000000000008009,
+ 0x000000000000008A,
+ 0x0000000000000088,
+ 0x0000000080008009,
+ 0x000000008000000A,
+ 0x000000008000808B,
+ 0x800000000000008B,
+ 0x8000000000008089,
+ 0x8000000000008003,
+ 0x8000000000008002,
+ 0x8000000000000080,
+ 0x000000000000800A,
+ 0x800000008000000A,
+ 0x8000000080008081,
+ 0x8000000000008080,
+ 0x0000000080000001,
+ 0x8000000080008008,
+}
+
+// keccakF1600 applies the Keccak permutation to a 1600b-wide
+// state represented as a slice of 25 uint64s.
+func keccakF1600(a *[25]uint64) {
+ // Implementation translated from Keccak-inplace.c
+ // in the keccak reference code.
+ var t, bc0, bc1, bc2, bc3, bc4, d0, d1, d2, d3, d4 uint64
+
+ for i := 0; i < 24; i += 4 {
+ // Combines the 5 steps in each round into 2 steps.
+ // Unrolls 4 rounds per loop and spreads some steps across rounds.
+
+ // Round 1
+ bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]
+ bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]
+ bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]
+ bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]
+ bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]
+ d0 = bc4 ^ (bc1<<1 | bc1>>63)
+ d1 = bc0 ^ (bc2<<1 | bc2>>63)
+ d2 = bc1 ^ (bc3<<1 | bc3>>63)
+ d3 = bc2 ^ (bc4<<1 | bc4>>63)
+ d4 = bc3 ^ (bc0<<1 | bc0>>63)
+
+ bc0 = a[0] ^ d0
+ t = a[6] ^ d1
+ bc1 = bits.RotateLeft64(t, 44)
+ t = a[12] ^ d2
+ bc2 = bits.RotateLeft64(t, 43)
+ t = a[18] ^ d3
+ bc3 = bits.RotateLeft64(t, 21)
+ t = a[24] ^ d4
+ bc4 = bits.RotateLeft64(t, 14)
+ a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i]
+ a[6] = bc1 ^ (bc3 &^ bc2)
+ a[12] = bc2 ^ (bc4 &^ bc3)
+ a[18] = bc3 ^ (bc0 &^ bc4)
+ a[24] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[10] ^ d0
+ bc2 = bits.RotateLeft64(t, 3)
+ t = a[16] ^ d1
+ bc3 = bits.RotateLeft64(t, 45)
+ t = a[22] ^ d2
+ bc4 = bits.RotateLeft64(t, 61)
+ t = a[3] ^ d3
+ bc0 = bits.RotateLeft64(t, 28)
+ t = a[9] ^ d4
+ bc1 = bits.RotateLeft64(t, 20)
+ a[10] = bc0 ^ (bc2 &^ bc1)
+ a[16] = bc1 ^ (bc3 &^ bc2)
+ a[22] = bc2 ^ (bc4 &^ bc3)
+ a[3] = bc3 ^ (bc0 &^ bc4)
+ a[9] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[20] ^ d0
+ bc4 = bits.RotateLeft64(t, 18)
+ t = a[1] ^ d1
+ bc0 = bits.RotateLeft64(t, 1)
+ t = a[7] ^ d2
+ bc1 = bits.RotateLeft64(t, 6)
+ t = a[13] ^ d3
+ bc2 = bits.RotateLeft64(t, 25)
+ t = a[19] ^ d4
+ bc3 = bits.RotateLeft64(t, 8)
+ a[20] = bc0 ^ (bc2 &^ bc1)
+ a[1] = bc1 ^ (bc3 &^ bc2)
+ a[7] = bc2 ^ (bc4 &^ bc3)
+ a[13] = bc3 ^ (bc0 &^ bc4)
+ a[19] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[5] ^ d0
+ bc1 = bits.RotateLeft64(t, 36)
+ t = a[11] ^ d1
+ bc2 = bits.RotateLeft64(t, 10)
+ t = a[17] ^ d2
+ bc3 = bits.RotateLeft64(t, 15)
+ t = a[23] ^ d3
+ bc4 = bits.RotateLeft64(t, 56)
+ t = a[4] ^ d4
+ bc0 = bits.RotateLeft64(t, 27)
+ a[5] = bc0 ^ (bc2 &^ bc1)
+ a[11] = bc1 ^ (bc3 &^ bc2)
+ a[17] = bc2 ^ (bc4 &^ bc3)
+ a[23] = bc3 ^ (bc0 &^ bc4)
+ a[4] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[15] ^ d0
+ bc3 = bits.RotateLeft64(t, 41)
+ t = a[21] ^ d1
+ bc4 = bits.RotateLeft64(t, 2)
+ t = a[2] ^ d2
+ bc0 = bits.RotateLeft64(t, 62)
+ t = a[8] ^ d3
+ bc1 = bits.RotateLeft64(t, 55)
+ t = a[14] ^ d4
+ bc2 = bits.RotateLeft64(t, 39)
+ a[15] = bc0 ^ (bc2 &^ bc1)
+ a[21] = bc1 ^ (bc3 &^ bc2)
+ a[2] = bc2 ^ (bc4 &^ bc3)
+ a[8] = bc3 ^ (bc0 &^ bc4)
+ a[14] = bc4 ^ (bc1 &^ bc0)
+
+ // Round 2
+ bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]
+ bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]
+ bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]
+ bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]
+ bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]
+ d0 = bc4 ^ (bc1<<1 | bc1>>63)
+ d1 = bc0 ^ (bc2<<1 | bc2>>63)
+ d2 = bc1 ^ (bc3<<1 | bc3>>63)
+ d3 = bc2 ^ (bc4<<1 | bc4>>63)
+ d4 = bc3 ^ (bc0<<1 | bc0>>63)
+
+ bc0 = a[0] ^ d0
+ t = a[16] ^ d1
+ bc1 = bits.RotateLeft64(t, 44)
+ t = a[7] ^ d2
+ bc2 = bits.RotateLeft64(t, 43)
+ t = a[23] ^ d3
+ bc3 = bits.RotateLeft64(t, 21)
+ t = a[14] ^ d4
+ bc4 = bits.RotateLeft64(t, 14)
+ a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+1]
+ a[16] = bc1 ^ (bc3 &^ bc2)
+ a[7] = bc2 ^ (bc4 &^ bc3)
+ a[23] = bc3 ^ (bc0 &^ bc4)
+ a[14] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[20] ^ d0
+ bc2 = bits.RotateLeft64(t, 3)
+ t = a[11] ^ d1
+ bc3 = bits.RotateLeft64(t, 45)
+ t = a[2] ^ d2
+ bc4 = bits.RotateLeft64(t, 61)
+ t = a[18] ^ d3
+ bc0 = bits.RotateLeft64(t, 28)
+ t = a[9] ^ d4
+ bc1 = bits.RotateLeft64(t, 20)
+ a[20] = bc0 ^ (bc2 &^ bc1)
+ a[11] = bc1 ^ (bc3 &^ bc2)
+ a[2] = bc2 ^ (bc4 &^ bc3)
+ a[18] = bc3 ^ (bc0 &^ bc4)
+ a[9] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[15] ^ d0
+ bc4 = bits.RotateLeft64(t, 18)
+ t = a[6] ^ d1
+ bc0 = bits.RotateLeft64(t, 1)
+ t = a[22] ^ d2
+ bc1 = bits.RotateLeft64(t, 6)
+ t = a[13] ^ d3
+ bc2 = bits.RotateLeft64(t, 25)
+ t = a[4] ^ d4
+ bc3 = bits.RotateLeft64(t, 8)
+ a[15] = bc0 ^ (bc2 &^ bc1)
+ a[6] = bc1 ^ (bc3 &^ bc2)
+ a[22] = bc2 ^ (bc4 &^ bc3)
+ a[13] = bc3 ^ (bc0 &^ bc4)
+ a[4] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[10] ^ d0
+ bc1 = bits.RotateLeft64(t, 36)
+ t = a[1] ^ d1
+ bc2 = bits.RotateLeft64(t, 10)
+ t = a[17] ^ d2
+ bc3 = bits.RotateLeft64(t, 15)
+ t = a[8] ^ d3
+ bc4 = bits.RotateLeft64(t, 56)
+ t = a[24] ^ d4
+ bc0 = bits.RotateLeft64(t, 27)
+ a[10] = bc0 ^ (bc2 &^ bc1)
+ a[1] = bc1 ^ (bc3 &^ bc2)
+ a[17] = bc2 ^ (bc4 &^ bc3)
+ a[8] = bc3 ^ (bc0 &^ bc4)
+ a[24] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[5] ^ d0
+ bc3 = bits.RotateLeft64(t, 41)
+ t = a[21] ^ d1
+ bc4 = bits.RotateLeft64(t, 2)
+ t = a[12] ^ d2
+ bc0 = bits.RotateLeft64(t, 62)
+ t = a[3] ^ d3
+ bc1 = bits.RotateLeft64(t, 55)
+ t = a[19] ^ d4
+ bc2 = bits.RotateLeft64(t, 39)
+ a[5] = bc0 ^ (bc2 &^ bc1)
+ a[21] = bc1 ^ (bc3 &^ bc2)
+ a[12] = bc2 ^ (bc4 &^ bc3)
+ a[3] = bc3 ^ (bc0 &^ bc4)
+ a[19] = bc4 ^ (bc1 &^ bc0)
+
+ // Round 3
+ bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]
+ bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]
+ bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]
+ bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]
+ bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]
+ d0 = bc4 ^ (bc1<<1 | bc1>>63)
+ d1 = bc0 ^ (bc2<<1 | bc2>>63)
+ d2 = bc1 ^ (bc3<<1 | bc3>>63)
+ d3 = bc2 ^ (bc4<<1 | bc4>>63)
+ d4 = bc3 ^ (bc0<<1 | bc0>>63)
+
+ bc0 = a[0] ^ d0
+ t = a[11] ^ d1
+ bc1 = bits.RotateLeft64(t, 44)
+ t = a[22] ^ d2
+ bc2 = bits.RotateLeft64(t, 43)
+ t = a[8] ^ d3
+ bc3 = bits.RotateLeft64(t, 21)
+ t = a[19] ^ d4
+ bc4 = bits.RotateLeft64(t, 14)
+ a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+2]
+ a[11] = bc1 ^ (bc3 &^ bc2)
+ a[22] = bc2 ^ (bc4 &^ bc3)
+ a[8] = bc3 ^ (bc0 &^ bc4)
+ a[19] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[15] ^ d0
+ bc2 = bits.RotateLeft64(t, 3)
+ t = a[1] ^ d1
+ bc3 = bits.RotateLeft64(t, 45)
+ t = a[12] ^ d2
+ bc4 = bits.RotateLeft64(t, 61)
+ t = a[23] ^ d3
+ bc0 = bits.RotateLeft64(t, 28)
+ t = a[9] ^ d4
+ bc1 = bits.RotateLeft64(t, 20)
+ a[15] = bc0 ^ (bc2 &^ bc1)
+ a[1] = bc1 ^ (bc3 &^ bc2)
+ a[12] = bc2 ^ (bc4 &^ bc3)
+ a[23] = bc3 ^ (bc0 &^ bc4)
+ a[9] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[5] ^ d0
+ bc4 = bits.RotateLeft64(t, 18)
+ t = a[16] ^ d1
+ bc0 = bits.RotateLeft64(t, 1)
+ t = a[2] ^ d2
+ bc1 = bits.RotateLeft64(t, 6)
+ t = a[13] ^ d3
+ bc2 = bits.RotateLeft64(t, 25)
+ t = a[24] ^ d4
+ bc3 = bits.RotateLeft64(t, 8)
+ a[5] = bc0 ^ (bc2 &^ bc1)
+ a[16] = bc1 ^ (bc3 &^ bc2)
+ a[2] = bc2 ^ (bc4 &^ bc3)
+ a[13] = bc3 ^ (bc0 &^ bc4)
+ a[24] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[20] ^ d0
+ bc1 = bits.RotateLeft64(t, 36)
+ t = a[6] ^ d1
+ bc2 = bits.RotateLeft64(t, 10)
+ t = a[17] ^ d2
+ bc3 = bits.RotateLeft64(t, 15)
+ t = a[3] ^ d3
+ bc4 = bits.RotateLeft64(t, 56)
+ t = a[14] ^ d4
+ bc0 = bits.RotateLeft64(t, 27)
+ a[20] = bc0 ^ (bc2 &^ bc1)
+ a[6] = bc1 ^ (bc3 &^ bc2)
+ a[17] = bc2 ^ (bc4 &^ bc3)
+ a[3] = bc3 ^ (bc0 &^ bc4)
+ a[14] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[10] ^ d0
+ bc3 = bits.RotateLeft64(t, 41)
+ t = a[21] ^ d1
+ bc4 = bits.RotateLeft64(t, 2)
+ t = a[7] ^ d2
+ bc0 = bits.RotateLeft64(t, 62)
+ t = a[18] ^ d3
+ bc1 = bits.RotateLeft64(t, 55)
+ t = a[4] ^ d4
+ bc2 = bits.RotateLeft64(t, 39)
+ a[10] = bc0 ^ (bc2 &^ bc1)
+ a[21] = bc1 ^ (bc3 &^ bc2)
+ a[7] = bc2 ^ (bc4 &^ bc3)
+ a[18] = bc3 ^ (bc0 &^ bc4)
+ a[4] = bc4 ^ (bc1 &^ bc0)
+
+ // Round 4
+ bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]
+ bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]
+ bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]
+ bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]
+ bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24]
+ d0 = bc4 ^ (bc1<<1 | bc1>>63)
+ d1 = bc0 ^ (bc2<<1 | bc2>>63)
+ d2 = bc1 ^ (bc3<<1 | bc3>>63)
+ d3 = bc2 ^ (bc4<<1 | bc4>>63)
+ d4 = bc3 ^ (bc0<<1 | bc0>>63)
+
+ bc0 = a[0] ^ d0
+ t = a[1] ^ d1
+ bc1 = bits.RotateLeft64(t, 44)
+ t = a[2] ^ d2
+ bc2 = bits.RotateLeft64(t, 43)
+ t = a[3] ^ d3
+ bc3 = bits.RotateLeft64(t, 21)
+ t = a[4] ^ d4
+ bc4 = bits.RotateLeft64(t, 14)
+ a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+3]
+ a[1] = bc1 ^ (bc3 &^ bc2)
+ a[2] = bc2 ^ (bc4 &^ bc3)
+ a[3] = bc3 ^ (bc0 &^ bc4)
+ a[4] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[5] ^ d0
+ bc2 = bits.RotateLeft64(t, 3)
+ t = a[6] ^ d1
+ bc3 = bits.RotateLeft64(t, 45)
+ t = a[7] ^ d2
+ bc4 = bits.RotateLeft64(t, 61)
+ t = a[8] ^ d3
+ bc0 = bits.RotateLeft64(t, 28)
+ t = a[9] ^ d4
+ bc1 = bits.RotateLeft64(t, 20)
+ a[5] = bc0 ^ (bc2 &^ bc1)
+ a[6] = bc1 ^ (bc3 &^ bc2)
+ a[7] = bc2 ^ (bc4 &^ bc3)
+ a[8] = bc3 ^ (bc0 &^ bc4)
+ a[9] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[10] ^ d0
+ bc4 = bits.RotateLeft64(t, 18)
+ t = a[11] ^ d1
+ bc0 = bits.RotateLeft64(t, 1)
+ t = a[12] ^ d2
+ bc1 = bits.RotateLeft64(t, 6)
+ t = a[13] ^ d3
+ bc2 = bits.RotateLeft64(t, 25)
+ t = a[14] ^ d4
+ bc3 = bits.RotateLeft64(t, 8)
+ a[10] = bc0 ^ (bc2 &^ bc1)
+ a[11] = bc1 ^ (bc3 &^ bc2)
+ a[12] = bc2 ^ (bc4 &^ bc3)
+ a[13] = bc3 ^ (bc0 &^ bc4)
+ a[14] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[15] ^ d0
+ bc1 = bits.RotateLeft64(t, 36)
+ t = a[16] ^ d1
+ bc2 = bits.RotateLeft64(t, 10)
+ t = a[17] ^ d2
+ bc3 = bits.RotateLeft64(t, 15)
+ t = a[18] ^ d3
+ bc4 = bits.RotateLeft64(t, 56)
+ t = a[19] ^ d4
+ bc0 = bits.RotateLeft64(t, 27)
+ a[15] = bc0 ^ (bc2 &^ bc1)
+ a[16] = bc1 ^ (bc3 &^ bc2)
+ a[17] = bc2 ^ (bc4 &^ bc3)
+ a[18] = bc3 ^ (bc0 &^ bc4)
+ a[19] = bc4 ^ (bc1 &^ bc0)
+
+ t = a[20] ^ d0
+ bc3 = bits.RotateLeft64(t, 41)
+ t = a[21] ^ d1
+ bc4 = bits.RotateLeft64(t, 2)
+ t = a[22] ^ d2
+ bc0 = bits.RotateLeft64(t, 62)
+ t = a[23] ^ d3
+ bc1 = bits.RotateLeft64(t, 55)
+ t = a[24] ^ d4
+ bc2 = bits.RotateLeft64(t, 39)
+ a[20] = bc0 ^ (bc2 &^ bc1)
+ a[21] = bc1 ^ (bc3 &^ bc2)
+ a[22] = bc2 ^ (bc4 &^ bc3)
+ a[23] = bc3 ^ (bc0 &^ bc4)
+ a[24] = bc4 ^ (bc1 &^ bc0)
+ }
+}
diff --git a/vendor/golang.org/x/crypto/sha3/shake.go b/vendor/golang.org/x/crypto/sha3/shake.go
new file mode 100644
index 0000000000..6f3f70c265
--- /dev/null
+++ b/vendor/golang.org/x/crypto/sha3/shake.go
@@ -0,0 +1,119 @@
+// 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 sha3
+
+import (
+ "crypto/sha3"
+ "hash"
+ "io"
+)
+
+// ShakeHash defines the interface to hash functions that support
+// arbitrary-length output. When used as a plain [hash.Hash], it
+// produces minimum-length outputs that provide full-strength generic
+// security.
+type ShakeHash interface {
+ hash.Hash
+
+ // Read reads more output from the hash; reading affects the hash's
+ // state. (ShakeHash.Read is thus very different from Hash.Sum.)
+ // It never returns an error, but subsequent calls to Write or Sum
+ // will panic.
+ io.Reader
+
+ // Clone returns a copy of the ShakeHash in its current state.
+ Clone() ShakeHash
+}
+
+// NewShake128 creates a new SHAKE128 variable-output-length ShakeHash.
+// Its generic security strength is 128 bits against all attacks if at
+// least 32 bytes of its output are used.
+func NewShake128() ShakeHash {
+ return &shakeWrapper{sha3.NewSHAKE128(), 32, false, sha3.NewSHAKE128}
+}
+
+// NewShake256 creates a new SHAKE256 variable-output-length ShakeHash.
+// Its generic security strength is 256 bits against all attacks if
+// at least 64 bytes of its output are used.
+func NewShake256() ShakeHash {
+ return &shakeWrapper{sha3.NewSHAKE256(), 64, false, sha3.NewSHAKE256}
+}
+
+// NewCShake128 creates a new instance of cSHAKE128 variable-output-length ShakeHash,
+// a customizable variant of SHAKE128.
+// N is used to define functions based on cSHAKE, it can be empty when plain cSHAKE is
+// desired. S is a customization byte string used for domain separation - two cSHAKE
+// computations on same input with different S yield unrelated outputs.
+// When N and S are both empty, this is equivalent to NewShake128.
+func NewCShake128(N, S []byte) ShakeHash {
+ return &shakeWrapper{sha3.NewCSHAKE128(N, S), 32, false, func() *sha3.SHAKE {
+ return sha3.NewCSHAKE128(N, S)
+ }}
+}
+
+// NewCShake256 creates a new instance of cSHAKE256 variable-output-length ShakeHash,
+// a customizable variant of SHAKE256.
+// N is used to define functions based on cSHAKE, it can be empty when plain cSHAKE is
+// desired. S is a customization byte string used for domain separation - two cSHAKE
+// computations on same input with different S yield unrelated outputs.
+// When N and S are both empty, this is equivalent to NewShake256.
+func NewCShake256(N, S []byte) ShakeHash {
+ return &shakeWrapper{sha3.NewCSHAKE256(N, S), 64, false, func() *sha3.SHAKE {
+ return sha3.NewCSHAKE256(N, S)
+ }}
+}
+
+// ShakeSum128 writes an arbitrary-length digest of data into hash.
+func ShakeSum128(hash, data []byte) {
+ h := NewShake128()
+ h.Write(data)
+ h.Read(hash)
+}
+
+// ShakeSum256 writes an arbitrary-length digest of data into hash.
+func ShakeSum256(hash, data []byte) {
+ h := NewShake256()
+ h.Write(data)
+ h.Read(hash)
+}
+
+// shakeWrapper adds the Size, Sum, and Clone methods to a sha3.SHAKE
+// to implement the ShakeHash interface.
+type shakeWrapper struct {
+ *sha3.SHAKE
+ outputLen int
+ squeezing bool
+ newSHAKE func() *sha3.SHAKE
+}
+
+func (w *shakeWrapper) Read(p []byte) (n int, err error) {
+ w.squeezing = true
+ return w.SHAKE.Read(p)
+}
+
+func (w *shakeWrapper) Clone() ShakeHash {
+ s := w.newSHAKE()
+ b, err := w.MarshalBinary()
+ if err != nil {
+ panic(err) // unreachable
+ }
+ if err := s.UnmarshalBinary(b); err != nil {
+ panic(err) // unreachable
+ }
+ return &shakeWrapper{s, w.outputLen, w.squeezing, w.newSHAKE}
+}
+
+func (w *shakeWrapper) Size() int { return w.outputLen }
+
+func (w *shakeWrapper) Sum(b []byte) []byte {
+ if w.squeezing {
+ panic("sha3: Sum after Read")
+ }
+ out := make([]byte, w.outputLen)
+ // Clone the state so that we don't affect future Write calls.
+ s := w.Clone()
+ s.Read(out)
+ return append(b, out...)
+}
diff --git a/vendor/golang.org/x/crypto/ssh/agent/keyring.go b/vendor/golang.org/x/crypto/ssh/agent/keyring.go
index a9e29b6f84..a4f4c11e4d 100644
--- a/vendor/golang.org/x/crypto/ssh/agent/keyring.go
+++ b/vendor/golang.org/x/crypto/ssh/agent/keyring.go
@@ -104,7 +104,7 @@ func (r *keyring) Unlock(passphrase []byte) error {
if !r.locked {
return errors.New("agent: not locked")
}
- if 1 != subtle.ConstantTimeCompare(passphrase, r.passphrase) {
+ if subtle.ConstantTimeCompare(passphrase, r.passphrase) != 1 {
return fmt.Errorf("agent: incorrect passphrase")
}
diff --git a/vendor/golang.org/x/crypto/ssh/agent/server.go b/vendor/golang.org/x/crypto/ssh/agent/server.go
index 782c54eb7c..27394125de 100644
--- a/vendor/golang.org/x/crypto/ssh/agent/server.go
+++ b/vendor/golang.org/x/crypto/ssh/agent/server.go
@@ -246,10 +246,10 @@ func setConstraints(key *AddedKey, constraintBytes []byte) error {
// on arbitrary inputs; the CRT coefficient recomputation is cubic in
// |p| and can consume excessive CPU on oversized keys.
func checkRSAKeyParams(N, E, P, Q *big.Int) error {
- if N.BitLen() > 8192 {
+ if N.BitLen() > 16384 {
return errors.New("agent: RSA modulus too large")
}
- if P.BitLen() > 4096 || Q.BitLen() > 4096 {
+ if P.BitLen() > 8192 || Q.BitLen() > 8192 {
return errors.New("agent: RSA prime too large")
}
if E.BitLen() > 24 {
diff --git a/vendor/golang.org/x/crypto/ssh/certs.go b/vendor/golang.org/x/crypto/ssh/certs.go
index 6f75d77ec1..fa848f51a5 100644
--- a/vendor/golang.org/x/crypto/ssh/certs.go
+++ b/vendor/golang.org/x/crypto/ssh/certs.go
@@ -229,15 +229,20 @@ func parseCert(in []byte, privAlgo string) (*Certificate, error) {
return nil, err
}
c.Reserved = g.Reserved
+ // Reject a certificate whose signature key is itself a certificate before
+ // parsing it. Certificates signed by certificates are not supported (see
+ // PROTOCOL.certkeys), and rejecting after ParsePublicKey returns would allow
+ // a chain of nested certificates to recurse once per level, exhausting the
+ // goroutine stack.
+ if sigAlgo, _, ok := parseString(g.SignatureKey); !ok {
+ return nil, errShortRead
+ } else if _, ok := certKeyAlgoNames[string(sigAlgo)]; ok {
+ return nil, fmt.Errorf("ssh: the signature key type %q is invalid for certificates", sigAlgo)
+ }
k, err := ParsePublicKey(g.SignatureKey)
if err != nil {
return nil, err
}
- // The Type() function is intended to return only certificate key types, but
- // we use certKeyAlgoNames anyway for safety, to match [Certificate.Type].
- if _, ok := certKeyAlgoNames[k.Type()]; ok {
- return nil, fmt.Errorf("ssh: the signature key type %q is invalid for certificates", k.Type())
- }
c.SignatureKey = k
c.Signature, rest, ok = parseSignatureBody(g.Signature)
if !ok || len(rest) > 0 {
diff --git a/vendor/golang.org/x/crypto/ssh/channel.go b/vendor/golang.org/x/crypto/ssh/channel.go
index afc9aef185..ba3279e91d 100644
--- a/vendor/golang.org/x/crypto/ssh/channel.go
+++ b/vendor/golang.org/x/crypto/ssh/channel.go
@@ -216,6 +216,10 @@ type channel struct {
// packetPool has a buffer for each extended channel ID to
// save allocations during writes.
packetPool map[uint32][]byte
+
+ // closeOnce guards close so it is idempotent: closing the internal Go
+ // channels (msg, incomingRequests) more than once would panic.
+ closeOnce sync.Once
}
// writePacket sends a packet. If the packet is a channel close, it updates
@@ -340,7 +344,18 @@ func (ch *channel) handleData(packet []byte) error {
if extended == 1 {
ch.extPending.write(data)
} else if extended > 0 {
- // discard other extended data.
+ // RFC 4254, Section 5.2 defines no extended data types other
+ // than stderr (type 1, handled above) and this package provides
+ // no API to read them, so the data is discarded. Credit its
+ // window back immediately: it can never be read, so the
+ // deduction above would otherwise shrink the window permanently.
+ // adjustWindow returns io.EOF if the local side has already
+ // sent a channel close; ignore it like ReadExtended does, since
+ // an error returned here would terminate the mux read loop and
+ // tear down the whole connection.
+ if err := ch.adjustWindow(length); err != nil && err != io.EOF {
+ return err
+ }
} else {
ch.pending.write(data)
}
@@ -393,17 +408,19 @@ func (c *channel) ReadExtended(data []byte, extended uint32) (n int, err error)
}
func (c *channel) close() {
- c.pending.eof()
- c.extPending.eof()
- close(c.msg)
- close(c.incomingRequests)
- c.writeMu.Lock()
- // This is not necessary for a normal channel teardown, but if
- // there was another error, it is.
- c.sentClose = true
- c.writeMu.Unlock()
- // Unblock writers.
- c.remoteWin.close()
+ c.closeOnce.Do(func() {
+ c.pending.eof()
+ c.extPending.eof()
+ close(c.msg)
+ close(c.incomingRequests)
+ c.writeMu.Lock()
+ // This is not necessary for a normal channel teardown, but if
+ // there was another error, it is.
+ c.sentClose = true
+ c.writeMu.Unlock()
+ // Unblock writers.
+ c.remoteWin.close()
+ })
}
// responseMessageReceived is called when a success or failure message is
@@ -493,19 +510,20 @@ func (ch *channel) handlePacket(packet []byte) error {
func (m *mux) newChannel(chanType string, direction channelDirection, extraData []byte) *channel {
ch := &channel{
- remoteWin: window{Cond: newCond()},
- myWindow: channelWindowSize,
- pending: newBuffer(),
- extPending: newBuffer(),
- direction: direction,
- incomingRequests: make(chan *Request, chanSize),
- msg: make(chan interface{}, chanSize),
- chanType: chanType,
- extraData: extraData,
- mux: m,
- packetPool: make(map[uint32][]byte),
- }
- ch.localId = m.chanList.add(ch)
+ remoteWin: window{Cond: newCond()},
+ myWindow: channelWindowSize,
+ maxIncomingPayload: channelMaxPacket,
+ pending: newBuffer(),
+ extPending: newBuffer(),
+ direction: direction,
+ incomingRequests: make(chan *Request, chanSize),
+ msg: make(chan interface{}, chanSize),
+ chanType: chanType,
+ extraData: extraData,
+ mux: m,
+ packetPool: make(map[uint32][]byte),
+ }
+ m.chanList.add(ch)
return ch
}
@@ -529,7 +547,6 @@ func (ch *channel) Accept() (Channel, <-chan *Request, error) {
if ch.decided {
return nil, nil, errDecidedAlready
}
- ch.maxIncomingPayload = channelMaxPacket
confirm := channelOpenConfirmMsg{
PeersID: ch.remoteId,
MyID: ch.localId,
diff --git a/vendor/golang.org/x/crypto/ssh/client_auth.go b/vendor/golang.org/x/crypto/ssh/client_auth.go
index 60af2fc4dd..138cc9003a 100644
--- a/vendor/golang.org/x/crypto/ssh/client_auth.go
+++ b/vendor/golang.org/x/crypto/ssh/client_auth.go
@@ -798,7 +798,7 @@ func (g *gssAPIWithMICCallback) auth(session []byte, user string, c packetConn,
return authFailure, nil, fmt.Errorf("GSS-API Error:\n"+
"Major Status: %d\n"+
"Minor Status: %d\n"+
- "Error Message: %s\n", userAuthGSSAPIErrorResp.MajorStatus, userAuthGSSAPIErrorResp.MinorStatus,
+ "Error Message: %q\n", userAuthGSSAPIErrorResp.MajorStatus, userAuthGSSAPIErrorResp.MinorStatus,
userAuthGSSAPIErrorResp.Message)
case msgUserAuthGSSAPIToken:
userAuthGSSAPITokenReq := &userAuthGSSAPIToken{}
diff --git a/vendor/golang.org/x/crypto/ssh/common.go b/vendor/golang.org/x/crypto/ssh/common.go
index 2e44e9c9ec..aed0fd926a 100644
--- a/vendor/golang.org/x/crypto/ssh/common.go
+++ b/vendor/golang.org/x/crypto/ssh/common.go
@@ -419,7 +419,7 @@ type AlgorithmNegotiationError struct {
}
func (a *AlgorithmNegotiationError) Error() string {
- return fmt.Sprintf("ssh: no common algorithm for %s; we offered: %v, peer offered: %v",
+ return fmt.Sprintf("ssh: no common algorithm for %s; we offered: %q, peer offered: %q",
a.What, a.SupportedAlgorithms, a.RequestedAlgorithms)
}
@@ -544,7 +544,7 @@ func (c *Config) SetDefaults() {
if c.Rand == nil {
c.Rand = rand.Reader
}
- if c.Ciphers == nil {
+ if len(c.Ciphers) == 0 {
c.Ciphers = defaultCiphers
}
var ciphers []string
@@ -556,7 +556,7 @@ func (c *Config) SetDefaults() {
}
c.Ciphers = ciphers
- if c.KeyExchanges == nil {
+ if len(c.KeyExchanges) == 0 {
c.KeyExchanges = defaultKexAlgos
}
var kexs []string
@@ -571,7 +571,7 @@ func (c *Config) SetDefaults() {
}
c.KeyExchanges = kexs
- if c.MACs == nil {
+ if len(c.MACs) == 0 {
c.MACs = defaultMACs
}
var macs []string
diff --git a/vendor/golang.org/x/crypto/ssh/connection.go b/vendor/golang.org/x/crypto/ssh/connection.go
index 378f6407b5..9e0ed089c4 100644
--- a/vendor/golang.org/x/crypto/ssh/connection.go
+++ b/vendor/golang.org/x/crypto/ssh/connection.go
@@ -17,7 +17,7 @@ type OpenChannelError struct {
}
func (e *OpenChannelError) Error() string {
- return fmt.Sprintf("ssh: rejected: %s (%s)", e.Reason, e.Message)
+ return fmt.Sprintf("ssh: rejected: %s (%q)", e.Reason, e.Message)
}
// ConnMetadata holds metadata for the connection.
diff --git a/vendor/golang.org/x/crypto/ssh/handshake.go b/vendor/golang.org/x/crypto/ssh/handshake.go
index 4be3cbb6de..711a7f7c47 100644
--- a/vendor/golang.org/x/crypto/ssh/handshake.go
+++ b/vendor/golang.org/x/crypto/ssh/handshake.go
@@ -162,7 +162,7 @@ func newClientTransport(conn keyingTransport, clientVersion, serverVersion []byt
t.remoteAddr = addr
t.hostKeyCallback = config.HostKeyCallback
t.bannerCallback = config.BannerCallback
- if config.HostKeyAlgorithms != nil {
+ if len(config.HostKeyAlgorithms) > 0 {
t.hostKeyAlgorithms = config.HostKeyAlgorithms
} else {
t.hostKeyAlgorithms = defaultHostKeyAlgos
diff --git a/vendor/golang.org/x/crypto/ssh/keys.go b/vendor/golang.org/x/crypto/ssh/keys.go
index 64377715e1..fbbfb6cf42 100644
--- a/vendor/golang.org/x/crypto/ssh/keys.go
+++ b/vendor/golang.org/x/crypto/ssh/keys.go
@@ -485,10 +485,11 @@ func parseRSA(in []byte) (out PublicKey, rest []byte, err error) {
return nil, nil, err
}
- // 8192 bits is also the maximum RSA key size accepted by crypto/tls for
- // signature verification:
- // https://github.com/golang/go/blob/69801b25/src/crypto/tls/handshake_client.go#L1096
- if w.N.BitLen() > 8192 {
+ // 16384 bits is the largest RSA key OpenSSH will generate (ssh-keygen
+ // caps -b at 16384), so it is the practical upper bound for keys seen on
+ // the wire. Rejecting anything larger bounds the CPU spent verifying an
+ // attacker-supplied key and signature, mitigating a denial of service.
+ if w.N.BitLen() > 16384 {
return nil, nil, errors.New("ssh: rsa modulus too large")
}
if w.E.BitLen() > 24 {
@@ -1669,13 +1670,13 @@ func parseOpenSSHPrivateKey(key []byte, decrypt openSSHDecryptFunc) (crypto.Priv
}
// Mirror the validation done in parseRSA for public keys: cap the
- // modulus at the same limit enforced by crypto/tls, reject oversized
- // or invalid exponents, and additionally bound the prime factors to
+ // modulus at the OpenSSH-generated maximum, reject oversized or
+ // invalid exponents, and additionally bound the prime factors to
// avoid the expensive CRT coefficient recomputation in pk.Precompute.
- if key.N.BitLen() > 8192 {
+ if key.N.BitLen() > 16384 {
return nil, errors.New("ssh: rsa modulus too large")
}
- if key.P.BitLen() > 4096 || key.Q.BitLen() > 4096 {
+ if key.P.BitLen() > 8192 || key.Q.BitLen() > 8192 {
return nil, errors.New("ssh: rsa prime too large")
}
if key.E.BitLen() > 24 {
diff --git a/vendor/golang.org/x/crypto/ssh/messages.go b/vendor/golang.org/x/crypto/ssh/messages.go
index de86f71cf4..1d23dde259 100644
--- a/vendor/golang.org/x/crypto/ssh/messages.go
+++ b/vendor/golang.org/x/crypto/ssh/messages.go
@@ -44,16 +44,7 @@ type disconnectMsg struct {
}
func (d *disconnectMsg) Error() string {
- return fmt.Sprintf("ssh: disconnect, reason %d: %q", d.Reason, sanitizeString(d.Message))
-}
-
-func sanitizeString(s string) string {
- return strings.Map(func(r rune) rune {
- if r == '\t' || (r >= ' ' && r < 0x7f) {
- return r
- }
- return -1
- }, s)
+ return fmt.Sprintf("ssh: disconnect, reason %d: %q", d.Reason, d.Message)
}
// See RFC 4253, section 7.1.
diff --git a/vendor/golang.org/x/crypto/ssh/mux.go b/vendor/golang.org/x/crypto/ssh/mux.go
index 5775881c6a..955560bdae 100644
--- a/vendor/golang.org/x/crypto/ssh/mux.go
+++ b/vendor/golang.org/x/crypto/ssh/mux.go
@@ -32,18 +32,21 @@ type chanList struct {
offset uint32
}
-// Assigns a channel ID to the given channel.
-func (c *chanList) add(ch *channel) uint32 {
+// add stores the given channel and assigns its localId while holding the
+// lock, so that getChan can never return a channel whose localId is not yet
+// initialized.
+func (c *chanList) add(ch *channel) {
c.Lock()
defer c.Unlock()
for i := range c.chans {
if c.chans[i] == nil {
c.chans[i] = ch
- return uint32(i) + c.offset
+ ch.localId = uint32(i) + c.offset
+ return
}
}
c.chans = append(c.chans, ch)
- return uint32(len(c.chans)-1) + c.offset
+ ch.localId = uint32(len(c.chans)-1) + c.offset
}
// getChan returns the channel for the given ID.
@@ -343,8 +346,6 @@ func (m *mux) OpenChannel(chanType string, extra []byte) (Channel, <-chan *Reque
func (m *mux) openChannel(chanType string, extra []byte) (*channel, error) {
ch := m.newChannel(chanType, channelOutbound, extra)
- ch.maxIncomingPayload = channelMaxPacket
-
open := channelOpenMsg{
ChanType: chanType,
PeersWindow: ch.myWindow,
diff --git a/vendor/golang.org/x/crypto/ssh/server.go b/vendor/golang.org/x/crypto/ssh/server.go
index 3c0fcc953e..e090262682 100644
--- a/vendor/golang.org/x/crypto/ssh/server.go
+++ b/vendor/golang.org/x/crypto/ssh/server.go
@@ -26,10 +26,16 @@ type Permissions struct {
// defines "force-command" (only allow the given command to
// execute) and "source-address" (only allow connections from
// the given address). The SSH package currently only enforces
- // the "source-address" critical option. It is up to server
- // implementations to enforce other critical options, such as
- // "force-command", by checking them after the SSH handshake
- // is successful. In general, SSH servers should reject
+ // the "source-address" critical option: it is validated against
+ // the client's remote address whenever it is present in the
+ // Permissions returned by any authentication callback. Its value
+ // is a comma-separated list of IP addresses and CIDR blocks;
+ // consistently with OpenSSH, a connection whose remote address is
+ // not an IP address, such as a Unix domain socket, never matches
+ // the list and is rejected when the option is present. It is up
+ // to server implementations to enforce other critical options,
+ // such as "force-command", by checking them after the SSH
+ // handshake is successful. In general, SSH servers should reject
// connections that specify critical options that are unknown
// or not supported.
CriticalOptions map[string]string
@@ -223,7 +229,9 @@ type ServerConfig struct {
// Permissions object can be the same object, optionally modified, or a
// completely new object. If VerifiedPublicKeyCallback is non-nil,
// PublicKeyCallback is not allowed to return a PartialSuccessError, which
- // can instead be returned by VerifiedPublicKeyCallback.
+ // can instead be returned by VerifiedPublicKeyCallback. The
+ // signatureAlgorithm argument is the format of the signature that was
+ // successfully verified.
//
// VerifiedPublicKeyCallback does not affect which authentication methods
// are included in the list of methods that can be attempted by the client.
@@ -442,6 +450,10 @@ func (s *connection) serverHandshake(config *ServerConfig) (*Permissions, error)
return perms, err
}
+// checkSourceAddress matches addr against sourceAddrs, a comma-separated list
+// of IP addresses and CIDR blocks. Consistently with OpenSSH, a remote address
+// that is not IP-based, such as a Unix domain socket, never matches the list
+// and is rejected.
func checkSourceAddress(addr net.Addr, sourceAddrs string) error {
if addr == nil {
return errors.New("ssh: no address known for client, but source-address match required")
@@ -449,7 +461,7 @@ func checkSourceAddress(addr net.Addr, sourceAddrs string) error {
tcpAddr, ok := addr.(*net.TCPAddr)
if !ok {
- return fmt.Errorf("ssh: remote address %v is not an TCP address when checking source-address match", addr)
+ return fmt.Errorf("ssh: remote address %v is not a TCP address when checking source-address match", addr)
}
for _, sourceAddr := range strings.Split(sourceAddrs, ",") {
@@ -472,6 +484,21 @@ func checkSourceAddress(addr net.Addr, sourceAddrs string) error {
return fmt.Errorf("ssh: remote address %v is not allowed because of source-address restriction", addr)
}
+// checkSourceAddressCriticalOption enforces the source-address critical
+// option, if present in perms, as documented in Permissions.CriticalOptions.
+// A present but empty value matches no address, so it denies authentication,
+// consistently with OpenSSH, rather than being treated as absent.
+func checkSourceAddressCriticalOption(addr net.Addr, perms *Permissions) error {
+ if perms == nil {
+ return nil
+ }
+ saco, ok := perms.CriticalOptions[sourceAddressCriticalOption]
+ if !ok {
+ return nil
+ }
+ return checkSourceAddress(addr, saco)
+}
+
func gssExchangeToken(gssapiConfig *GSSAPIWithMICConfig, token []byte, s *connection,
sessionID []byte, userAuthReq userAuthRequestMsg) (authErr error, perms *Permissions, err error) {
gssAPIServer := gssapiConfig.Server
@@ -685,7 +712,7 @@ userAuthLoop:
}
if userAuthReq.Service != serviceSSH {
- return nil, errors.New("ssh: client attempted to negotiate for unknown service: " + userAuthReq.Service)
+ return nil, fmt.Errorf("ssh: client attempted to negotiate for unknown service: %q", userAuthReq.Service)
}
if s.user != userAuthReq.User && partialSuccessReturned {
@@ -771,7 +798,8 @@ userAuthLoop:
pubKey, err := ParsePublicKey(pubKeyData)
if err != nil {
- return nil, err
+ authErr = err
+ break
}
candidate, ok := cache.get(s.user, pubKeyData)
@@ -784,13 +812,14 @@ userAuthLoop:
return nil, errors.New("ssh: invalid library usage: PublicKeyCallback must not return partial success when VerifiedPublicKeyCallback is defined")
}
- if (candidate.result == nil || isPartialSuccessError) &&
- candidate.perms != nil &&
- candidate.perms.CriticalOptions != nil &&
- candidate.perms.CriticalOptions[sourceAddressCriticalOption] != "" {
- if err := checkSourceAddress(
- s.RemoteAddr(),
- candidate.perms.CriticalOptions[sourceAddressCriticalOption]); err != nil {
+ // This check is authoritative for the Permissions returned by
+ // PublicKeyCallback: the check at the end of the auth loop sees
+ // the final Permissions, which VerifiedPublicKeyCallback may
+ // have replaced, and is skipped on partial success. It also
+ // makes public key queries fail before the client signs when
+ // PublicKeyCallback supplies the restriction.
+ if candidate.result == nil || isPartialSuccessError {
+ if err := checkSourceAddressCriticalOption(s.RemoteAddr(), candidate.perms); err != nil {
candidate.result = err
}
}
@@ -864,14 +893,7 @@ userAuthLoop:
// Only call VerifiedPublicKeyCallback after the key has been accepted
// and successfully verified. If authErr is non-nil, the key is not
// considered verified and the callback must not run.
- perms, authErr = config.VerifiedPublicKeyCallback(s, pubKey, perms, algo)
- }
- if authErr == nil && perms != nil && perms.CriticalOptions != nil {
- if saco := perms.CriticalOptions[sourceAddressCriticalOption]; saco != "" {
- if err := checkSourceAddress(s.RemoteAddr(), saco); err != nil {
- authErr = err
- }
- }
+ perms, authErr = config.VerifiedPublicKeyCallback(s, pubKey, perms, sig.Format)
}
}
case "gssapi-with-mic":
@@ -925,6 +947,17 @@ userAuthLoop:
authErr = fmt.Errorf("ssh: unknown method %q", userAuthReq.Method)
}
+ // The source-address critical option is enforced on the Permissions
+ // returned by any authentication callback. Permissions returned
+ // together with a PartialSuccessError skip this check: that is safe
+ // because they are required to be nil, as enforced in the partial
+ // success handling below.
+ if authErr == nil {
+ if err := checkSourceAddressCriticalOption(s.RemoteAddr(), perms); err != nil {
+ authErr = err
+ }
+ }
+
authErrs = append(authErrs, authErr)
if config.AuthLogCallback != nil {
diff --git a/vendor/golang.org/x/crypto/ssh/ssh_gss.go b/vendor/golang.org/x/crypto/ssh/ssh_gss.go
index a6249a1227..a7a099754f 100644
--- a/vendor/golang.org/x/crypto/ssh/ssh_gss.go
+++ b/vendor/golang.org/x/crypto/ssh/ssh_gss.go
@@ -118,24 +118,28 @@ func parseGSSAPIPayload(payload []byte) (*userAuthRequestGSSAPI, error) {
OIDS: make([]asn1.ObjectIdentifier, n),
}
for i := 0; i < int(n); i++ {
- var (
- desiredMech []byte
- err error
- )
+ var desiredMech []byte
desiredMech, rest, ok = parseString(rest)
if !ok {
return nil, errors.New("parse string failed")
}
- if rest, err = asn1.Unmarshal(desiredMech, &s.OIDS[i]); err != nil {
+ trailing, err := asn1.Unmarshal(desiredMech, &s.OIDS[i])
+ if err != nil {
return nil, err
}
+ if len(trailing) != 0 {
+ return nil, errors.New("trailing bytes after OID")
+ }
+ }
+ if len(rest) != 0 {
+ return nil, errors.New("trailing bytes after mechanisms")
}
return s, nil
}
// See RFC 4462 section 3.6.
func buildMIC(sessionID string, username string, service string, authMethod string) []byte {
- out := make([]byte, 0, 0)
+ out := make([]byte, 0)
out = appendString(out, sessionID)
out = append(out, msgUserAuthRequest)
out = appendString(out, username)
diff --git a/vendor/golang.org/x/crypto/ssh/streamlocal.go b/vendor/golang.org/x/crypto/ssh/streamlocal.go
index 152470fcb7..8e997da3db 100644
--- a/vendor/golang.org/x/crypto/ssh/streamlocal.go
+++ b/vendor/golang.org/x/crypto/ssh/streamlocal.go
@@ -58,6 +58,7 @@ func (c *Client) dialStreamLocal(socketPath string) (Channel, error) {
return nil, err
}
go DiscardRequests(in)
+ go io.Copy(io.Discard, ch.Stderr())
return ch, err
}
@@ -79,6 +80,7 @@ func (l *unixListener) Accept() (net.Conn, error) {
return nil, err
}
go DiscardRequests(incoming)
+ go io.Copy(io.Discard, ch.Stderr())
return &chanConn{
Channel: ch,
diff --git a/vendor/golang.org/x/crypto/ssh/tcpip.go b/vendor/golang.org/x/crypto/ssh/tcpip.go
index 78c41fe5a1..213d8a614a 100644
--- a/vendor/golang.org/x/crypto/ssh/tcpip.go
+++ b/vendor/golang.org/x/crypto/ssh/tcpip.go
@@ -332,6 +332,7 @@ func (l *tcpListener) Accept() (net.Conn, error) {
return nil, err
}
go DiscardRequests(incoming)
+ go io.Copy(io.Discard, ch.Stderr())
return &chanConn{
Channel: ch,
@@ -495,6 +496,7 @@ func (c *Client) dial(laddr string, lport int, raddr string, rport int) (Channel
return nil, err
}
go DiscardRequests(in)
+ go io.Copy(io.Discard, ch.Stderr())
return ch, nil
}
diff --git a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go b/vendor/golang.org/x/crypto/ssh/terminal/terminal.go
deleted file mode 100644
index a4d1919a9e..0000000000
--- a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go
+++ /dev/null
@@ -1,76 +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 terminal provides support functions for dealing with terminals, as
-// commonly found on UNIX systems.
-//
-// Deprecated: this package moved to golang.org/x/term.
-package terminal
-
-import (
- "io"
-
- "golang.org/x/term"
-)
-
-// EscapeCodes contains escape sequences that can be written to the terminal in
-// order to achieve different styles of text.
-type EscapeCodes = term.EscapeCodes
-
-// Terminal contains the state for running a VT100 terminal that is capable of
-// reading lines of input.
-type Terminal = term.Terminal
-
-// NewTerminal runs a VT100 terminal on the given ReadWriter. If the ReadWriter is
-// a local terminal, that terminal must first have been put into raw mode.
-// prompt is a string that is written at the start of each input line (i.e.
-// "> ").
-func NewTerminal(c io.ReadWriter, prompt string) *Terminal {
- return term.NewTerminal(c, prompt)
-}
-
-// ErrPasteIndicator may be returned from ReadLine as the error, in addition
-// to valid line data. It indicates that bracketed paste mode is enabled and
-// that the returned line consists only of pasted data. Programs may wish to
-// interpret pasted data more literally than typed data.
-var ErrPasteIndicator = term.ErrPasteIndicator
-
-// State contains the state of a terminal.
-type State = term.State
-
-// IsTerminal returns whether the given file descriptor is a terminal.
-func IsTerminal(fd int) bool {
- return term.IsTerminal(fd)
-}
-
-// ReadPassword reads a line of input from a terminal without local echo. This
-// is commonly used for inputting passwords and other sensitive data. The slice
-// returned does not include the \n.
-func ReadPassword(fd int) ([]byte, error) {
- return term.ReadPassword(fd)
-}
-
-// MakeRaw puts the terminal connected to the given file descriptor into raw
-// mode and returns the previous state of the terminal so that it can be
-// restored.
-func MakeRaw(fd int) (*State, error) {
- return term.MakeRaw(fd)
-}
-
-// Restore restores the terminal connected to the given file descriptor to a
-// previous state.
-func Restore(fd int, oldState *State) error {
- return term.Restore(fd, oldState)
-}
-
-// GetState returns the current state of a terminal which may be useful to
-// restore the terminal after a signal.
-func GetState(fd int) (*State, error) {
- return term.GetState(fd)
-}
-
-// GetSize returns the dimensions of the given terminal.
-func GetSize(fd int) (width, height int, err error) {
- return term.GetSize(fd)
-}
diff --git a/vendor/golang.org/x/text/currency/common.go b/vendor/golang.org/x/text/currency/common.go
new file mode 100644
index 0000000000..fef15be554
--- /dev/null
+++ b/vendor/golang.org/x/text/currency/common.go
@@ -0,0 +1,67 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+package currency
+
+import (
+ "time"
+
+ "golang.org/x/text/language"
+)
+
+// This file contains code common to gen.go and the package code.
+
+const (
+ cashShift = 3
+ roundMask = 0x7
+
+ nonTenderBit = 0x8000
+)
+
+// currencyInfo contains information about a currency.
+// bits 0..2: index into roundings for standard rounding
+// bits 3..5: index into roundings for cash rounding
+type currencyInfo byte
+
+// roundingType defines the scale (number of fractional decimals) and increments
+// in terms of units of size 10^-scale. For example, for scale == 2 and
+// increment == 1, the currency is rounded to units of 0.01.
+type roundingType struct {
+ scale, increment uint8
+}
+
+// roundings contains rounding data for currencies. This struct is
+// created by hand as it is very unlikely to change much.
+var roundings = [...]roundingType{
+ {2, 1}, // default
+ {0, 1},
+ {1, 1},
+ {3, 1},
+ {4, 1},
+ {2, 5}, // cash rounding alternative
+ {2, 50},
+}
+
+// regionToCode returns a 16-bit region code. Only two-letter codes are
+// supported. (Three-letter codes are not needed.)
+func regionToCode(r language.Region) uint16 {
+ if s := r.String(); len(s) == 2 {
+ return uint16(s[0])<<8 | uint16(s[1])
+ }
+ return 0
+}
+
+func toDate(t time.Time) uint32 {
+ y := t.Year()
+ if y == 1 {
+ return 0
+ }
+ date := uint32(y) << 4
+ date |= uint32(t.Month())
+ date <<= 5
+ date |= uint32(t.Day())
+ return date
+}
+
+func fromDate(date uint32) time.Time {
+ return time.Date(int(date>>9), time.Month((date>>5)&0xf), int(date&0x1f), 0, 0, 0, 0, time.UTC)
+}
diff --git a/vendor/golang.org/x/text/currency/currency.go b/vendor/golang.org/x/text/currency/currency.go
new file mode 100644
index 0000000000..598ddeff42
--- /dev/null
+++ b/vendor/golang.org/x/text/currency/currency.go
@@ -0,0 +1,185 @@
+// 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.
+
+//go:generate go run gen.go gen_common.go -output tables.go
+
+// Package currency contains currency-related functionality.
+//
+// NOTE: the formatting functionality is currently under development and may
+// change without notice.
+package currency // import "golang.org/x/text/currency"
+
+import (
+ "errors"
+ "sort"
+
+ "golang.org/x/text/internal/tag"
+ "golang.org/x/text/language"
+)
+
+// TODO:
+// - language-specific currency names.
+// - currency formatting.
+// - currency information per region
+// - register currency code (there are no private use area)
+
+// TODO: remove Currency type from package language.
+
+// Kind determines the rounding and rendering properties of a currency value.
+type Kind struct {
+ rounding rounding
+ // TODO: formatting type: standard, accounting. See CLDR.
+}
+
+type rounding byte
+
+const (
+ standard rounding = iota
+ cash
+)
+
+var (
+ // Standard defines standard rounding and formatting for currencies.
+ Standard Kind = Kind{rounding: standard}
+
+ // Cash defines rounding and formatting standards for cash transactions.
+ Cash Kind = Kind{rounding: cash}
+
+ // Accounting defines rounding and formatting standards for accounting.
+ Accounting Kind = Kind{rounding: standard}
+)
+
+// Rounding reports the rounding characteristics for the given currency, where
+// scale is the number of fractional decimals and increment is the number of
+// units in terms of 10^(-scale) to which to round to.
+func (k Kind) Rounding(cur Unit) (scale, increment int) {
+ info := currency.Elem(int(cur.index))[3]
+ switch k.rounding {
+ case standard:
+ info &= roundMask
+ case cash:
+ info >>= cashShift
+ }
+ return int(roundings[info].scale), int(roundings[info].increment)
+}
+
+// Unit is an ISO 4217 currency designator.
+type Unit struct {
+ index uint16
+}
+
+// String returns the ISO code of u.
+func (u Unit) String() string {
+ if u.index == 0 {
+ return "XXX"
+ }
+ return currency.Elem(int(u.index))[:3]
+}
+
+// Amount creates an Amount for the given currency unit and amount.
+func (u Unit) Amount(amount interface{}) Amount {
+ // TODO: verify amount is a supported number type
+ return Amount{amount: amount, currency: u}
+}
+
+var (
+ errSyntax = errors.New("currency: tag is not well-formed")
+ errValue = errors.New("currency: tag is not a recognized currency")
+)
+
+// ParseISO parses a 3-letter ISO 4217 currency code. It returns an error if s
+// is not well-formed or not a recognized currency code.
+func ParseISO(s string) (Unit, error) {
+ var buf [4]byte // Take one byte more to detect oversize keys.
+ key := buf[:copy(buf[:], s)]
+ if !tag.FixCase("XXX", key) {
+ return Unit{}, errSyntax
+ }
+ if i := currency.Index(key); i >= 0 {
+ if i == xxx {
+ return Unit{}, nil
+ }
+ return Unit{uint16(i)}, nil
+ }
+ return Unit{}, errValue
+}
+
+// MustParseISO is like ParseISO, but panics if the given currency unit
+// cannot be parsed. It simplifies safe initialization of Unit values.
+func MustParseISO(s string) Unit {
+ c, err := ParseISO(s)
+ if err != nil {
+ panic(err)
+ }
+ return c
+}
+
+// FromRegion reports the currency unit that is currently legal tender in the
+// given region according to CLDR. It will return false if region currently does
+// not have a legal tender.
+func FromRegion(r language.Region) (currency Unit, ok bool) {
+ x := regionToCode(r)
+ i := sort.Search(len(regionToCurrency), func(i int) bool {
+ return regionToCurrency[i].region >= x
+ })
+ if i < len(regionToCurrency) && regionToCurrency[i].region == x {
+ return Unit{regionToCurrency[i].code}, true
+ }
+ return Unit{}, false
+}
+
+// FromTag reports the most likely currency for the given tag. It considers the
+// currency defined in the -u extension and infers the region if necessary.
+func FromTag(t language.Tag) (Unit, language.Confidence) {
+ if cur := t.TypeForKey("cu"); len(cur) == 3 {
+ c, _ := ParseISO(cur)
+ return c, language.Exact
+ }
+ r, conf := t.Region()
+ if cur, ok := FromRegion(r); ok {
+ return cur, conf
+ }
+ return Unit{}, language.No
+}
+
+var (
+ // Undefined and testing.
+ XXX Unit = Unit{}
+ XTS Unit = Unit{xts}
+
+ // G10 currencies https://en.wikipedia.org/wiki/G10_currencies.
+ USD Unit = Unit{usd}
+ EUR Unit = Unit{eur}
+ JPY Unit = Unit{jpy}
+ GBP Unit = Unit{gbp}
+ CHF Unit = Unit{chf}
+ AUD Unit = Unit{aud}
+ NZD Unit = Unit{nzd}
+ CAD Unit = Unit{cad}
+ SEK Unit = Unit{sek}
+ NOK Unit = Unit{nok}
+
+ // Additional common currencies as defined by CLDR.
+ BRL Unit = Unit{brl}
+ CNY Unit = Unit{cny}
+ DKK Unit = Unit{dkk}
+ INR Unit = Unit{inr}
+ RUB Unit = Unit{rub}
+ HKD Unit = Unit{hkd}
+ IDR Unit = Unit{idr}
+ KRW Unit = Unit{krw}
+ MXN Unit = Unit{mxn}
+ PLN Unit = Unit{pln}
+ SAR Unit = Unit{sar}
+ THB Unit = Unit{thb}
+ TRY Unit = Unit{try}
+ TWD Unit = Unit{twd}
+ ZAR Unit = Unit{zar}
+
+ // Precious metals.
+ XAG Unit = Unit{xag}
+ XAU Unit = Unit{xau}
+ XPT Unit = Unit{xpt}
+ XPD Unit = Unit{xpd}
+)
diff --git a/vendor/golang.org/x/text/currency/format.go b/vendor/golang.org/x/text/currency/format.go
new file mode 100644
index 0000000000..cc4570d3b6
--- /dev/null
+++ b/vendor/golang.org/x/text/currency/format.go
@@ -0,0 +1,220 @@
+// 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 currency
+
+import (
+ "fmt"
+ "sort"
+
+ "golang.org/x/text/internal/format"
+ "golang.org/x/text/internal/language/compact"
+ "golang.org/x/text/internal/number"
+
+ "golang.org/x/text/language"
+)
+
+// Amount is an amount-currency unit pair.
+type Amount struct {
+ amount interface{} // Change to decimal(64|128).
+ currency Unit
+}
+
+// Currency reports the currency unit of this amount.
+func (a Amount) Currency() Unit { return a.currency }
+
+// TODO: based on decimal type, but may make sense to customize a bit.
+// func (a Amount) Decimal()
+// func (a Amount) Int() (int64, error)
+// func (a Amount) Fraction() (int64, error)
+// func (a Amount) Rat() *big.Rat
+// func (a Amount) Float() (float64, error)
+// func (a Amount) Scale() uint
+// func (a Amount) Precision() uint
+// func (a Amount) Sign() int
+//
+// Add/Sub/Div/Mul/Round.
+
+// Format implements fmt.Formatter. It accepts format.State for
+// language-specific rendering.
+func (a Amount) Format(s fmt.State, verb rune) {
+ v := formattedValue{
+ currency: a.currency,
+ amount: a.amount,
+ format: defaultFormat,
+ }
+ v.Format(s, verb)
+}
+
+// formattedValue is currency amount or unit that implements language-sensitive
+// formatting.
+type formattedValue struct {
+ currency Unit
+ amount interface{} // Amount, Unit, or number.
+ format *options
+}
+
+// Format implements fmt.Formatter. It accepts format.State for
+// language-specific rendering.
+func (v formattedValue) Format(s fmt.State, verb rune) {
+ var tag language.Tag
+ var lang compact.ID
+ if state, ok := s.(format.State); ok {
+ tag = state.Language()
+ lang, _ = compact.RegionalID(compact.Tag(tag))
+ }
+
+ // Get the options. Use DefaultFormat if not present.
+ opt := v.format
+ if opt == nil {
+ opt = defaultFormat
+ }
+ cur := v.currency
+ if cur.index == 0 {
+ cur = opt.currency
+ }
+
+ sym := opt.symbol(lang, cur)
+ if v.amount != nil {
+ var f number.Formatter
+ f.InitDecimal(tag)
+
+ scale, increment := opt.kind.Rounding(cur)
+ f.RoundingContext.SetScale(scale)
+ f.RoundingContext.Increment = uint32(increment)
+ f.RoundingContext.IncrementScale = uint8(scale)
+ f.RoundingContext.Mode = number.ToNearestAway
+
+ d := f.Append(nil, v.amount)
+
+ fmt.Fprint(s, sym, " ", string(d))
+ } else {
+ fmt.Fprint(s, sym)
+ }
+}
+
+// Formatter decorates a given number, Unit or Amount with formatting options.
+type Formatter func(amount interface{}) formattedValue
+
+// func (f Formatter) Options(opts ...Option) Formatter
+
+// TODO: call this a Formatter or FormatFunc?
+
+var dummy = USD.Amount(0)
+
+// adjust creates a new Formatter based on the adjustments of fn on f.
+func (f Formatter) adjust(fn func(*options)) Formatter {
+ var o options = *(f(dummy).format)
+ fn(&o)
+ return o.format
+}
+
+// Default creates a new Formatter that defaults to currency unit c if a numeric
+// value is passed that is not associated with a currency.
+func (f Formatter) Default(currency Unit) Formatter {
+ return f.adjust(func(o *options) { o.currency = currency })
+}
+
+// Kind sets the kind of the underlying currency unit.
+func (f Formatter) Kind(k Kind) Formatter {
+ return f.adjust(func(o *options) { o.kind = k })
+}
+
+var defaultFormat *options = ISO(dummy).format
+
+var (
+ // Uses Narrow symbols. Overrides Symbol, if present.
+ NarrowSymbol Formatter = Formatter(formNarrow)
+
+ // Use Symbols instead of ISO codes, when available.
+ Symbol Formatter = Formatter(formSymbol)
+
+ // Use ISO code as symbol.
+ ISO Formatter = Formatter(formISO)
+
+ // TODO:
+ // // Use full name as symbol.
+ // Name Formatter
+)
+
+// options configures rendering and rounding options for an Amount.
+type options struct {
+ currency Unit
+ kind Kind
+
+ symbol func(compactIndex compact.ID, c Unit) string
+}
+
+func (o *options) format(amount interface{}) formattedValue {
+ v := formattedValue{format: o}
+ switch x := amount.(type) {
+ case Amount:
+ v.amount = x.amount
+ v.currency = x.currency
+ case *Amount:
+ v.amount = x.amount
+ v.currency = x.currency
+ case Unit:
+ v.currency = x
+ case *Unit:
+ v.currency = *x
+ default:
+ if o.currency.index == 0 {
+ panic("cannot format number without a currency being set")
+ }
+ // TODO: Must be a number.
+ v.amount = x
+ v.currency = o.currency
+ }
+ return v
+}
+
+var (
+ optISO = options{symbol: lookupISO}
+ optSymbol = options{symbol: lookupSymbol}
+ optNarrow = options{symbol: lookupNarrow}
+)
+
+// These need to be functions, rather than curried methods, as curried methods
+// are evaluated at init time, causing tables to be included unconditionally.
+func formISO(x interface{}) formattedValue { return optISO.format(x) }
+func formSymbol(x interface{}) formattedValue { return optSymbol.format(x) }
+func formNarrow(x interface{}) formattedValue { return optNarrow.format(x) }
+
+func lookupISO(x compact.ID, c Unit) string { return c.String() }
+func lookupSymbol(x compact.ID, c Unit) string { return normalSymbol.lookup(x, c) }
+func lookupNarrow(x compact.ID, c Unit) string { return narrowSymbol.lookup(x, c) }
+
+type symbolIndex struct {
+ index []uint16 // position corresponds with compact index of language.
+ data []curToIndex
+}
+
+var (
+ normalSymbol = symbolIndex{normalLangIndex, normalSymIndex}
+ narrowSymbol = symbolIndex{narrowLangIndex, narrowSymIndex}
+)
+
+func (x *symbolIndex) lookup(lang compact.ID, c Unit) string {
+ for {
+ index := x.data[x.index[lang]:x.index[lang+1]]
+ i := sort.Search(len(index), func(i int) bool {
+ return index[i].cur >= c.index
+ })
+ if i < len(index) && index[i].cur == c.index {
+ x := index[i].idx
+ start := x + 1
+ end := start + uint16(symbols[x])
+ if start == end {
+ return c.String()
+ }
+ return symbols[start:end]
+ }
+ if lang == 0 {
+ break
+ }
+ lang = lang.Parent()
+ }
+ return c.String()
+}
diff --git a/vendor/golang.org/x/text/currency/query.go b/vendor/golang.org/x/text/currency/query.go
new file mode 100644
index 0000000000..7bf9430a62
--- /dev/null
+++ b/vendor/golang.org/x/text/currency/query.go
@@ -0,0 +1,152 @@
+// 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 currency
+
+import (
+ "sort"
+ "time"
+
+ "golang.org/x/text/language"
+)
+
+// QueryIter represents a set of Units. The default set includes all Units that
+// are currently in use as legal tender in any Region.
+type QueryIter interface {
+ // Next returns true if there is a next element available.
+ // It must be called before any of the other methods are called.
+ Next() bool
+
+ // Unit returns the unit of the current iteration.
+ Unit() Unit
+
+ // Region returns the Region for the current iteration.
+ Region() language.Region
+
+ // From returns the date from which the unit was used in the region.
+ // It returns false if this date is unknown.
+ From() (time.Time, bool)
+
+ // To returns the date up till which the unit was used in the region.
+ // It returns false if this date is unknown or if the unit is still in use.
+ To() (time.Time, bool)
+
+ // IsTender reports whether the unit is a legal tender in the region during
+ // the specified date range.
+ IsTender() bool
+}
+
+// Query represents a set of Units. The default set includes all Units that are
+// currently in use as legal tender in any Region.
+func Query(options ...QueryOption) QueryIter {
+ it := &iter{
+ end: len(regionData),
+ date: 0xFFFFFFFF,
+ }
+ for _, fn := range options {
+ fn(it)
+ }
+ return it
+}
+
+// NonTender returns a new query that also includes matching Units that are not
+// legal tender.
+var NonTender QueryOption = nonTender
+
+func nonTender(i *iter) {
+ i.nonTender = true
+}
+
+// Historical selects the units for all dates.
+var Historical QueryOption = historical
+
+func historical(i *iter) {
+ i.date = hist
+}
+
+// A QueryOption can be used to change the set of unit information returned by
+// a query.
+type QueryOption func(*iter)
+
+// Date queries the units that were in use at the given point in history.
+func Date(t time.Time) QueryOption {
+ d := toDate(t)
+ return func(i *iter) {
+ i.date = d
+ }
+}
+
+// Region limits the query to only return entries for the given region.
+func Region(r language.Region) QueryOption {
+ p, end := len(regionData), len(regionData)
+ x := regionToCode(r)
+ i := sort.Search(len(regionData), func(i int) bool {
+ return regionData[i].region >= x
+ })
+ if i < len(regionData) && regionData[i].region == x {
+ p = i
+ for i++; i < len(regionData) && regionData[i].region == x; i++ {
+ }
+ end = i
+ }
+ return func(i *iter) {
+ i.p, i.end = p, end
+ }
+}
+
+const (
+ hist = 0x00
+ now = 0xFFFFFFFF
+)
+
+type iter struct {
+ *regionInfo
+ p, end int
+ date uint32
+ nonTender bool
+}
+
+func (i *iter) Next() bool {
+ for ; i.p < i.end; i.p++ {
+ i.regionInfo = ®ionData[i.p]
+ if !i.nonTender && !i.IsTender() {
+ continue
+ }
+ if i.date == hist || (i.from <= i.date && (i.to == 0 || i.date <= i.to)) {
+ i.p++
+ return true
+ }
+ }
+ return false
+}
+
+func (r *regionInfo) Region() language.Region {
+ // TODO: this could be much faster.
+ var buf [2]byte
+ buf[0] = uint8(r.region >> 8)
+ buf[1] = uint8(r.region)
+ return language.MustParseRegion(string(buf[:]))
+}
+
+func (r *regionInfo) Unit() Unit {
+ return Unit{r.code &^ nonTenderBit}
+}
+
+func (r *regionInfo) IsTender() bool {
+ return r.code&nonTenderBit == 0
+}
+
+func (r *regionInfo) From() (time.Time, bool) {
+ if r.from == 0 {
+ return time.Time{}, false
+ }
+ return fromDate(r.from), true
+}
+
+func (r *regionInfo) To() (time.Time, bool) {
+ if r.to == 0 {
+ return time.Time{}, false
+ }
+ return fromDate(r.to), true
+}
diff --git a/vendor/golang.org/x/text/currency/tables.go b/vendor/golang.org/x/text/currency/tables.go
new file mode 100644
index 0000000000..d1a7440a6b
--- /dev/null
+++ b/vendor/golang.org/x/text/currency/tables.go
@@ -0,0 +1,2629 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+package currency
+
+import "golang.org/x/text/internal/tag"
+
+// CLDRVersion is the CLDR version from which the tables in this package are derived.
+const CLDRVersion = "32"
+
+const (
+ xxx = 285
+ xts = 283
+ usd = 252
+ eur = 94
+ jpy = 133
+ gbp = 99
+ chf = 61
+ aud = 19
+ nzd = 192
+ cad = 58
+ sek = 219
+ nok = 190
+ dkk = 82
+ xag = 266
+ xau = 267
+ xpt = 280
+ xpd = 278
+ brl = 46
+ cny = 68
+ inr = 125
+ rub = 210
+ hkd = 114
+ idr = 120
+ krw = 141
+ mxn = 178
+ pln = 201
+ sar = 213
+ thb = 235
+ try = 244
+ twd = 246
+ zar = 293
+)
+
+// currency holds an alphabetically sorted list of canonical 3-letter currency
+// identifiers. Each identifier is followed by a byte of type currencyInfo,
+// defined in gen_common.go.
+const currency tag.Index = "" + // Size: 1208 bytes
+ "\x00\x00\x00\x00ADP\x09AED\x00AFA\x00AFN\x09ALK\x00ALL\x09AMD\x09ANG\x00" +
+ "AOA\x00AOK\x00AON\x00AOR\x00ARA\x00ARL\x00ARM\x00ARP\x00ARS\x00ATS\x00AU" +
+ "D\x00AWG\x00AZM\x00AZN\x00BAD\x00BAM\x00BAN\x00BBD\x00BDT\x00BEC\x00BEF" +
+ "\x00BEL\x00BGL\x00BGM\x00BGN\x00BGO\x00BHD\x1bBIF\x09BMD\x00BND\x00BOB" +
+ "\x00BOL\x00BOP\x00BOV\x00BRB\x00BRC\x00BRE\x00BRL\x00BRN\x00BRR\x00BRZ" +
+ "\x00BSD\x00BTN\x00BUK\x00BWP\x00BYB\x00BYN\x00BYR\x09BZD\x00CAD(CDF\x00C" +
+ "HE\x00CHF(CHW\x00CLE\x00CLF$CLP\x09CNH\x00CNX\x00CNY\x00COP\x09COU\x00CR" +
+ "C\x08CSD\x00CSK\x00CUC\x00CUP\x00CVE\x00CYP\x00CZK\x08DDM\x00DEM\x00DJF" +
+ "\x09DKK0DOP\x00DZD\x00ECS\x00ECV\x00EEK\x00EGP\x00ERN\x00ESA\x00ESB\x00E" +
+ "SP\x09ETB\x00EUR\x00FIM\x00FJD\x00FKP\x00FRF\x00GBP\x00GEK\x00GEL\x00GHC" +
+ "\x00GHS\x00GIP\x00GMD\x00GNF\x09GNS\x00GQE\x00GRD\x00GTQ\x00GWE\x00GWP" +
+ "\x00GYD\x09HKD\x00HNL\x00HRD\x00HRK\x00HTG\x00HUF\x08IDR\x09IEP\x00ILP" +
+ "\x00ILR\x00ILS\x00INR\x00IQD\x09IRR\x09ISJ\x00ISK\x09ITL\x09JMD\x00JOD" +
+ "\x1bJPY\x09KES\x00KGS\x00KHR\x00KMF\x09KPW\x09KRH\x00KRO\x00KRW\x09KWD" +
+ "\x1bKYD\x00KZT\x00LAK\x09LBP\x09LKR\x00LRD\x00LSL\x00LTL\x00LTT\x00LUC" +
+ "\x00LUF\x09LUL\x00LVL\x00LVR\x00LYD\x1bMAD\x00MAF\x00MCF\x00MDC\x00MDL" +
+ "\x00MGA\x09MGF\x09MKD\x00MKN\x00MLF\x00MMK\x09MNT\x09MOP\x00MRO\x09MTL" +
+ "\x00MTP\x00MUR\x09MVP\x00MVR\x00MWK\x00MXN\x00MXP\x00MXV\x00MYR\x00MZE" +
+ "\x00MZM\x00MZN\x00NAD\x00NGN\x00NIC\x00NIO\x00NLG\x00NOK\x08NPR\x00NZD" +
+ "\x00OMR\x1bPAB\x00PEI\x00PEN\x00PES\x00PGK\x00PHP\x00PKR\x09PLN\x00PLZ" +
+ "\x00PTE\x00PYG\x09QAR\x00RHD\x00ROL\x00RON\x00RSD\x09RUB\x00RUR\x00RWF" +
+ "\x09SAR\x00SBD\x00SCR\x00SDD\x00SDG\x00SDP\x00SEK\x08SGD\x00SHP\x00SIT" +
+ "\x00SKK\x00SLL\x09SOS\x09SRD\x00SRG\x00SSP\x00STD\x09STN\x00SUR\x00SVC" +
+ "\x00SYP\x09SZL\x00THB\x00TJR\x00TJS\x00TMM\x09TMT\x00TND\x1bTOP\x00TPE" +
+ "\x00TRL\x09TRY\x00TTD\x00TWD\x08TZS\x09UAH\x00UAK\x00UGS\x00UGX\x09USD" +
+ "\x00USN\x00USS\x00UYI\x09UYP\x00UYU\x00UZS\x09VEB\x00VEF\x00VND\x09VNN" +
+ "\x00VUV\x09WST\x00XAF\x09XAG\x00XAU\x00XBA\x00XBB\x00XBC\x00XBD\x00XCD" +
+ "\x00XDR\x00XEU\x00XFO\x00XFU\x00XOF\x09XPD\x00XPF\x09XPT\x00XRE\x00XSU" +
+ "\x00XTS\x00XUA\x00XXX\x00YDD\x00YER\x09YUD\x00YUM\x00YUN\x00YUR\x00ZAL" +
+ "\x00ZAR\x00ZMK\x09ZMW\x00ZRN\x00ZRZ\x00ZWD\x09ZWL\x00ZWR\x00\xff\xff\xff" +
+ "\xff"
+
+const numCurrencies = 300
+
+type toCurrency struct {
+ region uint16
+ code uint16
+}
+
+var regionToCurrency = []toCurrency{ // 255 elements
+ 0: {region: 0x4143, code: 0xdd},
+ 1: {region: 0x4144, code: 0x5e},
+ 2: {region: 0x4145, code: 0x2},
+ 3: {region: 0x4146, code: 0x4},
+ 4: {region: 0x4147, code: 0x110},
+ 5: {region: 0x4149, code: 0x110},
+ 6: {region: 0x414c, code: 0x6},
+ 7: {region: 0x414d, code: 0x7},
+ 8: {region: 0x414f, code: 0x9},
+ 9: {region: 0x4152, code: 0x11},
+ 10: {region: 0x4153, code: 0xfc},
+ 11: {region: 0x4154, code: 0x5e},
+ 12: {region: 0x4155, code: 0x13},
+ 13: {region: 0x4157, code: 0x14},
+ 14: {region: 0x4158, code: 0x5e},
+ 15: {region: 0x415a, code: 0x16},
+ 16: {region: 0x4241, code: 0x18},
+ 17: {region: 0x4242, code: 0x1a},
+ 18: {region: 0x4244, code: 0x1b},
+ 19: {region: 0x4245, code: 0x5e},
+ 20: {region: 0x4246, code: 0x115},
+ 21: {region: 0x4247, code: 0x21},
+ 22: {region: 0x4248, code: 0x23},
+ 23: {region: 0x4249, code: 0x24},
+ 24: {region: 0x424a, code: 0x115},
+ 25: {region: 0x424c, code: 0x5e},
+ 26: {region: 0x424d, code: 0x25},
+ 27: {region: 0x424e, code: 0x26},
+ 28: {region: 0x424f, code: 0x27},
+ 29: {region: 0x4251, code: 0xfc},
+ 30: {region: 0x4252, code: 0x2e},
+ 31: {region: 0x4253, code: 0x32},
+ 32: {region: 0x4254, code: 0x33},
+ 33: {region: 0x4256, code: 0xbe},
+ 34: {region: 0x4257, code: 0x35},
+ 35: {region: 0x4259, code: 0x37},
+ 36: {region: 0x425a, code: 0x39},
+ 37: {region: 0x4341, code: 0x3a},
+ 38: {region: 0x4343, code: 0x13},
+ 39: {region: 0x4344, code: 0x3b},
+ 40: {region: 0x4346, code: 0x109},
+ 41: {region: 0x4347, code: 0x109},
+ 42: {region: 0x4348, code: 0x3d},
+ 43: {region: 0x4349, code: 0x115},
+ 44: {region: 0x434b, code: 0xc0},
+ 45: {region: 0x434c, code: 0x41},
+ 46: {region: 0x434d, code: 0x109},
+ 47: {region: 0x434e, code: 0x44},
+ 48: {region: 0x434f, code: 0x45},
+ 49: {region: 0x4352, code: 0x47},
+ 50: {region: 0x4355, code: 0x4b},
+ 51: {region: 0x4356, code: 0x4c},
+ 52: {region: 0x4357, code: 0x8},
+ 53: {region: 0x4358, code: 0x13},
+ 54: {region: 0x4359, code: 0x5e},
+ 55: {region: 0x435a, code: 0x4e},
+ 56: {region: 0x4445, code: 0x5e},
+ 57: {region: 0x4447, code: 0xfc},
+ 58: {region: 0x444a, code: 0x51},
+ 59: {region: 0x444b, code: 0x52},
+ 60: {region: 0x444d, code: 0x110},
+ 61: {region: 0x444f, code: 0x53},
+ 62: {region: 0x445a, code: 0x54},
+ 63: {region: 0x4541, code: 0x5e},
+ 64: {region: 0x4543, code: 0xfc},
+ 65: {region: 0x4545, code: 0x5e},
+ 66: {region: 0x4547, code: 0x58},
+ 67: {region: 0x4548, code: 0x9e},
+ 68: {region: 0x4552, code: 0x59},
+ 69: {region: 0x4553, code: 0x5e},
+ 70: {region: 0x4554, code: 0x5d},
+ 71: {region: 0x4555, code: 0x5e},
+ 72: {region: 0x4649, code: 0x5e},
+ 73: {region: 0x464a, code: 0x60},
+ 74: {region: 0x464b, code: 0x61},
+ 75: {region: 0x464d, code: 0xfc},
+ 76: {region: 0x464f, code: 0x52},
+ 77: {region: 0x4652, code: 0x5e},
+ 78: {region: 0x4741, code: 0x109},
+ 79: {region: 0x4742, code: 0x63},
+ 80: {region: 0x4744, code: 0x110},
+ 81: {region: 0x4745, code: 0x65},
+ 82: {region: 0x4746, code: 0x5e},
+ 83: {region: 0x4747, code: 0x63},
+ 84: {region: 0x4748, code: 0x67},
+ 85: {region: 0x4749, code: 0x68},
+ 86: {region: 0x474c, code: 0x52},
+ 87: {region: 0x474d, code: 0x69},
+ 88: {region: 0x474e, code: 0x6a},
+ 89: {region: 0x4750, code: 0x5e},
+ 90: {region: 0x4751, code: 0x109},
+ 91: {region: 0x4752, code: 0x5e},
+ 92: {region: 0x4753, code: 0x63},
+ 93: {region: 0x4754, code: 0x6e},
+ 94: {region: 0x4755, code: 0xfc},
+ 95: {region: 0x4757, code: 0x115},
+ 96: {region: 0x4759, code: 0x71},
+ 97: {region: 0x484b, code: 0x72},
+ 98: {region: 0x484d, code: 0x13},
+ 99: {region: 0x484e, code: 0x73},
+ 100: {region: 0x4852, code: 0x75},
+ 101: {region: 0x4854, code: 0x76},
+ 102: {region: 0x4855, code: 0x77},
+ 103: {region: 0x4943, code: 0x5e},
+ 104: {region: 0x4944, code: 0x78},
+ 105: {region: 0x4945, code: 0x5e},
+ 106: {region: 0x494c, code: 0x7c},
+ 107: {region: 0x494d, code: 0x63},
+ 108: {region: 0x494e, code: 0x7d},
+ 109: {region: 0x494f, code: 0xfc},
+ 110: {region: 0x4951, code: 0x7e},
+ 111: {region: 0x4952, code: 0x7f},
+ 112: {region: 0x4953, code: 0x81},
+ 113: {region: 0x4954, code: 0x5e},
+ 114: {region: 0x4a45, code: 0x63},
+ 115: {region: 0x4a4d, code: 0x83},
+ 116: {region: 0x4a4f, code: 0x84},
+ 117: {region: 0x4a50, code: 0x85},
+ 118: {region: 0x4b45, code: 0x86},
+ 119: {region: 0x4b47, code: 0x87},
+ 120: {region: 0x4b48, code: 0x88},
+ 121: {region: 0x4b49, code: 0x13},
+ 122: {region: 0x4b4d, code: 0x89},
+ 123: {region: 0x4b4e, code: 0x110},
+ 124: {region: 0x4b50, code: 0x8a},
+ 125: {region: 0x4b52, code: 0x8d},
+ 126: {region: 0x4b57, code: 0x8e},
+ 127: {region: 0x4b59, code: 0x8f},
+ 128: {region: 0x4b5a, code: 0x90},
+ 129: {region: 0x4c41, code: 0x91},
+ 130: {region: 0x4c42, code: 0x92},
+ 131: {region: 0x4c43, code: 0x110},
+ 132: {region: 0x4c49, code: 0x3d},
+ 133: {region: 0x4c4b, code: 0x93},
+ 134: {region: 0x4c52, code: 0x94},
+ 135: {region: 0x4c53, code: 0x125},
+ 136: {region: 0x4c54, code: 0x5e},
+ 137: {region: 0x4c55, code: 0x5e},
+ 138: {region: 0x4c56, code: 0x5e},
+ 139: {region: 0x4c59, code: 0x9d},
+ 140: {region: 0x4d41, code: 0x9e},
+ 141: {region: 0x4d43, code: 0x5e},
+ 142: {region: 0x4d44, code: 0xa2},
+ 143: {region: 0x4d45, code: 0x5e},
+ 144: {region: 0x4d46, code: 0x5e},
+ 145: {region: 0x4d47, code: 0xa3},
+ 146: {region: 0x4d48, code: 0xfc},
+ 147: {region: 0x4d4b, code: 0xa5},
+ 148: {region: 0x4d4c, code: 0x115},
+ 149: {region: 0x4d4d, code: 0xa8},
+ 150: {region: 0x4d4e, code: 0xa9},
+ 151: {region: 0x4d4f, code: 0xaa},
+ 152: {region: 0x4d50, code: 0xfc},
+ 153: {region: 0x4d51, code: 0x5e},
+ 154: {region: 0x4d52, code: 0xab},
+ 155: {region: 0x4d53, code: 0x110},
+ 156: {region: 0x4d54, code: 0x5e},
+ 157: {region: 0x4d55, code: 0xae},
+ 158: {region: 0x4d56, code: 0xb0},
+ 159: {region: 0x4d57, code: 0xb1},
+ 160: {region: 0x4d58, code: 0xb2},
+ 161: {region: 0x4d59, code: 0xb5},
+ 162: {region: 0x4d5a, code: 0xb8},
+ 163: {region: 0x4e41, code: 0xb9},
+ 164: {region: 0x4e43, code: 0x117},
+ 165: {region: 0x4e45, code: 0x115},
+ 166: {region: 0x4e46, code: 0x13},
+ 167: {region: 0x4e47, code: 0xba},
+ 168: {region: 0x4e49, code: 0xbc},
+ 169: {region: 0x4e4c, code: 0x5e},
+ 170: {region: 0x4e4f, code: 0xbe},
+ 171: {region: 0x4e50, code: 0xbf},
+ 172: {region: 0x4e52, code: 0x13},
+ 173: {region: 0x4e55, code: 0xc0},
+ 174: {region: 0x4e5a, code: 0xc0},
+ 175: {region: 0x4f4d, code: 0xc1},
+ 176: {region: 0x5041, code: 0xc2},
+ 177: {region: 0x5045, code: 0xc4},
+ 178: {region: 0x5046, code: 0x117},
+ 179: {region: 0x5047, code: 0xc6},
+ 180: {region: 0x5048, code: 0xc7},
+ 181: {region: 0x504b, code: 0xc8},
+ 182: {region: 0x504c, code: 0xc9},
+ 183: {region: 0x504d, code: 0x5e},
+ 184: {region: 0x504e, code: 0xc0},
+ 185: {region: 0x5052, code: 0xfc},
+ 186: {region: 0x5053, code: 0x7c},
+ 187: {region: 0x5054, code: 0x5e},
+ 188: {region: 0x5057, code: 0xfc},
+ 189: {region: 0x5059, code: 0xcc},
+ 190: {region: 0x5141, code: 0xcd},
+ 191: {region: 0x5245, code: 0x5e},
+ 192: {region: 0x524f, code: 0xd0},
+ 193: {region: 0x5253, code: 0xd1},
+ 194: {region: 0x5255, code: 0xd2},
+ 195: {region: 0x5257, code: 0xd4},
+ 196: {region: 0x5341, code: 0xd5},
+ 197: {region: 0x5342, code: 0xd6},
+ 198: {region: 0x5343, code: 0xd7},
+ 199: {region: 0x5344, code: 0xd9},
+ 200: {region: 0x5345, code: 0xdb},
+ 201: {region: 0x5347, code: 0xdc},
+ 202: {region: 0x5348, code: 0xdd},
+ 203: {region: 0x5349, code: 0x5e},
+ 204: {region: 0x534a, code: 0xbe},
+ 205: {region: 0x534b, code: 0x5e},
+ 206: {region: 0x534c, code: 0xe0},
+ 207: {region: 0x534d, code: 0x5e},
+ 208: {region: 0x534e, code: 0x115},
+ 209: {region: 0x534f, code: 0xe1},
+ 210: {region: 0x5352, code: 0xe2},
+ 211: {region: 0x5353, code: 0xe4},
+ 212: {region: 0x5354, code: 0xe6},
+ 213: {region: 0x5356, code: 0xfc},
+ 214: {region: 0x5358, code: 0x8},
+ 215: {region: 0x5359, code: 0xe9},
+ 216: {region: 0x535a, code: 0xea},
+ 217: {region: 0x5441, code: 0x63},
+ 218: {region: 0x5443, code: 0xfc},
+ 219: {region: 0x5444, code: 0x109},
+ 220: {region: 0x5446, code: 0x5e},
+ 221: {region: 0x5447, code: 0x115},
+ 222: {region: 0x5448, code: 0xeb},
+ 223: {region: 0x544a, code: 0xed},
+ 224: {region: 0x544b, code: 0xc0},
+ 225: {region: 0x544c, code: 0xfc},
+ 226: {region: 0x544d, code: 0xef},
+ 227: {region: 0x544e, code: 0xf0},
+ 228: {region: 0x544f, code: 0xf1},
+ 229: {region: 0x5452, code: 0xf4},
+ 230: {region: 0x5454, code: 0xf5},
+ 231: {region: 0x5456, code: 0x13},
+ 232: {region: 0x5457, code: 0xf6},
+ 233: {region: 0x545a, code: 0xf7},
+ 234: {region: 0x5541, code: 0xf8},
+ 235: {region: 0x5547, code: 0xfb},
+ 236: {region: 0x554d, code: 0xfc},
+ 237: {region: 0x5553, code: 0xfc},
+ 238: {region: 0x5559, code: 0x101},
+ 239: {region: 0x555a, code: 0x102},
+ 240: {region: 0x5641, code: 0x5e},
+ 241: {region: 0x5643, code: 0x110},
+ 242: {region: 0x5645, code: 0x104},
+ 243: {region: 0x5647, code: 0xfc},
+ 244: {region: 0x5649, code: 0xfc},
+ 245: {region: 0x564e, code: 0x105},
+ 246: {region: 0x5655, code: 0x107},
+ 247: {region: 0x5746, code: 0x117},
+ 248: {region: 0x5753, code: 0x108},
+ 249: {region: 0x584b, code: 0x5e},
+ 250: {region: 0x5945, code: 0x11f},
+ 251: {region: 0x5954, code: 0x5e},
+ 252: {region: 0x5a41, code: 0x125},
+ 253: {region: 0x5a4d, code: 0x127},
+ 254: {region: 0x5a57, code: 0xfc},
+} // Size: 1044 bytes
+
+type regionInfo struct {
+ region uint16
+ code uint16
+ from uint32
+ to uint32
+}
+
+var regionData = []regionInfo{ // 495 elements
+ 0: {region: 0x4143, code: 0xdd, from: 0xf7021, to: 0x0},
+ 1: {region: 0x4144, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 2: {region: 0x4144, code: 0x5c, from: 0xea221, to: 0xfa45c},
+ 3: {region: 0x4144, code: 0x62, from: 0xf5021, to: 0xfa451},
+ 4: {region: 0x4144, code: 0x1, from: 0xf2021, to: 0xfa39f},
+ 5: {region: 0x4145, code: 0x2, from: 0xf6ab3, to: 0x0},
+ 6: {region: 0x4146, code: 0x4, from: 0xfa547, to: 0x0},
+ 7: {region: 0x4146, code: 0x3, from: 0xf0e6e, to: 0xfa59f},
+ 8: {region: 0x4147, code: 0x110, from: 0xf5b46, to: 0x0},
+ 9: {region: 0x4149, code: 0x110, from: 0xf5b46, to: 0x0},
+ 10: {region: 0x414c, code: 0x6, from: 0xf5b10, to: 0x0},
+ 11: {region: 0x414c, code: 0x5, from: 0xf3561, to: 0xf5b10},
+ 12: {region: 0x414d, code: 0x7, from: 0xf9376, to: 0x0},
+ 13: {region: 0x414d, code: 0xd3, from: 0xf8f99, to: 0xf9376},
+ 14: {region: 0x414d, code: 0xe7, from: 0xf5221, to: 0xf8f99},
+ 15: {region: 0x414f, code: 0x9, from: 0xf9f8d, to: 0x0},
+ 16: {region: 0x414f, code: 0xc, from: 0xf96e1, to: 0xfa041},
+ 17: {region: 0x414f, code: 0xb, from: 0xf8d39, to: 0xfa041},
+ 18: {region: 0x414f, code: 0xa, from: 0xf7228, to: 0xf8e61},
+ 19: {region: 0x4151, code: 0x811d, from: 0x0, to: 0x0},
+ 20: {region: 0x4152, code: 0x11, from: 0xf9021, to: 0x0},
+ 21: {region: 0x4152, code: 0xd, from: 0xf82ce, to: 0xf9021},
+ 22: {region: 0x4152, code: 0x10, from: 0xf7ec1, to: 0xf82ce},
+ 23: {region: 0x4152, code: 0xe, from: 0xf6421, to: 0xf7ec1},
+ 24: {region: 0x4152, code: 0xf, from: 0xeb365, to: 0xf6421},
+ 25: {region: 0x4153, code: 0xfc, from: 0xee0f0, to: 0x0},
+ 26: {region: 0x4154, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 27: {region: 0x4154, code: 0x12, from: 0xf3784, to: 0xfa45c},
+ 28: {region: 0x4155, code: 0x13, from: 0xf5c4e, to: 0x0},
+ 29: {region: 0x4157, code: 0x14, from: 0xf8421, to: 0x0},
+ 30: {region: 0x4157, code: 0x8, from: 0xf28aa, to: 0xf8421},
+ 31: {region: 0x4158, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 32: {region: 0x415a, code: 0x16, from: 0xfac21, to: 0x0},
+ 33: {region: 0x415a, code: 0x15, from: 0xf9376, to: 0xfad9f},
+ 34: {region: 0x415a, code: 0xd3, from: 0xf8f99, to: 0xf9421},
+ 35: {region: 0x415a, code: 0xe7, from: 0xf5221, to: 0xf8f99},
+ 36: {region: 0x4241, code: 0x18, from: 0xf9621, to: 0x0},
+ 37: {region: 0x4241, code: 0x19, from: 0xf950f, to: 0xf9ae1},
+ 38: {region: 0x4241, code: 0x17, from: 0xf90e1, to: 0xf950f},
+ 39: {region: 0x4241, code: 0x123, from: 0xf90e1, to: 0xf9341},
+ 40: {region: 0x4241, code: 0x122, from: 0xf8c21, to: 0xf90e1},
+ 41: {region: 0x4241, code: 0x120, from: 0xf5c21, to: 0xf8c21},
+ 42: {region: 0x4242, code: 0x1a, from: 0xf6b83, to: 0x0},
+ 43: {region: 0x4242, code: 0x110, from: 0xf5b46, to: 0xf6b83},
+ 44: {region: 0x4244, code: 0x1b, from: 0xf6821, to: 0x0},
+ 45: {region: 0x4244, code: 0xc8, from: 0xf3881, to: 0xf6821},
+ 46: {region: 0x4244, code: 0x7d, from: 0xe5711, to: 0xf3881},
+ 47: {region: 0x4245, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 48: {region: 0x4245, code: 0x1d, from: 0xe4e47, to: 0xfa45c},
+ 49: {region: 0x4245, code: 0xbd, from: 0xe318f, to: 0xe4e47},
+ 50: {region: 0x4245, code: 0x801e, from: 0xf6421, to: 0xf8c65},
+ 51: {region: 0x4245, code: 0x801c, from: 0xf6421, to: 0xf8c65},
+ 52: {region: 0x4246, code: 0x115, from: 0xf8104, to: 0x0},
+ 53: {region: 0x4247, code: 0x21, from: 0xf9ee5, to: 0x0},
+ 54: {region: 0x4247, code: 0x1f, from: 0xf5421, to: 0xf9ee5},
+ 55: {region: 0x4247, code: 0x20, from: 0xf40ac, to: 0xf5421},
+ 56: {region: 0x4247, code: 0x22, from: 0xeaee8, to: 0xf40ac},
+ 57: {region: 0x4248, code: 0x23, from: 0xf5b50, to: 0x0},
+ 58: {region: 0x4249, code: 0x24, from: 0xf58b3, to: 0x0},
+ 59: {region: 0x424a, code: 0x115, from: 0xf6f7e, to: 0x0},
+ 60: {region: 0x424c, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 61: {region: 0x424c, code: 0x62, from: 0xf5021, to: 0xfa451},
+ 62: {region: 0x424d, code: 0x25, from: 0xf6446, to: 0x0},
+ 63: {region: 0x424e, code: 0x26, from: 0xf5ecc, to: 0x0},
+ 64: {region: 0x424e, code: 0xb5, from: 0xf5730, to: 0xf5ecc},
+ 65: {region: 0x424f, code: 0x27, from: 0xf8621, to: 0x0},
+ 66: {region: 0x424f, code: 0x29, from: 0xf5621, to: 0xf859f},
+ 67: {region: 0x424f, code: 0x28, from: 0xe8ed7, to: 0xf5621},
+ 68: {region: 0x424f, code: 0x802a, from: 0x0, to: 0x0},
+ 69: {region: 0x4251, code: 0xfc, from: 0xfb621, to: 0x0},
+ 70: {region: 0x4251, code: 0x8, from: 0xfb54a, to: 0xfb621},
+ 71: {region: 0x4252, code: 0x2e, from: 0xf94e1, to: 0x0},
+ 72: {region: 0x4252, code: 0x30, from: 0xf9301, to: 0xf94e1},
+ 73: {region: 0x4252, code: 0x2d, from: 0xf8c70, to: 0xf9301},
+ 74: {region: 0x4252, code: 0x2f, from: 0xf8a2f, to: 0xf8c70},
+ 75: {region: 0x4252, code: 0x2c, from: 0xf845c, to: 0xf8a2f},
+ 76: {region: 0x4252, code: 0x2b, from: 0xf5e4d, to: 0xf845c},
+ 77: {region: 0x4252, code: 0x31, from: 0xf2d61, to: 0xf5e4d},
+ 78: {region: 0x4253, code: 0x32, from: 0xf5cb9, to: 0x0},
+ 79: {region: 0x4254, code: 0x33, from: 0xf6c90, to: 0x0},
+ 80: {region: 0x4254, code: 0x7d, from: 0xee621, to: 0x0},
+ 81: {region: 0x4255, code: 0x34, from: 0xf40e1, to: 0xf8ad2},
+ 82: {region: 0x4256, code: 0xbe, from: 0xee2c7, to: 0x0},
+ 83: {region: 0x4257, code: 0x35, from: 0xf7117, to: 0x0},
+ 84: {region: 0x4257, code: 0x125, from: 0xf524e, to: 0xf7117},
+ 85: {region: 0x4259, code: 0x37, from: 0xfc0e1, to: 0x0},
+ 86: {region: 0x4259, code: 0x38, from: 0xfa021, to: 0xfc221},
+ 87: {region: 0x4259, code: 0x36, from: 0xf9501, to: 0xfa19f},
+ 88: {region: 0x4259, code: 0xd3, from: 0xf8f99, to: 0xf9568},
+ 89: {region: 0x4259, code: 0xe7, from: 0xf5221, to: 0xf8f99},
+ 90: {region: 0x425a, code: 0x39, from: 0xf6c21, to: 0x0},
+ 91: {region: 0x4341, code: 0x3a, from: 0xe8421, to: 0x0},
+ 92: {region: 0x4343, code: 0x13, from: 0xf5c4e, to: 0x0},
+ 93: {region: 0x4344, code: 0x3b, from: 0xf9ce1, to: 0x0},
+ 94: {region: 0x4344, code: 0x128, from: 0xf9361, to: 0xf9ce1},
+ 95: {region: 0x4344, code: 0x129, from: 0xf675b, to: 0xf9361},
+ 96: {region: 0x4346, code: 0x109, from: 0xf9221, to: 0x0},
+ 97: {region: 0x4347, code: 0x109, from: 0xf9221, to: 0x0},
+ 98: {region: 0x4348, code: 0x3d, from: 0xe0e71, to: 0x0},
+ 99: {region: 0x4348, code: 0x803c, from: 0x0, to: 0x0},
+ 100: {region: 0x4348, code: 0x803e, from: 0x0, to: 0x0},
+ 101: {region: 0x4349, code: 0x115, from: 0xf4d84, to: 0x0},
+ 102: {region: 0x434b, code: 0xc0, from: 0xf5eea, to: 0x0},
+ 103: {region: 0x434c, code: 0x41, from: 0xf6f3d, to: 0x0},
+ 104: {region: 0x434c, code: 0x3f, from: 0xf5021, to: 0xf6f3d},
+ 105: {region: 0x434c, code: 0x8040, from: 0x0, to: 0x0},
+ 106: {region: 0x434d, code: 0x109, from: 0xf6a81, to: 0x0},
+ 107: {region: 0x434e, code: 0x44, from: 0xf4261, to: 0x0},
+ 108: {region: 0x434e, code: 0x8043, from: 0xf7621, to: 0xf9d9f},
+ 109: {region: 0x434e, code: 0x8042, from: 0xfb4f3, to: 0x0},
+ 110: {region: 0x434f, code: 0x45, from: 0xee221, to: 0x0},
+ 111: {region: 0x434f, code: 0x8046, from: 0x0, to: 0x0},
+ 112: {region: 0x4350, code: 0x811d, from: 0x0, to: 0x0},
+ 113: {region: 0x4352, code: 0x47, from: 0xed15a, to: 0x0},
+ 114: {region: 0x4353, code: 0x48, from: 0xfa4af, to: 0xfacc3},
+ 115: {region: 0x4353, code: 0x5e, from: 0xfa644, to: 0xfacc3},
+ 116: {region: 0x4353, code: 0x121, from: 0xf9438, to: 0xfa4af},
+ 117: {region: 0x4355, code: 0x4b, from: 0xe8621, to: 0x0},
+ 118: {region: 0x4355, code: 0x4a, from: 0xf9421, to: 0x0},
+ 119: {region: 0x4355, code: 0xfc, from: 0xed621, to: 0xf4e21},
+ 120: {region: 0x4356, code: 0x4c, from: 0xef421, to: 0x0},
+ 121: {region: 0x4356, code: 0xcb, from: 0xeeeb6, to: 0xf6ee5},
+ 122: {region: 0x4357, code: 0x8, from: 0xfb54a, to: 0x0},
+ 123: {region: 0x4358, code: 0x13, from: 0xf5c4e, to: 0x0},
+ 124: {region: 0x4359, code: 0x5e, from: 0xfb021, to: 0x0},
+ 125: {region: 0x4359, code: 0x4d, from: 0xef52a, to: 0xfb03f},
+ 126: {region: 0x435a, code: 0x4e, from: 0xf9221, to: 0x0},
+ 127: {region: 0x435a, code: 0x49, from: 0xf42c1, to: 0xf9261},
+ 128: {region: 0x4444, code: 0x4f, from: 0xf38f4, to: 0xf8d42},
+ 129: {region: 0x4445, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 130: {region: 0x4445, code: 0x50, from: 0xf38d4, to: 0xfa45c},
+ 131: {region: 0x4447, code: 0xfc, from: 0xf5b68, to: 0x0},
+ 132: {region: 0x444a, code: 0x51, from: 0xf72db, to: 0x0},
+ 133: {region: 0x444b, code: 0x52, from: 0xea2bb, to: 0x0},
+ 134: {region: 0x444d, code: 0x110, from: 0xf5b46, to: 0x0},
+ 135: {region: 0x444f, code: 0x53, from: 0xf3741, to: 0x0},
+ 136: {region: 0x444f, code: 0xfc, from: 0xee2d5, to: 0xf3741},
+ 137: {region: 0x445a, code: 0x54, from: 0xf5881, to: 0x0},
+ 138: {region: 0x4541, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 139: {region: 0x4543, code: 0xfc, from: 0xfa142, to: 0x0},
+ 140: {region: 0x4543, code: 0x55, from: 0xeb881, to: 0xfa142},
+ 141: {region: 0x4543, code: 0x8056, from: 0xf92b7, to: 0xfa029},
+ 142: {region: 0x4545, code: 0x5e, from: 0xfb621, to: 0x0},
+ 143: {region: 0x4545, code: 0x57, from: 0xf90d5, to: 0xfb59f},
+ 144: {region: 0x4545, code: 0xe7, from: 0xf5221, to: 0xf90d4},
+ 145: {region: 0x4547, code: 0x58, from: 0xebb6e, to: 0x0},
+ 146: {region: 0x4548, code: 0x9e, from: 0xf705a, to: 0x0},
+ 147: {region: 0x4552, code: 0x59, from: 0xf9b68, to: 0x0},
+ 148: {region: 0x4552, code: 0x5d, from: 0xf92b8, to: 0xf9b68},
+ 149: {region: 0x4553, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 150: {region: 0x4553, code: 0x5c, from: 0xe9953, to: 0xfa45c},
+ 151: {region: 0x4553, code: 0x805a, from: 0xf7421, to: 0xf7b9f},
+ 152: {region: 0x4553, code: 0x805b, from: 0xf6e21, to: 0xf959f},
+ 153: {region: 0x4554, code: 0x5d, from: 0xf712f, to: 0x0},
+ 154: {region: 0x4555, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 155: {region: 0x4555, code: 0x8112, from: 0xf7621, to: 0xf9d9f},
+ 156: {region: 0x4649, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 157: {region: 0x4649, code: 0x5f, from: 0xf5621, to: 0xfa45c},
+ 158: {region: 0x464a, code: 0x60, from: 0xf622d, to: 0x0},
+ 159: {region: 0x464b, code: 0x61, from: 0xeda21, to: 0x0},
+ 160: {region: 0x464d, code: 0xfc, from: 0xf3021, to: 0x0},
+ 161: {region: 0x464d, code: 0x85, from: 0xef543, to: 0xf3021},
+ 162: {region: 0x464f, code: 0x52, from: 0xf3821, to: 0x0},
+ 163: {region: 0x4652, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 164: {region: 0x4652, code: 0x62, from: 0xf5021, to: 0xfa451},
+ 165: {region: 0x4741, code: 0x109, from: 0xf9221, to: 0x0},
+ 166: {region: 0x4742, code: 0x63, from: 0xd3cfb, to: 0x0},
+ 167: {region: 0x4744, code: 0x110, from: 0xf5e5b, to: 0x0},
+ 168: {region: 0x4745, code: 0x65, from: 0xf9737, to: 0x0},
+ 169: {region: 0x4745, code: 0x64, from: 0xf9285, to: 0xf9739},
+ 170: {region: 0x4745, code: 0xd3, from: 0xf8f99, to: 0xf92cb},
+ 171: {region: 0x4745, code: 0xe7, from: 0xf5221, to: 0xf8f99},
+ 172: {region: 0x4746, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 173: {region: 0x4746, code: 0x62, from: 0xf5021, to: 0xfa451},
+ 174: {region: 0x4747, code: 0x63, from: 0xe4c21, to: 0x0},
+ 175: {region: 0x4748, code: 0x67, from: 0xfaee3, to: 0x0},
+ 176: {region: 0x4748, code: 0x66, from: 0xf7669, to: 0xfaf9f},
+ 177: {region: 0x4749, code: 0x68, from: 0xd6221, to: 0x0},
+ 178: {region: 0x474c, code: 0x52, from: 0xea2bb, to: 0x0},
+ 179: {region: 0x474d, code: 0x69, from: 0xf66e1, to: 0x0},
+ 180: {region: 0x474e, code: 0x6a, from: 0xf8426, to: 0x0},
+ 181: {region: 0x474e, code: 0x6b, from: 0xf6942, to: 0xf8426},
+ 182: {region: 0x4750, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 183: {region: 0x4750, code: 0x62, from: 0xf5021, to: 0xfa451},
+ 184: {region: 0x4751, code: 0x109, from: 0xf9221, to: 0x0},
+ 185: {region: 0x4751, code: 0x6c, from: 0xf6ee7, to: 0xf84c1},
+ 186: {region: 0x4752, code: 0x5e, from: 0xfa221, to: 0x0},
+ 187: {region: 0x4752, code: 0x6d, from: 0xf44a1, to: 0xfa45c},
+ 188: {region: 0x4753, code: 0x63, from: 0xee821, to: 0x0},
+ 189: {region: 0x4754, code: 0x6e, from: 0xf0abb, to: 0x0},
+ 190: {region: 0x4755, code: 0xfc, from: 0xf3115, to: 0x0},
+ 191: {region: 0x4757, code: 0x115, from: 0xf9a7f, to: 0x0},
+ 192: {region: 0x4757, code: 0x70, from: 0xf705c, to: 0xf9a7f},
+ 193: {region: 0x4757, code: 0x6f, from: 0xef421, to: 0xf705c},
+ 194: {region: 0x4759, code: 0x71, from: 0xf5cba, to: 0x0},
+ 195: {region: 0x484b, code: 0x72, from: 0xece42, to: 0x0},
+ 196: {region: 0x484d, code: 0x13, from: 0xf5e50, to: 0x0},
+ 197: {region: 0x484e, code: 0x73, from: 0xf0c83, to: 0x0},
+ 198: {region: 0x4852, code: 0x75, from: 0xf94be, to: 0x0},
+ 199: {region: 0x4852, code: 0x74, from: 0xf8f97, to: 0xf9621},
+ 200: {region: 0x4852, code: 0x122, from: 0xf8c21, to: 0xf8f97},
+ 201: {region: 0x4852, code: 0x120, from: 0xf5c21, to: 0xf8c21},
+ 202: {region: 0x4854, code: 0x76, from: 0xea11a, to: 0x0},
+ 203: {region: 0x4854, code: 0xfc, from: 0xef621, to: 0x0},
+ 204: {region: 0x4855, code: 0x77, from: 0xf34f7, to: 0x0},
+ 205: {region: 0x4943, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 206: {region: 0x4944, code: 0x78, from: 0xf5b8d, to: 0x0},
+ 207: {region: 0x4945, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 208: {region: 0x4945, code: 0x79, from: 0xf0421, to: 0xfa449},
+ 209: {region: 0x4945, code: 0x63, from: 0xe1021, to: 0xf0421},
+ 210: {region: 0x494c, code: 0x7c, from: 0xf8324, to: 0x0},
+ 211: {region: 0x494c, code: 0x7b, from: 0xf7856, to: 0xf8324},
+ 212: {region: 0x494c, code: 0x7a, from: 0xf3910, to: 0xf7856},
+ 213: {region: 0x494d, code: 0x63, from: 0xe6023, to: 0x0},
+ 214: {region: 0x494e, code: 0x7d, from: 0xe5711, to: 0x0},
+ 215: {region: 0x494f, code: 0xfc, from: 0xf5b68, to: 0x0},
+ 216: {region: 0x4951, code: 0x7e, from: 0xf1693, to: 0x0},
+ 217: {region: 0x4951, code: 0x58, from: 0xf016b, to: 0xf1693},
+ 218: {region: 0x4951, code: 0x7d, from: 0xf016b, to: 0xf1693},
+ 219: {region: 0x4952, code: 0x7f, from: 0xf18ad, to: 0x0},
+ 220: {region: 0x4953, code: 0x81, from: 0xf7a21, to: 0x0},
+ 221: {region: 0x4953, code: 0x80, from: 0xefd81, to: 0xf7a21},
+ 222: {region: 0x4953, code: 0x52, from: 0xea2bb, to: 0xefd81},
+ 223: {region: 0x4954, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 224: {region: 0x4954, code: 0x82, from: 0xe8d18, to: 0xfa45c},
+ 225: {region: 0x4a45, code: 0x63, from: 0xe5a21, to: 0x0},
+ 226: {region: 0x4a4d, code: 0x83, from: 0xf6328, to: 0x0},
+ 227: {region: 0x4a4f, code: 0x84, from: 0xf3ce1, to: 0x0},
+ 228: {region: 0x4a50, code: 0x85, from: 0xe9ec1, to: 0x0},
+ 229: {region: 0x4b45, code: 0x86, from: 0xf5d2e, to: 0x0},
+ 230: {region: 0x4b47, code: 0x87, from: 0xf92aa, to: 0x0},
+ 231: {region: 0x4b47, code: 0xd3, from: 0xf8f99, to: 0xf92aa},
+ 232: {region: 0x4b47, code: 0xe7, from: 0xf5221, to: 0xf8f99},
+ 233: {region: 0x4b48, code: 0x88, from: 0xf7874, to: 0x0},
+ 234: {region: 0x4b49, code: 0x13, from: 0xf5c4e, to: 0x0},
+ 235: {region: 0x4b4d, code: 0x89, from: 0xf6ee6, to: 0x0},
+ 236: {region: 0x4b4e, code: 0x110, from: 0xf5b46, to: 0x0},
+ 237: {region: 0x4b50, code: 0x8a, from: 0xf4e91, to: 0x0},
+ 238: {region: 0x4b52, code: 0x8d, from: 0xf54ca, to: 0x0},
+ 239: {region: 0x4b52, code: 0x8b, from: 0xf424f, to: 0xf54ca},
+ 240: {region: 0x4b52, code: 0x8c, from: 0xf330f, to: 0xf424f},
+ 241: {region: 0x4b57, code: 0x8e, from: 0xf5281, to: 0x0},
+ 242: {region: 0x4b59, code: 0x8f, from: 0xf6621, to: 0x0},
+ 243: {region: 0x4b59, code: 0x83, from: 0xf6328, to: 0xf6621},
+ 244: {region: 0x4b5a, code: 0x90, from: 0xf9365, to: 0x0},
+ 245: {region: 0x4c41, code: 0x91, from: 0xf778a, to: 0x0},
+ 246: {region: 0x4c42, code: 0x92, from: 0xf3842, to: 0x0},
+ 247: {region: 0x4c43, code: 0x110, from: 0xf5b46, to: 0x0},
+ 248: {region: 0x4c49, code: 0x3d, from: 0xf0241, to: 0x0},
+ 249: {region: 0x4c4b, code: 0x93, from: 0xf74b6, to: 0x0},
+ 250: {region: 0x4c52, code: 0x94, from: 0xf3021, to: 0x0},
+ 251: {region: 0x4c53, code: 0x125, from: 0xf524e, to: 0x0},
+ 252: {region: 0x4c53, code: 0x95, from: 0xf7836, to: 0x0},
+ 253: {region: 0x4c54, code: 0x5e, from: 0xfbe21, to: 0x0},
+ 254: {region: 0x4c54, code: 0x96, from: 0xf92d9, to: 0xfbd9f},
+ 255: {region: 0x4c54, code: 0x97, from: 0xf9141, to: 0xf92d9},
+ 256: {region: 0x4c54, code: 0xe7, from: 0xf5221, to: 0xf9141},
+ 257: {region: 0x4c55, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 258: {region: 0x4c55, code: 0x99, from: 0xf3124, to: 0xfa45c},
+ 259: {region: 0x4c55, code: 0x8098, from: 0xf6421, to: 0xf8c65},
+ 260: {region: 0x4c55, code: 0x809a, from: 0xf6421, to: 0xf8c65},
+ 261: {region: 0x4c56, code: 0x5e, from: 0xfbc21, to: 0x0},
+ 262: {region: 0x4c56, code: 0x9b, from: 0xf92dc, to: 0xfbb9f},
+ 263: {region: 0x4c56, code: 0x9c, from: 0xf90a7, to: 0xf9351},
+ 264: {region: 0x4c56, code: 0xe7, from: 0xf5221, to: 0xf90f4},
+ 265: {region: 0x4c59, code: 0x9d, from: 0xf6721, to: 0x0},
+ 266: {region: 0x4d41, code: 0x9e, from: 0xf4f51, to: 0x0},
+ 267: {region: 0x4d41, code: 0x9f, from: 0xeb221, to: 0xf4f51},
+ 268: {region: 0x4d43, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 269: {region: 0x4d43, code: 0x62, from: 0xf5021, to: 0xfa451},
+ 270: {region: 0x4d43, code: 0xa0, from: 0xf5021, to: 0xfa451},
+ 271: {region: 0x4d44, code: 0xa2, from: 0xf937d, to: 0x0},
+ 272: {region: 0x4d44, code: 0xa1, from: 0xf90c1, to: 0xf937d},
+ 273: {region: 0x4d45, code: 0x5e, from: 0xfa421, to: 0x0},
+ 274: {region: 0x4d45, code: 0x50, from: 0xf9f42, to: 0xfa4af},
+ 275: {region: 0x4d45, code: 0x121, from: 0xf9438, to: 0xfa4af},
+ 276: {region: 0x4d46, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 277: {region: 0x4d46, code: 0x62, from: 0xf5021, to: 0xfa451},
+ 278: {region: 0x4d47, code: 0xa3, from: 0xf7f61, to: 0x0},
+ 279: {region: 0x4d47, code: 0xa4, from: 0xf56e1, to: 0xfa99f},
+ 280: {region: 0x4d48, code: 0xfc, from: 0xf3021, to: 0x0},
+ 281: {region: 0x4d4b, code: 0xa5, from: 0xf92b4, to: 0x0},
+ 282: {region: 0x4d4b, code: 0xa6, from: 0xf909a, to: 0xf92b4},
+ 283: {region: 0x4d4c, code: 0x115, from: 0xf80c1, to: 0x0},
+ 284: {region: 0x4d4c, code: 0xa7, from: 0xf54e2, to: 0xf811f},
+ 285: {region: 0x4d4c, code: 0x115, from: 0xf4d78, to: 0xf54e2},
+ 286: {region: 0x4d4d, code: 0xa8, from: 0xf8ad2, to: 0x0},
+ 287: {region: 0x4d4d, code: 0x34, from: 0xf40e1, to: 0xf8ad2},
+ 288: {region: 0x4d4e, code: 0xa9, from: 0xef661, to: 0x0},
+ 289: {region: 0x4d4f, code: 0xaa, from: 0xeda21, to: 0x0},
+ 290: {region: 0x4d50, code: 0xfc, from: 0xf3021, to: 0x0},
+ 291: {region: 0x4d51, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 292: {region: 0x4d51, code: 0x62, from: 0xf5021, to: 0xfa451},
+ 293: {region: 0x4d52, code: 0xab, from: 0xf6add, to: 0x0},
+ 294: {region: 0x4d52, code: 0x115, from: 0xf4d7c, to: 0xf6add},
+ 295: {region: 0x4d53, code: 0x110, from: 0xf5e5b, to: 0x0},
+ 296: {region: 0x4d54, code: 0x5e, from: 0xfb021, to: 0x0},
+ 297: {region: 0x4d54, code: 0xac, from: 0xf60c7, to: 0xfb03f},
+ 298: {region: 0x4d54, code: 0xad, from: 0xef50d, to: 0xf60c7},
+ 299: {region: 0x4d55, code: 0xae, from: 0xf1c81, to: 0x0},
+ 300: {region: 0x4d56, code: 0xb0, from: 0xf7ae1, to: 0x0},
+ 301: {region: 0x4d57, code: 0xb1, from: 0xf664f, to: 0x0},
+ 302: {region: 0x4d58, code: 0xb2, from: 0xf9221, to: 0x0},
+ 303: {region: 0x4d58, code: 0xb3, from: 0xe3c21, to: 0xf919f},
+ 304: {region: 0x4d58, code: 0x80b4, from: 0x0, to: 0x0},
+ 305: {region: 0x4d59, code: 0xb5, from: 0xf5730, to: 0x0},
+ 306: {region: 0x4d5a, code: 0xb8, from: 0xface1, to: 0x0},
+ 307: {region: 0x4d5a, code: 0xb7, from: 0xf78d0, to: 0xfad9f},
+ 308: {region: 0x4d5a, code: 0xb6, from: 0xf6ed9, to: 0xf78d0},
+ 309: {region: 0x4e41, code: 0xb9, from: 0xf9221, to: 0x0},
+ 310: {region: 0x4e41, code: 0x125, from: 0xf524e, to: 0x0},
+ 311: {region: 0x4e43, code: 0x117, from: 0xf8221, to: 0x0},
+ 312: {region: 0x4e45, code: 0x115, from: 0xf4d93, to: 0x0},
+ 313: {region: 0x4e46, code: 0x13, from: 0xf5c4e, to: 0x0},
+ 314: {region: 0x4e47, code: 0xba, from: 0xf6a21, to: 0x0},
+ 315: {region: 0x4e49, code: 0xbc, from: 0xf8e9e, to: 0x0},
+ 316: {region: 0x4e49, code: 0xbb, from: 0xf884f, to: 0xf8e9e},
+ 317: {region: 0x4e4c, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 318: {region: 0x4e4c, code: 0xbd, from: 0xe2a21, to: 0xfa45c},
+ 319: {region: 0x4e4f, code: 0xbe, from: 0xee2c7, to: 0x0},
+ 320: {region: 0x4e4f, code: 0xdb, from: 0xea2bb, to: 0xee2c7},
+ 321: {region: 0x4e50, code: 0xbf, from: 0xf1a21, to: 0x0},
+ 322: {region: 0x4e50, code: 0x7d, from: 0xe9c21, to: 0xf5d51},
+ 323: {region: 0x4e52, code: 0x13, from: 0xf5c4e, to: 0x0},
+ 324: {region: 0x4e55, code: 0xc0, from: 0xf5eea, to: 0x0},
+ 325: {region: 0x4e5a, code: 0xc0, from: 0xf5eea, to: 0x0},
+ 326: {region: 0x4f4d, code: 0xc1, from: 0xf696b, to: 0x0},
+ 327: {region: 0x5041, code: 0xc2, from: 0xedf64, to: 0x0},
+ 328: {region: 0x5041, code: 0xfc, from: 0xedf72, to: 0x0},
+ 329: {region: 0x5045, code: 0xc4, from: 0xf8ee1, to: 0x0},
+ 330: {region: 0x5045, code: 0xc3, from: 0xf8241, to: 0xf8ee1},
+ 331: {region: 0x5045, code: 0xc5, from: 0xe8e4e, to: 0xf8241},
+ 332: {region: 0x5046, code: 0x117, from: 0xf339a, to: 0x0},
+ 333: {region: 0x5047, code: 0xc6, from: 0xf6f30, to: 0x0},
+ 334: {region: 0x5047, code: 0x13, from: 0xf5c4e, to: 0xf6f30},
+ 335: {region: 0x5048, code: 0xc7, from: 0xf34e4, to: 0x0},
+ 336: {region: 0x504b, code: 0xc8, from: 0xf3881, to: 0x0},
+ 337: {region: 0x504b, code: 0x7d, from: 0xe5711, to: 0xf370f},
+ 338: {region: 0x504c, code: 0xc9, from: 0xf9621, to: 0x0},
+ 339: {region: 0x504c, code: 0xca, from: 0xf3d5c, to: 0xf959f},
+ 340: {region: 0x504d, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 341: {region: 0x504d, code: 0x62, from: 0xf6995, to: 0xfa451},
+ 342: {region: 0x504e, code: 0xc0, from: 0xf622d, to: 0x0},
+ 343: {region: 0x5052, code: 0xfc, from: 0xed58a, to: 0x0},
+ 344: {region: 0x5052, code: 0x5c, from: 0xe1021, to: 0xed58a},
+ 345: {region: 0x5053, code: 0x7c, from: 0xf8324, to: 0x0},
+ 346: {region: 0x5053, code: 0x84, from: 0xf984c, to: 0x0},
+ 347: {region: 0x5053, code: 0x7a, from: 0xf5ec1, to: 0xf7856},
+ 348: {region: 0x5053, code: 0x84, from: 0xf3ce1, to: 0xf5ec1},
+ 349: {region: 0x5054, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 350: {region: 0x5054, code: 0xcb, from: 0xeeeb6, to: 0xfa45c},
+ 351: {region: 0x5057, code: 0xfc, from: 0xf3021, to: 0x0},
+ 352: {region: 0x5059, code: 0xcc, from: 0xf2f61, to: 0x0},
+ 353: {region: 0x5141, code: 0xcd, from: 0xf6ab3, to: 0x0},
+ 354: {region: 0x5245, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 355: {region: 0x5245, code: 0x62, from: 0xf6e21, to: 0xfa451},
+ 356: {region: 0x524f, code: 0xd0, from: 0xfaae1, to: 0x0},
+ 357: {region: 0x524f, code: 0xcf, from: 0xf403c, to: 0xfad9f},
+ 358: {region: 0x5253, code: 0xd1, from: 0xfad59, to: 0x0},
+ 359: {region: 0x5253, code: 0x48, from: 0xfa4af, to: 0xfad59},
+ 360: {region: 0x5253, code: 0x121, from: 0xf9438, to: 0xfa4af},
+ 361: {region: 0x5255, code: 0xd2, from: 0xf9e21, to: 0x0},
+ 362: {region: 0x5255, code: 0xd3, from: 0xf8f99, to: 0xf9d9f},
+ 363: {region: 0x5257, code: 0xd4, from: 0xf58b3, to: 0x0},
+ 364: {region: 0x5341, code: 0xd5, from: 0xf4156, to: 0x0},
+ 365: {region: 0x5342, code: 0xd6, from: 0xf7358, to: 0x0},
+ 366: {region: 0x5342, code: 0x13, from: 0xf5c4e, to: 0xf74de},
+ 367: {region: 0x5343, code: 0xd7, from: 0xedf61, to: 0x0},
+ 368: {region: 0x5344, code: 0xd9, from: 0xfae2a, to: 0x0},
+ 369: {region: 0x5344, code: 0xd8, from: 0xf90c8, to: 0xfaede},
+ 370: {region: 0x5344, code: 0xda, from: 0xf4a88, to: 0xf9cc1},
+ 371: {region: 0x5344, code: 0x58, from: 0xec233, to: 0xf4c21},
+ 372: {region: 0x5344, code: 0x63, from: 0xec233, to: 0xf4c21},
+ 373: {region: 0x5345, code: 0xdb, from: 0xea2bb, to: 0x0},
+ 374: {region: 0x5347, code: 0xdc, from: 0xf5ecc, to: 0x0},
+ 375: {region: 0x5347, code: 0xb5, from: 0xf5730, to: 0xf5ecc},
+ 376: {region: 0x5348, code: 0xdd, from: 0xefa4f, to: 0x0},
+ 377: {region: 0x5349, code: 0x5e, from: 0xfae21, to: 0x0},
+ 378: {region: 0x5349, code: 0xde, from: 0xf9147, to: 0xfae2e},
+ 379: {region: 0x534a, code: 0xbe, from: 0xee2c7, to: 0x0},
+ 380: {region: 0x534b, code: 0x5e, from: 0xfb221, to: 0x0},
+ 381: {region: 0x534b, code: 0xdf, from: 0xf919f, to: 0xfb221},
+ 382: {region: 0x534b, code: 0x49, from: 0xf42c1, to: 0xf919f},
+ 383: {region: 0x534c, code: 0xe0, from: 0xf5904, to: 0x0},
+ 384: {region: 0x534c, code: 0x63, from: 0xe217e, to: 0xf5c44},
+ 385: {region: 0x534d, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 386: {region: 0x534d, code: 0x82, from: 0xe9397, to: 0xfa25c},
+ 387: {region: 0x534e, code: 0x115, from: 0xf4e84, to: 0x0},
+ 388: {region: 0x534f, code: 0xe1, from: 0xf50e1, to: 0x0},
+ 389: {region: 0x5352, code: 0xe2, from: 0xfa821, to: 0x0},
+ 390: {region: 0x5352, code: 0xe3, from: 0xf28aa, to: 0xfa79f},
+ 391: {region: 0x5352, code: 0xbd, from: 0xe2f74, to: 0xf28aa},
+ 392: {region: 0x5353, code: 0xe4, from: 0xfb6f2, to: 0x0},
+ 393: {region: 0x5353, code: 0xd9, from: 0xfae2a, to: 0xfb721},
+ 394: {region: 0x5354, code: 0xe6, from: 0xfc421, to: 0x0},
+ 395: {region: 0x5354, code: 0xe5, from: 0xf7328, to: 0xfc39f},
+ 396: {region: 0x5355, code: 0xe7, from: 0xf5221, to: 0xf8f99},
+ 397: {region: 0x5356, code: 0xfc, from: 0xfa221, to: 0x0},
+ 398: {region: 0x5356, code: 0xe8, from: 0xeff6b, to: 0xfa221},
+ 399: {region: 0x5358, code: 0x8, from: 0xfb54a, to: 0x0},
+ 400: {region: 0x5359, code: 0xe9, from: 0xf3821, to: 0x0},
+ 401: {region: 0x535a, code: 0xea, from: 0xf6d26, to: 0x0},
+ 402: {region: 0x5441, code: 0x63, from: 0xf242c, to: 0x0},
+ 403: {region: 0x5443, code: 0xfc, from: 0xf6328, to: 0x0},
+ 404: {region: 0x5444, code: 0x109, from: 0xf9221, to: 0x0},
+ 405: {region: 0x5446, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 406: {region: 0x5446, code: 0x62, from: 0xf4e21, to: 0xfa451},
+ 407: {region: 0x5447, code: 0x115, from: 0xf4d7c, to: 0x0},
+ 408: {region: 0x5448, code: 0xeb, from: 0xf108f, to: 0x0},
+ 409: {region: 0x544a, code: 0xed, from: 0xfa15a, to: 0x0},
+ 410: {region: 0x544a, code: 0xec, from: 0xf96aa, to: 0xfa159},
+ 411: {region: 0x544a, code: 0xd3, from: 0xf8f99, to: 0xf96aa},
+ 412: {region: 0x544b, code: 0xc0, from: 0xf5eea, to: 0x0},
+ 413: {region: 0x544c, code: 0xfc, from: 0xf9f54, to: 0x0},
+ 414: {region: 0x544c, code: 0xf2, from: 0xf4e22, to: 0xfa4b4},
+ 415: {region: 0x544c, code: 0x78, from: 0xf6f87, to: 0xfa4b4},
+ 416: {region: 0x544d, code: 0xef, from: 0xfb221, to: 0x0},
+ 417: {region: 0x544d, code: 0xee, from: 0xf9361, to: 0xfb221},
+ 418: {region: 0x544d, code: 0xd3, from: 0xf8f99, to: 0xf9361},
+ 419: {region: 0x544d, code: 0xe7, from: 0xf5221, to: 0xf8f99},
+ 420: {region: 0x544e, code: 0xf0, from: 0xf4d61, to: 0x0},
+ 421: {region: 0x544f, code: 0xf1, from: 0xf5c4e, to: 0x0},
+ 422: {region: 0x5450, code: 0xf2, from: 0xf4e22, to: 0xfa4b4},
+ 423: {region: 0x5450, code: 0x78, from: 0xf6f87, to: 0xfa4b4},
+ 424: {region: 0x5452, code: 0xf4, from: 0xfaa21, to: 0x0},
+ 425: {region: 0x5452, code: 0xf3, from: 0xf0561, to: 0xfab9f},
+ 426: {region: 0x5454, code: 0xf5, from: 0xf5821, to: 0x0},
+ 427: {region: 0x5456, code: 0x13, from: 0xf5c4e, to: 0x0},
+ 428: {region: 0x5457, code: 0xf6, from: 0xf3acf, to: 0x0},
+ 429: {region: 0x545a, code: 0xf7, from: 0xf5cce, to: 0x0},
+ 430: {region: 0x5541, code: 0xf8, from: 0xf9922, to: 0x0},
+ 431: {region: 0x5541, code: 0xf9, from: 0xf916d, to: 0xf9351},
+ 432: {region: 0x5541, code: 0xd3, from: 0xf8f99, to: 0xf916d},
+ 433: {region: 0x5541, code: 0xe7, from: 0xf5221, to: 0xf8f99},
+ 434: {region: 0x5547, code: 0xfb, from: 0xf86af, to: 0x0},
+ 435: {region: 0x5547, code: 0xfa, from: 0xf5d0f, to: 0xf86af},
+ 436: {region: 0x554d, code: 0xfc, from: 0xf3021, to: 0x0},
+ 437: {region: 0x5553, code: 0xfc, from: 0xe0021, to: 0x0},
+ 438: {region: 0x5553, code: 0x80fd, from: 0x0, to: 0x0},
+ 439: {region: 0x5553, code: 0x80fe, from: 0x0, to: 0xfbc61},
+ 440: {region: 0x5559, code: 0x101, from: 0xf9261, to: 0x0},
+ 441: {region: 0x5559, code: 0x100, from: 0xf6ee1, to: 0xf9261},
+ 442: {region: 0x5559, code: 0x80ff, from: 0x0, to: 0x0},
+ 443: {region: 0x555a, code: 0x102, from: 0xf94e1, to: 0x0},
+ 444: {region: 0x5641, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 445: {region: 0x5641, code: 0x82, from: 0xe9d53, to: 0xfa45c},
+ 446: {region: 0x5643, code: 0x110, from: 0xf5b46, to: 0x0},
+ 447: {region: 0x5645, code: 0x104, from: 0xfb021, to: 0x0},
+ 448: {region: 0x5645, code: 0x103, from: 0xe9eab, to: 0xfb0de},
+ 449: {region: 0x5647, code: 0xfc, from: 0xe5221, to: 0x0},
+ 450: {region: 0x5647, code: 0x63, from: 0xe5221, to: 0xf4e21},
+ 451: {region: 0x5649, code: 0xfc, from: 0xe5a21, to: 0x0},
+ 452: {region: 0x564e, code: 0x105, from: 0xf832e, to: 0x0},
+ 453: {region: 0x564e, code: 0x106, from: 0xf74a3, to: 0xf832e},
+ 454: {region: 0x5655, code: 0x107, from: 0xf7a21, to: 0x0},
+ 455: {region: 0x5746, code: 0x117, from: 0xf52fe, to: 0x0},
+ 456: {region: 0x5753, code: 0x108, from: 0xf5eea, to: 0x0},
+ 457: {region: 0x584b, code: 0x5e, from: 0xfa421, to: 0x0},
+ 458: {region: 0x584b, code: 0x50, from: 0xf9f21, to: 0xfa469},
+ 459: {region: 0x584b, code: 0x121, from: 0xf9438, to: 0xf9f3e},
+ 460: {region: 0x5944, code: 0x11e, from: 0xf5a81, to: 0xf9821},
+ 461: {region: 0x5945, code: 0x11f, from: 0xf8cb6, to: 0x0},
+ 462: {region: 0x5954, code: 0x5e, from: 0xf9e21, to: 0x0},
+ 463: {region: 0x5954, code: 0x62, from: 0xf7057, to: 0xfa451},
+ 464: {region: 0x5954, code: 0x89, from: 0xf6e21, to: 0xf7057},
+ 465: {region: 0x5955, code: 0x121, from: 0xf9438, to: 0xfa4af},
+ 466: {region: 0x5955, code: 0x122, from: 0xf8c21, to: 0xf90f8},
+ 467: {region: 0x5955, code: 0x120, from: 0xf5c21, to: 0xf8c21},
+ 468: {region: 0x5a41, code: 0x125, from: 0xf524e, to: 0x0},
+ 469: {region: 0x5a41, code: 0x8124, from: 0xf8321, to: 0xf966d},
+ 470: {region: 0x5a4d, code: 0x127, from: 0xfba21, to: 0x0},
+ 471: {region: 0x5a4d, code: 0x126, from: 0xf6030, to: 0xfba21},
+ 472: {region: 0x5a52, code: 0x128, from: 0xf9361, to: 0xf9cff},
+ 473: {region: 0x5a52, code: 0x129, from: 0xf675b, to: 0xf9361},
+ 474: {region: 0x5a57, code: 0xfc, from: 0xfb28c, to: 0x0},
+ 475: {region: 0x5a57, code: 0x12b, from: 0xfb242, to: 0xfb28c},
+ 476: {region: 0x5a57, code: 0x12c, from: 0xfb101, to: 0xfb242},
+ 477: {region: 0x5a57, code: 0x12a, from: 0xf7892, to: 0xfb101},
+ 478: {region: 0x5a57, code: 0xce, from: 0xf6451, to: 0xf7892},
+ 479: {region: 0x5a5a, code: 0x810a, from: 0x0, to: 0x0},
+ 480: {region: 0x5a5a, code: 0x810b, from: 0x0, to: 0x0},
+ 481: {region: 0x5a5a, code: 0x810c, from: 0x0, to: 0x0},
+ 482: {region: 0x5a5a, code: 0x810d, from: 0x0, to: 0x0},
+ 483: {region: 0x5a5a, code: 0x810e, from: 0x0, to: 0x0},
+ 484: {region: 0x5a5a, code: 0x810f, from: 0x0, to: 0x0},
+ 485: {region: 0x5a5a, code: 0x8111, from: 0x0, to: 0x0},
+ 486: {region: 0x5a5a, code: 0x8113, from: 0xf1421, to: 0xfa681},
+ 487: {region: 0x5a5a, code: 0x8114, from: 0x0, to: 0xfbb7e},
+ 488: {region: 0x5a5a, code: 0x8116, from: 0x0, to: 0x0},
+ 489: {region: 0x5a5a, code: 0x8118, from: 0x0, to: 0x0},
+ 490: {region: 0x5a5a, code: 0x8119, from: 0x0, to: 0xf9f7e},
+ 491: {region: 0x5a5a, code: 0x811a, from: 0x0, to: 0x0},
+ 492: {region: 0x5a5a, code: 0x811b, from: 0x0, to: 0x0},
+ 493: {region: 0x5a5a, code: 0x811c, from: 0x0, to: 0x0},
+ 494: {region: 0x5a5a, code: 0x811d, from: 0x0, to: 0x0},
+} // Size: 5964 bytes
+
+// symbols holds symbol data of the form , where n is the length of
+// the symbol string str.
+const symbols string = "" + // Size: 1445 bytes
+ "\x00\x02Kz\x01$\x02A$\x02KM\x03৳\x02Bs\x02R$\x01P\x03р.\x03CA$\x04CN¥" +
+ "\x02¥\x03₡\x03Kč\x02kr\x03E£\x03₧\x03€\x02£\x03₾\x02FG\x01Q\x03HK$\x01L" +
+ "\x02kn\x02Ft\x02Rp\x03₪\x03₹\x04JP¥\x03៛\x02CF\x03₩\x03₸\x03₭\x03L£\x02R" +
+ "s\x02Lt\x02Ls\x02Ar\x01K\x03₮\x03MX$\x02RM\x03₦\x02C$\x03NZ$\x03₱\x03zł" +
+ "\x03₲\x03lei\x03₽\x02RF\x02Db\x03฿\x02T$\x03₺\x03NT$\x03₴\x03US$\x03₫" +
+ "\x04FCFA\x03EC$\x03CFA\x04CFPF\x01R\x02ZK\x03leu\x05GH₵\x03AU$\x16የቻይና ዩ" +
+ "ዋን\x06ብር\x03***\x09د.إ.\u200f\x03AR$\x03BB$\x09د.ب.\u200f\x03BM$\x03BN" +
+ "$\x03BS$\x03BZ$\x03CL$\x03CO$\x03CU$\x03DO$\x09د.ج.\u200f\x09ج.م.\u200f" +
+ "\x03FJ$\x04UK£\x03GY$\x09د.ع.\u200f\x06ر.إ.\x03JM$\x09د.أ.\u200f\x09د.ك." +
+ "\u200f\x03KY$\x09ل.ل.\u200f\x09د.ل.\u200f\x09د.م.\u200f\x09أ.م.\u200f" +
+ "\x09ر.ع.\u200f\x09ر.ق.\u200f\x09ر.س.\u200f\x03SB$\x09د.س.\u200f\x06ج.س." +
+ "\x03SR$\x09ل.س.\u200f\x09د.ت.\u200f\x03TT$\x03UY$\x09ر.ي.\u200f\x03Fdj" +
+ "\x03Nfk\x01S\x04GB£\x03TSh\x03₼\x03ley\x03S£\x04Bds$\x03BD$\x02B$\x02Br" +
+ "\x04CUC$\x03$MN\x03RD$\x04FK£\x02G$\x04Íkr\x02J$\x03CI$\x02L$\x02N$\x07р" +
+ "уб.\x03SI$\x02S$\x02$U\x05лв.\x06щ.д.\x02$A\x03$CA\x04£ E\x05£ RU\x04$ " +
+ "HK\x03£L\x04$ ZN\x03$ T\x04$ SU\x04din.\x04КМ\x04Кч\x04зл\x07дин.\x04Тл" +
+ "\x01F\x06лей\x03USh\x04Kčs\x03ECU\x02TK\x03kr.\x03Ksh\x03öS\x03BGK\x03BG" +
+ "J\x04Cub$\x02DM\x04Fl£\x04F.G.\x02FC\x04F.Rw\x03Nu.\x05KR₩\x05TH฿\x06Δρχ" +
+ "\x02Tk\x02$b\x02Kr\x02Gs\x03CFP\x03FBu\x01D\x04MOP$\x02MK\x02SR\x02Le" +
+ "\x04NAf.\x01E\x02VT\x03WS$\x04SD£\x03BsF\x02p.\x03B/.\x02S/\x03Gs.\x03Bs" +
+ ".\x02؋\x04¥CN\x03$HK\x08ریال\x03$MX\x03$NZ\x03$EC\x02UM\x02mk\x03$AR\x03" +
+ "$AU\x02FB\x03$BM\x03$BN\x03$BS\x03$BZ\x03$CL\x03$CO\x04£CY\x03£E\x03$FJ" +
+ "\x04£FK\x04£GB\x04£GI\x04£IE\x04£IL\x05₤IT\x04£LB\x04£MT\x03$NA\x02$C" +
+ "\x03$RH\x02FR\x03$SB\x03$SG\x03$SR\x03$TT\x03$US\x03$UY\x04FCFP\x02Kw" +
+ "\x05$\u00a0AU\x05$\u00a0HK\x05$\u00a0NZ\x05$\u00a0SG\x05$\u00a0US\x02DA" +
+ "\x01G\x02LS\x02DT\x06руб\x07રૂ.\x0a\u200eCN¥\u200e\x06ל״י\x09लेई\x02֏" +
+ "\x03NKr\x03元\x03¥\x06レイ\x03\u200b\x06ಲೀ\x02LE\x02Kn\x06сом\x02zl\x02rb" +
+ "\x03MTn\x06ден\x04кр\x03NAf\x03Afl\x0cनेरू\x06रू\x04Afl.\x02ر\x03lej\x04" +
+ "Esc.\x06\u200bPTE\x04XXXX\x03ლ\x06ТМТ\x03Dkr\x03Skr\x03Nkr\x07රු.\x0fසිෆ" +
+ "්එ\x03NIS\x05Lekë\x03den\x02r.\x03BR$\x03Ekr\x04EG£\x04IE£\x03Ikr\x03R" +
+ "s.\x07сом.\x04AUD$\x04NZD$\x07крб.\x05soʻm\x06сўм\x03₩\x03ILS\x02P.\x03Z" +
+ "ł"
+
+type curToIndex struct {
+ cur uint16
+ idx uint16
+}
+
+var normalLangIndex = []uint16{ // 776 elements
+ // Entry 0 - 3F
+ 0x0000, 0x0014, 0x0017, 0x0018, 0x0018, 0x0018, 0x0018, 0x0019,
+ 0x0019, 0x001d, 0x001d, 0x0034, 0x0034, 0x0034, 0x0034, 0x0035,
+ 0x0035, 0x0035, 0x0035, 0x0036, 0x0036, 0x0036, 0x0036, 0x0037,
+ 0x0037, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038,
+ 0x0038, 0x0038, 0x0039, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b,
+ 0x003b, 0x003b, 0x003b, 0x003c, 0x003c, 0x003f, 0x003f, 0x0041,
+ 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0049, 0x0049,
+ 0x004a, 0x004a, 0x004b, 0x004b, 0x005c, 0x005c, 0x005c, 0x005c,
+ // Entry 40 - 7F
+ 0x005c, 0x005e, 0x005e, 0x005e, 0x005f, 0x005f, 0x0060, 0x006e,
+ 0x006e, 0x006e, 0x006e, 0x007f, 0x0085, 0x0085, 0x0085, 0x0085,
+ 0x008e, 0x008e, 0x008e, 0x008f, 0x008f, 0x0091, 0x0091, 0x0091,
+ 0x0092, 0x0092, 0x0093, 0x0093, 0x0094, 0x0094, 0x0095, 0x0095,
+ 0x0095, 0x009c, 0x009c, 0x009d, 0x009d, 0x009f, 0x009f, 0x00a3,
+ 0x00a3, 0x00a3, 0x00a4, 0x00a4, 0x00ac, 0x00ac, 0x00ac, 0x00ad,
+ 0x00ad, 0x00ad, 0x00ae, 0x00af, 0x00af, 0x00af, 0x00b4, 0x00b4,
+ 0x00b4, 0x00b4, 0x00b4, 0x00b4, 0x00b4, 0x00ba, 0x00ba, 0x00bb,
+ // Entry 80 - BF
+ 0x00bb, 0x00be, 0x00be, 0x00be, 0x00c1, 0x00c1, 0x00c1, 0x00c3,
+ 0x00c5, 0x00c5, 0x00c6, 0x00c7, 0x00c7, 0x00c7, 0x00dc, 0x00dd,
+ 0x00dd, 0x00de, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4,
+ 0x00e4, 0x00e5, 0x00e5, 0x00e6, 0x00e6, 0x00e6, 0x00e6, 0x00e7,
+ 0x00e8, 0x00e9, 0x00e9, 0x00ea, 0x00ec, 0x00ec, 0x00ec, 0x00ed,
+ 0x00ed, 0x00ee, 0x00f0, 0x00f1, 0x00f1, 0x00f2, 0x00f2, 0x00f2,
+ 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f3, 0x00f4, 0x00f5,
+ 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fb, 0x00fc,
+ // Entry C0 - FF
+ 0x00fc, 0x00fd, 0x00fe, 0x00ff, 0x0100, 0x0101, 0x0102, 0x0103,
+ 0x0104, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108, 0x0109, 0x010a,
+ 0x010b, 0x010b, 0x010b, 0x010c, 0x010d, 0x010e, 0x010e, 0x010f,
+ 0x0110, 0x0112, 0x0112, 0x0113, 0x0115, 0x0116, 0x0117, 0x0117,
+ 0x0118, 0x0119, 0x011a, 0x011b, 0x011c, 0x011d, 0x011d, 0x011d,
+ 0x011e, 0x011e, 0x011e, 0x011f, 0x0120, 0x0121, 0x0122, 0x0122,
+ 0x0122, 0x0122, 0x0133, 0x0138, 0x013a, 0x013b, 0x013c, 0x013d,
+ 0x013f, 0x0141, 0x0142, 0x0144, 0x0146, 0x0146, 0x0147, 0x0147,
+ // Entry 100 - 13F
+ 0x0148, 0x0149, 0x014a, 0x014a, 0x014b, 0x014c, 0x014d, 0x014e,
+ 0x014f, 0x0150, 0x0151, 0x0152, 0x0154, 0x0156, 0x0157, 0x015c,
+ 0x015c, 0x015e, 0x015e, 0x015e, 0x015e, 0x0169, 0x0169, 0x0169,
+ 0x0169, 0x0169, 0x016a, 0x016b, 0x016b, 0x017c, 0x017c, 0x0180,
+ 0x0180, 0x0181, 0x0182, 0x0182, 0x01a8, 0x01a8, 0x01a8, 0x01a9,
+ 0x01a9, 0x01a9, 0x01ca, 0x01cb, 0x01cb, 0x01cb, 0x01cb, 0x01cb,
+ 0x01cb, 0x01cc, 0x01cd, 0x01cd, 0x01cd, 0x01cd, 0x01ce, 0x01ce,
+ 0x01ce, 0x01cf, 0x01d0, 0x01d2, 0x01d2, 0x01d2, 0x01d2, 0x01d3,
+ // Entry 140 - 17F
+ 0x01d3, 0x01d3, 0x01d4, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5,
+ 0x01d5, 0x01d6, 0x01d7, 0x01d7, 0x01d8, 0x01d8, 0x01d8, 0x01d9,
+ 0x01da, 0x01da, 0x01da, 0x01da, 0x01da, 0x01e0, 0x01e0, 0x01e3,
+ 0x01e3, 0x01e5, 0x01e5, 0x01e9, 0x01e9, 0x01ec, 0x01ec, 0x01ec,
+ 0x01ec, 0x01ed, 0x01ed, 0x01ed, 0x01ee, 0x01ee, 0x01ee, 0x01ee,
+ 0x01ef, 0x01f0, 0x01f0, 0x01f0, 0x01f1, 0x01f1, 0x01f6, 0x01f6,
+ 0x01f8, 0x01f8, 0x020a, 0x020b, 0x020b, 0x0210, 0x0210, 0x0222,
+ 0x0222, 0x0225, 0x0225, 0x0229, 0x0229, 0x022a, 0x022a, 0x022b,
+ // Entry 180 - 1BF
+ 0x022b, 0x022b, 0x022b, 0x0237, 0x0237, 0x023f, 0x023f, 0x023f,
+ 0x023f, 0x023f, 0x023f, 0x023f, 0x0242, 0x0242, 0x0242, 0x0242,
+ 0x0242, 0x0242, 0x0243, 0x0243, 0x0243, 0x0243, 0x024d, 0x024d,
+ 0x024e, 0x024e, 0x024e, 0x024f, 0x024f, 0x024f, 0x0250, 0x0250,
+ 0x0253, 0x0253, 0x0253, 0x0253, 0x0254, 0x0254, 0x0258, 0x0258,
+ 0x0258, 0x0258, 0x0259, 0x0259, 0x025a, 0x025a, 0x025d, 0x025d,
+ 0x025f, 0x025f, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260,
+ 0x0260, 0x0261, 0x0261, 0x0261, 0x0261, 0x0261, 0x0261, 0x0261,
+ // Entry 1C0 - 1FF
+ 0x0261, 0x0261, 0x0270, 0x0270, 0x0271, 0x0271, 0x0276, 0x0276,
+ 0x0277, 0x0277, 0x0278, 0x0278, 0x0279, 0x027a, 0x027a, 0x027a,
+ 0x027a, 0x027c, 0x027c, 0x027d, 0x027d, 0x027d, 0x0290, 0x0290,
+ 0x0291, 0x0291, 0x0292, 0x0292, 0x0293, 0x0293, 0x0298, 0x0298,
+ 0x0299, 0x0299, 0x029a, 0x029b, 0x029b, 0x029c, 0x029c, 0x029d,
+ 0x029d, 0x029e, 0x029e, 0x029e, 0x029e, 0x02aa, 0x02aa, 0x02ad,
+ 0x02ad, 0x02b0, 0x02b0, 0x02b0, 0x02b2, 0x02b2, 0x02b6, 0x02b7,
+ 0x02b7, 0x02b8, 0x02b8, 0x02b8, 0x02b8, 0x02b8, 0x02bf, 0x02bf,
+ // Entry 200 - 23F
+ 0x02c0, 0x02c0, 0x02c0, 0x02c1, 0x02c1, 0x02d3, 0x02d3, 0x02d3,
+ 0x02d3, 0x02d3, 0x02d3, 0x02d3, 0x02d3, 0x02d5, 0x02d5, 0x02d5,
+ 0x02db, 0x02dc, 0x02dc, 0x02dd, 0x02de, 0x02de, 0x02df, 0x02e0,
+ 0x02e0, 0x02e0, 0x02f3, 0x02f3, 0x02f3, 0x02f3, 0x02f3, 0x02f3,
+ 0x02f3, 0x02f3, 0x02f5, 0x02f5, 0x02f5, 0x02f6, 0x02f6, 0x02f7,
+ 0x02f7, 0x02f8, 0x02fa, 0x02fa, 0x02fc, 0x02fc, 0x02fe, 0x02ff,
+ 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x030f, 0x030f, 0x030f,
+ 0x030f, 0x0310, 0x0310, 0x0313, 0x0314, 0x0314, 0x0314, 0x0316,
+ // Entry 240 - 27F
+ 0x0316, 0x0316, 0x0317, 0x0318, 0x0319, 0x031a, 0x031b, 0x031b,
+ 0x031c, 0x031e, 0x0320, 0x0320, 0x0320, 0x0320, 0x0321, 0x0321,
+ 0x0332, 0x0333, 0x0333, 0x0334, 0x0334, 0x033c, 0x033e, 0x033f,
+ 0x0340, 0x0341, 0x0341, 0x0341, 0x0342, 0x0342, 0x0343, 0x0343,
+ 0x0344, 0x0344, 0x0345, 0x0345, 0x0346, 0x0346, 0x0347, 0x0347,
+ 0x0347, 0x034b, 0x034b, 0x034b, 0x034d, 0x034e, 0x034e, 0x034e,
+ 0x034e, 0x034e, 0x034e, 0x034e, 0x034e, 0x034e, 0x034e, 0x034e,
+ 0x034e, 0x0351, 0x0351, 0x035f, 0x035f, 0x0369, 0x0369, 0x0369,
+ // Entry 280 - 2BF
+ 0x0369, 0x0369, 0x0369, 0x0369, 0x0369, 0x0369, 0x0369, 0x036a,
+ 0x036b, 0x036c, 0x036d, 0x036d, 0x036f, 0x036f, 0x0370, 0x0370,
+ 0x0376, 0x0376, 0x0376, 0x0376, 0x0376, 0x0376, 0x037c, 0x037c,
+ 0x037c, 0x037c, 0x037c, 0x037c, 0x037c, 0x037c, 0x0394, 0x0394,
+ 0x0394, 0x0394, 0x0397, 0x0398, 0x0398, 0x0398, 0x0399, 0x0399,
+ 0x039c, 0x039c, 0x039d, 0x039f, 0x03a2, 0x03a4, 0x03a4, 0x03a5,
+ 0x03a6, 0x03a6, 0x03a8, 0x03a8, 0x03aa, 0x03aa, 0x03ab, 0x03ac,
+ 0x03ac, 0x03ac, 0x03ae, 0x03ae, 0x03ae, 0x03ae, 0x03b1, 0x03b1,
+ // Entry 2C0 - 2FF
+ 0x03b6, 0x03b6, 0x03b6, 0x03b6, 0x03b8, 0x03b8, 0x03b8, 0x03b8,
+ 0x03b8, 0x03b8, 0x03ba, 0x03ba, 0x03cd, 0x03cd, 0x03d0, 0x03d1,
+ 0x03d1, 0x03d2, 0x03d3, 0x03d3, 0x03d5, 0x03d5, 0x03d5, 0x03d5,
+ 0x03d6, 0x03d7, 0x03d7, 0x03d7, 0x03d7, 0x03d7, 0x03d9, 0x03d9,
+ 0x03d9, 0x03d9, 0x03da, 0x03da, 0x03da, 0x03dc, 0x03dc, 0x03dd,
+ 0x03dd, 0x03dd, 0x03de, 0x03de, 0x03de, 0x03de, 0x03de, 0x03de,
+ 0x03df, 0x03df, 0x03df, 0x03e2, 0x03e5, 0x03e5, 0x03e5, 0x03e5,
+ 0x03e5, 0x03e5, 0x03e9, 0x03e9, 0x03e9, 0x03ea, 0x03ec, 0x03ee,
+ // Entry 300 - 33F
+ 0x03f2, 0x03f4, 0x03f5, 0x03f5, 0x03f7, 0x03f7, 0x03f7, 0x03f7,
+} // Size: 1576 bytes
+
+var normalSymIndex = []curToIndex{ // 1015 elements
+ 0: {cur: 0x13, idx: 0x6},
+ 1: {cur: 0x2e, idx: 0x13},
+ 2: {cur: 0x3a, idx: 0x1c},
+ 3: {cur: 0x44, idx: 0x20},
+ 4: {cur: 0x5e, idx: 0x3b},
+ 5: {cur: 0x63, idx: 0x3f},
+ 6: {cur: 0x72, idx: 0x4b},
+ 7: {cur: 0x7c, idx: 0x5a},
+ 8: {cur: 0x7d, idx: 0x5e},
+ 9: {cur: 0x85, idx: 0x62},
+ 10: {cur: 0x8d, idx: 0x6e},
+ 11: {cur: 0xb2, idx: 0x90},
+ 12: {cur: 0xc0, idx: 0x9e},
+ 13: {cur: 0xf6, idx: 0xc7},
+ 14: {cur: 0xfc, idx: 0xcf},
+ 15: {cur: 0x105, idx: 0xd3},
+ 16: {cur: 0x109, idx: 0xd7},
+ 17: {cur: 0x110, idx: 0xdc},
+ 18: {cur: 0x115, idx: 0xe0},
+ 19: {cur: 0x117, idx: 0xe4},
+ 20: {cur: 0xb2, idx: 0x0},
+ 21: {cur: 0xeb, idx: 0xbc},
+ 22: {cur: 0x125, idx: 0xe9},
+ 23: {cur: 0xb9, idx: 0x4},
+ 24: {cur: 0x67, idx: 0xf2},
+ 25: {cur: 0x13, idx: 0xf8},
+ 26: {cur: 0x42, idx: 0xfc},
+ 27: {cur: 0x5d, idx: 0x113},
+ 28: {cur: 0xeb, idx: 0xbc},
+ 29: {cur: 0x0, idx: 0x11a},
+ 30: {cur: 0x2, idx: 0x11e},
+ 31: {cur: 0x13, idx: 0xf8},
+ 32: {cur: 0x23, idx: 0x130},
+ 33: {cur: 0x54, idx: 0x15a},
+ 34: {cur: 0x58, idx: 0x164},
+ 35: {cur: 0x7e, idx: 0x17b},
+ 36: {cur: 0x7f, idx: 0x185},
+ 37: {cur: 0x84, idx: 0x190},
+ 38: {cur: 0x8e, idx: 0x19a},
+ 39: {cur: 0x92, idx: 0x1a8},
+ 40: {cur: 0x9d, idx: 0x1b2},
+ 41: {cur: 0x9e, idx: 0x1bc},
+ 42: {cur: 0xab, idx: 0x1c6},
+ 43: {cur: 0xc1, idx: 0x1d0},
+ 44: {cur: 0xcd, idx: 0x1da},
+ 45: {cur: 0xd5, idx: 0x1e4},
+ 46: {cur: 0xd8, idx: 0x1f2},
+ 47: {cur: 0xd9, idx: 0x1fc},
+ 48: {cur: 0xe9, idx: 0x207},
+ 49: {cur: 0xeb, idx: 0xbc},
+ 50: {cur: 0xf0, idx: 0x211},
+ 51: {cur: 0x11f, idx: 0x223},
+ 52: {cur: 0x51, idx: 0x22d},
+ 53: {cur: 0x59, idx: 0x231},
+ 54: {cur: 0x89, idx: 0x6b},
+ 55: {cur: 0xd9, idx: 0x0},
+ 56: {cur: 0xe1, idx: 0x235},
+ 57: {cur: 0x63, idx: 0x237},
+ 58: {cur: 0xe4, idx: 0x3f},
+ 59: {cur: 0xf7, idx: 0x23c},
+ 60: {cur: 0x85, idx: 0x25},
+ 61: {cur: 0xeb, idx: 0xbc},
+ 62: {cur: 0xfc, idx: 0x4},
+ 63: {cur: 0x16, idx: 0x240},
+ 64: {cur: 0xeb, idx: 0xbc},
+ 65: {cur: 0x16, idx: 0x240},
+ 66: {cur: 0x2e, idx: 0x0},
+ 67: {cur: 0x37, idx: 0x258},
+ 68: {cur: 0x3a, idx: 0x0},
+ 69: {cur: 0x85, idx: 0x25},
+ 70: {cur: 0xc0, idx: 0x0},
+ 71: {cur: 0xd2, idx: 0xb2},
+ 72: {cur: 0xfc, idx: 0x4},
+ 73: {cur: 0x127, idx: 0x8a},
+ 74: {cur: 0xf7, idx: 0x23c},
+ 75: {cur: 0x13, idx: 0x0},
+ 76: {cur: 0x21, idx: 0x294},
+ 77: {cur: 0x2e, idx: 0x0},
+ 78: {cur: 0x3a, idx: 0x0},
+ 79: {cur: 0x44, idx: 0x0},
+ 80: {cur: 0x63, idx: 0x0},
+ 81: {cur: 0x72, idx: 0x0},
+ 82: {cur: 0x7c, idx: 0x0},
+ 83: {cur: 0x7d, idx: 0x0},
+ 84: {cur: 0x85, idx: 0x0},
+ 85: {cur: 0x8d, idx: 0x0},
+ 86: {cur: 0xb2, idx: 0x0},
+ 87: {cur: 0xc0, idx: 0x0},
+ 88: {cur: 0xf6, idx: 0x0},
+ 89: {cur: 0xfc, idx: 0x29a},
+ 90: {cur: 0x105, idx: 0x0},
+ 91: {cur: 0x110, idx: 0x0},
+ 92: {cur: 0x1b, idx: 0xc},
+ 93: {cur: 0xeb, idx: 0xbc},
+ 94: {cur: 0x44, idx: 0x25},
+ 95: {cur: 0x44, idx: 0x20},
+ 96: {cur: 0x13, idx: 0x2a1},
+ 97: {cur: 0x2e, idx: 0x0},
+ 98: {cur: 0x3a, idx: 0x2a4},
+ 99: {cur: 0x44, idx: 0x0},
+ 100: {cur: 0x63, idx: 0x2ad},
+ 101: {cur: 0x72, idx: 0x2b3},
+ 102: {cur: 0x7c, idx: 0x0},
+ 103: {cur: 0x85, idx: 0x0},
+ 104: {cur: 0x8d, idx: 0x0},
+ 105: {cur: 0xc0, idx: 0x2bc},
+ 106: {cur: 0xf6, idx: 0x0},
+ 107: {cur: 0xfc, idx: 0x2c5},
+ 108: {cur: 0x105, idx: 0x0},
+ 109: {cur: 0x110, idx: 0x0},
+ 110: {cur: 0x13, idx: 0x0},
+ 111: {cur: 0x18, idx: 0x9},
+ 112: {cur: 0x2e, idx: 0x0},
+ 113: {cur: 0x3a, idx: 0x0},
+ 114: {cur: 0x44, idx: 0x0},
+ 115: {cur: 0x63, idx: 0x0},
+ 116: {cur: 0x72, idx: 0x0},
+ 117: {cur: 0x75, idx: 0x51},
+ 118: {cur: 0x7c, idx: 0x0},
+ 119: {cur: 0x85, idx: 0x25},
+ 120: {cur: 0xb2, idx: 0x0},
+ 121: {cur: 0xc0, idx: 0x0},
+ 122: {cur: 0xd1, idx: 0x2ca},
+ 123: {cur: 0xeb, idx: 0xbc},
+ 124: {cur: 0xfc, idx: 0x0},
+ 125: {cur: 0x110, idx: 0x0},
+ 126: {cur: 0x117, idx: 0x0},
+ 127: {cur: 0x18, idx: 0x2cf},
+ 128: {cur: 0x4e, idx: 0x2d4},
+ 129: {cur: 0x85, idx: 0x25},
+ 130: {cur: 0xc9, idx: 0x2d9},
+ 131: {cur: 0xd1, idx: 0x2de},
+ 132: {cur: 0xf4, idx: 0x2e6},
+ 133: {cur: 0x13, idx: 0xf8},
+ 134: {cur: 0x2e, idx: 0x0},
+ 135: {cur: 0x3a, idx: 0x0},
+ 136: {cur: 0x44, idx: 0x25},
+ 137: {cur: 0x5c, idx: 0x37},
+ 138: {cur: 0xb2, idx: 0x0},
+ 139: {cur: 0xeb, idx: 0xbc},
+ 140: {cur: 0xfc, idx: 0x0},
+ 141: {cur: 0x110, idx: 0x0},
+ 142: {cur: 0x62, idx: 0x2eb},
+ 143: {cur: 0x1b, idx: 0xc},
+ 144: {cur: 0xeb, idx: 0xbc},
+ 145: {cur: 0xd2, idx: 0xb2},
+ 146: {cur: 0xfb, idx: 0x2f4},
+ 147: {cur: 0xfc, idx: 0x4},
+ 148: {cur: 0x7e, idx: 0x17b},
+ 149: {cur: 0x13, idx: 0xf8},
+ 150: {cur: 0x49, idx: 0x2f8},
+ 151: {cur: 0x4e, idx: 0x2c},
+ 152: {cur: 0x7c, idx: 0x0},
+ 153: {cur: 0x7d, idx: 0x0},
+ 154: {cur: 0x105, idx: 0x0},
+ 155: {cur: 0x112, idx: 0x2fd},
+ 156: {cur: 0xd2, idx: 0xb2},
+ 157: {cur: 0x8d, idx: 0x0},
+ 158: {cur: 0xeb, idx: 0xbc},
+ 159: {cur: 0x13, idx: 0xf8},
+ 160: {cur: 0x52, idx: 0x304},
+ 161: {cur: 0xeb, idx: 0xbc},
+ 162: {cur: 0xfc, idx: 0x4},
+ 163: {cur: 0x86, idx: 0x308},
+ 164: {cur: 0x12, idx: 0x30c},
+ 165: {cur: 0x13, idx: 0xf8},
+ 166: {cur: 0x20, idx: 0x310},
+ 167: {cur: 0x22, idx: 0x314},
+ 168: {cur: 0x50, idx: 0x31d},
+ 169: {cur: 0x85, idx: 0x25},
+ 170: {cur: 0xeb, idx: 0xbc},
+ 171: {cur: 0xfc, idx: 0x4},
+ 172: {cur: 0x5e, idx: 0x0},
+ 173: {cur: 0x5e, idx: 0x0},
+ 174: {cur: 0x99, idx: 0x2eb},
+ 175: {cur: 0x13, idx: 0x0},
+ 176: {cur: 0x85, idx: 0x25},
+ 177: {cur: 0xc9, idx: 0xa6},
+ 178: {cur: 0xeb, idx: 0xbc},
+ 179: {cur: 0xfc, idx: 0x4},
+ 180: {cur: 0x13, idx: 0xf8},
+ 181: {cur: 0x33, idx: 0x332},
+ 182: {cur: 0x7c, idx: 0x0},
+ 183: {cur: 0x8d, idx: 0x336},
+ 184: {cur: 0xeb, idx: 0x33c},
+ 185: {cur: 0x109, idx: 0x0},
+ 186: {cur: 0x86, idx: 0x308},
+ 187: {cur: 0x13, idx: 0xf8},
+ 188: {cur: 0x67, idx: 0xf2},
+ 189: {cur: 0xeb, idx: 0xbc},
+ 190: {cur: 0x6d, idx: 0x342},
+ 191: {cur: 0xeb, idx: 0xbc},
+ 192: {cur: 0xfc, idx: 0x4},
+ 193: {cur: 0x85, idx: 0x25},
+ 194: {cur: 0xfc, idx: 0x4},
+ 195: {cur: 0x85, idx: 0x62},
+ 196: {cur: 0xfc, idx: 0xcf},
+ 197: {cur: 0x110, idx: 0x4},
+ 198: {cur: 0x110, idx: 0x4},
+ 199: {cur: 0x13, idx: 0x4},
+ 200: {cur: 0x2e, idx: 0x0},
+ 201: {cur: 0x3a, idx: 0x0},
+ 202: {cur: 0x44, idx: 0x0},
+ 203: {cur: 0x5e, idx: 0x0},
+ 204: {cur: 0x63, idx: 0x0},
+ 205: {cur: 0x72, idx: 0x0},
+ 206: {cur: 0x7c, idx: 0x0},
+ 207: {cur: 0x7d, idx: 0x0},
+ 208: {cur: 0x85, idx: 0x0},
+ 209: {cur: 0x8d, idx: 0x0},
+ 210: {cur: 0xb2, idx: 0x0},
+ 211: {cur: 0xc0, idx: 0x0},
+ 212: {cur: 0xd7, idx: 0x7e},
+ 213: {cur: 0xf6, idx: 0x0},
+ 214: {cur: 0xfc, idx: 0x0},
+ 215: {cur: 0x105, idx: 0x0},
+ 216: {cur: 0x109, idx: 0x0},
+ 217: {cur: 0x110, idx: 0x0},
+ 218: {cur: 0x115, idx: 0x0},
+ 219: {cur: 0x117, idx: 0x355},
+ 220: {cur: 0x1a, idx: 0x4},
+ 221: {cur: 0x24, idx: 0x359},
+ 222: {cur: 0x25, idx: 0x4},
+ 223: {cur: 0x32, idx: 0x4},
+ 224: {cur: 0x35, idx: 0x16},
+ 225: {cur: 0x39, idx: 0x4},
+ 226: {cur: 0x3a, idx: 0x4},
+ 227: {cur: 0x13, idx: 0x4},
+ 228: {cur: 0xc0, idx: 0x4},
+ 229: {cur: 0x13, idx: 0x4},
+ 230: {cur: 0x52, idx: 0x304},
+ 231: {cur: 0x110, idx: 0x4},
+ 232: {cur: 0x59, idx: 0x231},
+ 233: {cur: 0x60, idx: 0x4},
+ 234: {cur: 0x61, idx: 0x3f},
+ 235: {cur: 0x63, idx: 0x237},
+ 236: {cur: 0x110, idx: 0x4},
+ 237: {cur: 0x67, idx: 0xf2},
+ 238: {cur: 0x63, idx: 0x237},
+ 239: {cur: 0x68, idx: 0x3f},
+ 240: {cur: 0x69, idx: 0x35d},
+ 241: {cur: 0x71, idx: 0x4},
+ 242: {cur: 0x83, idx: 0x4},
+ 243: {cur: 0x86, idx: 0x308},
+ 244: {cur: 0x13, idx: 0x4},
+ 245: {cur: 0x110, idx: 0x4},
+ 246: {cur: 0x8f, idx: 0x4},
+ 247: {cur: 0x110, idx: 0x4},
+ 248: {cur: 0x94, idx: 0x4},
+ 249: {cur: 0x125, idx: 0xe9},
+ 250: {cur: 0xa3, idx: 0x87},
+ 251: {cur: 0xaa, idx: 0x35f},
+ 252: {cur: 0x110, idx: 0x4},
+ 253: {cur: 0x63, idx: 0x237},
+ 254: {cur: 0xae, idx: 0x7e},
+ 255: {cur: 0xb1, idx: 0x364},
+ 256: {cur: 0xb5, idx: 0x94},
+ 257: {cur: 0xb9, idx: 0x4},
+ 258: {cur: 0x13, idx: 0x4},
+ 259: {cur: 0xba, idx: 0x97},
+ 260: {cur: 0x13, idx: 0x4},
+ 261: {cur: 0xc0, idx: 0x4},
+ 262: {cur: 0xc0, idx: 0x4},
+ 263: {cur: 0xc6, idx: 0x8a},
+ 264: {cur: 0xc7, idx: 0xa2},
+ 265: {cur: 0xc8, idx: 0x7e},
+ 266: {cur: 0xc0, idx: 0x4},
+ 267: {cur: 0xd4, idx: 0xb6},
+ 268: {cur: 0xd6, idx: 0x4},
+ 269: {cur: 0xd7, idx: 0x367},
+ 270: {cur: 0xdb, idx: 0x30},
+ 271: {cur: 0xdc, idx: 0x4},
+ 272: {cur: 0x63, idx: 0x237},
+ 273: {cur: 0xdd, idx: 0x3f},
+ 274: {cur: 0xe0, idx: 0x36a},
+ 275: {cur: 0x63, idx: 0x237},
+ 276: {cur: 0xe4, idx: 0x3f},
+ 277: {cur: 0x8, idx: 0x36d},
+ 278: {cur: 0xea, idx: 0x372},
+ 279: {cur: 0xc0, idx: 0x4},
+ 280: {cur: 0xf1, idx: 0xc0},
+ 281: {cur: 0xf5, idx: 0x4},
+ 282: {cur: 0x13, idx: 0x4},
+ 283: {cur: 0xf7, idx: 0x23c},
+ 284: {cur: 0xfb, idx: 0x2f4},
+ 285: {cur: 0x110, idx: 0x4},
+ 286: {cur: 0x107, idx: 0x374},
+ 287: {cur: 0x108, idx: 0x377},
+ 288: {cur: 0x125, idx: 0xe9},
+ 289: {cur: 0x127, idx: 0x8a},
+ 290: {cur: 0x13, idx: 0x0},
+ 291: {cur: 0x2e, idx: 0x0},
+ 292: {cur: 0x44, idx: 0x0},
+ 293: {cur: 0x5c, idx: 0x37},
+ 294: {cur: 0x63, idx: 0x0},
+ 295: {cur: 0x72, idx: 0x0},
+ 296: {cur: 0x7c, idx: 0x0},
+ 297: {cur: 0x7d, idx: 0x0},
+ 298: {cur: 0x85, idx: 0x0},
+ 299: {cur: 0x8d, idx: 0x0},
+ 300: {cur: 0xb2, idx: 0x0},
+ 301: {cur: 0xc0, idx: 0x0},
+ 302: {cur: 0xeb, idx: 0xbc},
+ 303: {cur: 0xf6, idx: 0x0},
+ 304: {cur: 0x109, idx: 0x0},
+ 305: {cur: 0x110, idx: 0x0},
+ 306: {cur: 0x115, idx: 0x0},
+ 307: {cur: 0x3a, idx: 0x0},
+ 308: {cur: 0x5e, idx: 0x0},
+ 309: {cur: 0xeb, idx: 0x0},
+ 310: {cur: 0xfc, idx: 0x0},
+ 311: {cur: 0x105, idx: 0x0},
+ 312: {cur: 0x11, idx: 0x4},
+ 313: {cur: 0xfc, idx: 0xcf},
+ 314: {cur: 0x27, idx: 0x10},
+ 315: {cur: 0x2e, idx: 0x13},
+ 316: {cur: 0x39, idx: 0x4},
+ 317: {cur: 0x41, idx: 0x4},
+ 318: {cur: 0xfc, idx: 0xcf},
+ 319: {cur: 0x45, idx: 0x4},
+ 320: {cur: 0xfc, idx: 0xcf},
+ 321: {cur: 0x47, idx: 0x28},
+ 322: {cur: 0x4b, idx: 0x4},
+ 323: {cur: 0xfc, idx: 0xcf},
+ 324: {cur: 0x53, idx: 0x264},
+ 325: {cur: 0xfc, idx: 0xcf},
+ 326: {cur: 0xfc, idx: 0x4},
+ 327: {cur: 0x109, idx: 0xd7},
+ 328: {cur: 0x6e, idx: 0x49},
+ 329: {cur: 0x73, idx: 0x4f},
+ 330: {cur: 0xb2, idx: 0x4},
+ 331: {cur: 0xbc, idx: 0x9b},
+ 332: {cur: 0xc2, idx: 0x387},
+ 333: {cur: 0xc4, idx: 0x38b},
+ 334: {cur: 0xc7, idx: 0xa2},
+ 335: {cur: 0xfc, idx: 0x4},
+ 336: {cur: 0xcc, idx: 0x38e},
+ 337: {cur: 0xfc, idx: 0x4},
+ 338: {cur: 0x85, idx: 0x25},
+ 339: {cur: 0xfc, idx: 0x4},
+ 340: {cur: 0xfc, idx: 0xcf},
+ 341: {cur: 0x101, idx: 0x4},
+ 342: {cur: 0x104, idx: 0x392},
+ 343: {cur: 0x13, idx: 0xf8},
+ 344: {cur: 0x57, idx: 0x30},
+ 345: {cur: 0x85, idx: 0x25},
+ 346: {cur: 0xeb, idx: 0xbc},
+ 347: {cur: 0xfc, idx: 0x4},
+ 348: {cur: 0x5c, idx: 0x37},
+ 349: {cur: 0xeb, idx: 0xbc},
+ 350: {cur: 0x4, idx: 0x396},
+ 351: {cur: 0x3a, idx: 0x2a4},
+ 352: {cur: 0x44, idx: 0x399},
+ 353: {cur: 0x72, idx: 0x39e},
+ 354: {cur: 0x7f, idx: 0x3a2},
+ 355: {cur: 0x85, idx: 0x25},
+ 356: {cur: 0xb2, idx: 0x3ab},
+ 357: {cur: 0xc0, idx: 0x3af},
+ 358: {cur: 0xeb, idx: 0xbc},
+ 359: {cur: 0xfc, idx: 0x4},
+ 360: {cur: 0x110, idx: 0x3b3},
+ 361: {cur: 0x6a, idx: 0x46},
+ 362: {cur: 0xab, idx: 0x3b7},
+ 363: {cur: 0x13, idx: 0x0},
+ 364: {cur: 0x2e, idx: 0x0},
+ 365: {cur: 0x3a, idx: 0x0},
+ 366: {cur: 0x44, idx: 0x0},
+ 367: {cur: 0x5f, idx: 0x3ba},
+ 368: {cur: 0x72, idx: 0x0},
+ 369: {cur: 0x7c, idx: 0x0},
+ 370: {cur: 0x7d, idx: 0x0},
+ 371: {cur: 0x85, idx: 0x25},
+ 372: {cur: 0x8d, idx: 0x0},
+ 373: {cur: 0xb2, idx: 0x0},
+ 374: {cur: 0xc0, idx: 0x0},
+ 375: {cur: 0xf6, idx: 0x0},
+ 376: {cur: 0xfc, idx: 0x4},
+ 377: {cur: 0x105, idx: 0x0},
+ 378: {cur: 0x110, idx: 0x0},
+ 379: {cur: 0x117, idx: 0x0},
+ 380: {cur: 0x85, idx: 0x25},
+ 381: {cur: 0xc7, idx: 0xa2},
+ 382: {cur: 0xeb, idx: 0xbc},
+ 383: {cur: 0xfc, idx: 0x4},
+ 384: {cur: 0x52, idx: 0x30},
+ 385: {cur: 0x52, idx: 0x304},
+ 386: {cur: 0x11, idx: 0x3bd},
+ 387: {cur: 0x13, idx: 0x3c1},
+ 388: {cur: 0x1d, idx: 0x3c5},
+ 389: {cur: 0x25, idx: 0x3c8},
+ 390: {cur: 0x26, idx: 0x3cc},
+ 391: {cur: 0x32, idx: 0x3d0},
+ 392: {cur: 0x39, idx: 0x3d4},
+ 393: {cur: 0x3a, idx: 0x2a4},
+ 394: {cur: 0x41, idx: 0x3d8},
+ 395: {cur: 0x44, idx: 0x0},
+ 396: {cur: 0x45, idx: 0x3dc},
+ 397: {cur: 0x4d, idx: 0x3e0},
+ 398: {cur: 0x60, idx: 0x3e9},
+ 399: {cur: 0x61, idx: 0x3ed},
+ 400: {cur: 0x62, idx: 0x2eb},
+ 401: {cur: 0x63, idx: 0x3f2},
+ 402: {cur: 0x68, idx: 0x3f7},
+ 403: {cur: 0x72, idx: 0x0},
+ 404: {cur: 0x79, idx: 0x3fc},
+ 405: {cur: 0x7a, idx: 0x401},
+ 406: {cur: 0x82, idx: 0x406},
+ 407: {cur: 0x85, idx: 0x0},
+ 408: {cur: 0x92, idx: 0x40c},
+ 409: {cur: 0xad, idx: 0x411},
+ 410: {cur: 0xb2, idx: 0x3ab},
+ 411: {cur: 0xb9, idx: 0x416},
+ 412: {cur: 0xc0, idx: 0x3af},
+ 413: {cur: 0xce, idx: 0x41d},
+ 414: {cur: 0xd6, idx: 0x424},
+ 415: {cur: 0xdc, idx: 0x428},
+ 416: {cur: 0xe2, idx: 0x42c},
+ 417: {cur: 0xf5, idx: 0x430},
+ 418: {cur: 0xf6, idx: 0x0},
+ 419: {cur: 0xfc, idx: 0x434},
+ 420: {cur: 0x101, idx: 0x438},
+ 421: {cur: 0x108, idx: 0x377},
+ 422: {cur: 0x110, idx: 0x0},
+ 423: {cur: 0x117, idx: 0x43c},
+ 424: {cur: 0x24, idx: 0x359},
+ 425: {cur: 0x11, idx: 0x0},
+ 426: {cur: 0x13, idx: 0x444},
+ 427: {cur: 0x25, idx: 0x0},
+ 428: {cur: 0x26, idx: 0x0},
+ 429: {cur: 0x32, idx: 0x0},
+ 430: {cur: 0x39, idx: 0x0},
+ 431: {cur: 0x3a, idx: 0x4},
+ 432: {cur: 0x41, idx: 0x0},
+ 433: {cur: 0x44, idx: 0x20},
+ 434: {cur: 0x45, idx: 0x0},
+ 435: {cur: 0x60, idx: 0x0},
+ 436: {cur: 0x61, idx: 0x0},
+ 437: {cur: 0x63, idx: 0x3f},
+ 438: {cur: 0x68, idx: 0x0},
+ 439: {cur: 0x72, idx: 0x44a},
+ 440: {cur: 0x7c, idx: 0x0},
+ 441: {cur: 0x7d, idx: 0x0},
+ 442: {cur: 0x85, idx: 0x25},
+ 443: {cur: 0x8d, idx: 0x0},
+ 444: {cur: 0x92, idx: 0x0},
+ 445: {cur: 0xb2, idx: 0x0},
+ 446: {cur: 0xb9, idx: 0x0},
+ 447: {cur: 0xc0, idx: 0x450},
+ 448: {cur: 0xd6, idx: 0x0},
+ 449: {cur: 0xdc, idx: 0x456},
+ 450: {cur: 0xe2, idx: 0x0},
+ 451: {cur: 0xf5, idx: 0x0},
+ 452: {cur: 0xfc, idx: 0x45c},
+ 453: {cur: 0x101, idx: 0x0},
+ 454: {cur: 0x105, idx: 0x0},
+ 455: {cur: 0x109, idx: 0x0},
+ 456: {cur: 0x115, idx: 0x0},
+ 457: {cur: 0x117, idx: 0x0},
+ 458: {cur: 0x3b, idx: 0x32a},
+ 459: {cur: 0x51, idx: 0x22d},
+ 460: {cur: 0x54, idx: 0x462},
+ 461: {cur: 0x6a, idx: 0x46},
+ 462: {cur: 0x76, idx: 0x465},
+ 463: {cur: 0x89, idx: 0x6b},
+ 464: {cur: 0x62, idx: 0x0},
+ 465: {cur: 0x99, idx: 0x2eb},
+ 466: {cur: 0xa3, idx: 0x87},
+ 467: {cur: 0xab, idx: 0x3b7},
+ 468: {cur: 0xae, idx: 0x7e},
+ 469: {cur: 0xd4, idx: 0xb6},
+ 470: {cur: 0xd7, idx: 0x367},
+ 471: {cur: 0xe9, idx: 0x467},
+ 472: {cur: 0xf0, idx: 0x46a},
+ 473: {cur: 0x107, idx: 0x374},
+ 474: {cur: 0x13, idx: 0xf8},
+ 475: {cur: 0x3a, idx: 0x9b},
+ 476: {cur: 0x60, idx: 0x16e},
+ 477: {cur: 0xd6, idx: 0x28a},
+ 478: {cur: 0xeb, idx: 0xbc},
+ 479: {cur: 0x117, idx: 0x0},
+ 480: {cur: 0x85, idx: 0x25},
+ 481: {cur: 0xeb, idx: 0xbc},
+ 482: {cur: 0xfc, idx: 0x4},
+ 483: {cur: 0xeb, idx: 0xbc},
+ 484: {cur: 0xfc, idx: 0x4},
+ 485: {cur: 0x5c, idx: 0x37},
+ 486: {cur: 0xb2, idx: 0x3ab},
+ 487: {cur: 0xeb, idx: 0xbc},
+ 488: {cur: 0xfc, idx: 0x4},
+ 489: {cur: 0x12, idx: 0x30c},
+ 490: {cur: 0x85, idx: 0x25},
+ 491: {cur: 0xfc, idx: 0x4},
+ 492: {cur: 0xeb, idx: 0xbc},
+ 493: {cur: 0x86, idx: 0x308},
+ 494: {cur: 0xba, idx: 0x97},
+ 495: {cur: 0x67, idx: 0xf2},
+ 496: {cur: 0xfc, idx: 0x4},
+ 497: {cur: 0x44, idx: 0x47c},
+ 498: {cur: 0x7a, idx: 0x487},
+ 499: {cur: 0x85, idx: 0x25},
+ 500: {cur: 0xeb, idx: 0xbc},
+ 501: {cur: 0xfc, idx: 0x4},
+ 502: {cur: 0xeb, idx: 0xbc},
+ 503: {cur: 0xfc, idx: 0x4},
+ 504: {cur: 0x13, idx: 0x0},
+ 505: {cur: 0x2e, idx: 0x0},
+ 506: {cur: 0x3a, idx: 0x0},
+ 507: {cur: 0x44, idx: 0x0},
+ 508: {cur: 0x5e, idx: 0x0},
+ 509: {cur: 0x63, idx: 0x0},
+ 510: {cur: 0x72, idx: 0x0},
+ 511: {cur: 0x7c, idx: 0x0},
+ 512: {cur: 0x7d, idx: 0x0},
+ 513: {cur: 0x85, idx: 0x0},
+ 514: {cur: 0x8d, idx: 0x0},
+ 515: {cur: 0xb2, idx: 0x0},
+ 516: {cur: 0xc0, idx: 0x0},
+ 517: {cur: 0xf6, idx: 0x0},
+ 518: {cur: 0xfc, idx: 0x0},
+ 519: {cur: 0x105, idx: 0x0},
+ 520: {cur: 0x110, idx: 0x0},
+ 521: {cur: 0x117, idx: 0x0},
+ 522: {cur: 0x18, idx: 0x9},
+ 523: {cur: 0x13, idx: 0x0},
+ 524: {cur: 0x85, idx: 0x25},
+ 525: {cur: 0xc9, idx: 0xa6},
+ 526: {cur: 0xeb, idx: 0xbc},
+ 527: {cur: 0xfc, idx: 0x4},
+ 528: {cur: 0x13, idx: 0x0},
+ 529: {cur: 0x2e, idx: 0x0},
+ 530: {cur: 0x3a, idx: 0x0},
+ 531: {cur: 0x44, idx: 0x0},
+ 532: {cur: 0x5e, idx: 0x0},
+ 533: {cur: 0x63, idx: 0x0},
+ 534: {cur: 0x72, idx: 0x0},
+ 535: {cur: 0x77, idx: 0x54},
+ 536: {cur: 0x7c, idx: 0x0},
+ 537: {cur: 0x7d, idx: 0x0},
+ 538: {cur: 0x85, idx: 0x25},
+ 539: {cur: 0x8d, idx: 0x0},
+ 540: {cur: 0xb2, idx: 0x0},
+ 541: {cur: 0xc0, idx: 0x0},
+ 542: {cur: 0xf6, idx: 0x0},
+ 543: {cur: 0xfc, idx: 0x0},
+ 544: {cur: 0x105, idx: 0x0},
+ 545: {cur: 0x110, idx: 0x0},
+ 546: {cur: 0x7, idx: 0x498},
+ 547: {cur: 0xeb, idx: 0xbc},
+ 548: {cur: 0xfc, idx: 0x4},
+ 549: {cur: 0x13, idx: 0xf8},
+ 550: {cur: 0x78, idx: 0x57},
+ 551: {cur: 0x7d, idx: 0x7e},
+ 552: {cur: 0xeb, idx: 0xbc},
+ 553: {cur: 0xba, idx: 0x97},
+ 554: {cur: 0x44, idx: 0x25},
+ 555: {cur: 0x13, idx: 0x0},
+ 556: {cur: 0x2e, idx: 0x0},
+ 557: {cur: 0x3a, idx: 0x0},
+ 558: {cur: 0x5e, idx: 0x0},
+ 559: {cur: 0x63, idx: 0x0},
+ 560: {cur: 0x7d, idx: 0x0},
+ 561: {cur: 0x8d, idx: 0x0},
+ 562: {cur: 0xb2, idx: 0x0},
+ 563: {cur: 0xc0, idx: 0x0},
+ 564: {cur: 0xf6, idx: 0x0},
+ 565: {cur: 0xfc, idx: 0x0},
+ 566: {cur: 0x105, idx: 0x0},
+ 567: {cur: 0x2e, idx: 0x0},
+ 568: {cur: 0x72, idx: 0x0},
+ 569: {cur: 0x85, idx: 0x0},
+ 570: {cur: 0x8d, idx: 0x0},
+ 571: {cur: 0xb2, idx: 0x0},
+ 572: {cur: 0xeb, idx: 0xbc},
+ 573: {cur: 0xf6, idx: 0x0},
+ 574: {cur: 0xfc, idx: 0x0},
+ 575: {cur: 0x44, idx: 0x49f},
+ 576: {cur: 0x85, idx: 0x4a3},
+ 577: {cur: 0xfc, idx: 0x4},
+ 578: {cur: 0xf7, idx: 0x23c},
+ 579: {cur: 0x13, idx: 0x0},
+ 580: {cur: 0x44, idx: 0x0},
+ 581: {cur: 0x65, idx: 0x42},
+ 582: {cur: 0x72, idx: 0x0},
+ 583: {cur: 0x7c, idx: 0x0},
+ 584: {cur: 0x7d, idx: 0x0},
+ 585: {cur: 0x85, idx: 0x0},
+ 586: {cur: 0x8d, idx: 0x0},
+ 587: {cur: 0xc0, idx: 0x0},
+ 588: {cur: 0x105, idx: 0x0},
+ 589: {cur: 0x54, idx: 0x462},
+ 590: {cur: 0x86, idx: 0x308},
+ 591: {cur: 0xf7, idx: 0x23c},
+ 592: {cur: 0x13, idx: 0xf8},
+ 593: {cur: 0x4c, idx: 0x4ae},
+ 594: {cur: 0xeb, idx: 0xbc},
+ 595: {cur: 0x86, idx: 0x308},
+ 596: {cur: 0x90, idx: 0x72},
+ 597: {cur: 0xd2, idx: 0xb2},
+ 598: {cur: 0xeb, idx: 0xbc},
+ 599: {cur: 0xfc, idx: 0x4},
+ 600: {cur: 0x52, idx: 0x304},
+ 601: {cur: 0x86, idx: 0x308},
+ 602: {cur: 0x88, idx: 0x67},
+ 603: {cur: 0xeb, idx: 0xbc},
+ 604: {cur: 0xfc, idx: 0x4},
+ 605: {cur: 0xeb, idx: 0xbc},
+ 606: {cur: 0xfc, idx: 0x4},
+ 607: {cur: 0x13, idx: 0xf8},
+ 608: {cur: 0xf7, idx: 0x23c},
+ 609: {cur: 0x13, idx: 0x0},
+ 610: {cur: 0x2e, idx: 0x0},
+ 611: {cur: 0x3a, idx: 0x0},
+ 612: {cur: 0x63, idx: 0x0},
+ 613: {cur: 0x72, idx: 0x0},
+ 614: {cur: 0x7c, idx: 0x0},
+ 615: {cur: 0x7d, idx: 0x0},
+ 616: {cur: 0x87, idx: 0x4bf},
+ 617: {cur: 0x8d, idx: 0x0},
+ 618: {cur: 0xb2, idx: 0x0},
+ 619: {cur: 0xc0, idx: 0x0},
+ 620: {cur: 0xeb, idx: 0xbc},
+ 621: {cur: 0xf6, idx: 0x0},
+ 622: {cur: 0xfc, idx: 0x0},
+ 623: {cur: 0x110, idx: 0x0},
+ 624: {cur: 0xf7, idx: 0x23c},
+ 625: {cur: 0x12, idx: 0x30c},
+ 626: {cur: 0x13, idx: 0xf8},
+ 627: {cur: 0x85, idx: 0x25},
+ 628: {cur: 0xeb, idx: 0xbc},
+ 629: {cur: 0xfc, idx: 0x4},
+ 630: {cur: 0xfb, idx: 0x2f4},
+ 631: {cur: 0xfc, idx: 0x4},
+ 632: {cur: 0x3b, idx: 0x32a},
+ 633: {cur: 0x9, idx: 0x1},
+ 634: {cur: 0x91, idx: 0x76},
+ 635: {cur: 0xeb, idx: 0xbc},
+ 636: {cur: 0x7e, idx: 0x17b},
+ 637: {cur: 0x13, idx: 0x0},
+ 638: {cur: 0x2e, idx: 0x0},
+ 639: {cur: 0x3a, idx: 0x0},
+ 640: {cur: 0x44, idx: 0x0},
+ 641: {cur: 0x63, idx: 0x0},
+ 642: {cur: 0x72, idx: 0x0},
+ 643: {cur: 0x7c, idx: 0x0},
+ 644: {cur: 0x7d, idx: 0x0},
+ 645: {cur: 0x85, idx: 0x0},
+ 646: {cur: 0x8d, idx: 0x0},
+ 647: {cur: 0xb2, idx: 0x0},
+ 648: {cur: 0xc0, idx: 0x0},
+ 649: {cur: 0xf6, idx: 0x0},
+ 650: {cur: 0xfc, idx: 0x0},
+ 651: {cur: 0x105, idx: 0x0},
+ 652: {cur: 0x109, idx: 0x0},
+ 653: {cur: 0x110, idx: 0x0},
+ 654: {cur: 0x115, idx: 0x0},
+ 655: {cur: 0x117, idx: 0x0},
+ 656: {cur: 0x3b, idx: 0x32a},
+ 657: {cur: 0x86, idx: 0x308},
+ 658: {cur: 0x86, idx: 0x308},
+ 659: {cur: 0x13, idx: 0xf8},
+ 660: {cur: 0x85, idx: 0x25},
+ 661: {cur: 0x9b, idx: 0x84},
+ 662: {cur: 0xeb, idx: 0xbc},
+ 663: {cur: 0xfc, idx: 0x4},
+ 664: {cur: 0x86, idx: 0x308},
+ 665: {cur: 0xf7, idx: 0x23c},
+ 666: {cur: 0x86, idx: 0x308},
+ 667: {cur: 0xae, idx: 0x7e},
+ 668: {cur: 0xa3, idx: 0x87},
+ 669: {cur: 0xb8, idx: 0x4cc},
+ 670: {cur: 0x13, idx: 0x0},
+ 671: {cur: 0x44, idx: 0x0},
+ 672: {cur: 0x63, idx: 0x0},
+ 673: {cur: 0x72, idx: 0x0},
+ 674: {cur: 0x7c, idx: 0x0},
+ 675: {cur: 0x7d, idx: 0x0},
+ 676: {cur: 0x85, idx: 0x0},
+ 677: {cur: 0x8d, idx: 0x0},
+ 678: {cur: 0xa5, idx: 0x4d0},
+ 679: {cur: 0xc0, idx: 0x0},
+ 680: {cur: 0xf6, idx: 0x0},
+ 681: {cur: 0x105, idx: 0x0},
+ 682: {cur: 0x85, idx: 0x25},
+ 683: {cur: 0xeb, idx: 0xbc},
+ 684: {cur: 0xfc, idx: 0x4},
+ 685: {cur: 0xa9, idx: 0x8c},
+ 686: {cur: 0xeb, idx: 0xbc},
+ 687: {cur: 0xfc, idx: 0x4},
+ 688: {cur: 0xeb, idx: 0xbc},
+ 689: {cur: 0xfc, idx: 0x4},
+ 690: {cur: 0x3a, idx: 0x0},
+ 691: {cur: 0xb2, idx: 0x0},
+ 692: {cur: 0xb5, idx: 0x94},
+ 693: {cur: 0xfc, idx: 0x0},
+ 694: {cur: 0x26, idx: 0x4},
+ 695: {cur: 0xdc, idx: 0x4},
+ 696: {cur: 0x8, idx: 0x4dc},
+ 697: {cur: 0x14, idx: 0x4e0},
+ 698: {cur: 0x76, idx: 0x465},
+ 699: {cur: 0xa8, idx: 0x8a},
+ 700: {cur: 0xc2, idx: 0x387},
+ 701: {cur: 0xeb, idx: 0xbc},
+ 702: {cur: 0xf5, idx: 0x21b},
+ 703: {cur: 0xfc, idx: 0x4},
+ 704: {cur: 0xb9, idx: 0x4},
+ 705: {cur: 0x13, idx: 0x0},
+ 706: {cur: 0x2e, idx: 0x0},
+ 707: {cur: 0x3a, idx: 0x0},
+ 708: {cur: 0x44, idx: 0x0},
+ 709: {cur: 0x72, idx: 0x0},
+ 710: {cur: 0x7c, idx: 0x0},
+ 711: {cur: 0x7d, idx: 0x0},
+ 712: {cur: 0x85, idx: 0x0},
+ 713: {cur: 0x8d, idx: 0x0},
+ 714: {cur: 0xb2, idx: 0x0},
+ 715: {cur: 0xbe, idx: 0x30},
+ 716: {cur: 0xc0, idx: 0x0},
+ 717: {cur: 0xf6, idx: 0x0},
+ 718: {cur: 0xfc, idx: 0x0},
+ 719: {cur: 0x105, idx: 0x0},
+ 720: {cur: 0x109, idx: 0x0},
+ 721: {cur: 0x110, idx: 0x0},
+ 722: {cur: 0x117, idx: 0x0},
+ 723: {cur: 0xbf, idx: 0x4e4},
+ 724: {cur: 0xeb, idx: 0xbc},
+ 725: {cur: 0x13, idx: 0xf8},
+ 726: {cur: 0x3a, idx: 0x9b},
+ 727: {cur: 0x60, idx: 0x16e},
+ 728: {cur: 0xd6, idx: 0x28a},
+ 729: {cur: 0xeb, idx: 0xbc},
+ 730: {cur: 0x117, idx: 0x0},
+ 731: {cur: 0x14, idx: 0x4f8},
+ 732: {cur: 0xfc, idx: 0x4},
+ 733: {cur: 0x8, idx: 0x36d},
+ 734: {cur: 0xe2, idx: 0x4},
+ 735: {cur: 0x8, idx: 0x36d},
+ 736: {cur: 0x13, idx: 0x0},
+ 737: {cur: 0x2e, idx: 0x0},
+ 738: {cur: 0x3a, idx: 0x0},
+ 739: {cur: 0x44, idx: 0x0},
+ 740: {cur: 0x63, idx: 0x0},
+ 741: {cur: 0x72, idx: 0x0},
+ 742: {cur: 0x7c, idx: 0x0},
+ 743: {cur: 0x7d, idx: 0x0},
+ 744: {cur: 0x85, idx: 0x0},
+ 745: {cur: 0x8d, idx: 0x0},
+ 746: {cur: 0xb2, idx: 0x0},
+ 747: {cur: 0xbe, idx: 0x30},
+ 748: {cur: 0xc0, idx: 0x0},
+ 749: {cur: 0xf6, idx: 0x0},
+ 750: {cur: 0xfc, idx: 0x0},
+ 751: {cur: 0x105, idx: 0x0},
+ 752: {cur: 0x109, idx: 0x0},
+ 753: {cur: 0x110, idx: 0x0},
+ 754: {cur: 0x117, idx: 0x0},
+ 755: {cur: 0x63, idx: 0x237},
+ 756: {cur: 0xe4, idx: 0x3f},
+ 757: {cur: 0xfb, idx: 0x2f4},
+ 758: {cur: 0x5d, idx: 0x258},
+ 759: {cur: 0x86, idx: 0x308},
+ 760: {cur: 0x85, idx: 0x25},
+ 761: {cur: 0xfc, idx: 0x4},
+ 762: {cur: 0x65, idx: 0x42},
+ 763: {cur: 0xfc, idx: 0x4},
+ 764: {cur: 0x65, idx: 0x0},
+ 765: {cur: 0xd2, idx: 0xb2},
+ 766: {cur: 0xeb, idx: 0xbc},
+ 767: {cur: 0xc8, idx: 0x4fd},
+ 768: {cur: 0x13, idx: 0x0},
+ 769: {cur: 0x3a, idx: 0x0},
+ 770: {cur: 0x44, idx: 0x0},
+ 771: {cur: 0x63, idx: 0x0},
+ 772: {cur: 0x72, idx: 0x0},
+ 773: {cur: 0x7c, idx: 0x0},
+ 774: {cur: 0x7d, idx: 0x0},
+ 775: {cur: 0x85, idx: 0x0},
+ 776: {cur: 0x8d, idx: 0x0},
+ 777: {cur: 0xb2, idx: 0x0},
+ 778: {cur: 0xc0, idx: 0x0},
+ 779: {cur: 0xc9, idx: 0xa6},
+ 780: {cur: 0xf6, idx: 0x0},
+ 781: {cur: 0xfc, idx: 0x0},
+ 782: {cur: 0x105, idx: 0x0},
+ 783: {cur: 0x4, idx: 0x396},
+ 784: {cur: 0x13, idx: 0xf8},
+ 785: {cur: 0xcb, idx: 0x504},
+ 786: {cur: 0xeb, idx: 0xbc},
+ 787: {cur: 0x9, idx: 0x1},
+ 788: {cur: 0x4c, idx: 0x4ae},
+ 789: {cur: 0xcb, idx: 0x509},
+ 790: {cur: 0x99, idx: 0x2eb},
+ 791: {cur: 0xaa, idx: 0x35f},
+ 792: {cur: 0xb8, idx: 0x4cc},
+ 793: {cur: 0xcb, idx: 0x4ae},
+ 794: {cur: 0xe5, idx: 0xb9},
+ 795: {cur: 0xc4, idx: 0x38b},
+ 796: {cur: 0x27, idx: 0x10},
+ 797: {cur: 0xc4, idx: 0x0},
+ 798: {cur: 0xc4, idx: 0x0},
+ 799: {cur: 0xfc, idx: 0x4},
+ 800: {cur: 0x24, idx: 0x359},
+ 801: {cur: 0x13, idx: 0x0},
+ 802: {cur: 0x2e, idx: 0x0},
+ 803: {cur: 0x3a, idx: 0x0},
+ 804: {cur: 0x44, idx: 0x0},
+ 805: {cur: 0x5e, idx: 0x0},
+ 806: {cur: 0x63, idx: 0x0},
+ 807: {cur: 0x72, idx: 0x0},
+ 808: {cur: 0x7c, idx: 0x0},
+ 809: {cur: 0x7d, idx: 0x0},
+ 810: {cur: 0x85, idx: 0x0},
+ 811: {cur: 0x8d, idx: 0x0},
+ 812: {cur: 0xb2, idx: 0x0},
+ 813: {cur: 0xc0, idx: 0x0},
+ 814: {cur: 0xf6, idx: 0x0},
+ 815: {cur: 0xfc, idx: 0x0},
+ 816: {cur: 0x105, idx: 0x0},
+ 817: {cur: 0x110, idx: 0x0},
+ 818: {cur: 0xa2, idx: 0x4f},
+ 819: {cur: 0xf7, idx: 0x23c},
+ 820: {cur: 0x0, idx: 0x510},
+ 821: {cur: 0x85, idx: 0x25},
+ 822: {cur: 0xd2, idx: 0xb2},
+ 823: {cur: 0xd3, idx: 0x18},
+ 824: {cur: 0xeb, idx: 0xbc},
+ 825: {cur: 0xef, idx: 0x519},
+ 826: {cur: 0xf8, idx: 0xcb},
+ 827: {cur: 0xfc, idx: 0x4},
+ 828: {cur: 0x37, idx: 0x258},
+ 829: {cur: 0xd3, idx: 0x0},
+ 830: {cur: 0x87, idx: 0x4bf},
+ 831: {cur: 0x90, idx: 0x72},
+ 832: {cur: 0xa2, idx: 0x4f},
+ 833: {cur: 0xd4, idx: 0xb6},
+ 834: {cur: 0xf7, idx: 0x23c},
+ 835: {cur: 0xd2, idx: 0xb2},
+ 836: {cur: 0x86, idx: 0x308},
+ 837: {cur: 0xf7, idx: 0x23c},
+ 838: {cur: 0xc8, idx: 0x7e},
+ 839: {cur: 0x52, idx: 0x520},
+ 840: {cur: 0xbe, idx: 0x30},
+ 841: {cur: 0xdb, idx: 0x524},
+ 842: {cur: 0xeb, idx: 0xbc},
+ 843: {cur: 0xbe, idx: 0x528},
+ 844: {cur: 0xdb, idx: 0x30},
+ 845: {cur: 0xb8, idx: 0x4cc},
+ 846: {cur: 0x93, idx: 0x52c},
+ 847: {cur: 0xeb, idx: 0xbc},
+ 848: {cur: 0x115, idx: 0x534},
+ 849: {cur: 0x13, idx: 0x0},
+ 850: {cur: 0x2e, idx: 0x0},
+ 851: {cur: 0x3a, idx: 0x0},
+ 852: {cur: 0x44, idx: 0x0},
+ 853: {cur: 0x63, idx: 0x0},
+ 854: {cur: 0x72, idx: 0x0},
+ 855: {cur: 0x7c, idx: 0x544},
+ 856: {cur: 0x7d, idx: 0x0},
+ 857: {cur: 0x85, idx: 0x0},
+ 858: {cur: 0x8d, idx: 0x0},
+ 859: {cur: 0xc0, idx: 0x0},
+ 860: {cur: 0xf6, idx: 0x0},
+ 861: {cur: 0xfc, idx: 0x0},
+ 862: {cur: 0x105, idx: 0x0},
+ 863: {cur: 0x13, idx: 0x0},
+ 864: {cur: 0x2e, idx: 0x0},
+ 865: {cur: 0x3a, idx: 0x0},
+ 866: {cur: 0x63, idx: 0x0},
+ 867: {cur: 0x85, idx: 0x25},
+ 868: {cur: 0xb2, idx: 0x0},
+ 869: {cur: 0xc0, idx: 0x0},
+ 870: {cur: 0xf6, idx: 0x0},
+ 871: {cur: 0xfc, idx: 0x4},
+ 872: {cur: 0x110, idx: 0x0},
+ 873: {cur: 0xe1, idx: 0x235},
+ 874: {cur: 0x51, idx: 0x22d},
+ 875: {cur: 0x5d, idx: 0x258},
+ 876: {cur: 0x86, idx: 0x308},
+ 877: {cur: 0x6, idx: 0x548},
+ 878: {cur: 0xeb, idx: 0xbc},
+ 879: {cur: 0xa5, idx: 0x54e},
+ 880: {cur: 0x13, idx: 0x0},
+ 881: {cur: 0x18, idx: 0x2cf},
+ 882: {cur: 0x85, idx: 0x25},
+ 883: {cur: 0x8d, idx: 0x0},
+ 884: {cur: 0xc0, idx: 0x0},
+ 885: {cur: 0x105, idx: 0x0},
+ 886: {cur: 0x13, idx: 0x0},
+ 887: {cur: 0x18, idx: 0x9},
+ 888: {cur: 0x85, idx: 0x25},
+ 889: {cur: 0x8d, idx: 0x0},
+ 890: {cur: 0xc0, idx: 0x0},
+ 891: {cur: 0x105, idx: 0x0},
+ 892: {cur: 0x13, idx: 0x0},
+ 893: {cur: 0x1a, idx: 0x24c},
+ 894: {cur: 0x25, idx: 0x13a},
+ 895: {cur: 0x2e, idx: 0x555},
+ 896: {cur: 0x32, idx: 0x142},
+ 897: {cur: 0x39, idx: 0x146},
+ 898: {cur: 0x44, idx: 0x0},
+ 899: {cur: 0x52, idx: 0x520},
+ 900: {cur: 0x53, idx: 0x264},
+ 901: {cur: 0x57, idx: 0x559},
+ 902: {cur: 0x58, idx: 0x55d},
+ 903: {cur: 0x63, idx: 0x0},
+ 904: {cur: 0x72, idx: 0x0},
+ 905: {cur: 0x79, idx: 0x562},
+ 906: {cur: 0x7d, idx: 0x0},
+ 907: {cur: 0x81, idx: 0x567},
+ 908: {cur: 0x83, idx: 0x18c},
+ 909: {cur: 0x85, idx: 0x0},
+ 910: {cur: 0x8d, idx: 0x0},
+ 911: {cur: 0xbe, idx: 0x528},
+ 912: {cur: 0xc0, idx: 0x0},
+ 913: {cur: 0xdb, idx: 0x30},
+ 914: {cur: 0xf6, idx: 0x0},
+ 915: {cur: 0x105, idx: 0x0},
+ 916: {cur: 0x86, idx: 0x308},
+ 917: {cur: 0xeb, idx: 0xbc},
+ 918: {cur: 0xf7, idx: 0x23c},
+ 919: {cur: 0x3b, idx: 0x32a},
+ 920: {cur: 0xfb, idx: 0x2f4},
+ 921: {cur: 0x85, idx: 0x25},
+ 922: {cur: 0xeb, idx: 0xbc},
+ 923: {cur: 0xfc, idx: 0x4},
+ 924: {cur: 0x93, idx: 0x56b},
+ 925: {cur: 0xb5, idx: 0x94},
+ 926: {cur: 0xdc, idx: 0x28e},
+ 927: {cur: 0xb5, idx: 0x94},
+ 928: {cur: 0xdc, idx: 0x4},
+ 929: {cur: 0xfc, idx: 0xcf},
+ 930: {cur: 0xeb, idx: 0xbc},
+ 931: {cur: 0xfc, idx: 0x4},
+ 932: {cur: 0xfb, idx: 0x2f4},
+ 933: {cur: 0x86, idx: 0x308},
+ 934: {cur: 0xed, idx: 0x56f},
+ 935: {cur: 0xfc, idx: 0x4},
+ 936: {cur: 0x13, idx: 0xf8},
+ 937: {cur: 0x85, idx: 0x25},
+ 938: {cur: 0x5d, idx: 0x258},
+ 939: {cur: 0x59, idx: 0x231},
+ 940: {cur: 0x5e, idx: 0x0},
+ 941: {cur: 0x63, idx: 0x0},
+ 942: {cur: 0x13, idx: 0x577},
+ 943: {cur: 0xc0, idx: 0x57c},
+ 944: {cur: 0xf1, idx: 0xc0},
+ 945: {cur: 0x13, idx: 0xf8},
+ 946: {cur: 0x85, idx: 0x25},
+ 947: {cur: 0xeb, idx: 0xbc},
+ 948: {cur: 0xf4, idx: 0xc3},
+ 949: {cur: 0xfc, idx: 0x4},
+ 950: {cur: 0xd2, idx: 0xb2},
+ 951: {cur: 0xfc, idx: 0x4},
+ 952: {cur: 0x44, idx: 0x4a3},
+ 953: {cur: 0xfc, idx: 0x4},
+ 954: {cur: 0x13, idx: 0x0},
+ 955: {cur: 0x2e, idx: 0x0},
+ 956: {cur: 0x3a, idx: 0x0},
+ 957: {cur: 0x44, idx: 0x0},
+ 958: {cur: 0x5e, idx: 0x0},
+ 959: {cur: 0x63, idx: 0x0},
+ 960: {cur: 0x72, idx: 0x0},
+ 961: {cur: 0x7c, idx: 0x0},
+ 962: {cur: 0x7d, idx: 0x0},
+ 963: {cur: 0x85, idx: 0x25},
+ 964: {cur: 0x8d, idx: 0x0},
+ 965: {cur: 0xb2, idx: 0x0},
+ 966: {cur: 0xc0, idx: 0x0},
+ 967: {cur: 0xf6, idx: 0x0},
+ 968: {cur: 0xf8, idx: 0xcb},
+ 969: {cur: 0xf9, idx: 0x581},
+ 970: {cur: 0xfc, idx: 0x0},
+ 971: {cur: 0x105, idx: 0x0},
+ 972: {cur: 0x110, idx: 0x0},
+ 973: {cur: 0xc8, idx: 0x7e},
+ 974: {cur: 0xeb, idx: 0xbc},
+ 975: {cur: 0xfc, idx: 0x4},
+ 976: {cur: 0xc8, idx: 0x0},
+ 977: {cur: 0x102, idx: 0x589},
+ 978: {cur: 0x4, idx: 0x396},
+ 979: {cur: 0xeb, idx: 0xbc},
+ 980: {cur: 0x102, idx: 0x58f},
+ 981: {cur: 0x94, idx: 0x4},
+ 982: {cur: 0x94, idx: 0x4},
+ 983: {cur: 0x13, idx: 0xf8},
+ 984: {cur: 0xeb, idx: 0xbc},
+ 985: {cur: 0xf7, idx: 0x23c},
+ 986: {cur: 0x85, idx: 0x25},
+ 987: {cur: 0xfc, idx: 0x4},
+ 988: {cur: 0xfc, idx: 0x4},
+ 989: {cur: 0xfb, idx: 0x2f4},
+ 990: {cur: 0xba, idx: 0x97},
+ 991: {cur: 0x13, idx: 0xf8},
+ 992: {cur: 0x85, idx: 0x25},
+ 993: {cur: 0x8d, idx: 0x596},
+ 994: {cur: 0x13, idx: 0xf8},
+ 995: {cur: 0x44, idx: 0x4a3},
+ 996: {cur: 0x8d, idx: 0x596},
+ 997: {cur: 0x13, idx: 0xf8},
+ 998: {cur: 0x44, idx: 0x4a3},
+ 999: {cur: 0x7b, idx: 0x59a},
+ 1000: {cur: 0x8d, idx: 0x596},
+ 1001: {cur: 0x44, idx: 0x20},
+ 1002: {cur: 0x44, idx: 0x20},
+ 1003: {cur: 0xaa, idx: 0x35f},
+ 1004: {cur: 0x44, idx: 0x20},
+ 1005: {cur: 0xdc, idx: 0x4},
+ 1006: {cur: 0x13, idx: 0xf8},
+ 1007: {cur: 0x85, idx: 0x25},
+ 1008: {cur: 0x8d, idx: 0x596},
+ 1009: {cur: 0xf6, idx: 0x4},
+ 1010: {cur: 0x8d, idx: 0x6e},
+ 1011: {cur: 0xf6, idx: 0xc7},
+ 1012: {cur: 0xaa, idx: 0x35f},
+ 1013: {cur: 0xeb, idx: 0xbc},
+ 1014: {cur: 0x125, idx: 0xe9},
+} // Size: 4084 bytes
+
+var narrowLangIndex = []uint16{ // 776 elements
+ // Entry 0 - 3F
+ 0x0000, 0x0062, 0x0064, 0x0064, 0x0064, 0x0064, 0x0064, 0x0064,
+ 0x0064, 0x0065, 0x0065, 0x0081, 0x0081, 0x0082, 0x0082, 0x0082,
+ 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082,
+ 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082,
+ 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082,
+ 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x008b, 0x008b, 0x008e,
+ 0x008e, 0x008e, 0x008e, 0x008e, 0x008e, 0x008e, 0x00a8, 0x00a8,
+ 0x00a8, 0x00a8, 0x00a8, 0x00a8, 0x00d8, 0x00d8, 0x00d8, 0x00d8,
+ // Entry 40 - 7F
+ 0x00d8, 0x00d9, 0x00d9, 0x00d9, 0x00d9, 0x00d9, 0x00d9, 0x00dc,
+ 0x00dc, 0x00dc, 0x00dc, 0x00dd, 0x00dd, 0x00dd, 0x00dd, 0x00dd,
+ 0x00de, 0x00de, 0x00de, 0x00de, 0x00de, 0x00df, 0x00df, 0x00df,
+ 0x00e0, 0x00e0, 0x00e0, 0x00e0, 0x00e0, 0x00e0, 0x00e0, 0x00e0,
+ 0x00e0, 0x00e2, 0x00e2, 0x00e2, 0x00e2, 0x00e8, 0x00e8, 0x00ee,
+ 0x00ee, 0x00ee, 0x00ee, 0x00ee, 0x00f7, 0x00f7, 0x00f7, 0x00f8,
+ 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8,
+ 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8,
+ // Entry 80 - BF
+ 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8,
+ 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x00f8, 0x0100, 0x0100,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ // Entry C0 - FF
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0100, 0x0100, 0x0103, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108,
+ 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108,
+ // Entry 100 - 13F
+ 0x0108, 0x0108, 0x0108, 0x0108, 0x010d, 0x010d, 0x010d, 0x010d,
+ 0x010d, 0x010d, 0x010d, 0x010d, 0x0111, 0x0111, 0x0112, 0x0113,
+ 0x0113, 0x0114, 0x0114, 0x0114, 0x0114, 0x0114, 0x0114, 0x0114,
+ 0x0114, 0x0114, 0x0114, 0x0114, 0x0114, 0x0171, 0x0171, 0x0172,
+ 0x0172, 0x0172, 0x0172, 0x0172, 0x017a, 0x017a, 0x017a, 0x017a,
+ 0x017a, 0x017a, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f,
+ 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f,
+ 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f,
+ // Entry 140 - 17F
+ 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f,
+ 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f,
+ 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x017f, 0x0180,
+ 0x0180, 0x0182, 0x0182, 0x0185, 0x0185, 0x0185, 0x0185, 0x0185,
+ 0x0185, 0x0187, 0x0187, 0x0187, 0x0187, 0x0187, 0x0187, 0x0187,
+ 0x0187, 0x0187, 0x0187, 0x0187, 0x0187, 0x0187, 0x0188, 0x0188,
+ 0x018a, 0x018a, 0x018b, 0x018b, 0x018b, 0x018b, 0x018b, 0x018c,
+ 0x018c, 0x018d, 0x018d, 0x018e, 0x018e, 0x018e, 0x018e, 0x018e,
+ // Entry 180 - 1BF
+ 0x018e, 0x018e, 0x018e, 0x018f, 0x018f, 0x0193, 0x0193, 0x0193,
+ 0x0193, 0x0193, 0x0193, 0x0193, 0x0196, 0x0196, 0x0196, 0x0196,
+ 0x0196, 0x0196, 0x0196, 0x0196, 0x0196, 0x0196, 0x0197, 0x0197,
+ 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197,
+ 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0198, 0x0198,
+ 0x0198, 0x0198, 0x0198, 0x0198, 0x0198, 0x0198, 0x0199, 0x0199,
+ 0x019b, 0x019b, 0x019d, 0x019d, 0x019d, 0x019d, 0x019d, 0x019d,
+ 0x019d, 0x019d, 0x019d, 0x019d, 0x019d, 0x019d, 0x019d, 0x019d,
+ // Entry 1C0 - 1FF
+ 0x019d, 0x019d, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x01a9, 0x01a9,
+ 0x01a9, 0x01a9, 0x01a9, 0x01a9, 0x01a9, 0x01a9, 0x01a9, 0x01a9,
+ 0x01a9, 0x01aa, 0x01aa, 0x01aa, 0x01aa, 0x01aa, 0x01b5, 0x01b5,
+ 0x01b5, 0x01b5, 0x01b5, 0x01b5, 0x01b5, 0x01b5, 0x01b6, 0x01b6,
+ 0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b6,
+ 0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b7, 0x01b7, 0x01b8,
+ 0x01b8, 0x01ba, 0x01ba, 0x01ba, 0x01bb, 0x01bb, 0x01bc, 0x01bc,
+ 0x01bc, 0x01bc, 0x01bc, 0x01bc, 0x01bc, 0x01bc, 0x01be, 0x01be,
+ // Entry 200 - 23F
+ 0x01be, 0x01be, 0x01be, 0x01be, 0x01be, 0x01c0, 0x01c0, 0x01c0,
+ 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c1, 0x01c1, 0x01c1,
+ 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2,
+ 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2,
+ 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2,
+ 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c3,
+ 0x01c3, 0x01c3, 0x01c3, 0x01c3, 0x01c3, 0x01c5, 0x01c5, 0x01c5,
+ 0x01c5, 0x01c5, 0x01c5, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7,
+ // Entry 240 - 27F
+ 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7,
+ 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7,
+ 0x01c8, 0x01c8, 0x01c8, 0x01c8, 0x01c8, 0x01cb, 0x01cc, 0x01cc,
+ 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc,
+ 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc,
+ 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc,
+ 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc, 0x01cc,
+ 0x01cc, 0x01ce, 0x01ce, 0x01cf, 0x01cf, 0x01d0, 0x01d0, 0x01d0,
+ // Entry 280 - 2BF
+ 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0,
+ 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2, 0x01d2, 0x01d2, 0x01d2, 0x01d2, 0x01d5, 0x01d5,
+ 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d8, 0x01d8,
+ 0x01d8, 0x01d8, 0x01d9, 0x01d9, 0x01d9, 0x01d9, 0x01d9, 0x01d9,
+ 0x01da, 0x01da, 0x01da, 0x01da, 0x01da, 0x01db, 0x01db, 0x01db,
+ 0x01db, 0x01db, 0x01db, 0x01db, 0x01dc, 0x01dc, 0x01dc, 0x01dc,
+ 0x01dc, 0x01dc, 0x01dc, 0x01dc, 0x01dc, 0x01dc, 0x01dc, 0x01dc,
+ // Entry 2C0 - 2FF
+ 0x01de, 0x01de, 0x01de, 0x01de, 0x01de, 0x01de, 0x01de, 0x01de,
+ 0x01de, 0x01de, 0x01de, 0x01de, 0x01df, 0x01df, 0x01e0, 0x01e0,
+ 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0,
+ 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e1, 0x01e1,
+ 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1,
+ 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1,
+ 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1,
+ 0x01e1, 0x01e1, 0x01e2, 0x01e2, 0x01e2, 0x01e2, 0x01e2, 0x01e2,
+ // Entry 300 - 33F
+ 0x01e3, 0x01e3, 0x01e3, 0x01e3, 0x01eb, 0x01eb, 0x01eb, 0x01eb,
+} // Size: 1576 bytes
+
+var narrowSymIndex = []curToIndex{ // 491 elements
+ 0: {cur: 0x9, idx: 0x1},
+ 1: {cur: 0x11, idx: 0x4},
+ 2: {cur: 0x13, idx: 0x4},
+ 3: {cur: 0x18, idx: 0x9},
+ 4: {cur: 0x1a, idx: 0x4},
+ 5: {cur: 0x1b, idx: 0xc},
+ 6: {cur: 0x25, idx: 0x4},
+ 7: {cur: 0x26, idx: 0x4},
+ 8: {cur: 0x27, idx: 0x10},
+ 9: {cur: 0x2e, idx: 0x13},
+ 10: {cur: 0x32, idx: 0x4},
+ 11: {cur: 0x35, idx: 0x16},
+ 12: {cur: 0x37, idx: 0x18},
+ 13: {cur: 0x39, idx: 0x4},
+ 14: {cur: 0x3a, idx: 0x4},
+ 15: {cur: 0x41, idx: 0x4},
+ 16: {cur: 0x44, idx: 0x25},
+ 17: {cur: 0x45, idx: 0x4},
+ 18: {cur: 0x47, idx: 0x28},
+ 19: {cur: 0x4a, idx: 0x4},
+ 20: {cur: 0x4b, idx: 0x4},
+ 21: {cur: 0x4e, idx: 0x2c},
+ 22: {cur: 0x52, idx: 0x30},
+ 23: {cur: 0x53, idx: 0x4},
+ 24: {cur: 0x58, idx: 0x33},
+ 25: {cur: 0x5c, idx: 0x37},
+ 26: {cur: 0x5e, idx: 0x3b},
+ 27: {cur: 0x60, idx: 0x4},
+ 28: {cur: 0x61, idx: 0x3f},
+ 29: {cur: 0x63, idx: 0x3f},
+ 30: {cur: 0x65, idx: 0x42},
+ 31: {cur: 0x68, idx: 0x3f},
+ 32: {cur: 0x6a, idx: 0x46},
+ 33: {cur: 0x6e, idx: 0x49},
+ 34: {cur: 0x71, idx: 0x4},
+ 35: {cur: 0x72, idx: 0x4},
+ 36: {cur: 0x73, idx: 0x4f},
+ 37: {cur: 0x75, idx: 0x51},
+ 38: {cur: 0x77, idx: 0x54},
+ 39: {cur: 0x78, idx: 0x57},
+ 40: {cur: 0x7c, idx: 0x5a},
+ 41: {cur: 0x7d, idx: 0x5e},
+ 42: {cur: 0x81, idx: 0x30},
+ 43: {cur: 0x83, idx: 0x4},
+ 44: {cur: 0x85, idx: 0x25},
+ 45: {cur: 0x88, idx: 0x67},
+ 46: {cur: 0x89, idx: 0x6b},
+ 47: {cur: 0x8a, idx: 0x6e},
+ 48: {cur: 0x8d, idx: 0x6e},
+ 49: {cur: 0x8f, idx: 0x4},
+ 50: {cur: 0x90, idx: 0x72},
+ 51: {cur: 0x91, idx: 0x76},
+ 52: {cur: 0x92, idx: 0x7a},
+ 53: {cur: 0x93, idx: 0x7e},
+ 54: {cur: 0x94, idx: 0x4},
+ 55: {cur: 0x96, idx: 0x81},
+ 56: {cur: 0x9b, idx: 0x84},
+ 57: {cur: 0xa3, idx: 0x87},
+ 58: {cur: 0xa8, idx: 0x8a},
+ 59: {cur: 0xa9, idx: 0x8c},
+ 60: {cur: 0xae, idx: 0x7e},
+ 61: {cur: 0xb2, idx: 0x4},
+ 62: {cur: 0xb5, idx: 0x94},
+ 63: {cur: 0xb9, idx: 0x4},
+ 64: {cur: 0xba, idx: 0x97},
+ 65: {cur: 0xbc, idx: 0x9b},
+ 66: {cur: 0xbe, idx: 0x30},
+ 67: {cur: 0xbf, idx: 0x7e},
+ 68: {cur: 0xc0, idx: 0x4},
+ 69: {cur: 0xc7, idx: 0xa2},
+ 70: {cur: 0xc8, idx: 0x7e},
+ 71: {cur: 0xc9, idx: 0xa6},
+ 72: {cur: 0xcc, idx: 0xaa},
+ 73: {cur: 0xd0, idx: 0xae},
+ 74: {cur: 0xd2, idx: 0xb2},
+ 75: {cur: 0xd3, idx: 0x18},
+ 76: {cur: 0xd4, idx: 0xb6},
+ 77: {cur: 0xd6, idx: 0x4},
+ 78: {cur: 0xdb, idx: 0x30},
+ 79: {cur: 0xdc, idx: 0x4},
+ 80: {cur: 0xdd, idx: 0x3f},
+ 81: {cur: 0xe2, idx: 0x4},
+ 82: {cur: 0xe4, idx: 0x3f},
+ 83: {cur: 0xe5, idx: 0xb9},
+ 84: {cur: 0xe9, idx: 0x3f},
+ 85: {cur: 0xeb, idx: 0xbc},
+ 86: {cur: 0xf1, idx: 0xc0},
+ 87: {cur: 0xf4, idx: 0xc3},
+ 88: {cur: 0xf5, idx: 0x4},
+ 89: {cur: 0xf6, idx: 0x4},
+ 90: {cur: 0xf8, idx: 0xcb},
+ 91: {cur: 0xfc, idx: 0x4},
+ 92: {cur: 0x101, idx: 0x4},
+ 93: {cur: 0x104, idx: 0x10},
+ 94: {cur: 0x105, idx: 0xd3},
+ 95: {cur: 0x110, idx: 0x4},
+ 96: {cur: 0x125, idx: 0xe9},
+ 97: {cur: 0x127, idx: 0xeb},
+ 98: {cur: 0xd0, idx: 0xee},
+ 99: {cur: 0xf6, idx: 0xc7},
+ 100: {cur: 0xf6, idx: 0xc7},
+ 101: {cur: 0x11, idx: 0x128},
+ 102: {cur: 0x13, idx: 0xf8},
+ 103: {cur: 0x1a, idx: 0x12c},
+ 104: {cur: 0x25, idx: 0x13a},
+ 105: {cur: 0x26, idx: 0x13e},
+ 106: {cur: 0x32, idx: 0x142},
+ 107: {cur: 0x39, idx: 0x146},
+ 108: {cur: 0x3a, idx: 0x1c},
+ 109: {cur: 0x41, idx: 0x14a},
+ 110: {cur: 0x44, idx: 0x20},
+ 111: {cur: 0x45, idx: 0x14e},
+ 112: {cur: 0x4b, idx: 0x152},
+ 113: {cur: 0x53, idx: 0x156},
+ 114: {cur: 0x60, idx: 0x16e},
+ 115: {cur: 0x63, idx: 0x172},
+ 116: {cur: 0x71, idx: 0x177},
+ 117: {cur: 0x72, idx: 0x4b},
+ 118: {cur: 0x83, idx: 0x18c},
+ 119: {cur: 0x85, idx: 0x62},
+ 120: {cur: 0x8f, idx: 0x1a4},
+ 121: {cur: 0xb2, idx: 0x90},
+ 122: {cur: 0xc0, idx: 0x9e},
+ 123: {cur: 0xd6, idx: 0x1ee},
+ 124: {cur: 0xe2, idx: 0x203},
+ 125: {cur: 0xf5, idx: 0x21b},
+ 126: {cur: 0xf6, idx: 0xc7},
+ 127: {cur: 0xfc, idx: 0xcf},
+ 128: {cur: 0x101, idx: 0x21f},
+ 129: {cur: 0x26, idx: 0x4},
+ 130: {cur: 0x37, idx: 0x0},
+ 131: {cur: 0x52, idx: 0x0},
+ 132: {cur: 0x75, idx: 0x0},
+ 133: {cur: 0x81, idx: 0x0},
+ 134: {cur: 0xbe, idx: 0x0},
+ 135: {cur: 0xc9, idx: 0x0},
+ 136: {cur: 0xd3, idx: 0x0},
+ 137: {cur: 0xdb, idx: 0x0},
+ 138: {cur: 0xf6, idx: 0xc7},
+ 139: {cur: 0xd0, idx: 0x244},
+ 140: {cur: 0xe9, idx: 0x248},
+ 141: {cur: 0xf6, idx: 0xc7},
+ 142: {cur: 0x13, idx: 0x6},
+ 143: {cur: 0x1a, idx: 0x24c},
+ 144: {cur: 0x25, idx: 0x251},
+ 145: {cur: 0x32, idx: 0x255},
+ 146: {cur: 0x37, idx: 0x258},
+ 147: {cur: 0x39, idx: 0x146},
+ 148: {cur: 0x3a, idx: 0x1c},
+ 149: {cur: 0x4a, idx: 0x25b},
+ 150: {cur: 0x4b, idx: 0x260},
+ 151: {cur: 0x53, idx: 0x264},
+ 152: {cur: 0x60, idx: 0x16e},
+ 153: {cur: 0x61, idx: 0x268},
+ 154: {cur: 0x71, idx: 0x26d},
+ 155: {cur: 0x81, idx: 0x270},
+ 156: {cur: 0x83, idx: 0x275},
+ 157: {cur: 0x8f, idx: 0x278},
+ 158: {cur: 0x94, idx: 0x27c},
+ 159: {cur: 0xb2, idx: 0x90},
+ 160: {cur: 0xb9, idx: 0x27f},
+ 161: {cur: 0xc0, idx: 0x9e},
+ 162: {cur: 0xd2, idx: 0x282},
+ 163: {cur: 0xd6, idx: 0x28a},
+ 164: {cur: 0xdc, idx: 0x28e},
+ 165: {cur: 0xf5, idx: 0x21b},
+ 166: {cur: 0x101, idx: 0x291},
+ 167: {cur: 0x110, idx: 0xdc},
+ 168: {cur: 0x11, idx: 0x0},
+ 169: {cur: 0x13, idx: 0x0},
+ 170: {cur: 0x1a, idx: 0x0},
+ 171: {cur: 0x1b, idx: 0x0},
+ 172: {cur: 0x25, idx: 0x0},
+ 173: {cur: 0x26, idx: 0x0},
+ 174: {cur: 0x2e, idx: 0x0},
+ 175: {cur: 0x32, idx: 0x0},
+ 176: {cur: 0x37, idx: 0x0},
+ 177: {cur: 0x39, idx: 0x0},
+ 178: {cur: 0x3a, idx: 0x0},
+ 179: {cur: 0x41, idx: 0x0},
+ 180: {cur: 0x44, idx: 0x0},
+ 181: {cur: 0x45, idx: 0x0},
+ 182: {cur: 0x47, idx: 0x0},
+ 183: {cur: 0x4b, idx: 0x0},
+ 184: {cur: 0x53, idx: 0x0},
+ 185: {cur: 0x60, idx: 0x0},
+ 186: {cur: 0x68, idx: 0x0},
+ 187: {cur: 0x71, idx: 0x0},
+ 188: {cur: 0x72, idx: 0x0},
+ 189: {cur: 0x7c, idx: 0x0},
+ 190: {cur: 0x7d, idx: 0x0},
+ 191: {cur: 0x83, idx: 0x0},
+ 192: {cur: 0x88, idx: 0x0},
+ 193: {cur: 0x8d, idx: 0x0},
+ 194: {cur: 0x8f, idx: 0x0},
+ 195: {cur: 0x90, idx: 0x0},
+ 196: {cur: 0x91, idx: 0x0},
+ 197: {cur: 0x94, idx: 0x0},
+ 198: {cur: 0xa9, idx: 0x0},
+ 199: {cur: 0xb2, idx: 0x0},
+ 200: {cur: 0xb9, idx: 0x0},
+ 201: {cur: 0xba, idx: 0x0},
+ 202: {cur: 0xc0, idx: 0x0},
+ 203: {cur: 0xc7, idx: 0x0},
+ 204: {cur: 0xcc, idx: 0x0},
+ 205: {cur: 0xd0, idx: 0x0},
+ 206: {cur: 0xd6, idx: 0x0},
+ 207: {cur: 0xdc, idx: 0x0},
+ 208: {cur: 0xe2, idx: 0x0},
+ 209: {cur: 0xe4, idx: 0x0},
+ 210: {cur: 0xf4, idx: 0x0},
+ 211: {cur: 0xf5, idx: 0x0},
+ 212: {cur: 0xf6, idx: 0x0},
+ 213: {cur: 0xf8, idx: 0x0},
+ 214: {cur: 0x101, idx: 0x0},
+ 215: {cur: 0x105, idx: 0x0},
+ 216: {cur: 0xf6, idx: 0xc7},
+ 217: {cur: 0x58, idx: 0x2a8},
+ 218: {cur: 0x92, idx: 0x2b8},
+ 219: {cur: 0xf1, idx: 0x2c1},
+ 220: {cur: 0xf6, idx: 0xc7},
+ 221: {cur: 0x104, idx: 0x0},
+ 222: {cur: 0xf6, idx: 0xc7},
+ 223: {cur: 0xd0, idx: 0x2ed},
+ 224: {cur: 0xd0, idx: 0x4f},
+ 225: {cur: 0xf6, idx: 0xc7},
+ 226: {cur: 0x1b, idx: 0x301},
+ 227: {cur: 0x35, idx: 0x0},
+ 228: {cur: 0x72, idx: 0x4b},
+ 229: {cur: 0xf6, idx: 0xc7},
+ 230: {cur: 0x125, idx: 0x0},
+ 231: {cur: 0x127, idx: 0x0},
+ 232: {cur: 0x52, idx: 0x304},
+ 233: {cur: 0x81, idx: 0x304},
+ 234: {cur: 0xbe, idx: 0x304},
+ 235: {cur: 0xd0, idx: 0x4f},
+ 236: {cur: 0xdb, idx: 0x304},
+ 237: {cur: 0xf6, idx: 0xc7},
+ 238: {cur: 0x4a, idx: 0x318},
+ 239: {cur: 0x61, idx: 0x320},
+ 240: {cur: 0x6a, idx: 0x325},
+ 241: {cur: 0x89, idx: 0x32a},
+ 242: {cur: 0xd0, idx: 0x4f},
+ 243: {cur: 0xd4, idx: 0x32d},
+ 244: {cur: 0xe9, idx: 0x0},
+ 245: {cur: 0xf6, idx: 0xc7},
+ 246: {cur: 0x127, idx: 0x8a},
+ 247: {cur: 0x5e, idx: 0x0},
+ 248: {cur: 0x1b, idx: 0x349},
+ 249: {cur: 0x27, idx: 0x34c},
+ 250: {cur: 0x4b, idx: 0xa2},
+ 251: {cur: 0x58, idx: 0x3f},
+ 252: {cur: 0x81, idx: 0x34f},
+ 253: {cur: 0xcc, idx: 0x352},
+ 254: {cur: 0xdb, idx: 0x34f},
+ 255: {cur: 0x101, idx: 0x291},
+ 256: {cur: 0x58, idx: 0x0},
+ 257: {cur: 0xd0, idx: 0x4f},
+ 258: {cur: 0xf6, idx: 0xc7},
+ 259: {cur: 0x58, idx: 0x33},
+ 260: {cur: 0x61, idx: 0x268},
+ 261: {cur: 0xe4, idx: 0x37b},
+ 262: {cur: 0xe9, idx: 0x248},
+ 263: {cur: 0x104, idx: 0x380},
+ 264: {cur: 0x37, idx: 0x384},
+ 265: {cur: 0x61, idx: 0x3f},
+ 266: {cur: 0xd0, idx: 0xae},
+ 267: {cur: 0xe4, idx: 0x3f},
+ 268: {cur: 0xe9, idx: 0x3f},
+ 269: {cur: 0x61, idx: 0x3f},
+ 270: {cur: 0xd0, idx: 0xae},
+ 271: {cur: 0xe4, idx: 0x3f},
+ 272: {cur: 0xe9, idx: 0x3f},
+ 273: {cur: 0x104, idx: 0x392},
+ 274: {cur: 0xf6, idx: 0xc7},
+ 275: {cur: 0xf6, idx: 0xc7},
+ 276: {cur: 0x9, idx: 0x0},
+ 277: {cur: 0x11, idx: 0x0},
+ 278: {cur: 0x13, idx: 0x0},
+ 279: {cur: 0x18, idx: 0x0},
+ 280: {cur: 0x1a, idx: 0x0},
+ 281: {cur: 0x1b, idx: 0x0},
+ 282: {cur: 0x25, idx: 0x0},
+ 283: {cur: 0x26, idx: 0x0},
+ 284: {cur: 0x27, idx: 0x0},
+ 285: {cur: 0x2e, idx: 0x0},
+ 286: {cur: 0x32, idx: 0x0},
+ 287: {cur: 0x35, idx: 0x0},
+ 288: {cur: 0x37, idx: 0x0},
+ 289: {cur: 0x39, idx: 0x0},
+ 290: {cur: 0x3a, idx: 0x0},
+ 291: {cur: 0x41, idx: 0x0},
+ 292: {cur: 0x44, idx: 0x0},
+ 293: {cur: 0x45, idx: 0x0},
+ 294: {cur: 0x47, idx: 0x0},
+ 295: {cur: 0x4a, idx: 0x0},
+ 296: {cur: 0x4b, idx: 0x0},
+ 297: {cur: 0x4e, idx: 0x0},
+ 298: {cur: 0x52, idx: 0x0},
+ 299: {cur: 0x53, idx: 0x0},
+ 300: {cur: 0x58, idx: 0x0},
+ 301: {cur: 0x5c, idx: 0x0},
+ 302: {cur: 0x60, idx: 0x0},
+ 303: {cur: 0x61, idx: 0x0},
+ 304: {cur: 0x65, idx: 0x0},
+ 305: {cur: 0x68, idx: 0x0},
+ 306: {cur: 0x6a, idx: 0x0},
+ 307: {cur: 0x6e, idx: 0x0},
+ 308: {cur: 0x71, idx: 0x0},
+ 309: {cur: 0x72, idx: 0x0},
+ 310: {cur: 0x73, idx: 0x0},
+ 311: {cur: 0x75, idx: 0x0},
+ 312: {cur: 0x77, idx: 0x0},
+ 313: {cur: 0x78, idx: 0x0},
+ 314: {cur: 0x7c, idx: 0x0},
+ 315: {cur: 0x7d, idx: 0x0},
+ 316: {cur: 0x81, idx: 0x0},
+ 317: {cur: 0x83, idx: 0x0},
+ 318: {cur: 0x88, idx: 0x0},
+ 319: {cur: 0x89, idx: 0x0},
+ 320: {cur: 0x8a, idx: 0x0},
+ 321: {cur: 0x8d, idx: 0x0},
+ 322: {cur: 0x8f, idx: 0x0},
+ 323: {cur: 0x90, idx: 0x0},
+ 324: {cur: 0x91, idx: 0x0},
+ 325: {cur: 0x92, idx: 0x0},
+ 326: {cur: 0x93, idx: 0x0},
+ 327: {cur: 0x94, idx: 0x0},
+ 328: {cur: 0x96, idx: 0x0},
+ 329: {cur: 0x9b, idx: 0x0},
+ 330: {cur: 0xa3, idx: 0x0},
+ 331: {cur: 0xa8, idx: 0x0},
+ 332: {cur: 0xa9, idx: 0x0},
+ 333: {cur: 0xae, idx: 0x0},
+ 334: {cur: 0xb2, idx: 0x0},
+ 335: {cur: 0xb5, idx: 0x0},
+ 336: {cur: 0xb9, idx: 0x0},
+ 337: {cur: 0xba, idx: 0x0},
+ 338: {cur: 0xbc, idx: 0x0},
+ 339: {cur: 0xbe, idx: 0x0},
+ 340: {cur: 0xbf, idx: 0x0},
+ 341: {cur: 0xc0, idx: 0x0},
+ 342: {cur: 0xc7, idx: 0x0},
+ 343: {cur: 0xc8, idx: 0x0},
+ 344: {cur: 0xc9, idx: 0x0},
+ 345: {cur: 0xcc, idx: 0x0},
+ 346: {cur: 0xd0, idx: 0x0},
+ 347: {cur: 0xd3, idx: 0x0},
+ 348: {cur: 0xd4, idx: 0x0},
+ 349: {cur: 0xd6, idx: 0x0},
+ 350: {cur: 0xdb, idx: 0x0},
+ 351: {cur: 0xdc, idx: 0x0},
+ 352: {cur: 0xdd, idx: 0x0},
+ 353: {cur: 0xe2, idx: 0x0},
+ 354: {cur: 0xe4, idx: 0x0},
+ 355: {cur: 0xe5, idx: 0x0},
+ 356: {cur: 0xe9, idx: 0x0},
+ 357: {cur: 0xeb, idx: 0x0},
+ 358: {cur: 0xf1, idx: 0x0},
+ 359: {cur: 0xf4, idx: 0x0},
+ 360: {cur: 0xf5, idx: 0x0},
+ 361: {cur: 0xf6, idx: 0x0},
+ 362: {cur: 0xf8, idx: 0x0},
+ 363: {cur: 0x101, idx: 0x0},
+ 364: {cur: 0x104, idx: 0x0},
+ 365: {cur: 0x105, idx: 0x0},
+ 366: {cur: 0x110, idx: 0x0},
+ 367: {cur: 0x125, idx: 0x0},
+ 368: {cur: 0x127, idx: 0x0},
+ 369: {cur: 0xf6, idx: 0xc7},
+ 370: {cur: 0x58, idx: 0x3e5},
+ 371: {cur: 0x89, idx: 0x32a},
+ 372: {cur: 0x92, idx: 0x2b8},
+ 373: {cur: 0xbc, idx: 0x41a},
+ 374: {cur: 0xd0, idx: 0x4f},
+ 375: {cur: 0xd4, idx: 0x421},
+ 376: {cur: 0xf6, idx: 0xc7},
+ 377: {cur: 0x127, idx: 0x441},
+ 378: {cur: 0x37, idx: 0x258},
+ 379: {cur: 0x65, idx: 0x0},
+ 380: {cur: 0x89, idx: 0x6b},
+ 381: {cur: 0xbc, idx: 0x9b},
+ 382: {cur: 0x127, idx: 0xeb},
+ 383: {cur: 0xf6, idx: 0xc7},
+ 384: {cur: 0xd0, idx: 0xee},
+ 385: {cur: 0xf6, idx: 0xc7},
+ 386: {cur: 0x89, idx: 0x32a},
+ 387: {cur: 0xd2, idx: 0x46d},
+ 388: {cur: 0xf6, idx: 0xc7},
+ 389: {cur: 0xae, idx: 0x474},
+ 390: {cur: 0xf6, idx: 0xc7},
+ 391: {cur: 0xf6, idx: 0xc7},
+ 392: {cur: 0xd0, idx: 0x48e},
+ 393: {cur: 0xf6, idx: 0xc7},
+ 394: {cur: 0xf6, idx: 0xc7},
+ 395: {cur: 0xf6, idx: 0xc7},
+ 396: {cur: 0xf6, idx: 0xc7},
+ 397: {cur: 0xf6, idx: 0xc7},
+ 398: {cur: 0xf6, idx: 0xc7},
+ 399: {cur: 0x37, idx: 0x258},
+ 400: {cur: 0x58, idx: 0x3e5},
+ 401: {cur: 0xbe, idx: 0x49b},
+ 402: {cur: 0xf6, idx: 0xc7},
+ 403: {cur: 0x44, idx: 0x4a3},
+ 404: {cur: 0x85, idx: 0x4a3},
+ 405: {cur: 0xd0, idx: 0x4a7},
+ 406: {cur: 0xf6, idx: 0xc7},
+ 407: {cur: 0xf6, idx: 0xc7},
+ 408: {cur: 0xf6, idx: 0xc7},
+ 409: {cur: 0xd0, idx: 0x4b2},
+ 410: {cur: 0xf6, idx: 0xc7},
+ 411: {cur: 0xd0, idx: 0x4f},
+ 412: {cur: 0xf6, idx: 0xc7},
+ 413: {cur: 0x25, idx: 0x251},
+ 414: {cur: 0x32, idx: 0x255},
+ 415: {cur: 0x39, idx: 0x146},
+ 416: {cur: 0x3a, idx: 0x9b},
+ 417: {cur: 0x53, idx: 0x264},
+ 418: {cur: 0x58, idx: 0x4b9},
+ 419: {cur: 0x72, idx: 0x4b},
+ 420: {cur: 0x75, idx: 0x4bc},
+ 421: {cur: 0x83, idx: 0x275},
+ 422: {cur: 0xf5, idx: 0x21b},
+ 423: {cur: 0xf6, idx: 0xc7},
+ 424: {cur: 0xf6, idx: 0xc7},
+ 425: {cur: 0xf6, idx: 0xc7},
+ 426: {cur: 0x1b, idx: 0x0},
+ 427: {cur: 0x37, idx: 0x258},
+ 428: {cur: 0x7c, idx: 0x0},
+ 429: {cur: 0x7d, idx: 0x0},
+ 430: {cur: 0x88, idx: 0x0},
+ 431: {cur: 0x91, idx: 0x0},
+ 432: {cur: 0xa9, idx: 0x0},
+ 433: {cur: 0xc9, idx: 0x4c6},
+ 434: {cur: 0xcc, idx: 0x352},
+ 435: {cur: 0xd2, idx: 0x4c9},
+ 436: {cur: 0x105, idx: 0x0},
+ 437: {cur: 0xf6, idx: 0xc7},
+ 438: {cur: 0xf6, idx: 0xc7},
+ 439: {cur: 0xf6, idx: 0xc7},
+ 440: {cur: 0xdb, idx: 0x4d7},
+ 441: {cur: 0xf6, idx: 0xc7},
+ 442: {cur: 0xf6, idx: 0xc7},
+ 443: {cur: 0xf6, idx: 0xc7},
+ 444: {cur: 0x1a, idx: 0x24c},
+ 445: {cur: 0x32, idx: 0x255},
+ 446: {cur: 0xd0, idx: 0x4f},
+ 447: {cur: 0xf6, idx: 0xc7},
+ 448: {cur: 0xbf, idx: 0x4f1},
+ 449: {cur: 0xf6, idx: 0xc7},
+ 450: {cur: 0xf6, idx: 0xc7},
+ 451: {cur: 0xd0, idx: 0x500},
+ 452: {cur: 0xf6, idx: 0xc7},
+ 453: {cur: 0xd0, idx: 0x4f},
+ 454: {cur: 0xf6, idx: 0xc7},
+ 455: {cur: 0xf6, idx: 0xc7},
+ 456: {cur: 0x65, idx: 0x515},
+ 457: {cur: 0xd0, idx: 0x4f},
+ 458: {cur: 0xf6, idx: 0xc7},
+ 459: {cur: 0x37, idx: 0x258},
+ 460: {cur: 0x93, idx: 0x52c},
+ 461: {cur: 0xf6, idx: 0xc7},
+ 462: {cur: 0xf6, idx: 0xc7},
+ 463: {cur: 0xf6, idx: 0xc7},
+ 464: {cur: 0x65, idx: 0x515},
+ 465: {cur: 0xf6, idx: 0xc7},
+ 466: {cur: 0x37, idx: 0x552},
+ 467: {cur: 0x65, idx: 0x515},
+ 468: {cur: 0xf6, idx: 0xc7},
+ 469: {cur: 0x5c, idx: 0x0},
+ 470: {cur: 0xd0, idx: 0x4f},
+ 471: {cur: 0xf6, idx: 0xc7},
+ 472: {cur: 0xf6, idx: 0xc7},
+ 473: {cur: 0xf6, idx: 0xc7},
+ 474: {cur: 0xf6, idx: 0xc7},
+ 475: {cur: 0xf6, idx: 0xc7},
+ 476: {cur: 0xd0, idx: 0x4f},
+ 477: {cur: 0xf6, idx: 0xc7},
+ 478: {cur: 0xf6, idx: 0xc7},
+ 479: {cur: 0xf6, idx: 0xc7},
+ 480: {cur: 0xf6, idx: 0xc7},
+ 481: {cur: 0xf6, idx: 0xc7},
+ 482: {cur: 0xd0, idx: 0x4f},
+ 483: {cur: 0x37, idx: 0x59e},
+ 484: {cur: 0x52, idx: 0x34f},
+ 485: {cur: 0x75, idx: 0x4bc},
+ 486: {cur: 0x81, idx: 0x34f},
+ 487: {cur: 0xbe, idx: 0x34f},
+ 488: {cur: 0xc9, idx: 0x5a1},
+ 489: {cur: 0xdb, idx: 0x34f},
+ 490: {cur: 0xf6, idx: 0xc7},
+} // Size: 1988 bytes
+
+// Total table size 18885 bytes (18KiB); checksum: BE08FD0B
diff --git a/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-api.json b/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-api.json
index b3b17530c0..ae9e9cdf95 100644
--- a/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-api.json
+++ b/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-api.json
@@ -15,38 +15,6 @@
"description": "Creates short-lived credentials for impersonating IAM service accounts. Disabling this API also disables the IAM API (iam.googleapis.com). However, enabling this API doesn't enable the IAM API. ",
"discoveryVersion": "v1",
"documentationLink": "https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials",
- "endpoints": [
- {
- "description": "Regional Endpoint",
- "endpointUrl": "https://iamcredentials.asia-east1.rep.googleapis.com/",
- "location": "asia-east1"
- },
- {
- "description": "Regional Endpoint",
- "endpointUrl": "https://iamcredentials.europe-west1.rep.googleapis.com/",
- "location": "europe-west1"
- },
- {
- "description": "Regional Endpoint",
- "endpointUrl": "https://iamcredentials.us-central1.rep.googleapis.com/",
- "location": "us-central1"
- },
- {
- "description": "Regional Endpoint",
- "endpointUrl": "https://iamcredentials.us-east1.rep.googleapis.com/",
- "location": "us-east1"
- },
- {
- "description": "Regional Endpoint",
- "endpointUrl": "https://iamcredentials.us-east7.rep.googleapis.com/",
- "location": "us-east7"
- },
- {
- "description": "Regional Endpoint",
- "endpointUrl": "https://iamcredentials.us-west1.rep.googleapis.com/",
- "location": "us-west1"
- }
- ],
"fullyEncodeReservedExpansion": true,
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
@@ -340,7 +308,7 @@
}
}
},
- "revision": "20260604",
+ "revision": "20260630",
"rootUrl": "https://iamcredentials.googleapis.com/",
"schemas": {
"GenerateAccessTokenRequest": {
diff --git a/vendor/google.golang.org/api/internal/version.go b/vendor/google.golang.org/api/internal/version.go
index 146ea7c16f..c2c2c9beed 100644
--- a/vendor/google.golang.org/api/internal/version.go
+++ b/vendor/google.golang.org/api/internal/version.go
@@ -5,4 +5,4 @@
package internal
// Version is the current tagged release of the library.
-const Version = "0.287.1"
+const Version = "0.290.0"
diff --git a/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb b/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb
index 04696351ee..ad35ea4c44 100644
Binary files a/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb and b/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb differ
diff --git a/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go b/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go
index 328dc733b0..079a53dd15 100644
--- a/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go
+++ b/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go
@@ -69,19 +69,19 @@ func Unmarshal(s string, k protoreflect.Kind, evs protoreflect.EnumValueDescript
}
}
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
- if v, err := strconv.ParseInt(s, 10, 32); err == nil {
+ if v, err := strconv.ParseInt(s, 0, 32); err == nil {
return protoreflect.ValueOfInt32(int32(v)), nil, nil
}
case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
- if v, err := strconv.ParseInt(s, 10, 64); err == nil {
+ if v, err := strconv.ParseInt(s, 0, 64); err == nil {
return protoreflect.ValueOfInt64(int64(v)), nil, nil
}
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
- if v, err := strconv.ParseUint(s, 10, 32); err == nil {
+ if v, err := strconv.ParseUint(s, 0, 32); err == nil {
return protoreflect.ValueOfUint32(uint32(v)), nil, nil
}
case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
- if v, err := strconv.ParseUint(s, 10, 64); err == nil {
+ if v, err := strconv.ParseUint(s, 0, 64); err == nil {
return protoreflect.ValueOfUint64(uint64(v)), nil, nil
}
case protoreflect.FloatKind, protoreflect.DoubleKind:
diff --git a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go
index 65aaf4d210..58aeff8456 100644
--- a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go
+++ b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go
@@ -26,6 +26,7 @@ const (
Edition_EDITION_PROTO3_enum_value = 999
Edition_EDITION_2023_enum_value = 1000
Edition_EDITION_2024_enum_value = 1001
+ Edition_EDITION_2026_enum_value = 1002
Edition_EDITION_UNSTABLE_enum_value = 9999
Edition_EDITION_1_TEST_ONLY_enum_value = 1
Edition_EDITION_2_TEST_ONLY_enum_value = 2
@@ -806,11 +807,13 @@ const (
FieldOptions_FeatureSupport_EditionDeprecated_field_name protoreflect.Name = "edition_deprecated"
FieldOptions_FeatureSupport_DeprecationWarning_field_name protoreflect.Name = "deprecation_warning"
FieldOptions_FeatureSupport_EditionRemoved_field_name protoreflect.Name = "edition_removed"
+ FieldOptions_FeatureSupport_RemovalError_field_name protoreflect.Name = "removal_error"
FieldOptions_FeatureSupport_EditionIntroduced_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_introduced"
FieldOptions_FeatureSupport_EditionDeprecated_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_deprecated"
FieldOptions_FeatureSupport_DeprecationWarning_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.deprecation_warning"
FieldOptions_FeatureSupport_EditionRemoved_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_removed"
+ FieldOptions_FeatureSupport_RemovalError_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.removal_error"
)
// Field numbers for google.protobuf.FieldOptions.FeatureSupport.
@@ -819,6 +822,7 @@ const (
FieldOptions_FeatureSupport_EditionDeprecated_field_number protoreflect.FieldNumber = 2
FieldOptions_FeatureSupport_DeprecationWarning_field_number protoreflect.FieldNumber = 3
FieldOptions_FeatureSupport_EditionRemoved_field_number protoreflect.FieldNumber = 4
+ FieldOptions_FeatureSupport_RemovalError_field_number protoreflect.FieldNumber = 5
)
// Names for google.protobuf.OneofOptions.
@@ -1152,6 +1156,7 @@ const (
FeatureSet_ENFORCE_NAMING_STYLE_UNKNOWN_enum_value = 0
FeatureSet_STYLE2024_enum_value = 1
FeatureSet_STYLE_LEGACY_enum_value = 2
+ FeatureSet_STYLE2026_enum_value = 3
)
// Names for google.protobuf.FeatureSet.VisibilityFeature.
diff --git a/vendor/google.golang.org/protobuf/internal/version/version.go b/vendor/google.golang.org/protobuf/internal/version/version.go
index bfb2cfdea5..58ff0e2464 100644
--- a/vendor/google.golang.org/protobuf/internal/version/version.go
+++ b/vendor/google.golang.org/protobuf/internal/version/version.go
@@ -52,8 +52,8 @@ import (
const (
Major = 1
Minor = 36
- Patch = 11
- PreRelease = "devel"
+ Patch = 12
+ PreRelease = ""
)
// String formats the version string for this module in semver format.
diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go
index 730331e666..86f0d09262 100644
--- a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go
+++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go
@@ -546,6 +546,8 @@ func (p *SourcePath) appendFieldOptions_FeatureSupport(b []byte) []byte {
b = p.appendSingularField(b, "deprecation_warning", nil)
case 4:
b = p.appendSingularField(b, "edition_removed", nil)
+ case 5:
+ b = p.appendSingularField(b, "removal_error", nil)
}
return b
}
diff --git a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go
index 0b23faa957..a51cb1e546 100644
--- a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go
+++ b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go
@@ -1,32 +1,9 @@
// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
+// Copyright 2008 Google LLC. 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.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file or at
+// https://developers.google.com/open-source/licenses/bsd
// Author: kenton@google.com (Kenton Varda)
// Based on original Protocol Buffers design by
@@ -69,6 +46,7 @@ const (
// comparison.
Edition_EDITION_2023 Edition = 1000
Edition_EDITION_2024 Edition = 1001
+ Edition_EDITION_2026 Edition = 1002
// A placeholder edition for developing and testing unscheduled features.
Edition_EDITION_UNSTABLE Edition = 9999
// Placeholder editions for testing feature resolution. These should not be
@@ -93,6 +71,7 @@ var (
999: "EDITION_PROTO3",
1000: "EDITION_2023",
1001: "EDITION_2024",
+ 1002: "EDITION_2026",
9999: "EDITION_UNSTABLE",
1: "EDITION_1_TEST_ONLY",
2: "EDITION_2_TEST_ONLY",
@@ -108,6 +87,7 @@ var (
"EDITION_PROTO3": 999,
"EDITION_2023": 1000,
"EDITION_2024": 1001,
+ "EDITION_2026": 1002,
"EDITION_UNSTABLE": 9999,
"EDITION_1_TEST_ONLY": 1,
"EDITION_2_TEST_ONLY": 2,
@@ -1213,6 +1193,7 @@ const (
FeatureSet_ENFORCE_NAMING_STYLE_UNKNOWN FeatureSet_EnforceNamingStyle = 0
FeatureSet_STYLE2024 FeatureSet_EnforceNamingStyle = 1
FeatureSet_STYLE_LEGACY FeatureSet_EnforceNamingStyle = 2
+ FeatureSet_STYLE2026 FeatureSet_EnforceNamingStyle = 3
)
// Enum value maps for FeatureSet_EnforceNamingStyle.
@@ -1221,11 +1202,13 @@ var (
0: "ENFORCE_NAMING_STYLE_UNKNOWN",
1: "STYLE2024",
2: "STYLE_LEGACY",
+ 3: "STYLE2026",
}
FeatureSet_EnforceNamingStyle_value = map[string]int32{
"ENFORCE_NAMING_STYLE_UNKNOWN": 0,
"STYLE2024": 1,
"STYLE_LEGACY": 2,
+ "STYLE2026": 3,
}
)
@@ -4204,8 +4187,11 @@ type FieldOptions_FeatureSupport struct {
// this one, the last default assigned will be used, and proto files will
// not be able to override it.
EditionRemoved *Edition `protobuf:"varint,4,opt,name=edition_removed,json=editionRemoved,enum=google.protobuf.Edition" json:"edition_removed,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
+ // The removal error text if this feature is used after the edition it was
+ // removed in.
+ RemovalError *string `protobuf:"bytes,5,opt,name=removal_error,json=removalError" json:"removal_error,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *FieldOptions_FeatureSupport) Reset() {
@@ -4266,6 +4252,13 @@ func (x *FieldOptions_FeatureSupport) GetEditionRemoved() Edition {
return Edition_EDITION_UNKNOWN
}
+func (x *FieldOptions_FeatureSupport) GetRemovalError() string {
+ if x != nil && x.RemovalError != nil {
+ return *x.RemovalError
+ }
+ 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).
@@ -4719,7 +4712,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"\aoptions\x18\x03 \x01(\v2&.google.protobuf.ExtensionRangeOptionsR\aoptions\x1a7\n" +
"\rReservedRange\x12\x14\n" +
"\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n" +
- "\x03end\x18\x02 \x01(\x05R\x03end\"\xcc\x04\n" +
+ "\x03end\x18\x02 \x01(\x05R\x03end\"\xd4\x04\n" +
"\x15ExtensionRangeOptions\x12X\n" +
"\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x12Y\n" +
"\vdeclaration\x18\x02 \x03(\v22.google.protobuf.ExtensionRangeOptions.DeclarationB\x03\x88\x01\x02R\vdeclaration\x127\n" +
@@ -4735,7 +4728,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"\x11VerificationState\x12\x0f\n" +
"\vDECLARATION\x10\x00\x12\x0e\n" +
"\n" +
- "UNVERIFIED\x10\x01*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xc1\x06\n" +
+ "UNVERIFIED\x10\x01*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xc1\x06\n" +
"\x14FieldDescriptorProto\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" +
"\x06number\x18\x03 \x01(\x05R\x06number\x12A\n" +
@@ -4810,12 +4803,13 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"outputType\x128\n" +
"\aoptions\x18\x04 \x01(\v2\x1e.google.protobuf.MethodOptionsR\aoptions\x120\n" +
"\x10client_streaming\x18\x05 \x01(\b:\x05falseR\x0fclientStreaming\x120\n" +
- "\x10server_streaming\x18\x06 \x01(\b:\x05falseR\x0fserverStreaming\"\xad\t\n" +
+ "\x10server_streaming\x18\x06 \x01(\b:\x05falseR\x0fserverStreaming\"\xfa\n" +
+ "\n" +
"\vFileOptions\x12!\n" +
"\fjava_package\x18\x01 \x01(\tR\vjavaPackage\x120\n" +
- "\x14java_outer_classname\x18\b \x01(\tR\x12javaOuterClassname\x125\n" +
+ "\x14java_outer_classname\x18\b \x01(\tR\x12javaOuterClassname\x12\xf9\x01\n" +
"\x13java_multiple_files\x18\n" +
- " \x01(\b:\x05falseR\x11javaMultipleFiles\x12D\n" +
+ " \x01(\b:\x05falseB\xc1\x01\xb2\x01\xbd\x01\b\xe6\a \xe9\a*\xb4\x01This behavior is enabled by default in editions 2024 and above. To disable it, you can set `features.(pb.java).nest_in_file_class = YES` on individual messages, enums, or services.R\x11javaMultipleFiles\x12D\n" +
"\x1djava_generate_equals_and_hash\x18\x14 \x01(\bB\x02\x18\x01R\x19javaGenerateEqualsAndHash\x12:\n" +
"\x16java_string_check_utf8\x18\x1b \x01(\b:\x05falseR\x13javaStringCheckUtf8\x12S\n" +
"\foptimize_for\x18\t \x01(\x0e2).google.protobuf.FileOptions.OptimizeMode:\x05SPEEDR\voptimizeFor\x12\x1d\n" +
@@ -4840,7 +4834,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"\fOptimizeMode\x12\t\n" +
"\x05SPEED\x10\x01\x12\r\n" +
"\tCODE_SIZE\x10\x02\x12\x10\n" +
- "\fLITE_RUNTIME\x10\x03*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b*\x10+J\x04\b&\x10'R\x14php_generic_services\"\xf4\x03\n" +
+ "\fLITE_RUNTIME\x10\x03*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b*\x10+J\x04\b&\x10'R\x14php_generic_services\"\xfc\x03\n" +
"\x0eMessageOptions\x12<\n" +
"\x17message_set_wire_format\x18\x01 \x01(\b:\x05falseR\x14messageSetWireFormat\x12L\n" +
"\x1fno_standard_descriptor_accessor\x18\x02 \x01(\b:\x05falseR\x1cnoStandardDescriptorAccessor\x12%\n" +
@@ -4850,8 +4844,8 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"\tmap_entry\x18\a \x01(\bR\bmapEntry\x12V\n" +
"&deprecated_legacy_json_field_conflicts\x18\v \x01(\bB\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x127\n" +
"\bfeatures\x18\f \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" +
- "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06J\x04\b\x06\x10\aJ\x04\b\b\x10\tJ\x04\b\t\x10\n" +
- "\"\xa1\r\n" +
+ "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06J\x04\b\x06\x10\aJ\x04\b\b\x10\tJ\x04\b\t\x10\n" +
+ "\"\xce\r\n" +
"\fFieldOptions\x12A\n" +
"\x05ctype\x18\x01 \x01(\x0e2#.google.protobuf.FieldOptions.CType:\x06STRINGR\x05ctype\x12\x16\n" +
"\x06packed\x18\x02 \x01(\bR\x06packed\x12G\n" +
@@ -4872,12 +4866,13 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x1aZ\n" +
"\x0eEditionDefault\x122\n" +
"\aedition\x18\x03 \x01(\x0e2\x18.google.protobuf.EditionR\aedition\x12\x14\n" +
- "\x05value\x18\x02 \x01(\tR\x05value\x1a\x96\x02\n" +
+ "\x05value\x18\x02 \x01(\tR\x05value\x1a\xbb\x02\n" +
"\x0eFeatureSupport\x12G\n" +
"\x12edition_introduced\x18\x01 \x01(\x0e2\x18.google.protobuf.EditionR\x11editionIntroduced\x12G\n" +
"\x12edition_deprecated\x18\x02 \x01(\x0e2\x18.google.protobuf.EditionR\x11editionDeprecated\x12/\n" +
"\x13deprecation_warning\x18\x03 \x01(\tR\x12deprecationWarning\x12A\n" +
- "\x0fedition_removed\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eeditionRemoved\"/\n" +
+ "\x0fedition_removed\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eeditionRemoved\x12#\n" +
+ "\rremoval_error\x18\x05 \x01(\tR\fremovalError\"/\n" +
"\x05CType\x12\n" +
"\n" +
"\x06STRING\x10\x00\x12\b\n" +
@@ -4901,10 +4896,10 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"\x10TARGET_TYPE_ENUM\x10\x06\x12\x1a\n" +
"\x16TARGET_TYPE_ENUM_ENTRY\x10\a\x12\x17\n" +
"\x13TARGET_TYPE_SERVICE\x10\b\x12\x16\n" +
- "\x12TARGET_TYPE_METHOD\x10\t*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x12\x10\x13\"\xac\x01\n" +
+ "\x12TARGET_TYPE_METHOD\x10\t*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x12\x10\x13\"\xb4\x01\n" +
"\fOneofOptions\x127\n" +
"\bfeatures\x18\x01 \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" +
- "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd1\x02\n" +
+ "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd9\x02\n" +
"\vEnumOptions\x12\x1f\n" +
"\vallow_alias\x18\x02 \x01(\bR\n" +
"allowAlias\x12%\n" +
@@ -4913,7 +4908,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"deprecated\x12V\n" +
"&deprecated_legacy_json_field_conflicts\x18\x06 \x01(\bB\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x127\n" +
"\bfeatures\x18\a \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" +
- "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x05\x10\x06\"\xd8\x02\n" +
+ "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x05\x10\x06\"\xe0\x02\n" +
"\x10EnumValueOptions\x12%\n" +
"\n" +
"deprecated\x18\x01 \x01(\b:\x05falseR\n" +
@@ -4921,13 +4916,13 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"\bfeatures\x18\x02 \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12(\n" +
"\fdebug_redact\x18\x03 \x01(\b:\x05falseR\vdebugRedact\x12U\n" +
"\x0ffeature_support\x18\x04 \x01(\v2,.google.protobuf.FieldOptions.FeatureSupportR\x0efeatureSupport\x12X\n" +
- "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd5\x01\n" +
+ "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xdd\x01\n" +
"\x0eServiceOptions\x127\n" +
"\bfeatures\x18\" \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12%\n" +
"\n" +
"deprecated\x18! \x01(\b:\x05falseR\n" +
"deprecated\x12X\n" +
- "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x99\x03\n" +
+ "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xa1\x03\n" +
"\rMethodOptions\x12%\n" +
"\n" +
"deprecated\x18! \x01(\b:\x05falseR\n" +
@@ -4939,7 +4934,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"\x13IDEMPOTENCY_UNKNOWN\x10\x00\x12\x13\n" +
"\x0fNO_SIDE_EFFECTS\x10\x01\x12\x0e\n" +
"\n" +
- "IDEMPOTENT\x10\x02*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x9a\x03\n" +
+ "IDEMPOTENT\x10\x02*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x9a\x03\n" +
"\x13UninterpretedOption\x12A\n" +
"\x04name\x18\x02 \x03(\v2-.google.protobuf.UninterpretedOption.NamePartR\x04name\x12)\n" +
"\x10identifier_value\x18\x03 \x01(\tR\x0fidentifierValue\x12,\n" +
@@ -4950,7 +4945,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"\x0faggregate_value\x18\b \x01(\tR\x0eaggregateValue\x1aJ\n" +
"\bNamePart\x12\x1b\n" +
"\tname_part\x18\x01 \x02(\tR\bnamePart\x12!\n" +
- "\fis_extension\x18\x02 \x02(\bR\visExtension\"\x8e\x0f\n" +
+ "\fis_extension\x18\x02 \x02(\bR\visExtension\"\xae\x0f\n" +
"\n" +
"FeatureSet\x12\x91\x01\n" +
"\x0efield_presence\x18\x01 \x01(\x0e2).google.protobuf.FeatureSet.FieldPresenceB?\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\bEXPLICIT\x18\x84\a\xa2\x01\r\x12\bIMPLICIT\x18\xe7\a\xa2\x01\r\x12\bEXPLICIT\x18\xe8\a\xb2\x01\x03\b\xe8\aR\rfieldPresence\x12l\n" +
@@ -4960,8 +4955,8 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"\x10message_encoding\x18\x05 \x01(\x0e2+.google.protobuf.FeatureSet.MessageEncodingB&\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\x14\x12\x0fLENGTH_PREFIXED\x18\x84\a\xb2\x01\x03\b\xe8\aR\x0fmessageEncoding\x12\x82\x01\n" +
"\vjson_format\x18\x06 \x01(\x0e2&.google.protobuf.FeatureSet.JsonFormatB9\x88\x01\x01\x98\x01\x03\x98\x01\x06\x98\x01\x01\xa2\x01\x17\x12\x12LEGACY_BEST_EFFORT\x18\x84\a\xa2\x01\n" +
"\x12\x05ALLOW\x18\xe7\a\xb2\x01\x03\b\xe8\aR\n" +
- "jsonFormat\x12\xab\x01\n" +
- "\x14enforce_naming_style\x18\a \x01(\x0e2..google.protobuf.FeatureSet.EnforceNamingStyleBI\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\xa2\x01\x11\x12\fSTYLE_LEGACY\x18\x84\a\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x12enforceNamingStyle\x12\xb9\x01\n" +
+ "jsonFormat\x12\xbc\x01\n" +
+ "\x14enforce_naming_style\x18\a \x01(\x0e2..google.protobuf.FeatureSet.EnforceNamingStyleBZ\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\xa2\x01\x11\x12\fSTYLE_LEGACY\x18\x84\a\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\a\xa2\x01\x0e\x12\tSTYLE2026\x18\x8fN\xb2\x01\x03\b\xe9\aR\x12enforceNamingStyle\x12\xb9\x01\n" +
"\x19default_symbol_visibility\x18\b \x01(\x0e2E.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibilityB6\x88\x01\x02\x98\x01\x01\xa2\x01\x0f\x12\n" +
"EXPORT_ALL\x18\x84\a\xa2\x01\x15\x12\x10EXPORT_TOP_LEVEL\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x17defaultSymbolVisibility\x1a\xa1\x01\n" +
"\x11VisibilityFeature\"\x81\x01\n" +
@@ -5001,11 +4996,12 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"JsonFormat\x12\x17\n" +
"\x13JSON_FORMAT_UNKNOWN\x10\x00\x12\t\n" +
"\x05ALLOW\x10\x01\x12\x16\n" +
- "\x12LEGACY_BEST_EFFORT\x10\x02\"W\n" +
+ "\x12LEGACY_BEST_EFFORT\x10\x02\"f\n" +
"\x12EnforceNamingStyle\x12 \n" +
"\x1cENFORCE_NAMING_STYLE_UNKNOWN\x10\x00\x12\r\n" +
"\tSTYLE2024\x10\x01\x12\x10\n" +
- "\fSTYLE_LEGACY\x10\x02*\x06\b\xe8\a\x10\x8bN*\x06\b\x8bN\x10\x90N*\x06\b\x90N\x10\x91NJ\x06\b\xe7\a\x10\xe8\a\"\xef\x03\n" +
+ "\fSTYLE_LEGACY\x10\x02\x12\r\n" +
+ "\tSTYLE2026\x10\x03*\x06\b\xe8\a\x10\x8bN*\x06\b\x8bN\x10\x90N*\x06\b\x90N\x10\x91NJ\x06\b\xe7\a\x10\xe8\a\"\xef\x03\n" +
"\x12FeatureSetDefaults\x12X\n" +
"\bdefaults\x18\x01 \x03(\v2<.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefaultR\bdefaults\x12A\n" +
"\x0fminimum_edition\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eminimumEdition\x12A\n" +
@@ -5037,14 +5033,15 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" +
"\bSemantic\x12\b\n" +
"\x04NONE\x10\x00\x12\a\n" +
"\x03SET\x10\x01\x12\t\n" +
- "\x05ALIAS\x10\x02*\xbe\x02\n" +
+ "\x05ALIAS\x10\x02*\xd1\x02\n" +
"\aEdition\x12\x13\n" +
"\x0fEDITION_UNKNOWN\x10\x00\x12\x13\n" +
"\x0eEDITION_LEGACY\x10\x84\a\x12\x13\n" +
"\x0eEDITION_PROTO2\x10\xe6\a\x12\x13\n" +
"\x0eEDITION_PROTO3\x10\xe7\a\x12\x11\n" +
"\fEDITION_2023\x10\xe8\a\x12\x11\n" +
- "\fEDITION_2024\x10\xe9\a\x12\x15\n" +
+ "\fEDITION_2024\x10\xe9\a\x12\x11\n" +
+ "\fEDITION_2026\x10\xea\a\x12\x15\n" +
"\x10EDITION_UNSTABLE\x10\x8fN\x12\x17\n" +
"\x13EDITION_1_TEST_ONLY\x10\x01\x12\x17\n" +
"\x13EDITION_2_TEST_ONLY\x10\x02\x12\x1d\n" +
diff --git a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go
index 1ff0d1494d..510894f2b0 100644
--- a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go
+++ b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go
@@ -128,120 +128,66 @@ import (
// `Any` contains an arbitrary serialized protocol buffer message along with a
// URL that describes the type of the serialized message.
//
-// Protobuf library provides support to pack/unpack Any values in the form
-// of utility functions or additional generated methods of the Any type.
-//
-// Example 1: Pack and unpack a message in C++.
-//
-// Foo foo = ...;
-// Any any;
-// any.PackFrom(foo);
-// ...
-// if (any.UnpackTo(&foo)) {
-// ...
-// }
-//
-// Example 2: Pack and unpack a message in Java.
-//
-// Foo foo = ...;
-// Any any = Any.pack(foo);
-// ...
-// if (any.is(Foo.class)) {
-// foo = any.unpack(Foo.class);
-// }
-// // or ...
-// if (any.isSameTypeAs(Foo.getDefaultInstance())) {
-// foo = any.unpack(Foo.getDefaultInstance());
-// }
-//
-// Example 3: Pack and unpack a message in Python.
-//
-// foo = Foo(...)
-// any = Any()
-// any.Pack(foo)
-// ...
-// if any.Is(Foo.DESCRIPTOR):
-// any.Unpack(foo)
-// ...
-//
-// Example 4: Pack and unpack a message in Go
-//
-// foo := &pb.Foo{...}
-// any, err := anypb.New(foo)
-// if err != nil {
-// ...
-// }
-// ...
-// foo := &pb.Foo{}
-// if err := any.UnmarshalTo(foo); err != nil {
-// ...
-// }
-//
-// The pack methods provided by protobuf library will by default use
-// 'type.googleapis.com/full.type.name' as the type URL and the unpack
-// methods only use the fully qualified type name after the last '/'
-// in the type URL, for example "foo.bar.com/x/y.z" will yield type
-// name "y.z".
-//
-// JSON
-// ====
-// The JSON representation of an `Any` value uses the regular
-// representation of the deserialized, embedded message, with an
-// additional field `@type` which contains the type URL. Example:
-//
-// package google.profile;
-// message Person {
-// string first_name = 1;
-// string last_name = 2;
-// }
-//
-// {
-// "@type": "type.googleapis.com/google.profile.Person",
-// "firstName": ,
-// "lastName":
-// }
-//
-// If the embedded message type is well-known and has a custom JSON
-// representation, that representation will be embedded adding a field
-// `value` which holds the custom JSON in addition to the `@type`
-// field. Example (for message [google.protobuf.Duration][]):
-//
-// {
-// "@type": "type.googleapis.com/google.protobuf.Duration",
-// "value": "1.212s"
-// }
+// In its binary encoding, an `Any` is an ordinary message; but in other wire
+// forms like JSON, it has a special encoding. The format of the type URL is
+// described on the `type_url` field.
+//
+// Protobuf APIs provide utilities to interact with `Any` values:
+//
+// - A 'pack' operation accepts a message and constructs a generic `Any` wrapper
+// around it.
+// - An 'unpack' operation reads the content of an `Any` message, either into an
+// existing message or a new one. Unpack operations must check the type of the
+// value they unpack against the declared `type_url`.
+// - An 'is' operation decides whether an `Any` contains a message of the given
+// type, i.e. whether it can 'unpack' that type.
+//
+// The JSON format representation of an `Any` follows one of these cases:
+//
+// - For types without special-cased JSON encodings, the JSON format
+// representation of the `Any` is the same as that of the message, with an
+// additional `@type` field which contains the type URL.
+// - For types with special-cased JSON encodings (typically called 'well-known'
+// types, listed in https://protobuf.dev/programming-guides/json/#any), the
+// JSON format representation has a key `@type` which contains the type URL
+// and a key `value` which contains the JSON-serialized value.
+//
+// The text format representation of an `Any` is like a message with one field
+// whose name is the type URL in brackets. For example, an `Any` containing a
+// `foo.Bar` message may be written `[type.googleapis.com/foo.Bar] { a: 2 }`.
type Any struct {
state protoimpl.MessageState `protogen:"open.v1"`
- // A URL/resource name that uniquely identifies the type of the serialized
- // protocol buffer message. This string must contain at least
- // one "/" character. The last segment of the URL's path must represent
- // the fully qualified name of the type (as in
- // `path/google.protobuf.Duration`). The name should be in a canonical form
- // (e.g., leading "." is not accepted).
+ // Identifies the type of the serialized Protobuf message with a URI reference
+ // consisting of a prefix ending in a slash and the fully-qualified type name.
+ //
+ // Example: type.googleapis.com/google.protobuf.StringValue
//
- // In practice, teams usually precompile into the binary all types that they
- // expect it to use in the context of Any. However, for URLs which use the
- // scheme `http`, `https`, or no scheme, one can optionally set up a type
- // server that maps type URLs to message definitions as follows:
+ // This string must contain at least one `/` character, and the content after
+ // the last `/` must be the fully-qualified name of the type in canonical
+ // form, without a leading dot. Do not write a scheme on these URI references
+ // so that clients do not attempt to contact them.
//
- // - If no scheme is provided, `https` is assumed.
- // - An HTTP GET on the URL must yield a [google.protobuf.Type][]
- // value in binary format, or produce an error.
- // - Applications are allowed to cache lookup results based on the
- // URL, or have them precompiled into a binary to avoid any
- // lookup. Therefore, binary compatibility needs to be preserved
- // on changes to types. (Use versioned type names to manage
- // breaking changes.)
+ // The prefix is arbitrary and Protobuf implementations are expected to
+ // simply strip off everything up to and including the last `/` to identify
+ // the type. `type.googleapis.com/` is a common default prefix that some
+ // legacy implementations require. This prefix does not indicate the origin of
+ // the type, and URIs containing it are not expected to respond to any
+ // requests.
//
- // Note: this functionality is not currently available in the official
- // protobuf release, and it is not used for type URLs beginning with
- // type.googleapis.com. As of May 2023, there are no widely used type server
- // implementations and no plans to implement one.
+ // All type URL strings must be legal URI references with the additional
+ // restriction (for the text format) that the content of the reference
+ // must consist only of alphanumeric characters, percent-encoded escapes, and
+ // characters in the following set (not including the outer backticks):
+ // `/-.~_!$&()*+,;=`. Despite our allowing percent encodings, implementations
+ // should not unescape them to prevent confusion with existing parsers. For
+ // example, `type.googleapis.com%2FFoo` should be rejected.
//
- // Schemes other than `http`, `https` (or the empty scheme) might be
- // used with implementation specific semantics.
+ // In the original design of `Any`, the possibility of launching a type
+ // resolution service at these type URLs was considered but Protobuf never
+ // implemented one and considers contacting these URLs to be problematic and
+ // a potential security issue. Do not attempt to contact type URLs.
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
- // Must be a valid serialized protocol buffer of the above specified type.
+ // Holds a Protobuf serialization of the type described by type_url.
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
diff --git a/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go b/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go
index 91ee89a5cd..4a0437911d 100644
--- a/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go
+++ b/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go
@@ -197,24 +197,22 @@ import (
// An implementation may provide options to override this default behavior for
// repeated and message fields.
//
-// In order to reset a field's value to the default, the field must
-// be in the mask and set to the default value in the provided resource.
-// Hence, in order to reset all fields of a resource, provide a default
-// instance of the resource and set all fields in the mask, or do
-// not provide a mask as described below.
-//
-// If a field mask is not present on update, the operation applies to
-// all fields (as if a field mask of all fields has been specified).
-// Note that in the presence of schema evolution, this may mean that
-// fields the client does not know and has therefore not filled into
-// the request will be reset to their default. If this is unwanted
-// behavior, a specific service may require a client to always specify
-// a field mask, producing an error if not.
-//
-// As with get operations, the location of the resource which
-// describes the updated values in the request message depends on the
-// operation kind. In any case, the effect of the field mask is
-// required to be honored by the API.
+// Note that libraries which implement FieldMask resolution have various
+// different behaviors in the face of empty masks or the special "*" mask.
+// When implementing a service you should confirm these cases have the
+// appropriate behavior in the underlying FieldMask library that you desire,
+// and you may need to special case those cases in your application code if
+// the underlying field mask library behavior differs from your intended
+// service semantics.
+//
+// Update methods implementing https://google.aip.dev/134
+// - MUST support the special value * meaning "full replace"
+// - MUST treat an omitted field mask as "replace fields which are present".
+//
+// Other methods implementing https://google.aip.dev/157
+// - SHOULD support the special value "*" to mean "get all".
+// - MUST treat an omitted field mask to mean "get all", unless otherwise
+// documented.
//
// ## Considerations for HTTP REST
//
diff --git a/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go b/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go
index 30411b7283..8325a50489 100644
--- a/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go
+++ b/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go
@@ -131,10 +131,15 @@ import (
unsafe "unsafe"
)
-// `NullValue` is a singleton enumeration to represent the null value for the
-// `Value` type union.
+// Represents a JSON `null`.
//
-// The JSON representation for `NullValue` is JSON `null`.
+// `NullValue` is a sentinel, using an enum with only one value to represent
+// the null value for the `Value` type union.
+//
+// A field of type `NullValue` with any value other than `0` is considered
+// invalid. Most ProtoJSON serializers will emit a Value with a `null_value` set
+// as a JSON `null` regardless of the integer value, and so will round trip to
+// a `0` value.
type NullValue int32
const (
@@ -179,14 +184,19 @@ func (NullValue) EnumDescriptor() ([]byte, []int) {
return file_google_protobuf_struct_proto_rawDescGZIP(), []int{0}
}
-// `Struct` represents a structured data value, consisting of fields
-// which map to dynamically typed values. In some languages, `Struct`
-// might be supported by a native representation. For example, in
-// scripting languages like JS a struct is represented as an
-// object. The details of that representation are described together
-// with the proto support for the language.
+// Represents a JSON object.
+//
+// An unordered key-value map, intending to perfectly capture the semantics of a
+// JSON object. This enables parsing any arbitrary JSON payload as a message
+// field in ProtoJSON format.
+//
+// This follows RFC 8259 guidelines for interoperable JSON: notably this type
+// cannot represent large Int64 values or `NaN`/`Infinity` numbers,
+// since the JSON format generally does not support those values in its number
+// type.
//
-// The JSON representation for `Struct` is JSON object.
+// If you do not intend to parse arbitrary JSON into your message, a custom
+// typed message should be preferred instead of using this type.
type Struct struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Unordered map of dynamically typed values.
@@ -269,12 +279,12 @@ func (x *Struct) GetFields() map[string]*Value {
return nil
}
+// Represents a JSON value.
+//
// `Value` represents a dynamically typed value which can be either
// null, a number, a string, a boolean, a recursive struct value, or a
// list of values. A producer of value is expected to set one of these
-// variants. Absence of any variant indicates an error.
-//
-// The JSON representation for `Value` is JSON value.
+// variants. Absence of any variant is an invalid state.
type Value struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The kind of value.
@@ -548,32 +558,35 @@ type isValue_Kind interface {
}
type Value_NullValue struct {
- // Represents a null value.
+ // Represents a JSON `null`.
NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"`
}
type Value_NumberValue struct {
- // Represents a double value.
+ // Represents a JSON number. Must not be `NaN`, `Infinity` or
+ // `-Infinity`, since those are not supported in JSON. This also cannot
+ // represent large Int64 values, since JSON format generally does not
+ // support them in its number type.
NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,proto3,oneof"`
}
type Value_StringValue struct {
- // Represents a string value.
+ // Represents a JSON string.
StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof"`
}
type Value_BoolValue struct {
- // Represents a boolean value.
+ // Represents a JSON boolean (`true` or `false` literal in JSON).
BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"`
}
type Value_StructValue struct {
- // Represents a structured value.
+ // Represents a JSON object.
StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,proto3,oneof"`
}
type Value_ListValue struct {
- // Represents a repeated `Value`.
+ // Represents a JSON array.
ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,proto3,oneof"`
}
@@ -589,9 +602,7 @@ func (*Value_StructValue) isValue_Kind() {}
func (*Value_ListValue) isValue_Kind() {}
-// `ListValue` is a wrapper around a repeated field of values.
-//
-// The JSON representation for `ListValue` is JSON array.
+// Represents a JSON array.
type ListValue struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Repeated field of dynamically typed values.
diff --git a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go
index 484c21fd53..2cd60946cf 100644
--- a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go
+++ b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go
@@ -153,8 +153,8 @@ import (
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
-// is required. A proto3 JSON serializer should always use UTC (as indicated by
-// "Z") when printing the Timestamp type and a proto3 JSON parser should be
+// is required. A ProtoJSON serializer should always use UTC (as indicated by
+// "Z") when printing the Timestamp type and a ProtoJSON parser should be
// able to accept both UTC and other timezones (as indicated by an offset).
//
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
@@ -173,7 +173,7 @@ import (
type Timestamp struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
- // be between -315576000000 and 315576000000 inclusive (which corresponds to
+ // be between -62135596800 and 253402300799 inclusive (which corresponds to
// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
// Non-negative fractions of a second at nanosecond resolution. This field is
diff --git a/vendor/k8s.io/client-go/tools/cache/fake_custom_store.go b/vendor/k8s.io/client-go/tools/cache/fake_custom_store.go
index 462d22660c..e6456f7c9d 100644
--- a/vendor/k8s.io/client-go/tools/cache/fake_custom_store.go
+++ b/vendor/k8s.io/client-go/tools/cache/fake_custom_store.go
@@ -18,17 +18,21 @@ package cache
// FakeCustomStore lets you define custom functions for store operations.
type FakeCustomStore struct {
- AddFunc func(obj interface{}) error
- UpdateFunc func(obj interface{}) error
- DeleteFunc func(obj interface{}) error
- ListFunc func() []interface{}
- ListKeysFunc func() []string
- GetFunc func(obj interface{}) (item interface{}, exists bool, err error)
- GetByKeyFunc func(key string) (item interface{}, exists bool, err error)
- ReplaceFunc func(list []interface{}, resourceVersion string) error
- ResyncFunc func() error
+ AddFunc func(obj interface{}) error
+ UpdateFunc func(obj interface{}) error
+ DeleteFunc func(obj interface{}) error
+ ListFunc func() []interface{}
+ ListKeysFunc func() []string
+ GetFunc func(obj interface{}) (item interface{}, exists bool, err error)
+ GetByKeyFunc func(key string) (item interface{}, exists bool, err error)
+ ReplaceFunc func(list []interface{}, resourceVersion string) error
+ ResyncFunc func() error
+ BookmarkFunc func(rv string)
+ LastStoreSyncResourceVersionFunc func() string
}
+var _ Store = &FakeCustomStore{}
+
// Add calls the custom Add function if defined
func (f *FakeCustomStore) Add(obj interface{}) error {
if f.AddFunc != nil {
@@ -100,3 +104,18 @@ func (f *FakeCustomStore) Resync() error {
}
return nil
}
+
+// Bookmark calls the custom Bookmark function if defined
+func (f *FakeCustomStore) Bookmark(rv string) {
+ if f.BookmarkFunc != nil {
+ f.BookmarkFunc(rv)
+ }
+}
+
+// LastStoreSyncResourceVersion calls the custom LastStoreSyncResourceVersion function if defined
+func (f *FakeCustomStore) LastStoreSyncResourceVersion() string {
+ if f.LastStoreSyncResourceVersionFunc != nil {
+ return f.LastStoreSyncResourceVersionFunc()
+ }
+ return ""
+}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index f7a6f65804..391c4197df 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -42,12 +42,12 @@ cloud.google.com/go/auth/oauth2adapt
# cloud.google.com/go/compute/metadata v0.9.0
## explicit; go 1.24.0
cloud.google.com/go/compute/metadata
-# cloud.google.com/go/firestore v1.21.0
-## explicit; go 1.24.0
+# cloud.google.com/go/firestore v1.22.0
+## explicit; go 1.25.0
cloud.google.com/go/firestore/apiv1
cloud.google.com/go/firestore/apiv1/firestorepb
cloud.google.com/go/firestore/internal
-# cloud.google.com/go/iam v1.11.0
+# cloud.google.com/go/iam v1.13.0
## explicit; go 1.25.0
cloud.google.com/go/iam
cloud.google.com/go/iam/apiv1/iampb
@@ -62,7 +62,7 @@ cloud.google.com/go/longrunning
cloud.google.com/go/longrunning/autogen
cloud.google.com/go/longrunning/autogen/longrunningpb
cloud.google.com/go/longrunning/internal
-# cloud.google.com/go/monitoring v1.25.0
+# cloud.google.com/go/monitoring v1.29.0
## explicit; go 1.25.0
cloud.google.com/go/monitoring/apiv3/v2
cloud.google.com/go/monitoring/apiv3/v2/monitoringpb
@@ -127,10 +127,11 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime
github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming
github.com/Azure/azure-sdk-for-go/sdk/azcore/to
github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing
-# github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1
-## explicit; go 1.23.0
+# github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.0
+## explicit; go 1.25.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity
github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal
+github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/customtokenproxy
# github.com/Azure/azure-sdk-for-go/sdk/containers/azcontainerregistry v0.2.3
## explicit; go 1.23.0
github.com/Azure/azure-sdk-for-go/sdk/containers/azcontainerregistry
@@ -178,7 +179,7 @@ github.com/Azure/go-autorest/logger
# github.com/Azure/go-autorest/tracing v0.6.0
## explicit; go 1.12
github.com/Azure/go-autorest/tracing
-# github.com/AzureAD/microsoft-authentication-library-for-go v1.7.0
+# github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2
## explicit; go 1.18
github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache
github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential
@@ -244,6 +245,30 @@ github.com/Microsoft/go-winio/pkg/guid
## explicit; go 1.23.0
github.com/OpenPeeDeeP/depguard/v2
github.com/OpenPeeDeeP/depguard/v2/internal/utils
+# github.com/ProtonMail/go-crypto v1.4.1
+## explicit; go 1.23.0
+github.com/ProtonMail/go-crypto/bitcurves
+github.com/ProtonMail/go-crypto/brainpool
+github.com/ProtonMail/go-crypto/eax
+github.com/ProtonMail/go-crypto/internal/byteutil
+github.com/ProtonMail/go-crypto/ocb
+github.com/ProtonMail/go-crypto/openpgp
+github.com/ProtonMail/go-crypto/openpgp/aes/keywrap
+github.com/ProtonMail/go-crypto/openpgp/armor
+github.com/ProtonMail/go-crypto/openpgp/ecdh
+github.com/ProtonMail/go-crypto/openpgp/ecdsa
+github.com/ProtonMail/go-crypto/openpgp/ed25519
+github.com/ProtonMail/go-crypto/openpgp/ed448
+github.com/ProtonMail/go-crypto/openpgp/eddsa
+github.com/ProtonMail/go-crypto/openpgp/elgamal
+github.com/ProtonMail/go-crypto/openpgp/errors
+github.com/ProtonMail/go-crypto/openpgp/internal/algorithm
+github.com/ProtonMail/go-crypto/openpgp/internal/ecc
+github.com/ProtonMail/go-crypto/openpgp/internal/encoding
+github.com/ProtonMail/go-crypto/openpgp/packet
+github.com/ProtonMail/go-crypto/openpgp/s2k
+github.com/ProtonMail/go-crypto/openpgp/x25519
+github.com/ProtonMail/go-crypto/openpgp/x448
# github.com/ThalesIgnite/crypto11 v1.2.5
## explicit; go 1.13
github.com/ThalesIgnite/crypto11
@@ -357,11 +382,11 @@ github.com/aws/aws-sdk-go-v2/credentials/logincreds
github.com/aws/aws-sdk-go-v2/credentials/processcreds
github.com/aws/aws-sdk-go-v2/credentials/ssocreds
github.com/aws/aws-sdk-go-v2/credentials/stscreds
-# github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.20.26
-## explicit; go 1.23
+# github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.20.35
+## explicit; go 1.24
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue
-# github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.8.26
-## explicit; go 1.23
+# github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression v1.8.35
+## explicit; go 1.24
github.com/aws/aws-sdk-go-v2/feature/dynamodb/expression
# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.31
## explicit; go 1.24
@@ -378,14 +403,14 @@ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2
github.com/aws/aws-sdk-go-v2/internal/v4a
github.com/aws/aws-sdk-go-v2/internal/v4a/internal/crypto
github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4
-# github.com/aws/aws-sdk-go-v2/service/dynamodb v1.53.2
-## explicit; go 1.23
+# github.com/aws/aws-sdk-go-v2/service/dynamodb v1.56.2
+## explicit; go 1.24
github.com/aws/aws-sdk-go-v2/service/dynamodb
github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/customizations
github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/endpoints
github.com/aws/aws-sdk-go-v2/service/dynamodb/types
-# github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.6
-## explicit; go 1.23
+# github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.32.13
+## explicit; go 1.24
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams/types
# github.com/aws/aws-sdk-go-v2/service/ecr v1.55.3
## explicit; go 1.23
@@ -400,13 +425,13 @@ github.com/aws/aws-sdk-go-v2/service/ecrpublic/types
# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.13
## explicit; go 1.24
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding
-# github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.14
-## explicit; go 1.23
+# github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.20
+## explicit; go 1.24
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery
# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.31
## explicit; go 1.24
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url
-# github.com/aws/aws-sdk-go-v2/service/kms v1.54.0
+# github.com/aws/aws-sdk-go-v2/service/kms v1.55.0
## explicit; go 1.24
github.com/aws/aws-sdk-go-v2/service/kms
github.com/aws/aws-sdk-go-v2/service/kms/internal/endpoints
@@ -474,9 +499,6 @@ github.com/beorn7/perks/quantile
# github.com/bkielbasa/cyclop v1.2.3
## explicit; go 1.22.0
github.com/bkielbasa/cyclop/pkg/analyzer
-# github.com/blang/semver v3.5.1+incompatible
-## explicit
-github.com/blang/semver
# github.com/blang/semver/v4 v4.0.0
## explicit; go 1.14
github.com/blang/semver/v4
@@ -587,6 +609,20 @@ github.com/cloudevents/sdk-go/v2/event/datacodec/xml
github.com/cloudevents/sdk-go/v2/protocol
github.com/cloudevents/sdk-go/v2/protocol/http
github.com/cloudevents/sdk-go/v2/types
+# github.com/cloudflare/circl v1.6.3
+## explicit; go 1.22.0
+github.com/cloudflare/circl/dh/x25519
+github.com/cloudflare/circl/dh/x448
+github.com/cloudflare/circl/ecc/goldilocks
+github.com/cloudflare/circl/internal/conv
+github.com/cloudflare/circl/internal/sha3
+github.com/cloudflare/circl/math
+github.com/cloudflare/circl/math/fp25519
+github.com/cloudflare/circl/math/fp448
+github.com/cloudflare/circl/math/mlsbset
+github.com/cloudflare/circl/sign
+github.com/cloudflare/circl/sign/ed25519
+github.com/cloudflare/circl/sign/ed448
# github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2
## explicit; go 1.24.6
github.com/cncf/xds/go/udpa/annotations
@@ -756,8 +792,8 @@ github.com/gaganhr94/docker-credential-acr/pkg/token
# github.com/ghostiam/protogetter v0.3.9
## explicit; go 1.22.0
github.com/ghostiam/protogetter
-# github.com/go-chi/chi/v5 v5.2.5
-## explicit; go 1.22
+# github.com/go-chi/chi/v5 v5.3.1
+## explicit; go 1.23
github.com/go-chi/chi/v5
github.com/go-chi/chi/v5/middleware
# github.com/go-critic/go-critic v0.12.0
@@ -784,7 +820,7 @@ github.com/go-logr/stdr
# github.com/go-logr/zapr v1.3.0
## explicit; go 1.18
github.com/go-logr/zapr
-# github.com/go-openapi/analysis v0.25.2
+# github.com/go-openapi/analysis v0.26.0
## explicit; go 1.25.0
github.com/go-openapi/analysis
github.com/go-openapi/analysis/internal/debug
@@ -796,17 +832,18 @@ github.com/go-openapi/analysis/internal/flatten/sortref
# github.com/go-openapi/errors v0.22.8
## explicit; go 1.25.0
github.com/go-openapi/errors
-# github.com/go-openapi/jsonpointer v0.23.1
+# github.com/go-openapi/jsonpointer v1.0.0
## explicit; go 1.25.0
github.com/go-openapi/jsonpointer
-# github.com/go-openapi/jsonreference v0.21.6
+github.com/go-openapi/jsonpointer/jsonname
+# github.com/go-openapi/jsonreference v1.0.0
## explicit; go 1.25.0
github.com/go-openapi/jsonreference
github.com/go-openapi/jsonreference/internal
-# github.com/go-openapi/loads v0.24.0
+# github.com/go-openapi/loads v0.25.1
## explicit; go 1.25.0
github.com/go-openapi/loads
-# github.com/go-openapi/runtime v0.32.4
+# github.com/go-openapi/runtime v0.32.5
## explicit; go 1.25.0
github.com/go-openapi/runtime
github.com/go-openapi/runtime/client
@@ -823,53 +860,57 @@ github.com/go-openapi/runtime/server-middleware/docui
github.com/go-openapi/runtime/server-middleware/mediatype
github.com/go-openapi/runtime/server-middleware/negotiate
github.com/go-openapi/runtime/server-middleware/negotiate/header
-# github.com/go-openapi/spec v0.22.6
+# github.com/go-openapi/spec v0.22.9
## explicit; go 1.25.0
github.com/go-openapi/spec
-# github.com/go-openapi/strfmt v0.26.4
+# github.com/go-openapi/strfmt v0.27.0
## explicit; go 1.25.0
github.com/go-openapi/strfmt
github.com/go-openapi/strfmt/internal/bsonlite
+github.com/go-openapi/strfmt/internal/countries
# github.com/go-openapi/swag v0.26.1
## explicit; go 1.25.0
github.com/go-openapi/swag
# github.com/go-openapi/swag/cmdutils v0.26.1
## explicit; go 1.25.0
github.com/go-openapi/swag/cmdutils
-# github.com/go-openapi/swag/conv v0.26.1
+# github.com/go-openapi/swag/conv v0.28.0
## explicit; go 1.25.0
github.com/go-openapi/swag/conv
-# github.com/go-openapi/swag/fileutils v0.26.1
+# github.com/go-openapi/swag/fileutils v0.28.0
## explicit; go 1.25.0
github.com/go-openapi/swag/fileutils
# github.com/go-openapi/swag/jsonname v0.26.1
## explicit; go 1.25.0
github.com/go-openapi/swag/jsonname
-# github.com/go-openapi/swag/jsonutils v0.26.1
+# github.com/go-openapi/swag/jsonutils v0.28.0
## explicit; go 1.25.0
github.com/go-openapi/swag/jsonutils
github.com/go-openapi/swag/jsonutils/adapters
github.com/go-openapi/swag/jsonutils/adapters/ifaces
github.com/go-openapi/swag/jsonutils/adapters/stdlib/json
-# github.com/go-openapi/swag/loading v0.26.1
+# github.com/go-openapi/swag/loading v0.28.0
## explicit; go 1.25.0
github.com/go-openapi/swag/loading
-# github.com/go-openapi/swag/mangling v0.26.1
+# github.com/go-openapi/swag/mangling v0.28.0
## explicit; go 1.25.0
github.com/go-openapi/swag/mangling
# github.com/go-openapi/swag/netutils v0.26.1
## explicit; go 1.25.0
github.com/go-openapi/swag/netutils
-# github.com/go-openapi/swag/stringutils v0.26.1
+# github.com/go-openapi/swag/pools v0.28.0
+## explicit; go 1.25.0
+github.com/go-openapi/swag/pools
+# github.com/go-openapi/swag/stringutils v0.28.0
## explicit; go 1.25.0
github.com/go-openapi/swag/stringutils
-# github.com/go-openapi/swag/typeutils v0.26.1
+# github.com/go-openapi/swag/typeutils v0.28.0
## explicit; go 1.25.0
github.com/go-openapi/swag/typeutils
-# github.com/go-openapi/swag/yamlutils v0.26.1
+# github.com/go-openapi/swag/yamlutils v0.28.0
## explicit; go 1.25.0
github.com/go-openapi/swag/yamlutils
-# github.com/go-openapi/validate v0.26.0
+# github.com/go-openapi/validate v0.26.3
## explicit; go 1.25.0
github.com/go-openapi/validate
# github.com/go-toolsmith/astcast v1.1.0
@@ -1254,7 +1295,7 @@ github.com/google/uuid
# github.com/google/wire v0.7.0
## explicit; go 1.19
github.com/google/wire
-# github.com/googleapis/enterprise-certificate-proxy v0.3.17
+# github.com/googleapis/enterprise-certificate-proxy v0.3.18
## explicit; go 1.25.0
github.com/googleapis/enterprise-certificate-proxy/client
github.com/googleapis/enterprise-certificate-proxy/client/util
@@ -1545,7 +1586,7 @@ github.com/mgechev/revive/internal/ifelse
github.com/mgechev/revive/internal/typeparams
github.com/mgechev/revive/lint
github.com/mgechev/revive/rule
-# github.com/miekg/pkcs11 v1.1.1
+# github.com/miekg/pkcs11 v1.1.2
## explicit; go 1.12
github.com/miekg/pkcs11
# github.com/mitchellh/go-homedir v1.1.0
@@ -1684,8 +1725,8 @@ github.com/pmezard/go-difflib/difflib
# github.com/polyfloyd/go-errorlint v1.7.1
## explicit; go 1.22.0
github.com/polyfloyd/go-errorlint/errorlint
-# github.com/prometheus/client_golang v1.23.2
-## explicit; go 1.23.0
+# github.com/prometheus/client_golang v1.24.1
+## explicit; go 1.25.0
github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil
github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header
github.com/prometheus/client_golang/prometheus
@@ -1697,14 +1738,14 @@ github.com/prometheus/client_golang/prometheus/testutil/promlint/validations
# github.com/prometheus/client_model v0.6.2
## explicit; go 1.22.0
github.com/prometheus/client_model/go
-# github.com/prometheus/common v0.67.5
-## explicit; go 1.24.0
+# github.com/prometheus/common v0.70.1
+## explicit; go 1.25.0
github.com/prometheus/common/expfmt
github.com/prometheus/common/model
# github.com/prometheus/otlptranslator v1.0.0
## explicit; go 1.23.0
github.com/prometheus/otlptranslator
-# github.com/prometheus/procfs v0.20.1
+# github.com/prometheus/procfs v0.21.1
## explicit; go 1.25.0
github.com/prometheus/procfs
github.com/prometheus/procfs/internal/fs
@@ -1781,11 +1822,12 @@ github.com/sashamelentyev/interfacebloat/pkg/analyzer
## explicit; go 1.20
github.com/sashamelentyev/usestdlibvars/pkg/analyzer
github.com/sashamelentyev/usestdlibvars/pkg/analyzer/internal/mapping
-# github.com/sassoftware/relic v7.2.1+incompatible
-## explicit
-github.com/sassoftware/relic/lib/pkcs7
-github.com/sassoftware/relic/lib/x509tools
-# github.com/secure-systems-lab/go-securesystemslib v0.11.0
+# github.com/sassoftware/relic/v8 v8.2.0
+## explicit; go 1.22.0
+github.com/sassoftware/relic/v8/lib/pkcs7
+github.com/sassoftware/relic/v8/lib/x509tools
+github.com/sassoftware/relic/v8/signers/sigerrors
+# github.com/secure-systems-lab/go-securesystemslib v0.11.1
## explicit; go 1.25.0
github.com/secure-systems-lab/go-securesystemslib/cjson
github.com/secure-systems-lab/go-securesystemslib/dsse
@@ -1856,8 +1898,8 @@ github.com/sigstore/protobuf-specs/gen/pb-go/common/v1
github.com/sigstore/protobuf-specs/gen/pb-go/dsse
github.com/sigstore/protobuf-specs/gen/pb-go/rekor/v1
github.com/sigstore/protobuf-specs/gen/pb-go/trustroot/v1
-# github.com/sigstore/rekor v1.5.3
-## explicit; go 1.25.0
+# github.com/sigstore/rekor v1.5.4
+## explicit; go 1.25.11
github.com/sigstore/rekor/pkg/client
github.com/sigstore/rekor/pkg/generated/client
github.com/sigstore/rekor/pkg/generated/client/entries
@@ -2007,13 +2049,15 @@ github.com/ssgreg/nlreturn/v2/pkg/nlreturn
# github.com/stbenjam/no-sprintf-host-port v0.2.0
## explicit; go 1.18
github.com/stbenjam/no-sprintf-host-port/pkg/analyzer
-# github.com/stretchr/objx v0.5.2
+# github.com/stretchr/objx v0.5.3
## explicit; go 1.20
github.com/stretchr/objx
-# github.com/stretchr/testify v1.11.1
+# github.com/stretchr/testify v1.12.0
## explicit; go 1.17
github.com/stretchr/testify/assert
github.com/stretchr/testify/assert/yaml
+github.com/stretchr/testify/internal/difflib
+github.com/stretchr/testify/internal/spew
github.com/stretchr/testify/mock
# github.com/subosito/gotenv v1.6.0
## explicit; go 1.18
@@ -2458,8 +2502,8 @@ go.opentelemetry.io/proto/otlp/common/v1
go.opentelemetry.io/proto/otlp/metrics/v1
go.opentelemetry.io/proto/otlp/resource/v1
go.opentelemetry.io/proto/otlp/trace/v1
-# go.step.sm/crypto v0.77.7
-## explicit; go 1.25.0
+# go.step.sm/crypto v0.87.0
+## explicit; go 1.25.8
go.step.sm/crypto/fingerprint
go.step.sm/crypto/internal/bcrypt_pbkdf
go.step.sm/crypto/internal/emoji
@@ -2493,11 +2537,11 @@ go.uber.org/zap/zaptest
# go.yaml.in/yaml/v2 v2.4.4
## explicit; go 1.15
go.yaml.in/yaml/v2
-# go.yaml.in/yaml/v3 v3.0.4
+# go.yaml.in/yaml/v3 v3.0.5
## explicit; go 1.16
go.yaml.in/yaml/v3
-# gocloud.dev v0.45.0
-## explicit; go 1.24.0
+# gocloud.dev v0.46.0
+## explicit; go 1.25.0
gocloud.dev/aws
gocloud.dev/docstore
gocloud.dev/docstore/awsdynamodb/v2
@@ -2522,8 +2566,9 @@ gocloud.dev/docstore/mongodocstore
# gocloud.dev/pubsub/kafkapubsub v0.43.0
## explicit; go 1.24
gocloud.dev/pubsub/kafkapubsub
-# golang.org/x/crypto v0.54.0
+# golang.org/x/crypto v0.55.0
## explicit; go 1.25.0
+golang.org/x/crypto/argon2
golang.org/x/crypto/blake2b
golang.org/x/crypto/blowfish
golang.org/x/crypto/cast5
@@ -2551,11 +2596,11 @@ golang.org/x/crypto/pkcs12
golang.org/x/crypto/pkcs12/internal/rc2
golang.org/x/crypto/salsa20/salsa
golang.org/x/crypto/scrypt
+golang.org/x/crypto/sha3
golang.org/x/crypto/ssh
golang.org/x/crypto/ssh/agent
golang.org/x/crypto/ssh/internal/bcrypt_pbkdf
golang.org/x/crypto/ssh/knownhosts
-golang.org/x/crypto/ssh/terminal
# golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90
## explicit; go 1.25.0
golang.org/x/exp/maps
@@ -2613,8 +2658,9 @@ golang.org/x/sys/windows/registry
# golang.org/x/term v0.45.0
## explicit; go 1.25.0
golang.org/x/term
-# golang.org/x/text v0.40.0
+# golang.org/x/text v0.41.0
## explicit; go 1.25.0
+golang.org/x/text/currency
golang.org/x/text/encoding
golang.org/x/text/encoding/internal
golang.org/x/text/encoding/internal/identifier
@@ -2737,7 +2783,7 @@ golang.org/x/xerrors/internal
# gomodules.xyz/jsonpatch/v2 v2.5.0
## explicit; go 1.20
gomodules.xyz/jsonpatch/v2
-# google.golang.org/api v0.287.1
+# google.golang.org/api v0.290.0
## explicit; go 1.25.0
google.golang.org/api/googleapi
google.golang.org/api/googleapi/transport
@@ -2757,8 +2803,8 @@ google.golang.org/api/storage/v1
google.golang.org/api/transport
google.golang.org/api/transport/grpc
google.golang.org/api/transport/http
-# google.golang.org/genproto v0.0.0-20260406210006-6f92a3bedf2d
-## explicit; go 1.25.0
+# google.golang.org/genproto v0.0.0-20260622175928-b703f567277d
+## explicit; go 1.25.8
google.golang.org/genproto/googleapis/cloud/location
google.golang.org/genproto/googleapis/type/calendarperiod
google.golang.org/genproto/googleapis/type/date
@@ -2942,7 +2988,7 @@ google.golang.org/grpc/xds
google.golang.org/grpc/xds/bootstrap
google.golang.org/grpc/xds/csds
google.golang.org/grpc/xds/googledirectpath
-# google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af
+# google.golang.org/protobuf v1.36.12
## explicit; go 1.23
google.golang.org/protobuf/encoding/protodelim
google.golang.org/protobuf/encoding/protojson
@@ -3236,7 +3282,7 @@ honnef.co/go/tools/stylecheck/st1021
honnef.co/go/tools/stylecheck/st1022
honnef.co/go/tools/stylecheck/st1023
honnef.co/go/tools/unused
-# k8s.io/api v0.36.3
+# k8s.io/api v0.36.4
## explicit; go 1.26.0
k8s.io/api/admission/v1
k8s.io/api/admissionregistration/v1
@@ -3306,7 +3352,7 @@ k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset
k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme
k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1
k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1
-# k8s.io/apimachinery v0.36.3
+# k8s.io/apimachinery v0.36.4
## explicit; go 1.26.0
k8s.io/apimachinery/pkg/api/equality
k8s.io/apimachinery/pkg/api/errors
@@ -3367,7 +3413,7 @@ k8s.io/apimachinery/pkg/version
k8s.io/apimachinery/pkg/watch
k8s.io/apimachinery/third_party/forked/golang/json
k8s.io/apimachinery/third_party/forked/golang/reflect
-# k8s.io/client-go v0.36.3
+# k8s.io/client-go v0.36.4
## explicit; go 1.26.0
k8s.io/client-go/applyconfigurations
k8s.io/client-go/applyconfigurations/admissionregistration/v1
@@ -3695,7 +3741,7 @@ k8s.io/client-go/util/keyutil
k8s.io/client-go/util/retry
k8s.io/client-go/util/watchlist
k8s.io/client-go/util/workqueue
-# k8s.io/code-generator v0.36.3
+# k8s.io/code-generator v0.36.4
## explicit; go 1.26.0
k8s.io/code-generator/cmd/deepcopy-gen
k8s.io/code-generator/cmd/deepcopy-gen/args