Commit Graph

15 Commits

Author SHA1 Message Date
50b610bb61 Bump golangci/golangci-lint-action in the github-actions group (#416)
Some checks failed
CodeQL / Analyze (go) (push) Has been cancelled
Test / test-linux (1.24.x) (push) Has been cancelled
Test / test-linux-tpm12 (1.24.x) (push) Has been cancelled
Test / test-macos (1.24.x) (push) Has been cancelled
Test / test-windows (1.24.x) (push) Has been cancelled
Bumps the github-actions group with 1 update: [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action).

Updates `golangci/golangci-lint-action` from 6 to 7
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v6...v7)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-31 11:29:39 -07:00
0722a4900b Support sha384 RSA signature (#372)
Add signature algorithm details for sha384 RSA signature so certificates
using it can has its signature algorithm properly parsed
2024-04-15 15:05:48 -07:00
438907edb0 Fix lints; run gofmt (#293)
$ gofmt -s -w .
2022-11-01 12:19:57 -07:00
03018e6828 Remove certificate-transparency-go dependancy
Signed-off-by: Joe Richey <joerichey@google.com>
2022-04-04 13:48:39 -07:00
20a9e4b381 Internal change
PiperOrigin-RevId: 380881515
2021-06-22 20:41:11 +00:00
3cc596e3c6 Add missing optional tags
Some fields have default values, which also means they should be treated
as optional. Fix up the tagging to handle that. The natural defaults
here will work, so no need to make them explicit.
2020-11-17 15:00:41 -08:00
4ad1cc2bf5 Fix type for ComponentClassValue
This is an octet string (ie, an array of bytes) rather than a string.
Fix it to be []byte.
2020-11-12 16:31:41 -08:00
cc244b36f4 Explicitly tag context-specific UTF8Strings
Context-specific fields in ASN.1 don't have explicit type tags in the
ASN.1 stream, so encoding/asn1 infers the tag from the type of the
struct field the stream is being unmarshalled to. By default string is
assumed to be PrintableString, which is only permitted to contain a
subset of possible characters. If a field is defined as UTF8String in
the spec then it may contain characters that are not permitted in
PrintableString, and in this case Unmarshal() will return an error. We
can avoid this by explicitly tagging any context-specific UTF8Strings.
2020-11-12 16:31:41 -08:00
9559fc1cd4 Create oid package to centralize TCG relevant OIDs 2020-07-23 12:13:07 -07:00
42b1d805de Handle platform certificates that only provide a single property (#168)
Handle platform certificates that only provide a single property

The spec states that the PlatformProperties field of the
PlatformConfiguration attribute should be a sequence of key value pairs.
However, it seems that if there's only a single property present, it's
sometimes being stored as a bare key value pair rather than a sequence
with a single entry. Work around that.
2020-05-29 17:24:06 -07:00
fbd936aac7 Parse out platform component and properties data
This provides information about individual components within the system,
which may be useful for various policy decisions.
2020-05-08 14:32:33 -07:00
3538e3d287 Fix broken tag statements
A number of the struct definitions had broken tag definitions, which
meant some parsing was working by accident and some parsing was entirely
broken. Fixing this uncovered some additional issues (a mixture of
incorrect definitions and platform certificates that violate the spec),
so this is all cleaned up as well.
2020-05-08 14:32:33 -07:00
61ed2a0d17 Fix attribute certificate signature handling
Attribute certificates are generally using RSA-SHA1 or RSA-SHA256
signatures, so include those. In addition, the CA signing restrictions
imposed for general purpose certificates don't apply here - drop that
restriction from certificate signature validation.
2020-05-06 18:54:52 -07:00
6cfb57c8eb attributecert: update names that golint complains about
golint current generates complaints:

        var oidTpmIdLabel should be oidTpmIDLabel
        var oidTcgPlatformManufacturerIdV2 should be oidTcgPlatformManufacturerIDV2
        var oidTcgPlatformConfigUri should be oidTcgPlatformConfigURI

Update names to satisfy golint.

The following commands were run to generate this change:

        gopls rename -w attributecert.go:44:2 oidTpmIDLabel
        gopls rename -w attributecert.go:54:2 oidTcgPlatformManufacturerIDV2
        gopls rename -w attributecert.go:55:2 oidTcgPlatformConfigURI
        gopls rename -w attributecert.go:163:6 authKeyID
        gopls rename -w attributecert.go:164:2 ID
        gopls rename -w attributecert.go:171:2 ID
        gopls rename -w attributecert.go:178:2 ID
        gopls rename -w attributecert.go:210:2 BaseCertificateID
        gopls rename -w attributecert.go:232:2 ID
        gopls rename -w attributecert.go:304:2 ID
        gopls rename -w attributecert.go:309:2 ID
        gopls rename -w attributecert.go:390:2 ComponentManufacturerID
        sed -i 's/Uri/URI/g' attributecert.go
        git clean -f

Updates #131
2019-11-06 11:09:02 +01:00
f5fa92f739 First attempt at adding support for attribute certificates (#117)
Platform certificates are defined as RFC5755 attribute certificates with
various additional attributes and extensions defined in the TCG Platform
Certificate Profile. Add support for parsing them, derived from
crypto/x509. Include some test certificates and verify we parse them.
2019-10-27 23:12:15 -07:00