connector-contract-v3: bracket the over-long-id refusal by the carriage frame
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b6ad75c610
commit
2101602b8f
1 changed files with 5 additions and 5 deletions
|
|
@ -1027,12 +1027,12 @@ mod tests {
|
||||||
&security(KEY),
|
&security(KEY),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
// The sealed size varies with the random nonce and ciphertext bytes
|
// The frame carries the id twice (the message id and the envelope's
|
||||||
// (a byte of 128 or more takes two), so bracket it: the ciphertext
|
// request id) and the base64 of the envelope, so bracket it: the
|
||||||
// plus the id is a floor, twice the ciphertext plus the id and the
|
// ciphertext plus the id is a floor, twice the ciphertext and both
|
||||||
// envelope's other fields is a ceiling.
|
// ids plus the envelope's other fields is a ceiling.
|
||||||
let floor = sealed.ciphertext.len() + id.len();
|
let floor = sealed.ciphertext.len() + id.len();
|
||||||
let ceiling = 2 * sealed.ciphertext.len() + id.len() + 512;
|
let ceiling = 2 * (sealed.ciphertext.len() + 2 * id.len()) + 512;
|
||||||
let store = TestStore::new();
|
let store = TestStore::new();
|
||||||
let mut service = open_service(&store, 1);
|
let mut service = open_service(&store, 1);
|
||||||
assert!(matches!(
|
assert!(matches!(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue