From f2a6e96a29d68329fb00bef7af74c181a4508d41 Mon Sep 17 00:00:00 2001 From: qmuntal Date: Wed, 30 Mar 2022 14:48:15 +0200 Subject: [PATCH 1/4] Fix CI and run it on pull_request Signed-off-by: qmuntal --- .github/workflows/ci-go-cover.yml | 10 ++++++---- .github/workflows/ci.yml | 25 +++++++++++-------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci-go-cover.yml b/.github/workflows/ci-go-cover.yml index 980ed54..e7d32f6 100644 --- a/.github/workflows/ci-go-cover.yml +++ b/.github/workflows/ci-go-cover.yml @@ -15,7 +15,7 @@ # 2. Update README.md to use the new path to badge.svg because the path includes the workflow name. name: cover ≥89% -on: [push] +on: [push, pull_request] jobs: # Verify minimum coverage is reached using `go test -short -cover` on latest-ubuntu with default version of Go. @@ -25,9 +25,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 - - name: Install test cases - run: make install + uses: actions/checkout@v2 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: 1.18.x - name: Go Coverage run: | go version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 168fbe3..31c3e1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,25 +1,22 @@ # GitHub Actions - CI for Go to build & test. See ci-go-cover.yml and linters.yml for code coverage and linters. # Taken from: https://github.com/fxamacker/cbor/workflows/ci.yml (thanks!) name: ci -on: [push] +on: [push, pull_request] jobs: # Test on various OS with default Go version. tests: - name: Test on ${{matrix.os}} + strategy: + fail-fast: false + matrix: + go-version: [1.17.x, 1.18.x] runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v1 + - name: Install Go + uses: actions/setup-go@v2 with: - fetch-depth: 1 - - name: Get dependencies - run: go get -v -t -d ./... - - name: Build project - run: go build . - - name: Install test cases - run: make install + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 - name: Run tests - run: | - go version - go test -short -race -v . + run: go test -race -v . From 08c0128de4f7b22574295189a6f1e22f3cf0b4dd Mon Sep 17 00:00:00 2001 From: qmuntal Date: Wed, 30 Mar 2022 14:48:53 +0200 Subject: [PATCH 2/4] remove unecessary files and tests Signed-off-by: qmuntal --- .circleci/config.yml | 88 ---- Makefile | 51 -- cbor_test.go | 55 +- fuzz.go | 10 - helpers_test.go | 832 ------------------------------ sign_verify_cose_rust_cli_test.go | 102 ---- sign_verify_test.go | 39 +- 7 files changed, 53 insertions(+), 1124 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 Makefile delete mode 100644 fuzz.go delete mode 100644 helpers_test.go delete mode 100644 sign_verify_cose_rust_cli_test.go diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index e76502f..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,88 +0,0 @@ -version: 2 -jobs: - "golang-1.14": - docker: - - image: circleci/golang:1.14 - working_directory: /go/src/go.mozilla.org/cose/ - environment: - - GO111MODULE: "on" # yaml sees an unquoted on value as "true" but go checks for "on" - steps: - - checkout - - run: - name: install rust and cargo - command: | - sudo apt-get install libnss3-dev - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable - source $HOME/.cargo/env - echo $PATH - which cargo - - run: - name: print rust and cargo version information - command: | - source $HOME/.cargo/env - rustc --version - cargo --version - - run: - name: run tests - command: | - source $HOME/.cargo/env - make ci - "golang-1.15": - docker: - - image: circleci/golang:1.15 - working_directory: /go/src/go.mozilla.org/cose/ - environment: - - GO111MODULE: "on" # yaml sees an unquoted on value as "true" but go checks for "on" - steps: - - checkout - - run: - name: install rust and cargo - command: | - sudo apt-get install libnss3-dev - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable - source $HOME/.cargo/env - echo $PATH - which cargo - - run: - name: print rust and cargo version information - command: | - source $HOME/.cargo/env - rustc --version - cargo --version - - run: - name: run tests - command: | - source $HOME/.cargo/env - make ci - "lint": - docker: - - image: circleci/golang:1.15 - working_directory: /go/src/go.mozilla.org/cose/ - environment: - - GO111MODULE: "on" # yaml sees an unquoted on value as "true" but go checks for "on" - steps: - - checkout - - run: - name: install golangci-lint - command: | - GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.26.0 - - run: - name: print debugging info about go env - command: go env GOPATH - - run: - name: print debugging info about golangci-lint - command: which golangci-lint - - run: - name: Run required linters in .golangci.yml plus hard-coded ones here - command: $(go env GOPATH)/bin/golangci-lint run --timeout=3m - - run: - name: Run optional linters (not required to pass) - command : $(go env GOPATH)/bin/golangci-lint run --timeout=3m --issues-exit-code=0 -E dupl -E gocritic -E gosimple -E lll -E prealloc - -workflows: - version: 2 - build: - jobs: - - "lint" - - "golang-1.14" - - "golang-1.15" diff --git a/Makefile b/Makefile deleted file mode 100644 index 8ab16fe..0000000 --- a/Makefile +++ /dev/null @@ -1,51 +0,0 @@ - -install: - # dev requirements - go get -u github.com/stretchr/testify/assert - - mkdir -p test - cd test && git clone https://github.com/cose-wg/Examples.git cose-wg-examples || true - cd test && git clone https://github.com/g-k/cose-rust.git || true - cd test/cose-rust && git checkout test-verify-cli - - -install-go-fuzz: - # dev requirement - go get -u github.com/dvyukov/go-fuzz/... - -# sample generated with: -# for file in $(find . -name *.json); do jq '.output.cbor' < $file | tr -d \" | base64 --decode > $(echo $file | sed s/..// | tr '/' '_').cose; done -fuzz: install-go-fuzz - mkdir -p workdir/corpus - cp samples/*.cose workdir/corpus - go-fuzz-build github.com/veraison/go-cose - go-fuzz -bin=./cose-fuzz.zip -workdir=workdir - -lint: - golint - -vet: - go vet - -coverage: - go test -v -cover -race -coverprofile=coverage.out && go tool cover -html=coverage.out - -what-todo: - rg -g '**/*.go' -i TODO - -install-golint: - go get -u golang.org/x/lint/golint - -goveralls: - go get -u github.com/mattn/goveralls - -smoketest-examples: - go run example/sign.go - go run example/verify.go - go run example/sign1.go - -ci: install-golint goveralls install coverage lint vet - goveralls -coverprofile=coverage.out -service=circle-ci -repotoken=$(COVERALLS_TOKEN) - -.PHONY: licenses -licenses: ; @./scripts/licenses.sh diff --git a/cbor_test.go b/cbor_test.go index 5183c39..9ab7379 100644 --- a/cbor_test.go +++ b/cbor_test.go @@ -1,6 +1,7 @@ package cose import ( + "encoding/hex" "errors" "fmt" @@ -301,7 +302,7 @@ func TestCBORDecodeNilSignMessagePayload(t *testing.T) { msg.Payload = nil // tag(98) + array(4) [ bytes(0), map(0), nil/null, array(0) ] - b := HexToBytesOrDie("D862" + "84" + "40" + "A0" + "F6" + "80") + b := hexToBytesOrDie("D862" + "84" + "40" + "A0" + "F6" + "80") result, err := Unmarshal(b) assert.Nil(err) @@ -332,7 +333,7 @@ func TestCBORDecodingDuplicateKeys(t *testing.T) { // 29 # negative(10) // // and decodes to map[1:-10] so last/rightmost value wins - HexToBytesOrDie("D862" + "84" + "45A201260129" + "A0" + "40" + "80"), + hexToBytesOrDie("D862" + "84" + "45A201260129" + "A0" + "40" + "80"), SignMessage{ Headers: &Headers{ Protected: map[interface{}]interface{}{1: -10}, @@ -353,7 +354,7 @@ func TestCBORDecodingDuplicateKeys(t *testing.T) { // 29 # negative(10) // // and decodes to map[1:-10] so last/rightmost value wins - HexToBytesOrDie("D862" + "84" + "40" + "A201260129" + "40" + "80"), + hexToBytesOrDie("D862" + "84" + "40" + "A201260129" + "40" + "80"), SignMessage{ Headers: &Headers{ Protected: map[interface{}]interface{}{}, @@ -368,7 +369,7 @@ func TestCBORDecodingDuplicateKeys(t *testing.T) { // tag(98) + array(4) [ bytes(21), map(0), bytes(0), array(0) ] // // see next test for what bytes(21) represents - HexToBytesOrDie("D862" + "84" + "55" + "A2" + "63" + "616C67" + "65" + "4553323536" + "63" + "616C67" + "65" + "5053323536" + "A0" + "40" + "80"), + hexToBytesOrDie("D862" + "84" + "55" + "A2" + "63" + "616C67" + "65" + "4553323536" + "63" + "616C67" + "65" + "5053323536" + "A0" + "40" + "80"), SignMessage{ Headers: &Headers{ Protected: map[interface{}]interface{}{ @@ -396,7 +397,7 @@ func TestCBORDecodingDuplicateKeys(t *testing.T) { // 65 # text(5) // 5053323536 # "PS256" // - HexToBytesOrDie("D862" + "84" + "40" + "A2" + "63" + "616C67" + "65" + "4553323536" + "63" + "616C67" + "65" + "5053323536" + "40" + "80"), + hexToBytesOrDie("D862" + "84" + "40" + "A2" + "63" + "616C67" + "65" + "4553323536" + "63" + "616C67" + "65" + "5053323536" + "40" + "80"), SignMessage{ Headers: &Headers{ Protected: map[interface{}]interface{}{}, @@ -426,39 +427,39 @@ func TestCBORDecodingErrors(t *testing.T) { } var cases = []DecodeErrorTestCase{ { - HexToBytesOrDie("D862" + "60"), // tag(98) + text(0) + hexToBytesOrDie("D862" + "60"), // tag(98) + text(0) "cbor: cannot unmarshal UTF-8 text string into Go value of type cose.signMessage", }, { - HexToBytesOrDie("D862" + "80"), // tag(98) + array(0) + hexToBytesOrDie("D862" + "80"), // tag(98) + array(0) "cbor: cannot unmarshal array into Go value of type cose.signMessage (cannot decode CBOR array to struct with different number of elements)", }, { // tag(98) + array(4) [ 4 * text(0) ] - HexToBytesOrDie("D862" + "84" + "60" + "60" + "60" + "60"), + hexToBytesOrDie("D862" + "84" + "60" + "60" + "60" + "60"), "cbor: cannot unmarshal UTF-8 text string into Go struct field cose.signMessage.Protected of type []uint8", }, { // tag(98) + array(4) [ bytes(0), map(0), 2 * text(0) ] - HexToBytesOrDie("D862" + "84" + "40" + "A0" + "60" + "60"), + hexToBytesOrDie("D862" + "84" + "40" + "A0" + "60" + "60"), "cbor: cannot unmarshal UTF-8 text string into Go struct field cose.signMessage.Payload of type []uint8", }, { // tag(98) + array(4) [ bytes(0), map(0), bytes(0), text(0) ] - HexToBytesOrDie("D862" + "84" + "40" + "A0" + "40" + "60"), + hexToBytesOrDie("D862" + "84" + "40" + "A0" + "40" + "60"), "cbor: cannot unmarshal UTF-8 text string into Go struct field cose.signMessage.Signatures of type []cose.signature", }, { // wrong # of protected header bytes // tag(98) + array(4) [ bytes(2) (but actually 1), map(0), bytes(0), text(0) ] - HexToBytesOrDie("D862" + "84" + "4263" + "A0" + "40" + "60"), + hexToBytesOrDie("D862" + "84" + "4263" + "A0" + "40" + "60"), "unexpected EOF", }, { // protected header is serialized array // tag(98) + array(4) [ bytes(3), map(2), bytes(0), array(0) ] // protected header is bytes(3) is [2, -7] - HexToBytesOrDie("D862" + "84" + "43820226" + "A10224" + "40" + "80"), + hexToBytesOrDie("D862" + "84" + "43820226" + "A10224" + "40" + "80"), "cbor: error casting protected to map; got []interface {}", }, { @@ -466,7 +467,7 @@ func TestCBORDecodingErrors(t *testing.T) { // tag(98) + array(4) [ bytes(3), map(2), bytes(0), array(0) ] // bytes(3) is protected {2: -7} // map(1) is {2: -5} - HexToBytesOrDie("D862" + "84" + "43A10226" + "A10224" + "40" + "80"), + hexToBytesOrDie("D862" + "84" + "43A10226" + "A10224" + "40" + "80"), "cbor: Duplicate header 2 found", }, { @@ -474,7 +475,7 @@ func TestCBORDecodingErrors(t *testing.T) { // tag(98) + array(4) [ bytes(11), map(1), bytes(0), array(0) ] // bytes(11) is protected {"alg": "ES256"} // map(1) is unprotected {"alg": "ES256"} - HexToBytesOrDie("D862" + "84" + "4B" + "A1" + "63" + "616C67" + "65" + "4553323536" + "A1" + "63" + "616C67" + "65" + "4553323536" + "40" + "80"), + hexToBytesOrDie("D862" + "84" + "4B" + "A1" + "63" + "616C67" + "65" + "4553323536" + "A1" + "63" + "616C67" + "65" + "4553323536" + "40" + "80"), "cbor: Duplicate header 1 found", }, { @@ -482,7 +483,7 @@ func TestCBORDecodingErrors(t *testing.T) { // tag(98) + array(4) [ bytes(3), map(1), bytes(0), array(0) ] // bytes(3) is protected {1: -7} // map(1) is unprotected {"alg": "PS256"} - HexToBytesOrDie("D862" + "84" + "43" + "A10126" + "A1" + "63" + "616C67" + "65" + "4553323536" + "40" + "80"), + hexToBytesOrDie("D862" + "84" + "43" + "A10126" + "A1" + "63" + "616C67" + "65" + "4553323536" + "40" + "80"), "cbor: Duplicate header 1 found", }, { @@ -490,7 +491,7 @@ func TestCBORDecodingErrors(t *testing.T) { // tag(98) + array(4) [ bytes(11), map(1), bytes(0), array(0) ] // bytes(11) is protected {"alg": "ES256"} // map(1) is unprotected {1: -7} - HexToBytesOrDie("D862" + "84" + "4B" + "A1" + "63" + "616C67" + "65" + "4553323536" + "A10126" + "40" + "80"), + hexToBytesOrDie("D862" + "84" + "4B" + "A1" + "63" + "616C67" + "65" + "4553323536" + "A10126" + "40" + "80"), "cbor: Duplicate header 1 found", }, { @@ -498,7 +499,7 @@ func TestCBORDecodingErrors(t *testing.T) { // tag(98) + array(4) [ bytes(0), map(0), bytes(0), array(1) ] // Signature is array(3) [ bytes(3), map(0), bytes(0)] // Signature protected header is bytes(3) is [2, -7] - HexToBytesOrDie("D862" + "84" + "40" + "A0" + "40" + "81" + "83" + "43820226" + "A0" + "40"), + hexToBytesOrDie("D862" + "84" + "40" + "A0" + "40" + "81" + "83" + "43820226" + "A0" + "40"), "cbor: error casting protected to map; got []interface {}", }, { @@ -507,7 +508,7 @@ func TestCBORDecodingErrors(t *testing.T) { // Signature is array(3) [ bytes(3), map(1), bytes(0)] // Signature bytes(3) is protected {2: -7} // Signature map(1) is {2: -5} - HexToBytesOrDie("D862" + "84" + "40" + "A0" + "40" + "81" + "83" + "43A10226" + "A10224" + "40"), + hexToBytesOrDie("D862" + "84" + "40" + "A0" + "40" + "81" + "83" + "43A10226" + "A10224" + "40"), "cbor: Duplicate header 2 found", }, { @@ -517,7 +518,7 @@ func TestCBORDecodingErrors(t *testing.T) { // Signature bytes(11) is protected {"alg": "ES256"} // Signature map(1) is unprotected {"alg": "ES256"} //HexToBytesOrDie("D862" + "84" + "4B" + "A1" + "63" + "616C67" + "65" + "4553323536" + "A1" + "63" + "616C67" + "65" + "4553323536" + "40" + "80"), - HexToBytesOrDie("D862" + "84" + "40" + "A0" + "40" + "81" + "83" + "4B" + "A1" + "63" + "616C67" + "65" + "4553323536" + "A1" + "63" + "616C67" + "65" + "4553323536" + "40"), + hexToBytesOrDie("D862" + "84" + "40" + "A0" + "40" + "81" + "83" + "4B" + "A1" + "63" + "616C67" + "65" + "4553323536" + "A1" + "63" + "616C67" + "65" + "4553323536" + "40"), "cbor: Duplicate header 1 found", }, { @@ -527,7 +528,7 @@ func TestCBORDecodingErrors(t *testing.T) { // Signature bytes(3) is protected {1: -7} // Signature map(1) is unprotected {"alg": "PS256"} //HexToBytesOrDie("D862" + "84" + "43" + "A10126" + "A1" + "63" + "616C67" + "65" + "4553323536" + "40" + "80"), - HexToBytesOrDie("D862" + "84" + "40" + "A0" + "40" + "81" + "83" + "43" + "A10126" + "A1" + "63" + "616C67" + "65" + "4553323536" + "40"), + hexToBytesOrDie("D862" + "84" + "40" + "A0" + "40" + "81" + "83" + "43" + "A10126" + "A1" + "63" + "616C67" + "65" + "4553323536" + "40"), "cbor: Duplicate header 1 found", }, { @@ -537,7 +538,7 @@ func TestCBORDecodingErrors(t *testing.T) { // Signature bytes(11) is protected {"alg": "ES256"} // Signature map(1) is unprotected {1: -7} //HexToBytesOrDie("D862" + "84" + "4B" + "A1" + "63" + "616C67" + "65" + "4553323536" + "A10126" + "40" + "80"), - HexToBytesOrDie("D862" + "84" + "40" + "A0" + "40" + "81" + "83" + "4B" + "A1" + "63" + "616C67" + "65" + "4553323536" + "A10126" + "40"), + hexToBytesOrDie("D862" + "84" + "40" + "A0" + "40" + "81" + "83" + "4B" + "A1" + "63" + "616C67" + "65" + "4553323536" + "A10126" + "40"), "cbor: Duplicate header 1 found", }, } @@ -562,12 +563,12 @@ func TestCBORDecodingToSignMessageErrors(t *testing.T) { var cases = []DecodeErrorTestCase{ { "missing tag number", - HexToBytesOrDie("8440A0F680"), // array(4) [ bytes(0), map(0), nil, array(0)] + hexToBytesOrDie("8440A0F680"), // array(4) [ bytes(0), map(0), nil, array(0)] "cbor: cannot unmarshal array into Go value of type cbor.RawTag", }, { "wrong tag number", - HexToBytesOrDie("D8638440A0F680"), // tag(99) + array(4) [ bytes(0), map(0), nil, array(0)] + hexToBytesOrDie("D8638440A0F680"), // tag(99) + array(4) [ bytes(0), map(0), nil, array(0)] "cbor: wrong tag number 99", }, } @@ -597,3 +598,11 @@ func TestUnmarshalToNilSignMessage(t *testing.T) { err := msg.UnmarshalCBOR(b) assert.Equal("cbor: UnmarshalCBOR on nil SignMessage pointer", err.Error()) } + +func hexToBytesOrDie(s string) []byte { + b, err := hex.DecodeString(s) + if err != nil { + panic(fmt.Sprintf("Error decoding hex string: %s", err)) + } + return b +} diff --git a/fuzz.go b/fuzz.go deleted file mode 100644 index 591f20c..0000000 --- a/fuzz.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build gofuzz - -package cose - -func Fuzz(data []byte) int { - if _, err := Unmarshal(data); err != nil { - return 0 - } - return 1 -} diff --git a/helpers_test.go b/helpers_test.go deleted file mode 100644 index fd2d557..0000000 --- a/helpers_test.go +++ /dev/null @@ -1,832 +0,0 @@ -package cose - -import ( - "encoding/hex" - "fmt" -) - -// consts and helper functions for loading tests -// does not contain tests - -// signing tests for Firefox Addon COSE Signatures -// -// see also: -// https://github.com/franziskuskiefer/cose-rust -// https://searchfox.org/mozilla-central/source/security/manager/ssl/tests/unit/test_signed_apps - -// consts from cose-rust/examples/sign_verify/test_setup.rs below -// -// processed with: -// s/#[cfg_attr(rustfmt, rustfmt_skip)]\n//g -// s/pub const/var/g -// \[u8; [0-9]+\] = \[ → = [...]byte{): -// 0x\([a-f0-9]+\)^J → 0x\1,^J -// s/];/}/g - -var PKCS8_P256_EE = [...]byte{ - 0x30, 0x81, 0x87, 0x02, 0x01, 0x00, 0x30, 0x13, 0x06, 0x07, 0x2a, - 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, - 0xce, 0x3d, 0x03, 0x01, 0x07, 0x04, 0x6d, 0x30, 0x6b, 0x02, 0x01, - 0x01, 0x04, 0x20, 0x21, 0x91, 0x40, 0x3d, 0x57, 0x10, 0xbf, 0x15, - 0xa2, 0x65, 0x81, 0x8c, 0xd4, 0x2e, 0xd6, 0xfe, 0xdf, 0x09, 0xad, - 0xd9, 0x2d, 0x78, 0xb1, 0x8e, 0x7a, 0x1e, 0x9f, 0xeb, 0x95, 0x52, - 0x47, 0x02, 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x4f, 0xbf, 0xbb, - 0xbb, 0x61, 0xe0, 0xf8, 0xf9, 0xb1, 0xa6, 0x0a, 0x59, 0xac, 0x87, - 0x04, 0xe2, 0xec, 0x05, 0x0b, 0x42, 0x3e, 0x3c, 0xf7, 0x2e, 0x92, - 0x3f, 0x2c, 0x4f, 0x79, 0x4b, 0x45, 0x5c, 0x2a, 0x69, 0xd2, 0x33, - 0x45, 0x6c, 0x36, 0xc4, 0x11, 0x9d, 0x07, 0x06, 0xe0, 0x0e, 0xed, - 0xc8, 0xd1, 0x93, 0x90, 0xd7, 0x99, 0x1b, 0x7b, 0x2d, 0x07, 0xa3, - 0x04, 0xea, 0xa0, 0x4a, 0xa6, 0xc0, 0x0a, -} - -var P256_EE = [...]byte{ - 0x30, 0x82, 0x01, 0x28, 0x30, 0x81, 0xcf, 0xa0, 0x03, 0x02, 0x01, 0x02, - 0x02, 0x14, 0x2f, 0xc3, 0x5f, 0x05, 0x80, 0xb4, 0x49, 0x45, 0x13, 0x92, - 0xd6, 0x93, 0xb7, 0x2d, 0x71, 0x19, 0xc5, 0x8c, 0x40, 0x39, 0x30, 0x0a, - 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x13, - 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x08, 0x69, - 0x6e, 0x74, 0x2d, 0x70, 0x32, 0x35, 0x36, 0x30, 0x22, 0x18, 0x0f, 0x32, - 0x30, 0x31, 0x32, 0x30, 0x31, 0x30, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x32, 0x31, 0x31, 0x32, 0x33, 0x31, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x12, 0x31, 0x10, 0x30, - 0x0e, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x07, 0x65, 0x65, 0x2d, 0x70, - 0x32, 0x35, 0x36, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, - 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, - 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x4f, 0xbf, 0xbb, 0xbb, 0x61, 0xe0, - 0xf8, 0xf9, 0xb1, 0xa6, 0x0a, 0x59, 0xac, 0x87, 0x04, 0xe2, 0xec, 0x05, - 0x0b, 0x42, 0x3e, 0x3c, 0xf7, 0x2e, 0x92, 0x3f, 0x2c, 0x4f, 0x79, 0x4b, - 0x45, 0x5c, 0x2a, 0x69, 0xd2, 0x33, 0x45, 0x6c, 0x36, 0xc4, 0x11, 0x9d, - 0x07, 0x06, 0xe0, 0x0e, 0xed, 0xc8, 0xd1, 0x93, 0x90, 0xd7, 0x99, 0x1b, - 0x7b, 0x2d, 0x07, 0xa3, 0x04, 0xea, 0xa0, 0x4a, 0xa6, 0xc0, 0x30, 0x0a, - 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, - 0x00, 0x30, 0x45, 0x02, 0x20, 0x5c, 0x75, 0x51, 0x9f, 0x13, 0x11, 0x50, - 0xcd, 0x5d, 0x8a, 0xde, 0x20, 0xa3, 0xbc, 0x06, 0x30, 0x91, 0xff, 0xb2, - 0x73, 0x75, 0x5f, 0x31, 0x64, 0xec, 0xfd, 0xcb, 0x42, 0x80, 0x0a, 0x70, - 0xe6, 0x02, 0x21, 0x00, 0xff, 0x81, 0xbe, 0xa8, 0x0d, 0x03, 0x36, 0x6b, - 0x75, 0xe2, 0x70, 0x6a, 0xac, 0x07, 0x2e, 0x4c, 0xdc, 0xf9, 0xc5, 0x89, - 0xc1, 0xcf, 0x88, 0xc2, 0xc8, 0x2a, 0x32, 0xf5, 0x42, 0x0c, 0xfa, 0x0b, -} - -var PKCS8_P384_EE = [...]byte{ - 0x30, 0x81, 0xb6, 0x02, 0x01, 0x00, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, - 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x22, - 0x04, 0x81, 0x9e, 0x30, 0x81, 0x9b, 0x02, 0x01, 0x01, 0x04, 0x30, 0x03, - 0x5c, 0x7a, 0x1b, 0x10, 0xd9, 0xfa, 0xfe, 0x83, 0x7b, 0x64, 0xad, 0x92, - 0xf2, 0x2f, 0x5c, 0xed, 0x07, 0x89, 0x18, 0x65, 0x38, 0x66, 0x9b, 0x5c, - 0x6d, 0x87, 0x2c, 0xec, 0x3d, 0x92, 0x61, 0x22, 0xb3, 0x93, 0x77, 0x2b, - 0x57, 0x60, 0x2f, 0xf3, 0x13, 0x65, 0xef, 0xe1, 0x39, 0x32, 0x46, 0xa1, - 0x64, 0x03, 0x62, 0x00, 0x04, 0xa1, 0x68, 0x72, 0x43, 0x36, 0x2b, 0x5c, - 0x7b, 0x18, 0x89, 0xf3, 0x79, 0x15, 0x46, 0x15, 0xa1, 0xc7, 0x3f, 0xb4, - 0x8d, 0xee, 0x86, 0x3e, 0x02, 0x29, 0x15, 0xdb, 0x60, 0x8e, 0x25, 0x2d, - 0xe4, 0xb7, 0x13, 0x2d, 0xa8, 0xce, 0x98, 0xe8, 0x31, 0x53, 0x4e, 0x6a, - 0x9c, 0x0c, 0x0b, 0x09, 0xc8, 0xd6, 0x39, 0xad, 0xe8, 0x32, 0x06, 0xe5, - 0xba, 0x81, 0x34, 0x73, 0xa1, 0x1f, 0xa3, 0x30, 0xe0, 0x5d, 0xa8, 0xc9, - 0x6e, 0x43, 0x83, 0xfe, 0x27, 0x87, 0x3d, 0xa9, 0x71, 0x03, 0xbe, 0x28, - 0x88, 0xcf, 0xf0, 0x02, 0xf0, 0x5a, 0xf7, 0x1a, 0x1f, 0xdd, 0xcc, 0x83, - 0x74, 0xaa, 0x6e, 0xa9, 0xce, -} - -var PKCS8_P521_EE = [...]byte{ - 0x30, 0x81, 0xed, 0x02, 0x01, 0x00, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, - 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x23, - 0x04, 0x81, 0xd5, 0x30, 0x81, 0xd2, 0x02, 0x01, 0x01, 0x04, 0x42, 0x01, - 0x4f, 0x32, 0x84, 0xfa, 0x69, 0x8d, 0xd9, 0xfe, 0x11, 0x18, 0xdd, 0x33, - 0x18, 0x51, 0xcd, 0xfa, 0xac, 0x5a, 0x38, 0x29, 0x27, 0x8e, 0xb8, 0x99, - 0x48, 0x39, 0xde, 0x94, 0x71, 0xc9, 0x40, 0xb8, 0x58, 0xc6, 0x9d, 0x2d, - 0x05, 0xe8, 0xc0, 0x17, 0x88, 0xa7, 0xd0, 0xb6, 0xe2, 0x35, 0xaa, 0x5e, - 0x78, 0x3f, 0xc1, 0xbe, 0xe8, 0x07, 0xdc, 0xc3, 0x86, 0x5f, 0x92, 0x0e, - 0x12, 0xcf, 0x8f, 0x2d, 0x29, 0xa1, 0x81, 0x88, 0x03, 0x81, 0x85, 0x00, - 0x04, 0x18, 0x94, 0x55, 0x0d, 0x07, 0x85, 0x93, 0x2e, 0x00, 0xea, 0xa2, - 0x3b, 0x69, 0x4f, 0x21, 0x3f, 0x8c, 0x31, 0x21, 0xf8, 0x6d, 0xc9, 0x7a, - 0x04, 0xe5, 0xa7, 0x16, 0x7d, 0xb4, 0xe5, 0xbc, 0xd3, 0x71, 0x12, 0x3d, - 0x46, 0xe4, 0x5d, 0xb6, 0xb5, 0xd5, 0x37, 0x0a, 0x7f, 0x20, 0xfb, 0x63, - 0x31, 0x55, 0xd3, 0x8f, 0xfa, 0x16, 0xd2, 0xbd, 0x76, 0x1d, 0xca, 0xc4, - 0x74, 0xb9, 0xa2, 0xf5, 0x02, 0x3a, 0x40, 0x49, 0x31, 0x01, 0xc9, 0x62, - 0xcd, 0x4d, 0x2f, 0xdd, 0xf7, 0x82, 0x28, 0x5e, 0x64, 0x58, 0x41, 0x39, - 0xc2, 0xf9, 0x1b, 0x47, 0xf8, 0x7f, 0xf8, 0x23, 0x54, 0xd6, 0x63, 0x0f, - 0x74, 0x6a, 0x28, 0xa0, 0xdb, 0x25, 0x74, 0x1b, 0x5b, 0x34, 0xa8, 0x28, - 0x00, 0x8b, 0x22, 0xac, 0xc2, 0x3f, 0x92, 0x4f, 0xaa, 0xfb, 0xd4, 0xd3, - 0x3f, 0x81, 0xea, 0x66, 0x95, 0x6d, 0xfe, 0xaa, 0x2b, 0xfd, 0xfc, 0xf5, -} - -var P521_EE = [...]byte{ - 0x30, 0x82, 0x01, 0x6b, 0x30, 0x82, 0x01, 0x12, 0xa0, 0x03, 0x02, 0x01, - 0x02, 0x02, 0x14, 0x49, 0xdb, 0x7d, 0xec, 0x87, 0x2b, 0x95, 0xfc, 0xfb, - 0x57, 0xfb, 0xc8, 0xd5, 0x57, 0xb7, 0x3a, 0x10, 0xcc, 0xf1, 0x7a, 0x30, - 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, - 0x13, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x08, - 0x69, 0x6e, 0x74, 0x2d, 0x70, 0x32, 0x35, 0x36, 0x30, 0x22, 0x18, 0x0f, - 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, 0x30, 0x33, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x32, 0x31, 0x31, 0x32, 0x33, - 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x12, 0x31, 0x10, - 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x07, 0x65, 0x65, 0x2d, - 0x70, 0x35, 0x32, 0x31, 0x30, 0x81, 0x9b, 0x30, 0x10, 0x06, 0x07, 0x2a, - 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, - 0x23, 0x03, 0x81, 0x86, 0x00, 0x04, 0x01, 0x4c, 0xdc, 0x9c, 0xac, 0xc4, - 0x79, 0x41, 0x09, 0x6b, 0xc9, 0xcc, 0x66, 0x75, 0x2e, 0xc2, 0x7f, 0x59, - 0x77, 0x34, 0xfa, 0x66, 0xc6, 0x2b, 0x79, 0x2f, 0x88, 0xc5, 0x19, 0xd6, - 0xd3, 0x7f, 0x0d, 0x16, 0xea, 0x1c, 0x48, 0x3a, 0x18, 0x27, 0xa0, 0x10, - 0xb9, 0x12, 0x8e, 0x3a, 0x08, 0x07, 0x0c, 0xa3, 0x3e, 0xf5, 0xf5, 0x78, - 0x35, 0xb7, 0xc1, 0xba, 0x25, 0x1f, 0x6c, 0xc3, 0x52, 0x1d, 0xc4, 0x2b, - 0x01, 0x06, 0x53, 0x45, 0x19, 0x81, 0xb4, 0x45, 0xd3, 0x43, 0xee, 0xd3, - 0x78, 0x2a, 0x35, 0xd6, 0xcf, 0xf0, 0xff, 0x48, 0x4f, 0x5a, 0x88, 0x3d, - 0x20, 0x9f, 0x1b, 0x90, 0x42, 0xb7, 0x26, 0x70, 0x35, 0x68, 0xb2, 0xf3, - 0x26, 0xe1, 0x8b, 0x83, 0x3b, 0xdd, 0x8a, 0xa0, 0x73, 0x43, 0x92, 0xbc, - 0xd1, 0x95, 0x01, 0xe1, 0x0d, 0x69, 0x8a, 0x79, 0xf5, 0x3e, 0x11, 0xe0, - 0xa2, 0x2b, 0xdd, 0x2a, 0xad, 0x90, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, - 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, - 0x20, 0x5c, 0x75, 0x51, 0x9f, 0x13, 0x11, 0x50, 0xcd, 0x5d, 0x8a, 0xde, - 0x20, 0xa3, 0xbc, 0x06, 0x30, 0x91, 0xff, 0xb2, 0x73, 0x75, 0x5f, 0x31, - 0x64, 0xec, 0xfd, 0xcb, 0x42, 0x80, 0x0a, 0x70, 0xe6, 0x02, 0x20, 0x35, - 0x20, 0x7c, 0xff, 0x51, 0xf6, 0x68, 0xce, 0x1d, 0x00, 0xf9, 0xcc, 0x7f, - 0xa7, 0xbc, 0x79, 0x52, 0xea, 0x56, 0xdf, 0xc1, 0x46, 0x7c, 0x0c, 0xa1, - 0x2e, 0x32, 0xb1, 0x69, 0x4b, 0x20, 0xc4, -} - -var P384_EE = [...]byte{ - 0x30, 0x82, 0x01, 0x45, 0x30, 0x81, 0xec, 0xa0, 0x03, 0x02, 0x01, 0x02, - 0x02, 0x14, 0x79, 0xe3, 0x1c, 0x60, 0x97, 0xa4, 0x3c, 0x3b, 0x82, 0x11, - 0x42, 0x37, 0xaf, 0x57, 0x05, 0xa8, 0xde, 0xd3, 0x40, 0x58, 0x30, 0x0a, - 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x13, - 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x08, 0x69, - 0x6e, 0x74, 0x2d, 0x70, 0x32, 0x35, 0x36, 0x30, 0x22, 0x18, 0x0f, 0x32, - 0x30, 0x31, 0x32, 0x30, 0x31, 0x30, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x32, 0x31, 0x31, 0x32, 0x33, 0x31, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x12, 0x31, 0x10, 0x30, - 0x0e, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x07, 0x65, 0x65, 0x2d, 0x70, - 0x33, 0x38, 0x34, 0x30, 0x76, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, - 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x22, 0x03, - 0x62, 0x00, 0x04, 0xa1, 0x68, 0x72, 0x43, 0x36, 0x2b, 0x5c, 0x7b, 0x18, - 0x89, 0xf3, 0x79, 0x15, 0x46, 0x15, 0xa1, 0xc7, 0x3f, 0xb4, 0x8d, 0xee, - 0x86, 0x3e, 0x02, 0x29, 0x15, 0xdb, 0x60, 0x8e, 0x25, 0x2d, 0xe4, 0xb7, - 0x13, 0x2d, 0xa8, 0xce, 0x98, 0xe8, 0x31, 0x53, 0x4e, 0x6a, 0x9c, 0x0c, - 0x0b, 0x09, 0xc8, 0xd6, 0x39, 0xad, 0xe8, 0x32, 0x06, 0xe5, 0xba, 0x81, - 0x34, 0x73, 0xa1, 0x1f, 0xa3, 0x30, 0xe0, 0x5d, 0xa8, 0xc9, 0x6e, 0x43, - 0x83, 0xfe, 0x27, 0x87, 0x3d, 0xa9, 0x71, 0x03, 0xbe, 0x28, 0x88, 0xcf, - 0xf0, 0x02, 0xf0, 0x5a, 0xf7, 0x1a, 0x1f, 0xdd, 0xcc, 0x83, 0x74, 0xaa, - 0x6e, 0xa9, 0xce, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, - 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x20, 0x5c, 0x75, - 0x51, 0x9f, 0x13, 0x11, 0x50, 0xcd, 0x5d, 0x8a, 0xde, 0x20, 0xa3, 0xbc, - 0x06, 0x30, 0x91, 0xff, 0xb2, 0x73, 0x75, 0x5f, 0x31, 0x64, 0xec, 0xfd, - 0xcb, 0x42, 0x80, 0x0a, 0x70, 0xe6, 0x02, 0x21, 0x00, 0xf3, 0x04, 0x26, - 0xf2, 0xfd, 0xbc, 0x89, 0x3f, 0x29, 0x3b, 0x70, 0xbc, 0x72, 0xa6, 0xc2, - 0x23, 0xcc, 0x43, 0x4d, 0x84, 0x71, 0xaf, 0x53, 0xe4, 0x4b, 0x3e, 0xc0, - 0xbf, 0xe5, 0x68, 0x86, 0x49, -} - -var P256_INT = [...]byte{ - 0x30, 0x82, 0x01, 0x48, 0x30, 0x81, 0xf0, 0xa0, 0x03, 0x02, 0x01, - 0x02, 0x02, 0x14, 0x43, 0x63, 0x59, 0xad, 0x04, 0x34, 0x56, 0x80, - 0x43, 0xec, 0x90, 0x6a, 0xd4, 0x10, 0x64, 0x7c, 0x7f, 0x38, 0x32, - 0xe2, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, - 0x03, 0x02, 0x30, 0x14, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, - 0x04, 0x03, 0x0c, 0x09, 0x72, 0x6f, 0x6f, 0x74, 0x2d, 0x70, 0x32, - 0x35, 0x36, 0x30, 0x22, 0x18, 0x0f, 0x32, 0x30, 0x31, 0x32, 0x30, - 0x31, 0x30, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x18, - 0x0f, 0x32, 0x30, 0x32, 0x31, 0x31, 0x32, 0x33, 0x31, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x13, 0x31, 0x11, 0x30, 0x0f, - 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x08, 0x69, 0x6e, 0x74, 0x2d, - 0x70, 0x32, 0x35, 0x36, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, - 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, - 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x4f, 0xbf, - 0xbb, 0xbb, 0x61, 0xe0, 0xf8, 0xf9, 0xb1, 0xa6, 0x0a, 0x59, 0xac, - 0x87, 0x04, 0xe2, 0xec, 0x05, 0x0b, 0x42, 0x3e, 0x3c, 0xf7, 0x2e, - 0x92, 0x3f, 0x2c, 0x4f, 0x79, 0x4b, 0x45, 0x5c, 0x2a, 0x69, 0xd2, - 0x33, 0x45, 0x6c, 0x36, 0xc4, 0x11, 0x9d, 0x07, 0x06, 0xe0, 0x0e, - 0xed, 0xc8, 0xd1, 0x93, 0x90, 0xd7, 0x99, 0x1b, 0x7b, 0x2d, 0x07, - 0xa3, 0x04, 0xea, 0xa0, 0x4a, 0xa6, 0xc0, 0xa3, 0x1d, 0x30, 0x1b, - 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, 0x30, 0x03, - 0x01, 0x01, 0xff, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, - 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, - 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, - 0x02, 0x20, 0x63, 0x59, 0x02, 0x01, 0x89, 0xd7, 0x3e, 0x5b, 0xff, - 0xd1, 0x16, 0x4e, 0xe3, 0xe2, 0x0a, 0xe0, 0x4a, 0xd8, 0x75, 0xaf, - 0x77, 0x5c, 0x93, 0x60, 0xba, 0x10, 0x1f, 0x97, 0xdd, 0x27, 0x2d, - 0x24, 0x02, 0x20, 0x3d, 0x87, 0x0f, 0xac, 0x22, 0x4d, 0x16, 0xd9, - 0xa1, 0x95, 0xbb, 0x56, 0xe0, 0x21, 0x05, 0x93, 0xd1, 0x07, 0xb5, - 0x25, 0x3b, 0xf4, 0x57, 0x20, 0x87, 0x13, 0xa2, 0xf7, 0x78, 0x15, - 0x30, 0xa7, -} - -var P256_ROOT = [...]byte{ - 0x30, 0x82, 0x01, 0x4a, 0x30, 0x81, 0xf1, 0xa0, 0x03, 0x02, 0x01, 0x02, - 0x02, 0x14, 0x5f, 0x3f, 0xae, 0x90, 0x49, 0x30, 0x2f, 0x33, 0x6e, 0x95, - 0x23, 0xa7, 0xcb, 0x23, 0xd7, 0x65, 0x4f, 0xea, 0x3c, 0xf7, 0x30, 0x0a, - 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x14, - 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x09, 0x72, - 0x6f, 0x6f, 0x74, 0x2d, 0x70, 0x32, 0x35, 0x36, 0x30, 0x22, 0x18, 0x0f, - 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, 0x30, 0x33, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x32, 0x31, 0x31, 0x32, 0x33, - 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x14, 0x31, 0x12, - 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x09, 0x72, 0x6f, 0x6f, - 0x74, 0x2d, 0x70, 0x32, 0x35, 0x36, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, - 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x4f, 0xbf, 0xbb, - 0xbb, 0x61, 0xe0, 0xf8, 0xf9, 0xb1, 0xa6, 0x0a, 0x59, 0xac, 0x87, 0x04, - 0xe2, 0xec, 0x05, 0x0b, 0x42, 0x3e, 0x3c, 0xf7, 0x2e, 0x92, 0x3f, 0x2c, - 0x4f, 0x79, 0x4b, 0x45, 0x5c, 0x2a, 0x69, 0xd2, 0x33, 0x45, 0x6c, 0x36, - 0xc4, 0x11, 0x9d, 0x07, 0x06, 0xe0, 0x0e, 0xed, 0xc8, 0xd1, 0x93, 0x90, - 0xd7, 0x99, 0x1b, 0x7b, 0x2d, 0x07, 0xa3, 0x04, 0xea, 0xa0, 0x4a, 0xa6, - 0xc0, 0xa3, 0x1d, 0x30, 0x1b, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, - 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0b, 0x06, 0x03, 0x55, - 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x0a, 0x06, 0x08, - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, - 0x45, 0x02, 0x20, 0x5c, 0x75, 0x51, 0x9f, 0x13, 0x11, 0x50, 0xcd, 0x5d, - 0x8a, 0xde, 0x20, 0xa3, 0xbc, 0x06, 0x30, 0x91, 0xff, 0xb2, 0x73, 0x75, - 0x5f, 0x31, 0x64, 0xec, 0xfd, 0xcb, 0x42, 0x80, 0x0a, 0x70, 0xe6, 0x02, - 0x21, 0x00, 0xc2, 0xe4, 0xc1, 0xa8, 0xe2, 0x89, 0xdc, 0xa1, 0xbb, 0xe7, - 0xd5, 0x4f, 0x5c, 0x88, 0xad, 0xeb, 0xa4, 0x78, 0xa1, 0x19, 0xbe, 0x22, - 0x54, 0xc8, 0x9f, 0xef, 0xb8, 0x5d, 0xa2, 0x40, 0xd9, 0x8b, -} - -var PKCS8_RSA_EE = [...]byte{ - 0x30, 0x82, 0x04, 0xbe, 0x02, 0x01, 0x00, 0x30, 0x0d, 0x06, 0x09, 0x2a, - 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x82, - 0x04, 0xa8, 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, - 0x01, 0x00, 0xba, 0x88, 0x51, 0x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xb4, 0xca, 0xf7, 0xfc, 0xad, 0x1d, - 0x25, 0xd3, 0x09, 0xef, 0xb9, 0x17, 0x0e, 0xa7, 0x68, 0xe1, 0xb3, 0x7b, - 0x2f, 0x22, 0x6f, 0x69, 0xe3, 0xb4, 0x8a, 0x95, 0x61, 0x1d, 0xee, 0x26, - 0xd6, 0x25, 0x9d, 0xab, 0x91, 0x08, 0x4e, 0x36, 0xcb, 0x1c, 0x24, 0x04, - 0x2c, 0xbf, 0x16, 0x8b, 0x2f, 0xe5, 0xf1, 0x8f, 0x99, 0x17, 0x31, 0xb8, - 0xb3, 0xfe, 0x49, 0x23, 0xfa, 0x72, 0x51, 0xc4, 0x31, 0xd5, 0x03, 0xac, - 0xda, 0x18, 0x0a, 0x35, 0xed, 0x8d, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, - 0x82, 0x01, 0x01, 0x00, 0x9e, 0xcb, 0xce, 0x38, 0x61, 0xa4, 0x54, 0xec, - 0xb1, 0xe0, 0xfe, 0x8f, 0x85, 0xdd, 0x43, 0xc9, 0x2f, 0x58, 0x25, 0xce, - 0x2e, 0x99, 0x78, 0x84, 0xd0, 0xe1, 0xa9, 0x49, 0xda, 0xa2, 0xc5, 0xac, - 0x55, 0x9b, 0x24, 0x04, 0x50, 0xe5, 0xac, 0x9f, 0xe0, 0xc3, 0xe3, 0x1c, - 0x0e, 0xef, 0xa6, 0x52, 0x5a, 0x65, 0xf0, 0xc2, 0x21, 0x94, 0x00, 0x4e, - 0xe1, 0xab, 0x46, 0x3d, 0xde, 0x9e, 0xe8, 0x22, 0x87, 0xcc, 0x93, 0xe7, - 0x46, 0xa9, 0x19, 0x29, 0xc5, 0xe6, 0xac, 0x3d, 0x88, 0x75, 0x3f, 0x6c, - 0x25, 0xba, 0x59, 0x79, 0xe7, 0x3e, 0x5d, 0x8f, 0xb2, 0x39, 0x11, 0x1a, - 0x3c, 0xda, 0xb8, 0xa4, 0xb0, 0xcd, 0xf5, 0xf9, 0xca, 0xb0, 0x5f, 0x12, - 0x33, 0xa3, 0x83, 0x35, 0xc6, 0x4b, 0x55, 0x60, 0x52, 0x5e, 0x7e, 0x3b, - 0x92, 0xad, 0x7c, 0x75, 0x04, 0xcf, 0x1d, 0xc7, 0xcb, 0x00, 0x57, 0x88, - 0xaf, 0xcb, 0xe1, 0xe8, 0xf9, 0x5d, 0xf7, 0x40, 0x2a, 0x15, 0x15, 0x30, - 0xd5, 0x80, 0x83, 0x46, 0x86, 0x4e, 0xb3, 0x70, 0xaa, 0x79, 0x95, 0x6a, - 0x58, 0x78, 0x62, 0xcb, 0x53, 0x37, 0x91, 0x30, 0x7f, 0x70, 0xd9, 0x1c, - 0x96, 0xd2, 0x2d, 0x00, 0x1a, 0x69, 0x00, 0x9b, 0x92, 0x3c, 0x68, 0x33, - 0x88, 0xc9, 0xf3, 0x6c, 0xb9, 0xb5, 0xeb, 0xe6, 0x43, 0x02, 0x04, 0x1c, - 0x78, 0xd9, 0x08, 0x20, 0x6b, 0x87, 0x00, 0x9c, 0xb8, 0xca, 0xba, 0xca, - 0xd3, 0xdb, 0xdb, 0x27, 0x92, 0xfb, 0x91, 0x1b, 0x2c, 0xf4, 0xdb, 0x66, - 0x03, 0x58, 0x5b, 0xe9, 0xae, 0x0c, 0xa3, 0xb8, 0xe6, 0x41, 0x7a, 0xa0, - 0x4b, 0x06, 0xe4, 0x70, 0xea, 0x1a, 0x3b, 0x58, 0x1c, 0xa0, 0x3a, 0x67, - 0x81, 0xc9, 0x31, 0x5b, 0x62, 0xb3, 0x0e, 0x60, 0x11, 0xf2, 0x24, 0x72, - 0x59, 0x46, 0xee, 0xc5, 0x7c, 0x6d, 0x94, 0x41, 0x02, 0x81, 0x81, 0x00, - 0xdd, 0x6e, 0x1d, 0x4f, 0xff, 0xeb, 0xf6, 0x8d, 0x88, 0x9c, 0x4d, 0x11, - 0x4c, 0xda, 0xaa, 0x9c, 0xaa, 0x63, 0xa5, 0x93, 0x74, 0x28, 0x6c, 0x8a, - 0x5c, 0x29, 0xa7, 0x17, 0xbb, 0xa6, 0x03, 0x75, 0x64, 0x4d, 0x5c, 0xaa, - 0x67, 0x4c, 0x4b, 0x8b, 0xc7, 0x32, 0x63, 0x58, 0x64, 0x62, 0x20, 0xe4, - 0x55, 0x0d, 0x76, 0x08, 0xac, 0x27, 0xd5, 0x5b, 0x6d, 0xb7, 0x4f, 0x8d, - 0x81, 0x27, 0xef, 0x8f, 0xa0, 0x90, 0x98, 0xb6, 0x91, 0x47, 0xde, 0x06, - 0x55, 0x73, 0x44, 0x7e, 0x18, 0x3d, 0x22, 0xfe, 0x7d, 0x88, 0x5a, 0xce, - 0xb5, 0x13, 0xd9, 0x58, 0x1d, 0xd5, 0xe0, 0x7c, 0x1a, 0x90, 0xf5, 0xce, - 0x08, 0x79, 0xde, 0x13, 0x13, 0x71, 0xec, 0xef, 0xc9, 0xce, 0x72, 0xe9, - 0xc4, 0x3d, 0xc1, 0x27, 0xd2, 0x38, 0x19, 0x0d, 0xe8, 0x11, 0x77, 0x3c, - 0xa5, 0xd1, 0x93, 0x01, 0xf4, 0x8c, 0x74, 0x2b, 0x02, 0x81, 0x81, 0x00, - 0xd7, 0xa7, 0x73, 0xd9, 0xeb, 0xc3, 0x80, 0xa7, 0x67, 0xd2, 0xfe, 0xc0, - 0x93, 0x4a, 0xd4, 0xe8, 0xb5, 0x66, 0x72, 0x40, 0x77, 0x1a, 0xcd, 0xeb, - 0xb5, 0xad, 0x79, 0x6f, 0x47, 0x8f, 0xec, 0x4d, 0x45, 0x98, 0x5e, 0xfb, - 0xc9, 0x53, 0x29, 0x68, 0x28, 0x9c, 0x8d, 0x89, 0x10, 0x2f, 0xad, 0xf2, - 0x1f, 0x34, 0xe2, 0xdd, 0x49, 0x40, 0xeb, 0xa8, 0xc0, 0x9d, 0x6d, 0x1f, - 0x16, 0xdc, 0xc2, 0x97, 0x29, 0x77, 0x4c, 0x43, 0x27, 0x5e, 0x92, 0x51, - 0xdd, 0xbe, 0x49, 0x09, 0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x21, 0x47, 0xa7, 0x1a, - 0x24, 0x6b, 0xfb, 0x05, 0x4e, 0xe7, 0x6a, 0xa3, 0x46, 0xab, 0xcd, 0x26, - 0x92, 0xcf, 0xc9, 0xe4, 0x4c, 0x51, 0xe6, 0xf0, 0x69, 0xc7, 0x35, 0xe0, - 0x73, 0xba, 0x01, 0x9f, 0x6a, 0x72, 0x14, 0x96, 0x1c, 0x91, 0xb2, 0x68, - 0x71, 0xca, 0xea, 0xbf, 0x8f, 0x06, 0x44, 0x18, 0xa0, 0x26, 0x90, 0xe3, - 0x9a, 0x8d, 0x5f, 0xf3, 0x06, 0x7b, 0x7c, 0xdb, 0x7f, 0x50, 0xb1, 0xf5, - 0x34, 0x18, 0xa7, 0x03, 0x96, 0x6c, 0x4f, 0xc7, 0x74, 0xbf, 0x74, 0x02, - 0xaf, 0x6c, 0x43, 0x24, 0x7f, 0x43, -} - -var RSA_EE = [...]byte{ - 0x30, 0x82, 0x02, 0xaf, 0x30, 0x82, 0x01, 0x99, 0xa0, 0x03, 0x02, 0x01, - 0x02, 0x02, 0x14, 0x07, 0x1c, 0x3b, 0x71, 0x08, 0xbe, 0xd7, 0x9f, 0xfd, - 0xaf, 0x26, 0xb6, 0x08, 0xa3, 0x99, 0x06, 0x77, 0x69, 0x32, 0x7e, 0x30, - 0x0b, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, - 0x30, 0x12, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, - 0x07, 0x69, 0x6e, 0x74, 0x2d, 0x72, 0x73, 0x61, 0x30, 0x22, 0x18, 0x0f, - 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, 0x30, 0x33, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x32, 0x31, 0x31, 0x32, 0x33, - 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x11, 0x31, 0x0f, - 0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x06, 0x65, 0x65, 0x2d, - 0x72, 0x73, 0x61, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, - 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, - 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, - 0xba, 0x88, 0x51, 0xa8, 0x44, 0x8e, 0x16, 0xd6, 0x41, 0xfd, 0x6e, 0xb6, - 0x88, 0x06, 0x36, 0x10, 0x3d, 0x3c, 0x13, 0xd9, 0xea, 0xe4, 0x35, 0x4a, - 0xb4, 0xec, 0xf5, 0x68, 0x57, 0x6c, 0x24, 0x7b, 0xc1, 0xc7, 0x25, 0xa8, - 0xe0, 0xd8, 0x1f, 0xbd, 0xb1, 0x9c, 0x06, 0x9b, 0x6e, 0x1a, 0x86, 0xf2, - 0x6b, 0xe2, 0xaf, 0x5a, 0x75, 0x6b, 0x6a, 0x64, 0x71, 0x08, 0x7a, 0xa5, - 0x5a, 0xa7, 0x45, 0x87, 0xf7, 0x1c, 0xd5, 0x24, 0x9c, 0x02, 0x7e, 0xcd, - 0x43, 0xfc, 0x1e, 0x69, 0xd0, 0x38, 0x20, 0x29, 0x93, 0xab, 0x20, 0xc3, - 0x49, 0xe4, 0xdb, 0xb9, 0x4c, 0xc2, 0x6b, 0x6c, 0x0e, 0xed, 0x15, 0x82, - 0x0f, 0xf1, 0x7e, 0xad, 0x69, 0x1a, 0xb1, 0xd3, 0x02, 0x3a, 0x8b, 0x2a, - 0x41, 0xee, 0xa7, 0x70, 0xe0, 0x0f, 0x0d, 0x8d, 0xfd, 0x66, 0x0b, 0x2b, - 0xb0, 0x24, 0x92, 0xa4, 0x7d, 0xb9, 0x88, 0x61, 0x79, 0x90, 0xb1, 0x57, - 0x90, 0x3d, 0xd2, 0x3b, 0xc5, 0xe0, 0xb8, 0x48, 0x1f, 0xa8, 0x37, 0xd3, - 0x88, 0x43, 0xef, 0x27, 0x16, 0xd8, 0x55, 0xb7, 0x66, 0x5a, 0xaa, 0x7e, - 0x02, 0x90, 0x2f, 0x3a, 0x7b, 0x10, 0x80, 0x06, 0x24, 0xcc, 0x1c, 0x6c, - 0x97, 0xad, 0x96, 0x61, 0x5b, 0xb7, 0xe2, 0x96, 0x12, 0xc0, 0x75, 0x31, - 0xa3, 0x0c, 0x91, 0xdd, 0xb4, 0xca, 0xf7, 0xfc, 0xad, 0x1d, 0x25, 0xd3, - 0x09, 0xef, 0xb9, 0x17, 0x0e, 0xa7, 0x68, 0xe1, 0xb3, 0x7b, 0x2f, 0x22, - 0x6f, 0x69, 0xe3, 0xb4, 0x8a, 0x95, 0x61, 0x1d, 0xee, 0x26, 0xd6, 0x25, - 0x9d, 0xab, 0x91, 0x08, 0x4e, 0x36, 0xcb, 0x1c, 0x24, 0x04, 0x2c, 0xbf, - 0x16, 0x8b, 0x2f, 0xe5, 0xf1, 0x8f, 0x99, 0x17, 0x31, 0xb8, 0xb3, 0xfe, - 0x49, 0x23, 0xfa, 0x72, 0x51, 0xc4, 0x31, 0xd5, 0x03, 0xac, 0xda, 0x18, - 0x0a, 0x35, 0xed, 0x8d, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0b, 0x06, - 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x03, 0x82, - 0x01, 0x01, 0x00, 0x44, 0x92, 0xbb, 0x8e, 0x83, 0x58, 0x56, 0x2e, 0x7a, - 0x86, 0xfa, 0x1d, 0x77, 0x50, 0x3f, 0x45, 0x8d, 0x90, 0xc4, 0x62, 0x27, - 0x21, 0x96, 0x5a, 0xef, 0x51, 0x78, 0xd7, 0x7d, 0x0d, 0x02, 0x2d, 0x5a, - 0x0e, 0x3c, 0x82, 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xeb, 0x0c, 0x46, 0xe5, 0xa0, 0x6b, 0xef, 0xd4, - 0x5e, 0xa4, 0x0f, 0x53, 0xe1, 0xbc, 0xb4, 0xc9, 0x37, 0x0e, 0x75, 0xdd, - 0x93, 0xe8, 0x0f, 0x18, 0x0a, 0x02, 0x83, 0x17, 0x74, 0xbb, 0x1a, 0x42, - 0x5b, 0x63, 0x2c, 0x80, 0x80, 0xa6, 0x84, -} - -var RSA_INT = [...]byte{ - 0x30, 0x82, 0x02, 0xd0, 0x30, 0x82, 0x01, 0xba, 0xa0, 0x03, 0x02, 0x01, - 0x02, 0x02, 0x14, 0x07, 0x10, 0xaf, 0xc4, 0x1a, 0x3a, 0x56, 0x4f, 0xd8, - 0xc2, 0xcc, 0x46, 0xd7, 0x5b, 0xdf, 0x1c, 0x4e, 0x2f, 0x49, 0x3a, 0x30, - 0x0b, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, - 0x30, 0x13, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, - 0x08, 0x72, 0x6f, 0x6f, 0x74, 0x2d, 0x72, 0x73, 0x61, 0x30, 0x22, 0x18, - 0x0f, 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, 0x30, 0x33, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x32, 0x31, 0x31, 0x32, - 0x33, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x12, 0x31, - 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x07, 0x69, 0x6e, - 0x74, 0x2d, 0x72, 0x73, 0x61, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, - 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, - 0x03, 0x82, 0x01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96, 0x61, 0x5b, 0xb7, 0xe2, 0x96, 0x12, 0xc0, - 0x75, 0x31, 0xa3, 0x0c, 0x91, 0xdd, 0xb4, 0xca, 0xf7, 0xfc, 0xad, 0x1d, - 0x25, 0xd3, 0x09, 0xef, 0xb9, 0x17, 0x0e, 0xa7, 0x68, 0xe1, 0xb3, 0x7b, - 0x2f, 0x22, 0x6f, 0x69, 0xe3, 0xb4, 0x8a, 0x95, 0x61, 0x1d, 0xee, 0x26, - 0xd6, 0x25, 0x9d, 0xab, 0x91, 0x08, 0x4e, 0x36, 0xcb, 0x1c, 0x24, 0x04, - 0x2c, 0xbf, 0x16, 0x8b, 0x2f, 0xe5, 0xf1, 0x8f, 0x99, 0x17, 0x31, 0xb8, - 0xb3, 0xfe, 0x49, 0x23, 0xfa, 0x72, 0x51, 0xc4, 0x31, 0xd5, 0x03, 0xac, - 0xda, 0x18, 0x0a, 0x35, 0xed, 0x8d, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, - 0x1d, 0x30, 0x1b, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, - 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, - 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x0b, 0x06, 0x09, 0x2a, 0x86, - 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x03, 0x82, 0x01, 0x01, 0x00, - 0x5e, 0xba, 0x69, 0x55, 0x9f, 0xf8, 0xeb, 0x16, 0x21, 0x98, 0xde, 0xb7, - 0x31, 0x3e, 0x66, 0xe1, 0x3b, 0x0c, 0x29, 0xf7, 0x48, 0x73, 0x05, 0xd9, - 0xce, 0x5e, 0x4c, 0xbe, 0x03, 0xc4, 0x51, 0xd6, 0x21, 0x92, 0x40, 0x38, - 0xaa, 0x5b, 0x28, 0xb5, 0xa1, 0x10, 0x52, 0x57, 0xff, 0x91, 0x54,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0x22, 0x2e, 0xb1, 0x82, 0x4c, 0xbf, 0x83, 0x3e, 0x49, 0x72, 0x03, - 0x2a, 0x68, 0xe7, 0x2d, 0xe5, 0x2d, 0x4b, 0x61, 0xb0, 0x8d, 0x0d, 0x0c, - 0x87, 0xc6, 0x5c, 0x51, -} - -var RSA_ROOT = [...]byte{ - 0x30, 0x82, 0x02, 0xd1, 0x30, 0x82, 0x01, 0xbb, 0xa0, 0x03, 0x02, 0x01, - 0x02, 0x02, 0x14, 0x29, 0x6c, 0x1a, 0xd8, 0x20, 0xcd, 0x74, 0x6d, 0x4b, - 0x00, 0xf3, 0x16, 0x88, 0xd9, 0x66, 0x87, 0x5f, 0x28, 0x56, 0x6a, 0x30, - 0x0b, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, - 0x30, 0x13, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, - 0x08, 0x72, 0x6f, 0x6f, 0x74, 0x2d, 0x72, 0x73, 0x61, 0x30, 0x22, 0x18, - 0x0f, 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, 0x30, 0x33, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x32, 0x31, 0x31, 0x32, - 0x33, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x13, 0x31, - 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x08, 0x72, 0x6f, - 0x6f, 0x74, 0x2d, 0x72, 0x73, 0x61, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, - 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, - 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, - 0x01, 0x01, 0x00, 0x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c, 0x91, 0xdd, 0xb4, 0xca, 0xf7, 0xfc, 0xad, - 0x1d, 0x25, 0xd3, 0x09, 0xef, 0xb9, 0x17, 0x0e, 0xa7, 0x68, 0xe1, 0xb3, - 0x7b, 0x2f, 0x22, 0x6f, 0x69, 0xe3, 0xb4, 0x8a, 0x95, 0x61, 0x1d, 0xee, - 0x26, 0xd6, 0x25, 0x9d, 0xab, 0x91, 0x08, 0x4e, 0x36, 0xcb, 0x1c, 0x24, - 0x04, 0x2c, 0xbf, 0x16, 0x8b, 0x2f, 0xe5, 0xf1, 0x8f, 0x99, 0x17, 0x31, - 0xb8, 0xb3, 0xfe, 0x49, 0x23, 0xfa, 0x72, 0x51, 0xc4, 0x31, 0xd5, 0x03, - 0xac, 0xda, 0x18, 0x0a, 0x35, 0xed, 0x8d, 0x02, 0x03, 0x01, 0x00, 0x01, - 0xa3, 0x1d, 0x30, 0x1b, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, - 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, - 0x0f, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x0b, 0x06, 0x09, 0x2a, - 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x03, 0x82, 0x01, 0x01, - 0x00, 0x23, 0x2f, 0x9f, 0x72, 0xeb, 0x70, 0x6d, 0x9e, 0x3e, 0x9f, 0xd7, - 0x9c, 0xd9, 0x19, 0x7c, 0x99, 0x07, 0xc5, 0x5c, 0x9d, 0xf5, 0x66, 0x9f, - 0x28, 0x8d, 0xfe, 0x0e, 0x3f, 0x38, 0x75, 0xed, 0xee, 0x4e, 0x3f, 0xf6, - 0x6e, 0x35, 0xe0, 0x95, 0x3f, 0x08, 0x4a, 0x71, 0x5a, 0xf2, 0x4f, 0xc9, - 0x96, 0x61, 0x8d, 0x45, 0x4b, 0x97, 0x85, 0xff, 0xb0, 0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0xf3, 0x23, 0x7e, 0x1c, - 0xab, 0xe2, 0xa2, 0xd1, 0x83, 0xc4, 0x25, 0x93, 0x37, 0x80, 0xca, 0xda, - 0xf0, 0xef, 0x7d, 0x94, 0xb5, -} - -var XPI_SIGNATURE = [...]byte{ - 0xd8, 0x62, 0x84, 0x43, 0xa1, 0x04, 0x80, 0xa0, 0xf6, 0x81, 0x83, 0x59, - 0x02, 0x35, 0xa2, 0x01, 0x26, 0x04, 0x59, 0x02, 0x2e, 0x30, 0x82, 0x02, - 0x2a, 0x30, 0x82, 0x01, 0x12, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, - 0x17, 0x03, 0x6b, 0xc1, 0xfe, 0xb4, 0x38, 0xe1, 0x83, 0x8f, 0xe5, 0xa7, - 0xca, 0xf1, 0x54, 0x32, 0x4c, 0x8b, 0xf3, 0x05, 0x30, 0x0d, 0x06, 0x09, - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, - 0x29, 0x31, 0x27, 0x30, 0x25, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x1e, - 0x78, 0x70, 0x63, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x20, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x20, 0x61, 0x70, 0x70, 0x73, 0x20, 0x74, 0x65, 0x73, - 0x74, 0x20, 0x72, 0x6f, 0x6f, 0x74, 0x30, 0x22, 0x18, 0x0f, 0x32, 0x30, - 0x31, 0x35, 0x31, 0x31, 0x32, 0x38, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x31, 0x38, 0x30, 0x32, 0x30, 0x35, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x2b, 0x31, 0x29, 0x30, 0x27, - 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x20, 0x20, 0x78, 0x70, 0x63, 0x73, - 0x68, 0x65, 0x6c, 0x6c, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, - 0x61, 0x70, 0x70, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x72, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, - 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, - 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x4f, 0xbf, 0xbb, 0xbb, 0x61, 0xe0, - 0xf8, 0xf9, 0xb1, 0xa6, 0x0a, 0x59, 0xac, 0x87, 0x04, 0xe2, 0xec, 0x05, - 0x0b, 0x42, 0x3e, 0x3c, 0xf7, 0x2e, 0x92, 0x3f, 0x2c, 0x4f, 0x79, 0x4b, - 0x45, 0x5c, 0x2a, 0x69, 0xd2, 0x33, 0x45, 0x6c, 0x36, 0xc4, 0x11, 0x9d, - 0x07, 0x06, 0xe0, 0x0e, 0xed, 0xc8, 0xd1, 0x93, 0x90, 0xd7, 0x99, 0x1b, - 0x7b, 0x2d, 0x07, 0xa3, 0x04, 0xea, 0xa0, 0x4a, 0xa6, 0xc0, 0xa3, 0x0f, - 0x30, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, - 0x02, 0x07, 0x80, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, - 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x4f, - 0x5c, 0xcb, 0x1d, 0xea, 0x71, 0x58, 0xfe, 0xe2, 0x49, 0x11, 0x16, 0x65, - 0xbc, 0x23, 0x6d, 0xda, 0x46, 0x7e, 0x98, 0x93, 0x5d, 0x48, 0x2a, 0xa0, - 0xbb, 0x7f, 0x4e, 0xbd, 0x01, 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76, 0x0a, 0x54, 0x7a, 0x05, - 0xd8, 0xa1, 0xcd, 0xe9, 0x07, 0x8a, 0x02, 0x07, 0x4b, 0x87, 0x7d, 0xb5, - 0x27, 0xca, 0x38, 0xb3, 0x30, 0xaf, 0x97, 0xe0, 0xb7, 0x35, 0x14, 0x08, - 0xab, 0x01, 0xb0, 0x14, 0x08, 0x5c, 0x4b, 0xfb, 0x76, 0x0a, 0x95, 0xfc, - 0xb4, 0xb8, 0x34, 0xa0, 0x58, 0x40, 0x5c, 0x75, 0x51, 0x9f, 0x13, 0x11, - 0x50, 0xcd, 0x5d, 0x8a, 0xde, 0x20, 0xa3, 0xbc, 0x06, 0x30, 0x91, 0xff, - 0xb2, 0x73, 0x75, 0x5f, 0x31, 0x64, 0xec, 0xfd, 0xcb, 0x42, 0x80, 0x0a, - 0x70, 0xe6, 0x82, 0x02, 0x0a, 0xe8, 0x69, 0x13, 0xd5, 0xf4, 0x1b, 0xab, - 0xb6, 0xbb, 0x59, 0x93, 0x08, 0x48, 0x68, 0x9c, 0xbd, 0x72, 0xc7, 0xcb, - 0x37, 0xde, 0x26, 0xbc, 0xe9, 0x83, 0x0e, 0xd8, 0x90, 0xa3, -} - -var XPI_PAYLOAD = [...]byte{ - 0x4E, 0x61, 0x6D, 0x65, 0x3A, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, 0x65, - 0x73, 0x74, 0x2E, 0x6A, 0x73, 0x6F, 0x6E, 0x0A, 0x53, 0x48, 0x41, 0x32, - 0x35, 0x36, 0x2D, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x3A, 0x20, 0x42, - 0x54, 0x6E, 0x43, 0x70, 0x54, 0x31, 0x35, 0x34, 0x4E, 0x32, 0x36, 0x52, - 0x5A, 0x6D, 0x38, 0x62, 0x68, 0x64, 0x44, 0x34, 0x33, 0x57, 0x58, 0x64, - 0x30, 0x74, 0x6A, 0x35, 0x62, 0x67, 0x36, 0x6F, 0x66, 0x4D, 0x31, 0x39, - 0x4E, 0x4C, 0x49, 0x30, 0x4F, 0x45, 0x3D, 0x0A, 0x0A, 0x4E, 0x61, 0x6D, - 0x65, 0x3A, 0x20, 0x52, 0x45, 0x41, 0x44, 0x4D, 0x45, 0x0A, 0x53, 0x48, - 0x41, 0x32, 0x35, 0x36, 0x2D, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x3A, - 0x20, 0x62, 0x59, 0x30, 0x6C, 0x39, 0x78, 0x71, 0x47, 0x4A, 0x59, 0x43, - 0x70, 0x71, 0x59, 0x65, 0x4A, 0x30, 0x4B, 0x36, 0x71, 0x34, 0x44, 0x57, - 0x55, 0x51, 0x71, 0x75, 0x30, 0x6D, 0x4E, 0x42, 0x46, 0x4D, 0x34, 0x48, - 0x34, 0x65, 0x6D, 0x68, 0x6A, 0x69, 0x4A, 0x67, 0x3D, 0x0A, 0x0A, 0x4E, - 0x61, 0x6D, 0x65, 0x3A, 0x20, 0x64, 0x61, 0x74, 0x61, 0x2F, 0x69, 0x6D, - 0x61, 0x67, 0x65, 0x2E, 0x70, 0x6E, 0x67, 0x0A, 0x53, 0x48, 0x41, 0x32, - 0x35, 0x36, 0x2D, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x3A, 0x20, 0x45, - 0x50, 0x6A, 0x6B, 0x4E, 0x5A, 0x77, 0x79, 0x61, 0x39, 0x58, 0x2B, 0x70, - 0x72, 0x75, 0x4C, 0x6C, 0x78, 0x47, 0x2B, 0x46, 0x41, 0x43, 0x4C, 0x77, - 0x47, 0x43, 0x34, 0x38, 0x58, 0x55, 0x34, 0x53, 0x39, 0x6F, 0x5A, 0x4F, - 0x41, 0x30, 0x6C, 0x56, 0x56, 0x51, 0x3D, 0x0A, -} - -// consts from cose-rust/examples/sign_verify/main.rs below -// -// processed with: -// s/const/var/g -// SignatureAlgorithm::\([A-Z0-9]+\) → getAlgByNameOrPanic("\1") -// s/&test:://g -// s/: COSERustSignatureParameters//g -// s/_EE/_EE[:]/g - -type COSERustSignatureParameters struct { - certificate []byte - algorithm *Algorithm - pkcs8 []byte -} - -var P256_PARAMS = COSERustSignatureParameters{ - certificate: P256_EE[:], - algorithm: ES256, - pkcs8: PKCS8_P256_EE[:], -} -var P384_PARAMS = COSERustSignatureParameters{ - certificate: P384_EE[:], - algorithm: ES384, - pkcs8: PKCS8_P384_EE[:], -} -var P521_PARAMS = COSERustSignatureParameters{ - certificate: P521_EE[:], - algorithm: ES512, - pkcs8: PKCS8_P521_EE[:], -} -var RSA_PARAMS = COSERustSignatureParameters{ - certificate: RSA_EE[:], - algorithm: PS256, - pkcs8: PKCS8_RSA_EE[:], -} - -type RustTestCase struct { - Title string // test fn name in cose-rust/examples/sign_verify/main.rs - SignAlg *Algorithm // COSE signing algorithm to use - SignPayload []byte // payload to sign - VerifyPayload []byte // payload to verify (defaults to SignPayload) - Certs [][]byte - Params []COSERustSignatureParameters - // SignError // expected error nil for success/ok - VerifyResult error // error (if any) or nil for success/ok - - ModifyPayload bool // change the playload after signing and expect verification failure (CoseError::VerificationFailed in rust) - ModifySignature bool // change the signature after signing and expect verification failure (CoseError::VerificationFailed in rust) -} - -// From cose-rust/examples/sign_verify/main.rs::main -var RustTestCases = []RustTestCase{ - // Basic NSS example usage. - // { - // Title: "test_nss_sign_verify", - // SignPayload: []byte("sample"), - // SignAlg: getAlgByNameOrPanic("ES256"), - // // nss::sign(&SignatureAlgorithm::ES256, PKCS8_P256_EE, payload) - // // nss::verify_signature( - // // &SignatureAlgorithm::ES256, - // // P256_EE, - // // payload, - // // &signature_result, - // // ).is_ok() - // }, - // { - // // Verify the signature with a different payload. - // Title: "test_nss_sign_verify_different_payload", - // SignPayload: []byte("sample"), - // SignAlg: getAlgByNameOrPanic("ES256"), - // VerifyPayload: []byte("sampli"), - // - // // nss::sign(&SignatureAlgorithm::ES256, PKCS8_P256_EE, payload); - // // verify_result = nss::verify_signature( - // // &SignatureAlgorithm::ES256, - // // P256_EE, - // // payload, - // // &signature_result, - // // ); - // // assert!(verify_result.is_err - // // assert_eq!(verify_result, NSSError::SignatureVerificationFail - // }, - // { - // // Verify the signature with a wrong cert. - // Title: "test_nss_sign_verify_wrong_cert", - // SignPayload: []byte("sample"), - // SignAlg: getAlgByNameOrPanic("ES256"), - - // // verify_result = nss::verify_signature( - // // &SignatureAlgorithm::ES256, - // // P384_EE, - // // payload, - // // &signature_result, - // // ); - // // assert!(verify_result.is_err - // // assert_eq!(verify_result, NSSError::SignatureVerificationFailed - // }, - - // COSE sign/verify example usages. - { - Title: "test_cose_sign_verify_two_signatures_tampered_signature", - SignPayload: []byte("This is the content."), - Certs: [][]byte{P256_ROOT[:], P256_INT[:], RSA_ROOT[:], RSA_INT[:]}, - Params: []COSERustSignatureParameters{P256_PARAMS, RSA_PARAMS}, - VerifyResult: ErrECDSAVerification, - ModifySignature: true, - }, - { - Title: "test_cose_sign_verify_two_signatures_tampered_payload", - SignPayload: []byte("This is the content."), - Certs: [][]byte{P256_ROOT[:], P256_INT[:], RSA_ROOT[:], RSA_INT[:]}, - Params: []COSERustSignatureParameters{P256_PARAMS, RSA_PARAMS}, - VerifyResult: ErrECDSAVerification, - ModifyPayload: true, - }, - { - Title: "test_cose_sign_verify_two_signatures", - SignPayload: []byte("This is the content."), - Certs: [][]byte{P256_ROOT[:], P256_INT[:], RSA_ROOT[:], RSA_INT[:]}, - Params: []COSERustSignatureParameters{P256_PARAMS, RSA_PARAMS}, - }, - { - Title: "test_cose_sign_verify_rsa_tampered_signature", - SignPayload: []byte("This is the RSA-signed content."), - Certs: [][]byte{RSA_ROOT[:], RSA_INT[:]}, - Params: []COSERustSignatureParameters{RSA_PARAMS}, - VerifyResult: ErrRSAPSSVerification, - ModifySignature: true, - }, - { - Title: "test_cose_sign_verify_rsa_modified_payload", - SignPayload: []byte("This is the RSA-signed content."), - Certs: [][]byte{RSA_ROOT[:], RSA_INT[:]}, - Params: []COSERustSignatureParameters{RSA_PARAMS}, - VerifyResult: ErrRSAPSSVerification, - ModifyPayload: true, - }, - { - Title: "test_cose_sign_verify_rsa", - SignPayload: []byte("This is the RSA-signed content."), - Certs: [][]byte{RSA_ROOT[:], RSA_INT[:]}, - Params: []COSERustSignatureParameters{RSA_PARAMS}, - }, - { - Title: "test_cose_sign_verify_tampered_signature", - SignPayload: []byte("This is the content."), - Certs: [][]byte{P256_ROOT[:], P256_INT[:]}, - Params: []COSERustSignatureParameters{P256_PARAMS}, - VerifyResult: ErrECDSAVerification, - ModifySignature: true, - }, - // { - // Title: "test_cose_sign_verify_wrong_cert", - // SignPayload: []byte("This is the content."), - // Certs: [][]byte{P256_ROOT[:], P256_INT[:], }, - // Params: []COSERustSignatureParameters{ - // COSERustSignatureParameters{ - // certificate: P384_EE[:], - // algorithm: ES256, - // pkcs8: PKCS8_P256_EE[:], - // }, - // }, - // // test_verify_verification_fails(payload, &certs, params_vec); - // }, - { - Title: "test_cose_sign_verify_modified_payload", - SignPayload: []byte("This is the content."), - Certs: [][]byte{P256_ROOT[:], P256_INT[:]}, - Params: []COSERustSignatureParameters{P256_PARAMS}, - VerifyResult: ErrECDSAVerification, - ModifyPayload: true, - }, - // { - // // Doesn't check certs - // Title: "test_cose_verify_xpi_signature", - // SignPayload: []byte(""), - // // test::setup(); - // // assert!(verify_signature(XPI_PAYLOAD, test::XPI_SIGNATURE.to_vec()).is_ok - // }, - - // NB: These are split out a different tests from test_cose_sign_verify in cose-rust - { - Title: "test_cose_sign_verify_P256", - SignPayload: []byte("This is the content."), - Certs: [][]byte{P256_ROOT[:], P256_INT[:]}, - Params: []COSERustSignatureParameters{P256_PARAMS}, - }, - { - Title: "test_cose_sign_verify_P256_no_other_certs", - SignPayload: []byte("This is the content."), - Certs: [][]byte{}, - Params: []COSERustSignatureParameters{P256_PARAMS}, - }, - { - Title: "test_cose_sign_verify_P384_no_other_certs", - SignPayload: []byte("This is the content."), - Certs: [][]byte{}, - Params: []COSERustSignatureParameters{P384_PARAMS}, - }, - { - Title: "test_cose_sign_verify_P521_no_other_certs", - SignPayload: []byte("This is the content."), - Certs: [][]byte{}, - Params: []COSERustSignatureParameters{P521_PARAMS}, - }, -} - -var algTag = GetCommonHeaderTagOrPanic("alg") -var kidTag = GetCommonHeaderTagOrPanic("kid") - -func HexToBytesOrDie(s string) []byte { - b, err := hex.DecodeString(s) - if err != nil { - panic(fmt.Sprintf("Error decoding hex string: %s", err)) - } - return b -} diff --git a/sign_verify_cose_rust_cli_test.go b/sign_verify_cose_rust_cli_test.go deleted file mode 100644 index 7cb50bb..0000000 --- a/sign_verify_cose_rust_cli_test.go +++ /dev/null @@ -1,102 +0,0 @@ -package cose - -import ( - "crypto/rand" - "crypto/x509" - "encoding/hex" - "fmt" - "os" - "os/exec" - "testing" - - "github.com/stretchr/testify/assert" -) - -// signing tests for Firefox Addon COSE Signatures -// - -func RustCoseVerifiesGoCoseSignatures(t *testing.T, testCase RustTestCase) { - fmt.Println(fmt.Sprintf("%s", testCase.Title)) - - assert := assert.New(t) - assert.True(len(testCase.Params) > 0, "No signature params!") - - signers := []Signer{} - verifiers := []Verifier{} - - message := NewSignMessage() - msgHeaders := &Headers{ - Protected: map[interface{}]interface{}{}, - Unprotected: map[interface{}]interface{}{}, - } - msgHeaders.Protected[kidTag] = testCase.Certs - message.Headers = msgHeaders - message.Payload = []byte(testCase.SignPayload) - - for _, param := range testCase.Params { - key, err := x509.ParsePKCS8PrivateKey(param.pkcs8) - assert.Nil(err) - - signer, err := NewSignerFromKey(param.algorithm, key) - assert.Nil(err, fmt.Sprintf("%s: Error creating signer %s", testCase.Title, err)) - signers = append(signers, *signer) - verifiers = append(verifiers, *signer.Verifier()) - - sig := NewSignature() - sig.Headers.Protected[algTag] = param.algorithm.Value - sig.Headers.Protected[kidTag] = param.certificate - - message.AddSignature(sig) - } - assert.True(len(message.Signatures) > 0) - assert.Equal(len(message.Signatures), len(signers)) - - var external []byte - - err := message.Sign(rand.Reader, external, signers) - assert.Nil(err, fmt.Sprintf("%s: signing failed with err %s", testCase.Title, err)) - - if testCase.ModifySignature { - // tamper with the COSE signature. - sig1 := message.Signatures[0].SignatureBytes - sig1[len(sig1)-5] ^= 1 - } - if testCase.ModifyPayload { - message.Payload[0] ^= 1 - } - - message.Payload = nil - - // Verify our signature with cose-rust - - // encode message and signature - msgBytes, err := Marshal(message) - assert.Nil(err, fmt.Sprintf("%s: Error marshaling signed message to bytes %s", testCase.Title, err)) - - // Make sure cose-rust can verify our signature too - cmd := exec.Command("cargo", "run", "--quiet", "--color", "never", "--example", "sign_verify", - "--", - "verify", - hex.EncodeToString([]byte(testCase.SignPayload)), - hex.EncodeToString(msgBytes)) - - cmd.Dir = "./test/cose-rust" - cmd.Env = append(os.Environ(), "RUSTFLAGS=-A dead_code -A unused_imports") - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - err = cmd.Run() - - if testCase.ModifySignature || testCase.ModifyPayload { - assert.NotNil(err, fmt.Sprintf("%s: verifying signature with cose-rust did not fail %s", testCase.Title, err)) - } else { - assert.Nil(err, fmt.Sprintf("%s: error verifying signature with cose-rust %s", testCase.Title, err)) - } -} - -func TestRustCoseCli(t *testing.T) { - for _, testCase := range RustTestCases { - t.Run(testCase.Title, func(t *testing.T) { - RustCoseVerifiesGoCoseSignatures(t, testCase) - }) - } -} diff --git a/sign_verify_test.go b/sign_verify_test.go index 8183b61..750d209 100644 --- a/sign_verify_test.go +++ b/sign_verify_test.go @@ -6,10 +6,14 @@ import ( "crypto/elliptic" "crypto/rand" "fmt" - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) +var algTag = GetCommonHeaderTagOrPanic("alg") +var kidTag = GetCommonHeaderTagOrPanic("kid") + func TestSignErrors(t *testing.T) { assert := assert.New(t) @@ -120,18 +124,18 @@ func TestSignatureDecodeErrors(t *testing.T) { assert := assert.New(t) var ( - s *Signature = nil + s *Signature = nil result interface{} ) - assert.Panics(func () { s.Decode(result) }) + assert.Panics(func() { s.Decode(result) }) s = &Signature{} result = 5 - assert.Panics(func () { s.Decode(result) }) + assert.Panics(func() { s.Decode(result) }) s = &Signature{} result = []interface{}{1, 2} - assert.Panics(func () { s.Decode(result) }) + assert.Panics(func() { s.Decode(result) }) s = &Signature{} result = []interface{}{ @@ -139,27 +143,27 @@ func TestSignatureDecodeErrors(t *testing.T) { map[interface{}]interface{}{}, []byte(""), } - assert.Panics(func () { s.Decode(result) }) + assert.Panics(func() { s.Decode(result) }) s.Headers = &Headers{} - result = []interface{}{ + result = []interface{}{ []byte("\xA0"), map[interface{}]interface{}{}, -1, } - assert.Panics(func () { s.Decode(result) }) + assert.Panics(func() { s.Decode(result) }) } func TestSignMessageSignatureDigest(t *testing.T) { assert := assert.New(t) var ( - external = []byte("") - hashFunc = crypto.SHA256 - signature *Signature = nil - msg *SignMessage = nil - digest []byte - err error + external = []byte("") + hashFunc = crypto.SHA256 + signature *Signature = nil + msg *SignMessage = nil + digest []byte + err error ) digest, err = msg.signatureDigest(external, signature, hashFunc) @@ -172,11 +176,11 @@ func TestSignMessageSignatureDigest(t *testing.T) { assert.Equal(len(digest), 0) msg.AddSignature(&Signature{ - Headers: nil, + Headers: nil, SignatureBytes: []byte("123"), }) signature = &Signature{ - Headers: nil, + Headers: nil, SignatureBytes: nil, } digest, err = msg.signatureDigest(external, signature, hashFunc) @@ -197,7 +201,6 @@ func TestVerifyErrors(t *testing.T) { msg := NewSignMessage() msg.Payload = []byte("payload to sign") - sig := NewSignature() sig.Headers.Protected[algTag] = -41 // RSAES-OAEP w/ SHA-256 from [RFC8230] sig.Headers.Protected[kidTag] = 1 @@ -255,7 +258,7 @@ func TestVerifyErrors(t *testing.T) { verifiers = []Verifier{ Verifier{ PublicKey: ecdsaPrivateKey.Public(), - Alg: ES256, + Alg: ES256, }, } assert.Equal("invalid signature length: 14", msg.Verify(payload, verifiers).Error()) From 279ec76470c11d8e38de5327d90ccb83b0543fef Mon Sep 17 00:00:00 2001 From: qmuntal Date: Wed, 30 Mar 2022 14:52:52 +0200 Subject: [PATCH 3/4] bump go directive to go1.18 to support built-in fuzzing Signed-off-by: qmuntal --- go.mod | 9 +++++++-- go.sum | 2 -- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 17fc386..9242143 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,16 @@ module github.com/veraison/go-cose -go 1.15 +go 1.18 require ( - github.com/davecgh/go-spew v1.1.1 // indirect github.com/fxamacker/cbor/v2 v2.2.1-0.20200429214022-fc263b46c618 github.com/pkg/errors v0.8.0 github.com/stretchr/testify v1.6.1 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/x448/float16 v0.8.4 // indirect gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect ) diff --git a/go.sum b/go.sum index 3f9d5b9..a571841 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -15,7 +14,6 @@ github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 93cb3d350df281bab3a0462c091cc80f47da7661 Mon Sep 17 00:00:00 2001 From: qmuntal Date: Wed, 30 Mar 2022 15:27:39 +0200 Subject: [PATCH 4/4] add first fuzzing test Signed-off-by: qmuntal --- fuzz_test.go | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 fuzz_test.go diff --git a/fuzz_test.go b/fuzz_test.go new file mode 100644 index 0000000..e41a0a9 --- /dev/null +++ b/fuzz_test.go @@ -0,0 +1,58 @@ +//go:build go1.18 +// +build go1.18 + +package cose_test + +import ( + "encoding/json" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/veraison/go-cose" +) + +func FuzzSign1_Encode(f *testing.F) { + testdata, err := os.ReadDir("testdata") + if err != nil { + f.Fatalf("failed to read testdata directory: %s", err) + } + for _, de := range testdata { + if de.IsDir() || !strings.HasPrefix(de.Name(), "sign1-") || !strings.HasSuffix(de.Name(), ".json") { + continue + } + b, err := os.ReadFile(filepath.Join("testdata", de.Name())) + if err != nil { + f.Fatalf("failed to read testdata: %s", err) + } + type testCase struct { + Sign1 *Sign1 `json:"sign1::sign"` + Verify1 *Verify1 `json:"sign1::verify"` + } + var tc testCase + err = json.Unmarshal(b, &tc) + if err != nil { + f.Fatal(err) + } + if tc.Sign1 != nil { + f.Add(mustHexToBytes(tc.Sign1.Output.CBORHex)) + } else if tc.Verify1 != nil { + f.Add(mustHexToBytes(tc.Verify1.TaggedCOSESign1.CBORHex)) + } + } + f.Fuzz(func(t *testing.T, b []byte) { + var msg cose.Sign1Message + if err := msg.UnmarshalCBOR(b); err != nil { + return + } + _, err := msg.MarshalCBOR() + if err != nil { + t.Fatalf("failed to marshal valid message: %s", err) + } + // TODO: uncomment the roundtrip test once https://github.com/veraison/go-cose/pull/17 lands. + // if !bytes.Equal(b, got) { + // t.Fatalf("roundtripped message has changed, got: %v, want: %v", got, b) + // } + }) +}