Skip to content

Commit 0d57edf

Browse files
authored
Merge pull request #34 from deeglaze/fwcert
Add firmware cert to certificate chain
2 parents a487d28 + 8c9936c commit 0d57edf

File tree

8 files changed

+68
-27
lines changed

8 files changed

+68
-27
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ jobs:
4444
repo-token: ${{ secrets.GITHUB_TOKEN }}
4545
version: "3.12.4"
4646
- name: Install protoc-gen-go
47-
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1
47+
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1
4848
- name: Check Protobuf Generation
4949
run: |
50-
go generate ./...
50+
go generate ./...
5151
git diff -G'^[^/]' --exit-code
5252
- name: Generate all protobufs
5353
run: go generate ./...

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
!*.*
33
!*/
44
*~
5+
external/*

abi/abi.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"fmt"
2323
"math/big"
2424

25+
"github.com/google/go-sev-guest/gce"
2526
pb "github.com/google/go-sev-guest/proto/sevsnp"
2627
"github.com/google/logger"
2728
"github.com/pborman/uuid"
@@ -690,9 +691,11 @@ func (c *CertTable) Proto() *pb.CertificateChain {
690691
if err != nil {
691692
logger.Warningf("ARK certificate not found in data pages: %v", err)
692693
}
694+
firmware, _ := c.GetByGUIDString(gce.FirmwareCertGUID)
693695
return &pb.CertificateChain{
694-
VcekCert: vcek,
695-
AskCert: ask,
696-
ArkCert: ark,
696+
VcekCert: vcek,
697+
AskCert: ask,
698+
ArkCert: ark,
699+
FirmwareCert: firmware,
697700
}
698701
}

gce/gce.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2022 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Package gce defines logic specific to verification of GCE-specific attestations.
16+
package gce
17+
18+
// FirmwareCertGUID is the extended report GUID table GUID for a firmware certificate on GCE.
19+
const FirmwareCertGUID = "9f4116cd-c503-4f5a-8f6f-fb68882f4ce2"

proto/check/check.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/fakekds/fakekds.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/sevsnp.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ message CertificateChain {
6565

6666
// The AMD Root key certificate (signs the ASK cert).
6767
bytes ark_cert = 3;
68+
69+
// A certificate the host may inject to endorse the measurement of the
70+
// firmware.
71+
bytes firmware_cert = 4;
6872
}
6973

7074
message Attestation {

proto/sevsnp/sevsnp.pb.go

Lines changed: 34 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)