Skip to content

Commit

Permalink
Turn appropriate RSAParameter calls into function calls (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
pawalt authored and twitchy-jsonp committed Aug 16, 2019
1 parent a182290 commit e6f0fc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions verifier/aik.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func verifyAIK20(public, creationData, attestationData, signature []byte) (*pb.A
if pub.RSAParameters.KeyBits < 2048 {
out.KeyTooSmall = true
}
out.RocaVulnerableKey = ROCAVulnerableKey(&rsa.PublicKey{N: pub.RSAParameters.Modulus})
out.RocaVulnerableKey = ROCAVulnerableKey(&rsa.PublicKey{N: pub.RSAParameters.Modulus()})
default:
return nil, fmt.Errorf("public key of alg 0x%x not supported", pub.Type)
}
Expand Down Expand Up @@ -109,7 +109,7 @@ func verifyAIK20(public, creationData, attestationData, signature []byte) (*pb.A
out.NameAttestationMismatch = !match

// Check the signature over the attestation data verifies correctly.
p := rsa.PublicKey{E: int(pub.RSAParameters.Exponent), N: pub.RSAParameters.Modulus}
p := rsa.PublicKey{E: int(pub.RSAParameters.Exponent()), N: pub.RSAParameters.Modulus()}
signHashConstructor, err := pub.RSAParameters.Sign.Hash.HashConstructor()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion verifier/quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func VerifyQuote(tpmVersion tpb.TpmVersion, public, attestationData, signature [
pcrDigestMatched = bytes.Equal(compositeDigest.Sum(nil), digest)

// Check the signature over the attestation data verifies correctly.
p := rsa.PublicKey{E: int(pub.RSAParameters.Exponent), N: pub.RSAParameters.Modulus}
p := rsa.PublicKey{E: int(pub.RSAParameters.Exponent()), N: pub.RSAParameters.Modulus()}
signHashConstructor, err := pub.RSAParameters.Sign.Hash.HashConstructor()
if err != nil {
return nil, err
Expand Down

0 comments on commit e6f0fc6

Please sign in to comment.