Skip to content

Commit 2dc41e7

Browse files
committed
Fix AEAD algorithm documentation to indicate when AuthenticationTagMismatchException is thrown
1 parent 9951e3f commit 2dc41e7

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

xml/System.Security.Cryptography/AesCcm.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ The <paramref name="nonce" /> parameter length is not permitted by <see cref="P:
212212

213213
The <paramref name="tag" /> parameter length is not permitted by <see cref="P:System.Security.Cryptography.AesCcm.TagByteSizes" />.</exception>
214214
<exception cref="T:System.ArgumentNullException">The <paramref name="nonce" />, <paramref name="ciphertext" />, <paramref name="tag" />, or <paramref name="plaintext" /> parameter is <see langword="null" />.</exception>
215-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
215+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
216+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
216217
</Docs>
217218
</Member>
218219
<Member MemberName="Decrypt">
@@ -280,7 +281,8 @@ The <paramref name="nonce" /> parameter length is not permitted by <see cref="P:
280281
-or-
281282

282283
The <paramref name="tag" /> parameter length is not permitted by <see cref="P:System.Security.Cryptography.AesCcm.TagByteSizes" />.</exception>
283-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
284+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
285+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
284286
</Docs>
285287
</Member>
286288
<Member MemberName="Dispose">

xml/System.Security.Cryptography/AesGcm.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ The <paramref name="nonce" /> parameter length is not permitted by <see cref="P:
309309

310310
The <paramref name="tag" /> parameter length is not permitted by <see cref="P:System.Security.Cryptography.AesGcm.TagByteSizes" />.</exception>
311311
<exception cref="T:System.ArgumentNullException">The <paramref name="nonce" />, <paramref name="ciphertext" />, <paramref name="tag" />, or <paramref name="plaintext" /> parameter is <see langword="null" />.</exception>
312-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
312+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
313+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
313314
</Docs>
314315
</Member>
315316
<Member MemberName="Decrypt">
@@ -377,7 +378,8 @@ The <paramref name="nonce" /> parameter length is not permitted by <see cref="P:
377378
-or-
378379

379380
The <paramref name="tag" /> parameter length is not permitted by <see cref="P:System.Security.Cryptography.AesGcm.TagByteSizes" />.</exception>
380-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
381+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
382+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
381383
</Docs>
382384
</Member>
383385
<Member MemberName="Dispose">

xml/System.Security.Cryptography/ChaCha20Poly1305.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ The <paramref name="nonce" /> parameter length is not 12 bytes (96 bits).
187187

188188
The <paramref name="tag" /> parameter length is not 16 bytes (128 bits).</exception>
189189
<exception cref="T:System.ArgumentNullException">The <paramref name="nonce" />, <paramref name="ciphertext" />, <paramref name="tag" />, or <paramref name="plaintext" /> parameter is <see langword="null" />.</exception>
190-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
190+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
191+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
191192
</Docs>
192193
</Member>
193194
<Member MemberName="Decrypt">
@@ -242,7 +243,8 @@ The <paramref name="nonce" /> parameter length is not 12 bytes (96 bits).
242243
-or-
243244

244245
The <paramref name="tag" /> parameter length is not 16 bytes (128 bits).</exception>
245-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
246+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
247+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
246248
</Docs>
247249
</Member>
248250
<Member MemberName="Dispose">

0 commit comments

Comments
 (0)