Skip to content

Commit

Permalink
Merge pull request #34 from deeglaze/fwcert
Browse files Browse the repository at this point in the history
Add firmware cert to certificate chain
  • Loading branch information
deeglaze authored Jan 19, 2023
2 parents a487d28 + 8c9936c commit 0d57edf
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: "3.12.4"
- name: Install protoc-gen-go
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1
- name: Check Protobuf Generation
run: |
go generate ./...
go generate ./...
git diff -G'^[^/]' --exit-code
- name: Generate all protobufs
run: go generate ./...
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
!*.*
!*/
*~
external/*
9 changes: 6 additions & 3 deletions abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"math/big"

"github.com/google/go-sev-guest/gce"
pb "github.com/google/go-sev-guest/proto/sevsnp"
"github.com/google/logger"
"github.com/pborman/uuid"
Expand Down Expand Up @@ -690,9 +691,11 @@ func (c *CertTable) Proto() *pb.CertificateChain {
if err != nil {
logger.Warningf("ARK certificate not found in data pages: %v", err)
}
firmware, _ := c.GetByGUIDString(gce.FirmwareCertGUID)
return &pb.CertificateChain{
VcekCert: vcek,
AskCert: ask,
ArkCert: ark,
VcekCert: vcek,
AskCert: ask,
ArkCert: ark,
FirmwareCert: firmware,
}
}
19 changes: 19 additions & 0 deletions gce/gce.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Package gce defines logic specific to verification of GCE-specific attestations.
package gce

// FirmwareCertGUID is the extended report GUID table GUID for a firmware certificate on GCE.
const FirmwareCertGUID = "9f4116cd-c503-4f5a-8f6f-fb68882f4ce2"
2 changes: 1 addition & 1 deletion proto/check/check.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/fakekds/fakekds.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions proto/sevsnp.proto
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ message CertificateChain {

// The AMD Root key certificate (signs the ASK cert).
bytes ark_cert = 3;

// A certificate the host may inject to endorse the measurement of the
// firmware.
bytes firmware_cert = 4;
}

message Attestation {
Expand Down
54 changes: 34 additions & 20 deletions proto/sevsnp/sevsnp.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0d57edf

Please sign in to comment.