fix(crypto): reject plaintext fallback without crypto (#4391)

* fix(crypto): reject plaintext fallback without crypto

* test(crypto): gate no-feature regression under cfg
This commit is contained in:
Zhengchao An
2026-07-08 09:29:37 +08:00
committed by GitHub
parent 2b063b0c4a
commit f8ee0e7071
6 changed files with 30 additions and 7 deletions
+3
View File
@@ -26,6 +26,9 @@ pub enum Error {
#[error("invalid key length")]
ErrInvalidKeyLength,
#[error("crypto feature is disabled")]
ErrCryptoDisabled,
#[cfg(any(test, feature = "crypto"))]
#[error("{0}")]
ErrInvalidLength(#[from] sha2::digest::InvalidLength),