mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-12-01 02:36:02 +01:00
clippy: also ban the rsa private-key methods
disallowed-types only fires where a type is named. A private key that reaches pdfcraft without its type being named, returned by another crate or behind a generic over rsa's traits, could still decrypt or sign. The RsaPrivateKey constructors and private-key methods, and the private-key methods of rsa's Decryptor, RandomizedDecryptor, PaddingScheme and SignatureScheme traits, are now disallowed methods. The generic signature and pkcs8 traits stay allowed: the ECDSA keys use them too.
This commit is contained in:
1 parent
97354050b2
commit
f8e60b4cc3
1 file changed
+20
-1
+20
-1
@@ -15,11 +15,30 @@ disallowed-methods = [
|
||||
# The raw RSA private-key operations: see disallowed-types below.
|
||||
{ path = "rsa::hazmat::rsa_decrypt", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::hazmat::rsa_decrypt_and_check", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
# The ways to make or use an `rsa` private key, so a key whose type is never named (one
|
||||
# returned by another crate, or a generic over these traits) is caught too. The generic
|
||||
# `signature` and `pkcs8` traits are left out: the ECDSA keys use them as well.
|
||||
{ path = "rsa::RsaPrivateKey::new", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::RsaPrivateKey::new_unchecked", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::RsaPrivateKey::new_with_exp", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::RsaPrivateKey::new_with_exp_unchecked", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::RsaPrivateKey::from_components", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::RsaPrivateKey::from_components_with_large_exponent", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::RsaPrivateKey::from_p_q", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::RsaPrivateKey::from_primes", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::RsaPrivateKey::decrypt", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::RsaPrivateKey::decrypt_blinded", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::RsaPrivateKey::sign", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::RsaPrivateKey::sign_with_rng", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::traits::Decryptor::decrypt", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::traits::RandomizedDecryptor::decrypt_with_rng", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::traits::PaddingScheme::decrypt", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
{ path = "rsa::traits::SignatureScheme::sign", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
]
|
||||
|
||||
# deny.toml ignores the Marvin advisory (RUSTSEC-2023-0071) because `rsa` is only used to verify
|
||||
# signatures; RSA private-key operations use aws-lc-rs (ADR-0009). These are the `rsa` types
|
||||
# that hold a private key, and above are the `rsa::hazmat` functions that take one, so a
|
||||
# that hold a private key, and above are the functions and methods that make or use one, so a
|
||||
# private-key operation through `rsa` fails clippy instead.
|
||||
disallowed-types = [
|
||||
{ path = "rsa::RsaPrivateKey", reason = "rsa is for verification only (RUSTSEC-2023-0071, ADR-0009); use aws-lc-rs" },
|
||||
|
||||
Reference in new issue
Block a user