From c43c7011e79cff4470e792eddcd2ccb47344a17e Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Wed, 1 Nov 2023 07:36:36 +0800 Subject: [PATCH] feat: v1.7.8 --- src/cmd_hmac_sha1.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd_hmac_sha1.rs b/src/cmd_hmac_sha1.rs index 26164b9..2a44585 100644 --- a/src/cmd_hmac_sha1.rs +++ b/src/cmd_hmac_sha1.rs @@ -46,6 +46,10 @@ impl Command for CommandImpl { return simple_error!("Challenge must assigned"); }; + if secret_bytes.len() != 20 { + return simple_error!("Secret length must be 20, actual is: {}", secret_bytes.len()); + } + // Challenge can not be greater than 64 bytes if challenge_bytes.len() > 64 { return simple_error!("Challenge bytes is: {}, more than 64", challenge_bytes.len());