From f7011725bd23296b8de300cd865381b5915b9b9f Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Fri, 26 Jul 2024 15:14:34 -0600 Subject: [PATCH] aes,kuznyechik,threefish: Rust 1.80 lint fixes (#429) - add `lints.rust.unexpected_cfgs` to Cargo.toml - threefish: fix typo in `cfg(feature = "cipher")` --- aes/Cargo.toml | 6 +++++- kuznyechik/Cargo.toml | 4 ++++ threefish/tests/mod.rs | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/aes/Cargo.toml b/aes/Cargo.toml index 4fe31c77..023b5996 100644 --- a/aes/Cargo.toml +++ b/aes/Cargo.toml @@ -15,7 +15,7 @@ categories = ["cryptography", "no-std"] [dependencies] cfg-if = "1" cipher = "=0.5.0-pre.4" -zeroize = { version = "1.5.6", optional = true, default_features = false, features = ["aarch64"] } +zeroize = { version = "1.5.6", optional = true, default-features = false, features = ["aarch64"] } [target.'cfg(any(target_arch = "aarch64", target_arch = "x86_64", target_arch = "x86"))'.dependencies] cpufeatures = "0.2" @@ -27,6 +27,10 @@ hex-literal = "0.3" [features] hazmat = [] # Expose cryptographically hazardous APIs +[lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = ["cfg(aes_compact)", "cfg(aes_force_soft)"] + [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] diff --git a/kuznyechik/Cargo.toml b/kuznyechik/Cargo.toml index 415198af..67d6451e 100644 --- a/kuznyechik/Cargo.toml +++ b/kuznyechik/Cargo.toml @@ -22,6 +22,10 @@ hex-literal = "0.4" [features] zeroize = ["cipher/zeroize"] +[lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = ["cfg(kuznyechik_force_soft)"] + [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] diff --git a/threefish/tests/mod.rs b/threefish/tests/mod.rs index d1c738be..6b357600 100644 --- a/threefish/tests/mod.rs +++ b/threefish/tests/mod.rs @@ -1,6 +1,6 @@ //! Test vectors from: //! https://github.com/weidai11/cryptopp/blob/master/TestVectors/threefish.txt -#![cfg(featue = "cipher")] +#![cfg(feature = "cipher")] use cipher::{Block, BlockCipherDecrypt, BlockCipherEncrypt, KeyInit}; use hex_literal::hex; use threefish::{Threefish1024, Threefish256, Threefish512};