From 2c5717038638ef2f3d362abaf67d97b616d9bbb6 Mon Sep 17 00:00:00 2001 From: Nicolas Temciuc Date: Wed, 5 Feb 2025 13:55:44 -0300 Subject: [PATCH] fixup! test(TPM::KeyAttestation#key): returns nil when t_public curve_id differs from key curve_id --- spec/tpm/key_attestation_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/tpm/key_attestation_spec.rb b/spec/tpm/key_attestation_spec.rb index 7225614..e00ff92 100644 --- a/spec/tpm/key_attestation_spec.rb +++ b/spec/tpm/key_attestation_spec.rb @@ -361,6 +361,7 @@ let(:root_key) { create_ecc_key(key_curve_id) } let(:attestation_key) { create_ecc_key(key_curve_id) } let(:attested_key) { create_ecc_key(key_curve_id) } + let(:key_curve_id) { TPM::ECC_NIST_P256 } let(:signature_algorithm) { TPM::ALG_ECDSA } let(:hash_algorithm) { TPM::ALG_SHA256 } @@ -387,7 +388,6 @@ let(:scheme) { TPM::ALG_NULL } context "when t_public.parameters and t_public.unique are compatible" do - let(:key_curve_id) { TPM::ECC_NIST_P256 } let(:t_public_curve_id) { TPM::ECC_NIST_P256 } it "returns a public ECDSA key with the correct properties" do @@ -398,8 +398,9 @@ end context "when t_public.parameters and t_public.unique are incompatible" do - let(:key_curve_id) { TPM::ECC_NIST_P256 } - let(:t_public_curve_id) { TPM::ECC_NIST_P256 + 1 } + # Make the curve in t_public.parameters different than the curve + # used to generate the coordinates of the t_public.unique field + let(:t_public_curve_id) { TPM::ECC_NIST_P384 } it "returns nil" do expect(key_attestation.key).to be nil