Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos, unused variables and parameter name to be consistent with … #394

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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