Skip to content

Commit

Permalink
fixup! test(TPM::KeyAttestation#key): returns nil when t_public curve…
Browse files Browse the repository at this point in the history
…_id differs from key curve_id
  • Loading branch information
nicolastemciuc committed Feb 5, 2025
1 parent 5e4a328 commit 2c57170
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/tpm/key_attestation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2c57170

Please sign in to comment.