Skip to content

Commit

Permalink
Fix the mistake of signature algorithm number (#349)
Browse files Browse the repository at this point in the history
`TPMUSignature.ECDAA()` incorrectly checked whether 
the signature algorithm is `RSASSA`, so this commit fixes it.

Update: `TPMAlgRSASSA` => `TPMAlgECDAA`
  • Loading branch information
akakou authored Feb 6, 2024
1 parent ee6cbcd commit 638c2b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tpm2/structures.go
Original file line number Diff line number Diff line change
Expand Up @@ -2450,7 +2450,7 @@ func (u *TPMUSignature) ECDSA() (*TPMSSignatureECC, error) {

// ECDAA returns the 'ecdaa' member of the union.
func (u *TPMUSignature) ECDAA() (*TPMSSignatureECC, error) {
if u.selector == TPMAlgRSASSA {
if u.selector == TPMAlgECDAA {
return u.contents.(*TPMSSignatureECC), nil
}
return nil, fmt.Errorf("did not contain ecdaa (selector value was %v)", u.selector)
Expand Down

0 comments on commit 638c2b8

Please sign in to comment.