Skip to content

Commit

Permalink
update Nonce size limits
Browse files Browse the repository at this point in the history
This change wants to sync with veraison/ear#35.

Signed-off-by: Dave Chen <[email protected]>
  • Loading branch information
chendave committed Oct 16, 2023
1 parent 5b41088 commit 6f60f0c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/nonce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ impl TryFrom<&str> for OneNonce {
type Error = Error;

fn try_from(v: &str) -> Result<Self, Error> {
if v.len() >= 10 && v.len() <= 74 {
if v.len() >= 8 && v.len() <= 88 {
Ok(OneNonce::String(v.to_string()))
} else {
Err(Error::ParseError(
"nonce must be between 10 and 74 characters".to_string(),
"nonce must be between 8 and 88 characters".to_string(),
))
}
}
Expand Down Expand Up @@ -318,7 +318,7 @@ mod test {
let e = Nonce::try_from("foo").unwrap_err();
assert_eq!(
e.to_string(),
"parse error: nonce must be between 10 and 74 characters"
"parse error: nonce must be between 8 and 88 characters"
);

let e = Nonce::try_from(
Expand All @@ -327,7 +327,7 @@ mod test {
.unwrap_err();
assert_eq!(
e.to_string(),
"parse error: nonce must be between 10 and 74 characters"
"parse error: nonce must be between 8 and 88 characters"
);
}

Expand Down Expand Up @@ -368,7 +368,7 @@ mod test {
let e = Nonce::try_from(["test value one", "foo"].as_slice()).unwrap_err();
assert_eq!(
e.to_string(),
"parse error: item 1: nonce must be between 10 and 74 characters"
"parse error: item 1: nonce must be between 8 and 88 characters"
);
}

Expand Down

0 comments on commit 6f60f0c

Please sign in to comment.