-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Make DSA.Create, AesCcm, AesGcm, ChaCha20Poly1305 throw PNSE on iOS #52978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
55b5851
Make DSA.Create, AesCcm, AesGcm, ChaCha20Poly1305 throw PNSE on iOS
filipnavara 034b4ab
Remove DSASecurityTransforms.iOS.cs
filipnavara 8152f88
Re-enable System.Security.Cryptography.Algorithms.Tests on iOS
filipnavara 2e10774
Fix System.Security.Cryptography.Primitives.Tests CryptoConfig tests
filipnavara 51368a3
Disable DSA tests in System.Security.Cryptography.Csp.Tests
filipnavara 367ea34
Enable System.Security.Cryptography.Pkcs tests on iOS
filipnavara 7848f96
Enable System.Security.Cryptography.Xml tests on iOS
filipnavara 806376d
Add UnsupportedOSPlatform attributes
filipnavara 37fa10d
Annotate DSAKeyValue default constructor with UnsupportedOSPlatform
filipnavara 39eea65
Simplify platform checks
filipnavara 0cfc56e
Add more UnsupportedOSPlatform attributes to DSA.Create
filipnavara 4cb6326
Fix ApiCompat
filipnavara 6c61e1d
Might as well use DSA.CreateCore in the other two DSA.Create methods
filipnavara d9a8cc8
More ApiCompat fixes
filipnavara fdc95f2
Fix test build
filipnavara c663d2a
Fix tests on Mac Catalyst
filipnavara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
src/libraries/Common/src/System/Security/Cryptography/DSASecurityTransforms.iOS.cs
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
....Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.NotSupported.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,48 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Diagnostics; | ||
|
|
||
| namespace System.Security.Cryptography | ||
| { | ||
| public partial class AesCcm | ||
| { | ||
| public static bool IsSupported => false; | ||
|
|
||
| #if !BROWSER // allow GenFacades to handle browser target | ||
| private void ImportKey(ReadOnlySpan<byte> key) | ||
| { | ||
| Debug.Fail("Instance ctor should fail before we reach this point."); | ||
| throw new NotImplementedException(); | ||
| } | ||
|
|
||
| private void EncryptCore( | ||
| ReadOnlySpan<byte> nonce, | ||
| ReadOnlySpan<byte> plaintext, | ||
| Span<byte> ciphertext, | ||
| Span<byte> tag, | ||
| ReadOnlySpan<byte> associatedData = default) | ||
| { | ||
| Debug.Fail("Instance ctor should fail before we reach this point."); | ||
| throw new NotImplementedException(); | ||
| } | ||
|
|
||
| private void DecryptCore( | ||
| ReadOnlySpan<byte> nonce, | ||
| ReadOnlySpan<byte> ciphertext, | ||
| ReadOnlySpan<byte> tag, | ||
| Span<byte> plaintext, | ||
| ReadOnlySpan<byte> associatedData = default) | ||
| { | ||
| Debug.Fail("Instance ctor should fail before we reach this point."); | ||
| throw new NotImplementedException(); | ||
| } | ||
|
|
||
| public void Dispose() | ||
| { | ||
| Debug.Fail("Instance ctor should fail before we reach this point."); | ||
| // no-op | ||
| } | ||
| #endif | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
....Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.NotSupported.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,48 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Diagnostics; | ||
|
|
||
| namespace System.Security.Cryptography | ||
| { | ||
| public partial class AesGcm | ||
| { | ||
| public static bool IsSupported => false; | ||
|
|
||
| #if !BROWSER // allow GenFacades to handle browser target | ||
| private void ImportKey(ReadOnlySpan<byte> key) | ||
| { | ||
| Debug.Fail("Instance ctor should fail before we reach this point."); | ||
| throw new NotImplementedException(); | ||
| } | ||
|
|
||
| private void EncryptCore( | ||
| ReadOnlySpan<byte> nonce, | ||
| ReadOnlySpan<byte> plaintext, | ||
| Span<byte> ciphertext, | ||
| Span<byte> tag, | ||
| ReadOnlySpan<byte> associatedData = default) | ||
| { | ||
| Debug.Fail("Instance ctor should fail before we reach this point."); | ||
| throw new NotImplementedException(); | ||
| } | ||
|
|
||
| private void DecryptCore( | ||
| ReadOnlySpan<byte> nonce, | ||
| ReadOnlySpan<byte> ciphertext, | ||
| ReadOnlySpan<byte> tag, | ||
| Span<byte> plaintext, | ||
| ReadOnlySpan<byte> associatedData = default) | ||
| { | ||
| Debug.Fail("Instance ctor should fail before we reach this point."); | ||
| throw new NotImplementedException(); | ||
| } | ||
|
|
||
| public void Dispose() | ||
| { | ||
| Debug.Fail("Instance ctor should fail before we reach this point."); | ||
| // no-op | ||
| } | ||
| #endif | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...urity.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.Create.NotSupported.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Runtime.Versioning; | ||
|
|
||
| namespace System.Security.Cryptography | ||
| { | ||
| public partial class DSA : AsymmetricAlgorithm | ||
| { | ||
| private static DSA CreateCore() | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.