Skip to content

Commit f2979c4

Browse files
sergio-correiaansasaki
authored andcommitted
Fix ECC algorithm selection and reporting for keylime agent
- Use AsymmetricAlgorithmSelection instead of AsymmetricAlgorithm to allow ecc521 to properly map to P-521 curve instead of defaulting to P-256 - Change ECC256 algorithm display from generic "ecc" to specific "ecc256" These changes are required for enabling ECC attestation with the NIST curves. Signed-off-by: Sergio Correia <[email protected]>
1 parent 5e32460 commit f2979c4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

keylime/src/algorithms.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ impl fmt::Display for EncryptionAlgorithm {
279279
EncryptionAlgorithm::Rsa4096 => "rsa4096",
280280
EncryptionAlgorithm::Ecc192 => "ecc192",
281281
EncryptionAlgorithm::Ecc224 => "ecc224",
282-
EncryptionAlgorithm::Ecc256 => "ecc", /* for backwards compatibility */
282+
EncryptionAlgorithm::Ecc256 => "ecc256",
283283
EncryptionAlgorithm::Ecc384 => "ecc384",
284284
EncryptionAlgorithm::Ecc521 => "ecc521",
285285
EncryptionAlgorithm::EccSm2 => "ecc_sm2",

keylime/src/tpm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use tss_esapi::{
3131
abstraction::{
3232
ak, ek, nv,
3333
pcr::{read_all, PcrData},
34-
DefaultKey,
34+
AsymmetricAlgorithmSelection, DefaultKey,
3535
},
3636
attributes::{
3737
object::ObjectAttributesBuilder, session::SessionAttributesBuilder,
@@ -773,7 +773,7 @@ impl Context<'_> {
773773
&mut self.inner.lock().unwrap(), //#[allow_ci]
774774
handle,
775775
hash_alg.into(),
776-
key_alg.into(),
776+
Into::<AsymmetricAlgorithmSelection>::into(key_alg),
777777
sign_alg.into(),
778778
None,
779779
DefaultKey,

0 commit comments

Comments
 (0)