From e6f0fc61963ddb12d751be97cc8cd84ab510ad5c Mon Sep 17 00:00:00 2001 From: Pwpon500 Date: Fri, 16 Aug 2019 10:33:28 -0400 Subject: [PATCH] Turn appropriate RSAParameter calls into function calls (#71) --- verifier/aik.go | 4 ++-- verifier/quote.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/verifier/aik.go b/verifier/aik.go index 498a8d00..1e7caec2 100644 --- a/verifier/aik.go +++ b/verifier/aik.go @@ -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 diff --git a/verifier/quote.go b/verifier/quote.go index 7ca036fd..efddfb79 100644 --- a/verifier/quote.go +++ b/verifier/quote.go @@ -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