-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[tvOS] Make the managed code depending on System.Net.Security.Native throw PNSE #51861
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
marek-safar
merged 10 commits into
dotnet:main
from
MaximLipnin:make_snsn_throw_pnse_on_tvos
Apr 29, 2021
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
457c937
Add PNSE version of NegotiateStreamPal class
MaximLipnin 871ac98
Rename PNSE to PlatformNotSupported
MaximLipnin 60d99f7
Remove the interop files from the build
MaximLipnin 0ac3a31
Remove redundant compile element
MaximLipnin 3fc038e
Add missing compile elements
MaximLipnin 7d9a449
Make the handle ctors private
MaximLipnin 9f2c488
Exclude SafeDeleteNegoContext.cs and SafeFreeNegoCredentials.cs from …
MaximLipnin ac37b41
Highlight the unsupported APIs
MaximLipnin 60b7a9f
Update ref-part
MaximLipnin bff6a09
Reduce the condition
MaximLipnin 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
Next
Next commit
Add PNSE version of NegotiateStreamPal class
- Loading branch information
commit 457c937753fadaffbd7ea4c4ae585be9758bd4c3
There are no files selected for viewing
122 changes: 122 additions & 0 deletions
122
src/libraries/Common/src/System/Net/Security/NegotiateStreamPal.PNSE.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,122 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.IO; | ||
| using System.ComponentModel; | ||
| using System.Diagnostics; | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using System.Runtime.InteropServices; | ||
| using System.Security; | ||
| using System.Security.Authentication; | ||
| using System.Security.Authentication.ExtendedProtection; | ||
| using System.Security.Principal; | ||
| using System.Text; | ||
| using System.Threading; | ||
| using Microsoft.Win32.SafeHandles; | ||
|
|
||
| namespace System.Net.Security | ||
| { | ||
| // | ||
| // The class maintains the state of the authentication process and the security context. | ||
| // It encapsulates security context and does the real work in authentication and | ||
| // user data encryption with NEGO SSPI package. | ||
| // | ||
| internal static partial class NegotiateStreamPal | ||
| { | ||
| internal static string QueryContextClientSpecifiedSpn(SafeDeleteContext securityContext) | ||
| { | ||
| throw new PlatformNotSupportedException(SR.net_nego_server_not_supported); | ||
| } | ||
|
|
||
| internal static string QueryContextAuthenticationPackage(SafeDeleteContext securityContext) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
|
|
||
| internal static SecurityStatusPal InitializeSecurityContext( | ||
| ref SafeFreeCredentials credentialsHandle, | ||
| ref SafeDeleteContext? securityContext, | ||
| string? spn, | ||
| ContextFlagsPal requestedContextFlags, | ||
| byte[]? incomingBlob, | ||
| ChannelBinding? channelBinding, | ||
| ref byte[]? resultBlob, | ||
| ref ContextFlagsPal contextFlags) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
|
|
||
| internal static SecurityStatusPal AcceptSecurityContext( | ||
| SafeFreeCredentials? credentialsHandle, | ||
| ref SafeDeleteContext? securityContext, | ||
| ContextFlagsPal requestedContextFlags, | ||
| byte[]? incomingBlob, | ||
| ChannelBinding? channelBinding, | ||
| ref byte[] resultBlob, | ||
| ref ContextFlagsPal contextFlags) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
|
|
||
| internal static Win32Exception CreateExceptionFromError(SecurityStatusPal statusCode) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
|
|
||
| internal static int QueryMaxTokenSize(string package) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
|
|
||
| internal static SafeFreeCredentials AcquireDefaultCredential(string package, bool isServer) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
|
|
||
| internal static SafeFreeCredentials AcquireCredentialsHandle(string package, bool isServer, NetworkCredential credential) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
|
|
||
| internal static SecurityStatusPal CompleteAuthToken( | ||
| ref SafeDeleteContext? securityContext, | ||
| byte[]? incomingBlob) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
|
|
||
| internal static int Encrypt( | ||
| SafeDeleteContext securityContext, | ||
| ReadOnlySpan<byte> buffer, | ||
| bool isConfidential, | ||
| bool isNtlm, | ||
| [NotNull] ref byte[]? output, | ||
| uint sequenceNumber) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
|
|
||
| internal static int Decrypt( | ||
| SafeDeleteContext securityContext, | ||
| byte[]? buffer, | ||
| int offset, | ||
| int count, | ||
| bool isConfidential, | ||
| bool isNtlm, | ||
| out int newOffset, | ||
| uint sequenceNumber) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
|
|
||
| internal static int VerifySignature(SafeDeleteContext securityContext, byte[] buffer, int offset, int count) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
|
|
||
| internal static int MakeSignature(SafeDeleteContext securityContext, byte[] buffer, int offset, int count, [AllowNull] ref byte[] output) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
| } | ||
| } |
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
31 changes: 31 additions & 0 deletions
31
src/libraries/System.Net.Security/src/System/Net/Security/NegotiateStreamPal.PNSE.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,31 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.ComponentModel; | ||
| using System.Security.Principal; | ||
|
|
||
| namespace System.Net.Security | ||
| { | ||
| // | ||
| // The class maintains the state of the authentication process and the security context. | ||
| // It encapsulates security context and does the real work in authentication and | ||
| // user data encryption with NEGO SSPI package. | ||
| // | ||
| internal static partial class NegotiateStreamPal | ||
| { | ||
| internal static IIdentity GetIdentity(NTAuthentication context) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
|
|
||
| internal static string QueryContextAssociatedName(SafeDeleteContext? securityContext) | ||
| { | ||
| throw new PlatformNotSupportedException(SR.net_nego_server_not_supported); | ||
| } | ||
|
|
||
| internal static void ValidateImpersonationLevel(TokenImpersonationLevel impersonationLevel) | ||
| { | ||
| throw new PlatformNotSupportedException(); | ||
| } | ||
| } | ||
| } |
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.