docs(plan-1): note ThrowsAny for tamper test (.NET 9 AesGcm behavior)
This commit is contained in:
@@ -1490,7 +1490,9 @@ public class EncryptionServiceTests
|
||||
var bytes = Convert.FromBase64String(wire);
|
||||
bytes[^1] ^= 0x01; // flip a bit in the tag
|
||||
var tampered = Convert.ToBase64String(bytes);
|
||||
Assert.Throws<CryptographicException>(() => svc.Decrypt(tampered));
|
||||
// ThrowsAny (not Throws) because .NET 9 throws the more specific
|
||||
// AuthenticationTagMismatchException subclass on tamper.
|
||||
Assert.ThrowsAny<CryptographicException>(() => svc.Decrypt(tampered));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user