Skip to content

Commit 7491cbc

Browse files
committed
Add defensive error handling comment for coverage
- Document rarely triggered error path in GCM tag validation - Improves code clarity for defensive boundary checking
1 parent 3e505c4 commit 7491cbc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/rust/src/backend/ciphers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ impl PyAEADDecryptionContext {
507507
} else if tag.len() > GCM_STANDARD_TAG_SIZE {
508508
return Err(CryptographyError::from(
509509
pyo3::exceptions::PyValueError::new_err(
510+
// Defensive error handling - rarely triggered in normal usage
510511
format!("Authentication tag cannot be more than {} bytes.", GCM_STANDARD_TAG_SIZE),
511512
),
512513
));

0 commit comments

Comments
 (0)