Skip to content

Commit

Permalink
Fix typos, unused variables and parameter name to be consistent with …
Browse files Browse the repository at this point in the history
…type declaration
  • Loading branch information
jacquelinewong authored and jhand2 committed Feb 13, 2025
1 parent 4479955 commit 8891d1f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions verification/client/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,14 +448,14 @@ func (c *DPEABI[_, _, _]) DestroyContextABI(cmd *DestroyCtxCmd) error {
}

// CertifyKeyABI calls the DPE CertifyKey command.
func (c *DPEABI[CurveParameter, Digest, DPECertificate]) CertifyKeyABI(cmd *CertifyKeyReq[Digest]) (*CertifyKeyResp[CurveParameter, Digest], error) {
func (c *DPEABI[CurveParameter, Digest, Cert]) CertifyKeyABI(cmd *CertifyKeyReq[Digest]) (*CertifyKeyResp[CurveParameter, Digest], error) {
// Define an anonymous struct for the response, because we have to accept the variable-sized certificate.
respStruct := struct {
NewContextHandle [16]byte
DerivedPublicKeyX CurveParameter
DerivedPublicKeyY CurveParameter
CertificateSize uint32
Certificate DPECertificate
Certificate Cert
}{}

_, err := execCommand(c.transport, c.constants.Codes.CertifyKey, c.Profile, cmd, &respStruct)
Expand All @@ -464,7 +464,7 @@ func (c *DPEABI[CurveParameter, Digest, DPECertificate]) CertifyKeyABI(cmd *Cert
}

// Check that the reported cert size makes sense.
if respStruct.CertificateSize > uint32(CertLen[DPECertificate]()) {
if respStruct.CertificateSize > uint32(CertLen[Cert]()) {
return nil, fmt.Errorf("DPE reported a %d-byte cert, which was larger than 2048", respStruct.CertificateSize)
}

Expand Down Expand Up @@ -516,15 +516,15 @@ func (c *DPEABI[_, _, _]) GetCertificateChainABI() (*GetCertificateChainResp, er
}

// DeriveContextABI calls DPE DeriveContext command.
func (c *DPEABI[_, Digest, DPECertificate]) DeriveContextABI(cmd *DeriveContextReq[Digest]) (*DeriveContextResp, error) {
func (c *DPEABI[_, Digest, Cert]) DeriveContextABI(cmd *DeriveContextReq[Digest]) (*DeriveContextResp, error) {
// Define an anonymous struct for the response, because the shape changes if exportCdi is set.
if cmd.Flags&CdiExport == CdiExport {
respStruct := struct {
NewContextHandle [16]byte
ParentContextHandle [16]byte
ExportedCdi [32]byte
CertificateSize uint32
Certificate DPECertificate
Certificate Cert
}{}
_, err := execCommand(c.transport, c.constants.Codes.DeriveContext, c.Profile, cmd, &respStruct)
if err != nil {
Expand Down

0 comments on commit 8891d1f

Please sign in to comment.