Turn appropriate RSAParameter calls into function calls (#71)

This commit is contained in:
Pwpon500 2019-08-16 10:33:28 -04:00 committed by Tom D
parent a1822903b4
commit e6f0fc6196
2 changed files with 3 additions and 3 deletions

View File

@ -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)
}
@ -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

View File

@ -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