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());