From b7828cdc7cc968e14b8ccc35e676bda3f5a97d7c Mon Sep 17 00:00:00 2001 From: Paul van Brouwershaven Date: Mon, 14 Sep 2026 09:29:25 +0200 Subject: [PATCH] deps: update pkcs7 to the patched BER parser --- .github/workflows/go.yml | 14 +++++++------- .github/workflows/golangci-lint.yml | 6 +++--- go.mod | 4 ++-- go.sum | 4 ++-- timestamp.go | 6 +++--- timestamp_example_test.go | 7 +++---- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index fe031a2..5735eae 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -13,17 +13,17 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.x - uses: actions/setup-go@v2 - with: - go-version: ^1.13 - - name: Check out code into the Go module directory - uses: actions/checkout@v2 + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod - name: Get dependencies run: | - go get -v -t -d ./... + go mod download - name: Build run: go build -v ./... diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 940c982..01a79e1 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -19,15 +19,15 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version-file: go.mod cache: false - name: golangci-lint - uses: golangci/golangci-lint-action@v4 + uses: golangci/golangci-lint-action@v9 with: # Require: The version of golangci-lint to use. # When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. # When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit. - version: v1.62 + version: v2.13.0 # Optional: working directory, useful for monorepos # working-directory: somedir diff --git a/go.mod b/go.mod index 59636a8..9265fdc 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/digitorus/timestamp -go 1.16 +go 1.27 -require github.com/digitorus/pkcs7 v0.0.0-20230713084857-e76b763bdc49 +require github.com/digitorus/pkcs7 v0.0.0-20260914070511-d678ea5ea03f diff --git a/go.sum b/go.sum index 0a8bd53..5cbb2ea 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/digitorus/pkcs7 v0.0.0-20230713084857-e76b763bdc49 h1:h+XMRXf+WLY0h/3itqE8OT3TgjCMHK4nq2FNGi0au2c= -github.com/digitorus/pkcs7 v0.0.0-20230713084857-e76b763bdc49/go.mod h1:SKVExuS+vpu2l9IoOc0RwqE7NYnb0JlcFHFnEJkVDzc= +github.com/digitorus/pkcs7 v0.0.0-20260914070511-d678ea5ea03f h1:LBDTasGDT7gkpSl3tIq+V4Yy0nr+l+ZmI6VN9MY9FU0= +github.com/digitorus/pkcs7 v0.0.0-20260914070511-d678ea5ea03f/go.mod h1:OQvyvldkvDCxGsUPLSibXqM4B/Pz5RaXQP4CPo5LXs4= diff --git a/timestamp.go b/timestamp.go index e4f2690..6f2a1ee 100644 --- a/timestamp.go +++ b/timestamp.go @@ -531,9 +531,9 @@ func (t *Timestamp) populateTSTInfo(messageImprint messageImprint, policyOID asn if ms != 0 { tstInfo.Accuracy.Milliseconds = int64(ms.Milliseconds()) } - microSeconds := (t.Accuracy - seconds - ms).Truncate(time.Microsecond) - if microSeconds != 0 { - tstInfo.Accuracy.Microseconds = int64(microSeconds.Microseconds()) + us := (t.Accuracy - seconds - ms).Truncate(time.Microsecond) + if us != 0 { + tstInfo.Accuracy.Microseconds = int64(us.Microseconds()) } } } diff --git a/timestamp_example_test.go b/timestamp_example_test.go index 4ab08d9..3a7fe65 100644 --- a/timestamp_example_test.go +++ b/timestamp_example_test.go @@ -12,10 +12,9 @@ import ( "github.com/digitorus/timestamp" ) -// ExampleCreateRequest_ParseResponse demonstrates the creation of a time-stamp request, sending +// ExampleCreateRequest_parseResponse demonstrates the creation of a time-stamp request, sending // it to the server and parsing the response. -// nolint: govet -func ExampleCreateRequest_ParseResponse() { +func ExampleCreateRequest_parseResponse() { tsq, err := timestamp.CreateRequest(strings.NewReader("ExampleCreateRequestParseResponse"), ×tamp.RequestOptions{ Hash: crypto.SHA256, Certificates: true, @@ -43,7 +42,7 @@ func ExampleCreateRequest_ParseResponse() { log.Fatal(err) } - fmt.Println(tsResp.HashedMessage) + fmt.Printf("%v\n", tsResp.HashedMessage) fmt.Println(tsResp.Policy) for _, c := range tsResp.Certificates { fmt.Println(c.Subject.Organization, c.Subject.OrganizationalUnit)