Commit Graph

156 Commits

Author SHA1 Message Date
Tom D
596928d20b
Fix oss-fuzz, update to latest go-tpm (#165) 2020-05-07 15:25:53 -07:00
Matthew Garrett
bddeb5217c Add tests to verify attribute certificate signatures
Use an old Intel Transparent Supply Chain certificate to verify the
signatures for the test platform certificates we have that correspond to
it.
2020-05-06 18:54:52 -07:00
Matthew Garrett
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
Tom D
ebb0b62d80
Split linuxTPM -> {trousersTPM,wrappedTPM20}, implement CommandChannel
* Split linuxTPM -> {trousersTPM,wrappedTPM20} + prefix windows key type with windows

* Address feedback, implement CommandChannel
2020-05-05 16:56:57 -07:00
Tom D
1045ef6327
Refactor *platformTPM -> tpmBase interface (#160) 2020-05-05 14:56:40 -07:00
Tom D
ab116a02a1
Implement workaround for secureboot authority events from shim (#158) 2020-05-01 14:20:54 -07:00
Tom D
022cf8e2ae
Fix broken build from intersection of two PRs (#155) 2020-04-16 11:42:48 -07:00
Tom D
67c0b4ad07
Add workaround in validation for missing exit boot services event log messages (#153) 2020-04-16 10:20:55 -07:00
Matthew Garrett
0815f5e221
Remove length-based hash lookups
Using the length of a digest to infer the hash algorithm is somewhat
fragile - if we end up with multiple hash algorithms that share the same
digest length, things will break. Instead, pass more complete digest
information through to relevant functions and figure things out by
mapping the TPM hash algorithm to the appropriate Golang type.
2020-04-14 14:38:24 -07:00
Tom D
fe41cef1db
Return error from AttestPlatform() if the event log returned from the system is too short to be valid (#151) 2020-01-30 14:39:59 -08:00
Brandon Weeks
e9e2656545 Return an error if event data size is 0 2020-01-08 13:43:10 -08:00
Tom D
e134551bb0
Implement extractor for determining secure boot state (#148) 2019-12-19 12:28:32 -08:00
Eric Chiang
34338f547c
Merge pull request #147 from ericchiang/formatting
docs: small changes to wording in the event log disclosure
2019-12-12 09:41:08 -08:00
Eric Chiang
9ad68fc43f docs: small changes to wording in the event log disclosure 2019-12-12 09:33:10 -08:00
Eric Chiang
303958184b
Merge pull request #146 from afritzler/patch-1
Fixed typo
2019-12-11 13:58:20 -08:00
Andreas Fritzler
c0a238f2c6
Fixed typo 2019-12-11 22:02:49 +01:00
Eric Chiang
6884946fc9
Merge pull request #144 from mjg59/use_header_digest_size
Pay attention to digest size information in the headers
2019-12-10 12:33:31 -08:00
Matthew Garrett
9176b4bcb6 Pay attention to digest size information in the headers
Crypto agile logs may contain digest types that we don't currently
handle. However, we still need to know how long each digest is in order
to read over the appropriate amount of the buffer. This information is
provided to us as part of the spec header - make use of it rather than
hardcoding the set of digests and lengths we know about.
2019-12-10 12:28:28 -08:00
Eric Chiang
bb3d835294
Merge pull request #145 from ericchiang/event-log-disclosure
docs: add TCG disclosure report
2019-12-10 10:09:15 -08:00
Eric Chiang
fabec56c0e docs: add TCG disclosure report 2019-12-10 10:03:50 -08:00
Tom D
9746da2bfe
Fix uint16 overflow in ParseEKCertificate bounds check (#143) 2019-12-09 10:58:36 -08:00
Tom D
82eea759eb
Enable ParseAKPublic & ParseEKCertificate for fuzzing. (#141) 2019-12-04 15:04:06 -08:00
Tom D
814084b657
Validate signature scheme is present when decoding TPMT_PUBLIC blobs (#140) 2019-12-04 14:35:21 -08:00
Tom D
fb4487ace5
Implement self-test mode into attest-tool. (#137) 2019-11-08 09:52:59 -08:00
Eric Chiang
ecf3f3087d
Merge pull request #136 from ericchiang/readme
README.md: add more information and an example to the readme
2019-11-08 07:49:38 +01:00
Eric Chiang
6ba2320709
Merge pull request #134 from ericchiang/mod-tidy
go.sum: run go mod tidy
2019-11-07 09:33:07 +01:00
Eric Chiang
3b090f6cc8 README.md: add more information and an example to the readme 2019-11-07 09:31:40 +01:00
Eric Chiang
bd37cfce50
Merge pull request #135 from ericchiang/lint-names
attributecert: update names that golint complains about
2019-11-07 09:16:41 +01:00
Eric Chiang
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
Eric Chiang
2737628247 go.sum: run go mod tidy 2019-11-06 09:15:19 +01:00
Matthew Garrett
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
Eric Chiang
43f6c42dc3
Merge pull request #133 from ericchiang/hash-constructor
attest: work around tpm2 removal of Algorithm.HashConstructor()
2019-10-26 18:06:57 +09:00
Eric Chiang
7b7e21da78 attest: update go-tpm and switch hash method
go-tpm recently removed Algorithm.HashConstructor() in favor of
Algorithm.Hash(). Update go-tpm dependency and use the new method.
2019-10-18 10:39:55 -04:00
Tom D
25ce56400c
Fix linter errors, go fmt (#130) 2019-10-10 14:29:46 -07:00
Eric Chiang
9631d92677
Merge pull request #129 from ericchiang/fix-make
attest: fix another unbounded memory allocation
2019-10-09 09:33:51 -07:00
Eric Chiang
f0e8d0fe7c attest: fix another unbounded memory allocation
@brandonweeks detected another case of the "make([]T, untrustedValue)"
pattern, which would allow an attacker to cause the parser to allocate
an unbounded amount of memory.

Fix this by reading one algorithm at a time instead of pre-allocating a
slice of algorithms.
2019-10-09 08:39:15 -07:00
Brandon Weeks
2bc8d58530 ParseEventLog fuzz target
A go-fuzz target for the ParseEventLog function. It has been tested
with go-fuzz and go-fuzz + libFuzzer.

oss-fuzz requires a statically built fuzzer binary, so `gofuzz` build
tags are added to avoid building files that depend on go-tspi. A mock
tpm_other.go file is also included to satisfy the `platformTPM`
interface.
2019-10-09 10:05:21 +11:00
Brandon Weeks
73020b971b Rename AIK to AK everywhere
AIK is the terminology used as part of the TPM 1.2 specifications.
2019-10-09 08:56:19 +11:00
Eric Chiang
a0b6fcfd38
Merge pull request #127 from ericchiang/fix-dos
attest: ensure parsing event can't allocated unbounded memory
2019-10-08 13:18:10 -07:00
Eric Chiang
f365b3275e attest: ensure parsing event can't allocated unbounded memory
Add a sanity check to ensure the measurement log actually contains as
much data as the event size reports.
2019-10-08 09:57:09 -07:00
Brandon Weeks
74a97ba02f Revert WIP fuzzing work 2019-10-08 18:08:43 +11:00
Brandon Weeks
58786a4742 Target gofuzz build tag instead of cgo
go-fuzz + libFuzzer can't be built with `CGO_ENABLED=0`.
2019-10-08 17:52:40 +11:00
Brandon Weeks
355782cbf9 Fix building without cgo 2019-10-08 17:19:02 +11:00
Brandon Weeks
59a5f6851d Simple fuzzer for ParseEventLog 2019-10-08 16:09:51 +11:00
Tom D
de6a3af7e4
Add config struct for AttestPlatform(), to configure event log source (#118) 2019-10-03 11:09:32 -07:00
Tom D
56dc743f14
Support AIKPublic.validate20Quote() consuming PCRs not part of the quote (#115) 2019-09-26 15:11:31 -07:00
Eric Chiang
5d5d6d83ca
Merge pull request #114 from ericchiang/mod
go.mod: update using "go mod tidy"
2019-09-26 13:09:43 -07:00
Eric Chiang
ebcdccf2d5 go.mod: update using "go mod tidy"
After removing proto and verifier packages we no longer need the
protobuf package.
2019-09-26 13:06:07 -07:00
Tom D
20ad7d44ab
Implement helper method + struct for getting a platform attestation (#113) 2019-09-26 13:00:20 -07:00
Tom D
82c790063a
Support verifying the event log with multiple PCR values for a given PCR (#112) 2019-09-25 14:50:17 -07:00