mirror of
https://github.com/google/go-attestation.git
synced 2025-01-02 19:26:49 +00:00
Turn appropriate RSAParameter calls into function calls (#71)
This commit is contained in:
parent
a1822903b4
commit
e6f0fc6196
@ -74,7 +74,7 @@ func verifyAIK20(public, creationData, attestationData, signature []byte) (*pb.A
|
|||||||
if pub.RSAParameters.KeyBits < 2048 {
|
if pub.RSAParameters.KeyBits < 2048 {
|
||||||
out.KeyTooSmall = true
|
out.KeyTooSmall = true
|
||||||
}
|
}
|
||||||
out.RocaVulnerableKey = ROCAVulnerableKey(&rsa.PublicKey{N: pub.RSAParameters.Modulus})
|
out.RocaVulnerableKey = ROCAVulnerableKey(&rsa.PublicKey{N: pub.RSAParameters.Modulus()})
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("public key of alg 0x%x not supported", pub.Type)
|
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
|
out.NameAttestationMismatch = !match
|
||||||
|
|
||||||
// Check the signature over the attestation data verifies correctly.
|
// 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()
|
signHashConstructor, err := pub.RSAParameters.Sign.Hash.HashConstructor()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -79,7 +79,7 @@ func VerifyQuote(tpmVersion tpb.TpmVersion, public, attestationData, signature [
|
|||||||
pcrDigestMatched = bytes.Equal(compositeDigest.Sum(nil), digest)
|
pcrDigestMatched = bytes.Equal(compositeDigest.Sum(nil), digest)
|
||||||
|
|
||||||
// Check the signature over the attestation data verifies correctly.
|
// 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()
|
signHashConstructor, err := pub.RSAParameters.Sign.Hash.HashConstructor()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user