diff --git a/src/ctap/crypto_wrapper.rs b/src/ctap/crypto_wrapper.rs index 3420081..cd59d65 100644 --- a/src/ctap/crypto_wrapper.rs +++ b/src/ctap/crypto_wrapper.rs @@ -89,7 +89,9 @@ pub fn aes256_cbc_decrypt( } /// An asymmetric private key that can sign messages. -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug)] +// We shouldn't compare private keys in prod without constant-time operations. +#[cfg_attr(test, derive(PartialEq, Eq))] pub enum PrivateKey { Ecdsa(ecdsa::SecKey), } diff --git a/src/ctap/data_formats.rs b/src/ctap/data_formats.rs index b5866de..658ba58 100644 --- a/src/ctap/data_formats.rs +++ b/src/ctap/data_formats.rs @@ -571,7 +571,8 @@ impl TryFrom for CredentialProtectionPolicy { // // Note that we only use the WebAuthn definition as an example. This data-structure is not specified // by FIDO. In particular we may choose how we serialize and deserialize it. -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug)] +#[cfg_attr(test, derive(PartialEq, Eq))] pub struct PublicKeyCredentialSource { pub key_type: PublicKeyCredentialType, pub credential_id: Vec,