Skip to content

Commit 6139eea

Browse files
authored
Fix AEAD algorithm documentation to indicate when AuthenticationTagMismatchException is thrown (#10471)
1 parent 15dfa29 commit 6139eea

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
@@ -305,7 +305,8 @@ The <paramref name="nonce" /> parameter length is not permitted by <see cref="P:
305305

306306
The <paramref name="tag" /> parameter length is not permitted by <see cref="P:System.Security.Cryptography.AesGcm.TagByteSizes" />.</exception>
307307
<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>
308-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
308+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
309+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
309310
</Docs>
310311
</Member>
311312
<Member MemberName="Decrypt">
@@ -373,7 +374,8 @@ The <paramref name="nonce" /> parameter length is not permitted by <see cref="P:
373374
-or-
374375

375376
The <paramref name="tag" /> parameter length is not permitted by <see cref="P:System.Security.Cryptography.AesGcm.TagByteSizes" />.</exception>
376-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
377+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
378+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
377379
</Docs>
378380
</Member>
379381
<Member MemberName="Dispose">

xml/System.Security.Cryptography/ChaCha20Poly1305.xml

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

184184
The <paramref name="tag" /> parameter length is not 16 bytes (128 bits).</exception>
185185
<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>
186-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
186+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
187+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
187188
</Docs>
188189
</Member>
189190
<Member MemberName="Decrypt">
@@ -238,7 +239,8 @@ The <paramref name="nonce" /> parameter length is not 12 bytes (96 bits).
238239
-or-
239240

240241
The <paramref name="tag" /> parameter length is not 16 bytes (128 bits).</exception>
241-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
242+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
243+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
242244
</Docs>
243245
</Member>
244246
<Member MemberName="Dispose">

0 commit comments

Comments
 (0)