554 references to Interop
System.Net.Security (554)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LibraryImports.g.cs (182)
7
internal static extern partial global::
Interop
.Error ConvertErrorPlatformToPal(int platformErrno);
15
internal static extern partial int ConvertErrorPalToPlatform(global::
Interop
.Error error);
47
internal static partial global::
Interop
.NetSecurityNative.Status DisplayMinorStatus(out global::
Interop
.NetSecurityNative.Status minorStatus, global::
Interop
.NetSecurityNative.Status statusValue, ref global::
Interop
.NetSecurityNative.GssBuffer buffer)
52
global::
Interop
.NetSecurityNative.Status __retVal;
54
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __buffer_native = &buffer)
55
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
62
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, global::
Interop
.NetSecurityNative.Status __statusValue_native, global::
Interop
.NetSecurityNative.GssBuffer* __buffer_native);
72
internal static partial global::
Interop
.NetSecurityNative.Status DisplayMajorStatus(out global::
Interop
.NetSecurityNative.Status minorStatus, global::
Interop
.NetSecurityNative.Status statusValue, ref global::
Interop
.NetSecurityNative.GssBuffer buffer)
77
global::
Interop
.NetSecurityNative.Status __retVal;
79
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __buffer_native = &buffer)
80
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
87
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, global::
Interop
.NetSecurityNative.Status __statusValue_native, global::
Interop
.NetSecurityNative.GssBuffer* __buffer_native);
97
internal static partial global::
Interop
.NetSecurityNative.Status ImportUserName(out global::
Interop
.NetSecurityNative.Status minorStatus, string inputName, int inputNameByteCount, out global::Microsoft.Win32.SafeHandles.SafeGssNameHandle outputName)
106
global::
Interop
.NetSecurityNative.Status __retVal = default;
115
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
140
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, byte* __inputName_native, int __inputNameByteCount_native, nint* __outputName_native);
150
internal static partial global::
Interop
.NetSecurityNative.Status ImportPrincipalName(out global::
Interop
.NetSecurityNative.Status minorStatus, string inputName, int inputNameByteCount, out global::Microsoft.Win32.SafeHandles.SafeGssNameHandle outputName)
159
global::
Interop
.NetSecurityNative.Status __retVal = default;
168
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
193
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, byte* __inputName_native, int __inputNameByteCount_native, nint* __outputName_native);
203
internal static partial global::
Interop
.NetSecurityNative.Status ReleaseName(out global::
Interop
.NetSecurityNative.Status minorStatus, ref nint inputName)
208
global::
Interop
.NetSecurityNative.Status __retVal;
211
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
218
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint* __inputName_native);
228
internal static partial global::
Interop
.NetSecurityNative.Status AcquireAcceptorCred(out global::
Interop
.NetSecurityNative.Status minorStatus, global::
Interop
.NetSecurityNative.PackageType packageType, out global::Microsoft.Win32.SafeHandles.SafeGssCredHandle outputCredHandle)
236
global::
Interop
.NetSecurityNative.Status __retVal = default;
242
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
263
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, global::
Interop
.NetSecurityNative.PackageType __packageType_native, nint* __outputCredHandle_native);
273
internal static partial global::
Interop
.NetSecurityNative.Status InitiateCredSpNego(out global::
Interop
.NetSecurityNative.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssNameHandle desiredName, out global::Microsoft.Win32.SafeHandles.SafeGssCredHandle outputCredHandle)
282
global::
Interop
.NetSecurityNative.Status __retVal = default;
291
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
316
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint __desiredName_native, nint* __outputCredHandle_native);
326
internal static partial global::
Interop
.NetSecurityNative.Status InitiateCredWithPassword(out global::
Interop
.NetSecurityNative.Status minorStatus, global::
Interop
.NetSecurityNative.PackageType packageType, global::Microsoft.Win32.SafeHandles.SafeGssNameHandle desiredName, string password, int passwordLen, out global::Microsoft.Win32.SafeHandles.SafeGssCredHandle outputCredHandle)
336
global::
Interop
.NetSecurityNative.Status __retVal = default;
347
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
374
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, global::
Interop
.NetSecurityNative.PackageType __packageType_native, nint __desiredName_native, byte* __password_native, int __passwordLen_native, nint* __outputCredHandle_native);
384
internal static partial global::
Interop
.NetSecurityNative.Status ReleaseCred(out global::
Interop
.NetSecurityNative.Status minorStatus, ref nint credHandle)
389
global::
Interop
.NetSecurityNative.Status __retVal;
392
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
399
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint* __credHandle_native);
409
private static partial global::
Interop
.NetSecurityNative.Status InitSecContext(out global::
Interop
.NetSecurityNative.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssCredHandle initiatorCredHandle, ref global::Microsoft.Win32.SafeHandles.SafeGssContextHandle contextHandle, global::
Interop
.NetSecurityNative.PackageType packageType, global::Microsoft.Win32.SafeHandles.SafeGssNameHandle targetName, uint reqFlags, ref byte inputBytes, int inputLength, ref global::
Interop
.NetSecurityNative.GssBuffer token, out uint retFlags, out bool isNtlmUsed)
421
global::
Interop
.NetSecurityNative.Status __retVal = default;
434
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __token_native = &token)
436
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
467
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint __initiatorCredHandle_native, nint* __contextHandle_native, global::
Interop
.NetSecurityNative.PackageType __packageType_native, nint __targetName_native, uint __reqFlags_native, byte* __inputBytes_native, int __inputLength_native, global::
Interop
.NetSecurityNative.GssBuffer* __token_native, uint* __retFlags_native, int* __isNtlmUsed_native);
477
private static partial global::
Interop
.NetSecurityNative.Status InitSecContext(out global::
Interop
.NetSecurityNative.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssCredHandle initiatorCredHandle, ref global::Microsoft.Win32.SafeHandles.SafeGssContextHandle contextHandle, global::
Interop
.NetSecurityNative.PackageType packageType, nint cbt, int cbtSize, global::Microsoft.Win32.SafeHandles.SafeGssNameHandle targetName, uint reqFlags, ref byte inputBytes, int inputLength, ref global::
Interop
.NetSecurityNative.GssBuffer token, out uint retFlags, out bool isNtlmUsed)
489
global::
Interop
.NetSecurityNative.Status __retVal = default;
502
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __token_native = &token)
504
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
535
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint __initiatorCredHandle_native, nint* __contextHandle_native, global::
Interop
.NetSecurityNative.PackageType __packageType_native, nint __cbt_native, int __cbtSize_native, nint __targetName_native, uint __reqFlags_native, byte* __inputBytes_native, int __inputLength_native, global::
Interop
.NetSecurityNative.GssBuffer* __token_native, uint* __retFlags_native, int* __isNtlmUsed_native);
545
private static partial global::
Interop
.NetSecurityNative.Status AcceptSecContext(out global::
Interop
.NetSecurityNative.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssCredHandle acceptorCredHandle, ref global::Microsoft.Win32.SafeHandles.SafeGssContextHandle acceptContextHandle, nint cbt, int cbtSize, ref byte inputBytes, int inputLength, ref global::
Interop
.NetSecurityNative.GssBuffer token, out uint retFlags, out bool isNtlmUsed)
556
global::
Interop
.NetSecurityNative.Status __retVal = default;
567
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __token_native = &token)
569
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
598
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint __acceptorCredHandle_native, nint* __acceptContextHandle_native, nint __cbt_native, int __cbtSize_native, byte* __inputBytes_native, int __inputLength_native, global::
Interop
.NetSecurityNative.GssBuffer* __token_native, uint* __retFlags_native, int* __isNtlmUsed_native);
608
internal static partial global::
Interop
.NetSecurityNative.Status DeleteSecContext(out global::
Interop
.NetSecurityNative.Status minorStatus, ref nint contextHandle)
613
global::
Interop
.NetSecurityNative.Status __retVal;
616
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
623
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint* __contextHandle_native);
633
internal static partial global::
Interop
.NetSecurityNative.Status GetUser(out global::
Interop
.NetSecurityNative.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssContextHandle acceptContextHandle, ref global::
Interop
.NetSecurityNative.GssBuffer token)
639
global::
Interop
.NetSecurityNative.Status __retVal = default;
647
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __token_native = &token)
648
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
663
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint __acceptContextHandle_native, global::
Interop
.NetSecurityNative.GssBuffer* __token_native);
673
internal static unsafe partial global::
Interop
.NetSecurityNative.Status GetNameAttribute(out global::
Interop
.NetSecurityNative.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssContextHandle acceptContextHandle, byte* attributeName, uint attributeNameLen, out bool isAvailable, out bool isAuthenticated, ref global::
Interop
.NetSecurityNative.GssBuffer token)
683
global::
Interop
.NetSecurityNative.Status __retVal = default;
691
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __token_native = &token)
692
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
710
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint __acceptContextHandle_native, byte* __attributeName_native, uint __attributeNameLen_native, int* __isAvailable_native, int* __isAuthenticated_native, global::
Interop
.NetSecurityNative.GssBuffer* __token_native);
720
private static unsafe partial global::
Interop
.NetSecurityNative.Status Wrap(out global::
Interop
.NetSecurityNative.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssContextHandle contextHandle, ref bool isEncrypt, byte* inputBytes, int count, ref global::
Interop
.NetSecurityNative.GssBuffer outBuffer)
727
global::
Interop
.NetSecurityNative.Status __retVal = default;
736
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __outBuffer_native = &outBuffer)
737
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
754
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint __contextHandle_native, int* __isEncrypt_native, byte* __inputBytes_native, int __count_native, global::
Interop
.NetSecurityNative.GssBuffer* __outBuffer_native);
764
private static unsafe partial global::
Interop
.NetSecurityNative.Status Unwrap(out global::
Interop
.NetSecurityNative.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssContextHandle contextHandle, out bool isEncrypt, byte* inputBytes, int count, ref global::
Interop
.NetSecurityNative.GssBuffer outBuffer)
772
global::
Interop
.NetSecurityNative.Status __retVal = default;
780
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __outBuffer_native = &outBuffer)
781
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
798
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint __contextHandle_native, int* __isEncrypt_native, byte* __inputBytes_native, int __count_native, global::
Interop
.NetSecurityNative.GssBuffer* __outBuffer_native);
808
private static unsafe partial global::
Interop
.NetSecurityNative.Status GetMic(out global::
Interop
.NetSecurityNative.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssContextHandle contextHandle, byte* inputBytes, int inputLength, ref global::
Interop
.NetSecurityNative.GssBuffer outBuffer)
814
global::
Interop
.NetSecurityNative.Status __retVal = default;
822
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __outBuffer_native = &outBuffer)
823
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
838
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint __contextHandle_native, byte* __inputBytes_native, int __inputLength_native, global::
Interop
.NetSecurityNative.GssBuffer* __outBuffer_native);
848
private static unsafe partial global::
Interop
.NetSecurityNative.Status VerifyMic(out global::
Interop
.NetSecurityNative.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssContextHandle contextHandle, byte* inputBytes, int inputLength, byte* tokenBytes, int tokenLength)
854
global::
Interop
.NetSecurityNative.Status __retVal = default;
862
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
877
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint __contextHandle_native, byte* __inputBytes_native, int __inputLength_native, byte* __tokenBytes_native, int __tokenLength_native);
2461
internal static partial global::
Interop
.Ssl.SslErrorCode SslGetError(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, int ret)
2466
global::
Interop
.Ssl.SslErrorCode __retVal = default;
2487
static extern unsafe global::
Interop
.Ssl.SslErrorCode __PInvoke(nint __ssl_native, int __ret_native);
2814
internal static partial int SslWrite(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, ref byte buf, int num, out global::
Interop
.Ssl.SslErrorCode error)
2829
fixed (global::
Interop
.Ssl.SslErrorCode* __error_native = &error)
2848
static extern unsafe int __PInvoke(nint __ssl_native, byte* __buf_native, int __num_native, global::
Interop
.Ssl.SslErrorCode* __error_native);
2858
internal static partial int SslRead(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, ref byte buf, int num, out global::
Interop
.Ssl.SslErrorCode error)
2873
fixed (global::
Interop
.Ssl.SslErrorCode* __error_native = &error)
2892
static extern unsafe int __PInvoke(nint __ssl_native, byte* __buf_native, int __num_native, global::
Interop
.Ssl.SslErrorCode* __error_native);
2926
internal static partial int SslRenegotiate(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, out global::
Interop
.Ssl.SslErrorCode error)
2940
fixed (global::
Interop
.Ssl.SslErrorCode* __error_native = &error)
2955
static extern unsafe int __PInvoke(nint __ssl_native, global::
Interop
.Ssl.SslErrorCode* __error_native);
3167
internal static partial int SslDoHandshake(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, out global::
Interop
.Ssl.SslErrorCode error, bool processPeer)
3184
fixed (global::
Interop
.Ssl.SslErrorCode* __error_native = &error)
3202
static extern unsafe int __PInvoke(nint __ssl_native, global::
Interop
.Ssl.SslErrorCode* __error_native, int __processPeer_native);
3212
internal static unsafe partial int SslHandshake(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, byte* inputPtr, int inputLen, out int consumed, byte* outputPtr, int outputCap, out int outputWritten, out int outputPending, out global::
Interop
.Ssl.SslErrorCode errorCode)
3230
fixed (global::
Interop
.Ssl.SslErrorCode* __errorCode_native = &errorCode)
3251
static extern unsafe int __PInvoke(nint __ssl_native, byte* __inputPtr_native, int __inputLen_native, int* __consumed_native, byte* __outputPtr_native, int __outputCap_native, int* __outputWritten_native, int* __outputPending_native, global::
Interop
.Ssl.SslErrorCode* __errorCode_native);
3261
internal static unsafe partial int SslEncrypt(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, byte* plaintextPtr, int plaintextLen, byte* outputPtr, int outputCap, out int outputWritten, out int outputPending, out global::
Interop
.Ssl.SslErrorCode errorCode)
3278
fixed (global::
Interop
.Ssl.SslErrorCode* __errorCode_native = &errorCode)
3298
static extern unsafe int __PInvoke(nint __ssl_native, byte* __plaintextPtr_native, int __plaintextLen_native, byte* __outputPtr_native, int __outputCap_native, int* __outputWritten_native, int* __outputPending_native, global::
Interop
.Ssl.SslErrorCode* __errorCode_native);
3308
internal static unsafe partial int SslDecrypt(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, byte* inputPtr, int inputLen, out int consumed, byte* outputPtr, int outputCap, out int leftoverOffset, out int leftoverLength, out global::
Interop
.Ssl.SslErrorCode errorCode)
3326
fixed (global::
Interop
.Ssl.SslErrorCode* __errorCode_native = &errorCode)
3347
static extern unsafe int __PInvoke(nint __ssl_native, byte* __inputPtr_native, int __inputLen_native, int* __consumed_native, byte* __outputPtr_native, int __outputCap_native, int* __leftoverOffset_native, int* __leftoverLength_native, global::
Interop
.Ssl.SslErrorCode* __errorCode_native);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (6)
124
_error =
Interop
.Sys.ConvertErrorPlatformToPal(errno);
141
get { return _rawErrno == -1 ? (_rawErrno =
Interop
.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; }
146
return
Interop
.Sys.StrError(RawErrno);
220
public static
Interop
.ErrorInfo Info(this
Interop
.Error error)
222
return new
Interop
.ErrorInfo(error);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs (2)
85
Interop
.NetSecurityNative.Status minStat;
86
Interop
.NetSecurityNative.Status displayCallStatus = isMinor ?
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (1)
62
Interop
.NetSecurityNative.ReleaseGssBuffer(_data, _length);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs (20)
15
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_ReleaseGssBuffer")]
20
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_DisplayMinorStatus")]
26
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_DisplayMajorStatus")]
32
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_ImportUserName")]
39
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_ImportPrincipalName")]
46
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_ReleaseName")]
51
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_AcquireAcceptorCred")]
57
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_InitiateCredSpNego")]
63
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_InitiateCredWithPassword", StringMarshalling = StringMarshalling.Utf8)]
72
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_ReleaseCred")]
77
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_InitSecContext")]
91
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_InitSecContextEx")]
215
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_AcceptSecContext")]
289
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_DeleteSecContext")]
294
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_GetUser")]
300
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_GetNameAttribute")]
310
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_Wrap")]
319
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_Unwrap")]
328
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_GetMic")]
336
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_VerifyMic")]
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs (3)
11
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_IsNtlmInstalled")]
15
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_IsGetNameAttributeSupported")]
19
[LibraryImport(
Interop
.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_EnsureGssInitialized")]
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (5)
153
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
163
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
172
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
191
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
200
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OCSP.cs (2)
107
Interop
.Crypto.OcspRequestDestroy(handle);
122
Interop
.Crypto.OcspResponseDestroy(handle);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (30)
149
if (!
Interop
.Ssl.Capabilities.Tls13Supported)
292
Interop
.Ssl.SslCtxSetAlpnSelectCb(sslCtx, &AlpnServerSelectCallback, IntPtr.Zero);
329
Interop
.Ssl.SslSetClientCertCallback(ssl, 0);
384
if (!
Interop
.Ssl.Capabilities.Tls13Supported ||
452
if (
Interop
.Ssl.SslSetAlpnProtos(sslHandle, sslAuthenticationOptions.ApplicationProtocols) != 0)
554
ushort[] rawAlgs =
Interop
.Ssl.GetDefaultSignatureAlgorithms();
654
ret =
Interop
.Ssl.SslSetSigalgs(sslHandle, pBuffer);
660
ret =
Interop
.Ssl.SslSetClientSigalgs(sslHandle, pBuffer);
689
int ret =
Interop
.Ssl.SslRenegotiate(sslContext, out Ssl.SslErrorCode errorCode);
1066
Ssl.X509StoreCtxSetError(storeCtx, (int)
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_OK);
1087
Ssl.X509StoreCtxSetError(storeCtx, (int)
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_OK);
1093
Interop
.Crypto.X509VerifyStatusCodeUniversal verifyError;
1096
verifyError =
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_APPLICATION_VERIFICATION;
1119
TlsAlertMessage.BadCertificate =>
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_REJECTED,
1120
TlsAlertMessage.UnknownCA =>
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT,
1121
TlsAlertMessage.CertificateRevoked =>
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_REVOKED,
1122
TlsAlertMessage.CertificateExpired =>
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_HAS_EXPIRED,
1123
TlsAlertMessage.UnsupportedCert =>
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_INVALID_PURPOSE,
1124
_ =>
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_REJECTED,
1161
Ssl.X509StoreCtxSetError(storeCtx, (int)
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_UNSPECIFIED);
1176
using (SafeSharedX509StackHandle chainStack =
Interop
.Crypto.X509StoreCtxGetSharedUntrusted(storeHandle))
1180
int count =
Interop
.Crypto.GetX509StackFieldCount(chainStack);
1184
IntPtr certPtr =
Interop
.Crypto.GetX509StackField(chainStack, i);
1195
Interop
.Ssl.SslUpdateOcspStaple(sslHandle, certificate.Handle);
1275
IntPtr cert =
Interop
.Ssl.SslGetCertificate(ssl);
1280
if (cert == IntPtr.Zero &&
Interop
.Ssl.SslSessionReused(ssl))
1282
IntPtr currentSession =
Interop
.Ssl.SslGetSession(ssl);
1285
cert =
Interop
.Ssl.SslSessionGetData(currentSession);
1289
Interop
.Ssl.SslSessionSetData(session, cert);
1397
innerError =
Interop
.Crypto.CreateOpenSslCryptographicException();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (19)
99
throw
Interop
.OpenSsl.CreateSslException(SR.net_ssl_get_default_sigalgs_failed);
561
writeBio =
Interop
.Ssl.BioNewSocketReplay(socket!, ReadOnlySpan<byte>.Empty);
567
readBio =
Interop
.Ssl.BioNewSocketReplay(socket!, replayPrefix);
568
writeBio =
Interop
.Ssl.BioNewSocketReplay(socket!, ReadOnlySpan<byte>.Empty);
572
readBio =
Interop
.Ssl.BioNewManagedSpan();
573
writeBio =
Interop
.Ssl.BioNewManagedSpan();
576
SafeSslHandle handle =
Interop
.Ssl.SslCreate(context);
586
Interop
.Ssl.SslSetData(handle, WeakGCHandle<SslAuthenticationOptions>.ToIntPtr(handle._authOptionsHandle));
598
Interop
.Ssl.SslSetAcceptMovingWriteBuffer(handle);
603
if (
Interop
.Ssl.SslSetFd(handle, socket!) != 1)
606
throw
Interop
.OpenSsl.CreateSslException(SR.net_allocate_ssl_context_failed);
618
Interop
.Ssl.SslSetBio(handle, readBio, writeBio);
634
Interop
.Ssl.SslSetAcceptState(handle);
638
Interop
.Ssl.SslSetConnectState(handle);
670
Interop
.Ssl.SslSetData(handle, IntPtr.Zero);
677
Interop
.Ssl.SslDestroy(h); // will free the handles underlying _readBio and _writeBio
686
int retVal =
Interop
.Ssl.SslShutdown(handle);
694
retVal =
Interop
.Ssl.SslShutdown(handle);
700
Interop
.Crypto.ErrClearError();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (11)
158
Interop
.Ssl.SslCtxSetData(handle, IntPtr.Zero);
166
Interop
.Ssl.SessionFree(cached.Session);
177
Interop
.Ssl.SslCtxDestroy(handle);
191
Interop
.Ssl.SslCtxSetData(this, (IntPtr)_gch);
214
Interop
.Ssl.SessionSetHostname(session, namePtr);
257
Interop
.Ssl.SslCtxRemoveSession(this, evicted![i]);
258
Interop
.Ssl.SessionFree(evicted[i]);
308
Interop
.Ssl.SessionFree(session);
344
else if (
Interop
.Ssl.SessionUpRef(cached.Session) != 1)
355
bool set =
Interop
.Ssl.SslSetSession(sslHandle, owned) == 1;
356
Interop
.Ssl.SessionFree(owned);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs (1)
73
Interop
.Crypto.RecursiveFreeX509Stack(handle);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs (1)
86
Interop
.Crypto.X509StoreCtxDestroy(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs (2)
18
Interop
.Crypto.Asn1ObjectFree(handle);
38
Interop
.Crypto.Asn1OctetStringFree(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\GssSafeHandles.cs (36)
20
Interop
.NetSecurityNative.Status minorStatus;
21
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.ImportUserName(
24
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
27
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
37
Interop
.NetSecurityNative.Status minorStatus;
38
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.ImportPrincipalName(
41
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
44
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
57
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.ReleaseName(out _, ref handle);
59
return status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE;
75
public static SafeGssCredHandle CreateAcceptor(
Interop
.NetSecurityNative.PackageType packageType)
78
Interop
.NetSecurityNative.Status status;
79
Interop
.NetSecurityNative.Status minorStatus;
81
status =
Interop
.NetSecurityNative.AcquireAcceptorCred(out minorStatus, packageType, out retHandle);
82
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
85
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
95
public static SafeGssCredHandle Create(string username, string password,
Interop
.NetSecurityNative.PackageType packageType)
97
if (packageType ==
Interop
.NetSecurityNative.PackageType.NTLM && !s_IsNtlmInstalled.Value)
99
throw new
Interop
.NetSecurityNative.GssApiException(
100
Interop
.NetSecurityNative.Status.GSS_S_BAD_MECH,
113
Interop
.NetSecurityNative.Status status;
114
Interop
.NetSecurityNative.Status minorStatus;
117
status =
Interop
.NetSecurityNative.InitiateCredSpNego(out minorStatus, userHandle, out retHandle);
121
status =
Interop
.NetSecurityNative.InitiateCredWithPassword(out minorStatus, packageType, userHandle, password, Encoding.UTF8.GetByteCount(password), out retHandle);
124
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
127
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
146
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.ReleaseCred(out _, ref handle);
148
return status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE;
153
return
Interop
.NetSecurityNative.IsNtlmInstalled();
171
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.DeleteSecContext(out _, ref handle);
173
return status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE;
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (1)
34
return
Interop
.Crypto.BioDestroy(h);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs (3)
39
Interop
.Crypto.X509Destroy(handle);
59
Interop
.Crypto.X509CrlDestroy(handle);
79
Interop
.Crypto.X509StoreDestroy(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs (1)
19
Interop
.Crypto.X509ExtensionDestroy(handle);
src\runtime\src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (4)
37
using (SafeX509Handle certHandle =
Interop
.Crypto.X509UpRef(remoteCertificate.Handle))
43
hostNameMatch =
Interop
.Crypto.CheckX509IpAddress(certHandle, addressBytes, addressBytes.Length, hostName, hostName.Length);
51
hostNameMatch =
Interop
.Crypto.CheckX509Hostname(certHandle, matchName, matchName.Length);
56
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
System\Net\CertificateValidationPal.Unix.cs (13)
39
IntPtr remoteCertificate =
Interop
.OpenSsl.GetPeerCertificate((SafeSslHandle)securityContext);
58
Interop
.OpenSsl.GetPeerCertificateChain((SafeSslHandle)securityContext))
62
int count =
Interop
.Crypto.GetX509StackFieldCount(chainStack);
66
IntPtr certPtr =
Interop
.Crypto.GetX509StackField(chainStack, i);
90
Interop
.Crypto.X509Destroy(remoteCertificate);
105
if (!
Interop
.Ssl.SslSessionReused(ssl))
109
return
Interop
.Ssl.SslGetCertificate(ssl) != IntPtr.Zero;
123
IntPtr session =
Interop
.Ssl.SslGetSession(ssl);
125
return
Interop
.Ssl.SslSessionGetData(session) != IntPtr.Zero;
141
using (SafeSharedX509NameStackHandle names =
Interop
.Ssl.SslGetClientCAList((SafeSslHandle)securityContext))
148
int nameCount =
Interop
.Crypto.GetX509NameStackFieldCount(names);
159
using (SafeSharedX509NameHandle nameHandle =
Interop
.Crypto.GetX509NameStackField(names, i))
161
X500DistinguishedName dn =
Interop
.Crypto.LoadX500Name(nameHandle);
System\Net\NegotiateAuthenticationPal.Unix.cs (126)
44
catch (Exception ex) when (ex is
Interop
.NetSecurityNative.GssApiException or TypeInitializationException)
49
if (ex is
Interop
.NetSecurityNative.GssApiException gex)
68
catch (Exception ex) when (ex is
Interop
.NetSecurityNative.GssApiException or TypeInitializationException)
74
if (ex is
Interop
.NetSecurityNative.GssApiException gex)
94
private
Interop
.NetSecurityNative.GssFlags _requestedContextFlags;
95
private
Interop
.NetSecurityNative.GssFlags _contextFlags;
100
private readonly
Interop
.NetSecurityNative.PackageType _packageType;
112
public override bool IsSigned => (_contextFlags &
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG) != 0;
114
public override bool IsEncrypted => (_contextFlags &
Interop
.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG) != 0;
116
public override bool IsMutuallyAuthenticated => (_contextFlags &
Interop
.NetSecurityNative.GssFlags.GSS_C_MUTUAL_FLAG) != 0;
199
catch (
Interop
.NetSecurityNative.GssApiException ex)
251
(_contextFlags &
Interop
.NetSecurityNative.GssFlags.GSS_C_DELEG_FLAG) != 0 && Package != NegotiationInfoClass.NTLM ? TokenImpersonationLevel.Delegation :
252
(_contextFlags &
Interop
.NetSecurityNative.GssFlags.GSS_C_IDENTIFY_FLAG) != 0 ? TokenImpersonationLevel.Identification :
259
Interop
.NetSecurityNative.GssFlags contextFlags = clientOptions.RequiredProtectionLevel switch
261
ProtectionLevel.Sign =>
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG,
262
ProtectionLevel.EncryptAndSign =>
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG |
Interop
.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG,
266
contextFlags |= clientOptions.RequireMutualAuthentication ?
Interop
.NetSecurityNative.GssFlags.GSS_C_MUTUAL_FLAG : 0;
270
TokenImpersonationLevel.Identification =>
Interop
.NetSecurityNative.GssFlags.GSS_C_IDENTIFY_FLAG,
271
TokenImpersonationLevel.Delegation =>
Interop
.NetSecurityNative.GssFlags.GSS_C_DELEG_FLAG,
291
if (_packageType ==
Interop
.NetSecurityNative.PackageType.NTLM)
295
throw new
Interop
.NetSecurityNative.GssApiException(
Interop
.NetSecurityNative.Status.GSS_S_NO_CRED, 0, SR.net_ntlm_not_possible_default_cred);
300
throw new
Interop
.NetSecurityNative.GssApiException(
Interop
.NetSecurityNative.Status.GSS_S_BAD_NAME, 0, SR.net_nego_not_supported_empty_target_with_defaultcreds);
313
Interop
.NetSecurityNative.GssFlags contextFlags = serverOptions.RequiredProtectionLevel switch
315
ProtectionLevel.Sign =>
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG,
316
ProtectionLevel.EncryptAndSign =>
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG |
Interop
.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG,
422
Interop
.NetSecurityNative.GssBuffer encryptedBuffer = default;
425
Interop
.NetSecurityNative.Status minorStatus;
427
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.WrapBuffer(
434
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
453
Interop
.NetSecurityNative.GssBuffer decryptedBuffer = default(
Interop
.NetSecurityNative.GssBuffer);
456
Interop
.NetSecurityNative.Status minorStatus;
457
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer);
458
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
462
Interop
.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered,
481
Interop
.NetSecurityNative.GssBuffer decryptedBuffer = default(
Interop
.NetSecurityNative.GssBuffer);
484
Interop
.NetSecurityNative.Status minorStatus;
485
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer);
486
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
492
Interop
.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered,
512
Interop
.NetSecurityNative.GssBuffer micBuffer = default;
515
Interop
.NetSecurityNative.Status minorStatus;
516
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.GetMic(
521
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
523
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
538
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.VerifyMic(
543
return status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE;
546
private static
Interop
.NetSecurityNative.PackageType GetPackageType(string package)
550
return
Interop
.NetSecurityNative.PackageType.Negotiate;
554
return
Interop
.NetSecurityNative.PackageType.NTLM;
558
return
Interop
.NetSecurityNative.PackageType.Kerberos;
563
throw new
Interop
.NetSecurityNative.GssApiException(
Interop
.NetSecurityNative.Status.GSS_S_UNAVAILABLE, 0);
595
catch (Exception ex) when (ex is not
Interop
.NetSecurityNative.GssApiException)
598
throw new
Interop
.NetSecurityNative.GssApiException(
Interop
.NetSecurityNative.Status.GSS_S_BAD_NAME, 0);
608
Interop
.NetSecurityNative.GssBuffer token = default(
Interop
.NetSecurityNative.GssBuffer);
613
Interop
.NetSecurityNative.Status status;
618
status =
Interop
.NetSecurityNative.GetNameAttribute(out var minorStatus,
626
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
628
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
642
Interop
.NetSecurityNative.GssBuffer token = default(
Interop
.NetSecurityNative.GssBuffer);
646
Interop
.NetSecurityNative.Status status
647
=
Interop
.NetSecurityNative.GetUser(out var minorStatus,
651
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
653
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
677
Interop
.NetSecurityNative.GssFlags requestedContextFlags,
682
ref
Interop
.NetSecurityNative.GssFlags contextFlags)
693
Interop
.NetSecurityNative.PackageType.NTLM => "NTLM",
694
Interop
.NetSecurityNative.PackageType.Kerberos => "Kerberos",
704
Interop
.NetSecurityNative.GssBuffer token = default(
Interop
.NetSecurityNative.GssBuffer);
705
Interop
.NetSecurityNative.Status status;
706
Interop
.NetSecurityNative.Status minorStatus;
714
status =
Interop
.NetSecurityNative.InitSecContext(out minorStatus,
728
status =
Interop
.NetSecurityNative.InitSecContext(out minorStatus,
740
if ((status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE) &&
741
(status !=
Interop
.NetSecurityNative.Status.GSS_S_CONTINUE_NEEDED))
748
Interop
.NetSecurityNative.GssApiException gex = new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
757
if (status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
763
Interop
.NetSecurityNative.PackageType.NTLM => "NTLM",
764
Interop
.NetSecurityNative.PackageType.Kerberos => "Kerberos",
775
contextFlags = (
Interop
.NetSecurityNative.GssFlags)outputFlags;
777
return status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE ?
799
ref
Interop
.NetSecurityNative.GssFlags contextFlags)
803
Interop
.NetSecurityNative.GssBuffer token = default(
Interop
.NetSecurityNative.GssBuffer);
806
Interop
.NetSecurityNative.Status status;
807
Interop
.NetSecurityNative.Status minorStatus;
809
status =
Interop
.NetSecurityNative.AcceptSecContext(out minorStatus,
818
if ((status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE) &&
819
(status !=
Interop
.NetSecurityNative.Status.GSS_S_CONTINUE_NEEDED))
821
Interop
.NetSecurityNative.GssApiException gex = new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
827
if (status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE &&
828
((_packageType ==
Interop
.NetSecurityNative.PackageType.Kerberos && isNtlmUsed) ||
829
(_packageType ==
Interop
.NetSecurityNative.PackageType.NTLM && !isNtlmUsed)))
837
if (status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE &&
839
(outputFlags & (uint)
Interop
.NetSecurityNative.GssFlags.GSS_C_CHANNEL_BOUND_FLAG) == 0)
850
contextFlags = (
Interop
.NetSecurityNative.GssFlags)outputFlags;
854
if (status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
886
internal static NegotiateAuthenticationStatusCode GetErrorCode(
Interop
.NetSecurityNative.GssApiException exception)
890
case
Interop
.NetSecurityNative.Status.GSS_S_NO_CRED:
892
case
Interop
.NetSecurityNative.Status.GSS_S_BAD_BINDINGS:
894
case
Interop
.NetSecurityNative.Status.GSS_S_CREDENTIALS_EXPIRED:
896
case
Interop
.NetSecurityNative.Status.GSS_S_DEFECTIVE_TOKEN:
898
case
Interop
.NetSecurityNative.Status.GSS_S_DEFECTIVE_CREDENTIAL:
900
case
Interop
.NetSecurityNative.Status.GSS_S_BAD_SIG:
902
case
Interop
.NetSecurityNative.Status.GSS_S_BAD_MECH:
903
case
Interop
.NetSecurityNative.Status.GSS_S_UNAVAILABLE:
905
case
Interop
.NetSecurityNative.Status.GSS_S_FAILURE:
913
case
Interop
.NetSecurityNative.Status.GSS_S_NO_CONTEXT:
924
_ =
Interop
.NetSecurityNative.IsNtlmInstalled();
System\Net\Security\CipherSuitesPolicyPal.Linux.cs (4)
10
using OpenSsl =
Interop
.OpenSsl;
11
using Ssl =
Interop
.Ssl;
25
if (!
Interop
.Ssl.Capabilities.Tls13Supported)
51
string? name =
Interop
.Ssl.GetOpenSslCipherSuiteName(
System\Net\Security\NegotiateStream.cs (12)
824
NegotiateAuthenticationStatusCode.BadBinding => (int)
Interop
.SECURITY_STATUS.BadBinding,
825
NegotiateAuthenticationStatusCode.Unsupported => (int)
Interop
.SECURITY_STATUS.Unsupported,
826
NegotiateAuthenticationStatusCode.MessageAltered => (int)
Interop
.SECURITY_STATUS.MessageAltered,
827
NegotiateAuthenticationStatusCode.ContextExpired => (int)
Interop
.SECURITY_STATUS.ContextExpired,
828
NegotiateAuthenticationStatusCode.CredentialsExpired => (int)
Interop
.SECURITY_STATUS.CertExpired,
829
NegotiateAuthenticationStatusCode.InvalidCredentials => (int)
Interop
.SECURITY_STATUS.LogonDenied,
830
NegotiateAuthenticationStatusCode.InvalidToken => (int)
Interop
.SECURITY_STATUS.InvalidToken,
831
NegotiateAuthenticationStatusCode.UnknownCredentials => (int)
Interop
.SECURITY_STATUS.UnknownCredentials,
832
NegotiateAuthenticationStatusCode.QopNotSupported => (int)
Interop
.SECURITY_STATUS.QopNotSupported,
833
NegotiateAuthenticationStatusCode.OutOfSequence => (int)
Interop
.SECURITY_STATUS.OutOfSequence,
834
_ => (int)
Interop
.SECURITY_STATUS.InternalError
943
(int)
Interop
.SECURITY_STATUS.LogonDenied => new InvalidCredentialException(SR.net_auth_bad_client_creds, e),
System\Net\Security\SslConnectionInfo.Linux.cs (5)
13
Protocol = (int)MapProtocolVersion(
Interop
.Ssl.SslGetVersion(sslContext));
14
ReadOnlySpan<byte> alpn =
Interop
.Ssl.SslGetAlpnSelected(sslContext);
31
TlsResumed =
Interop
.Ssl.SslSessionReused(sslContext);
38
if (!
Interop
.Ssl.SslGetCurrentCipherId(ssl, out cipherSuite))
40
throw
Interop
.OpenSsl.CreateSslException(SR.net_ssl_get_connection_info_failed);
System\Net\Security\SslStreamCertificateContext.Linux.cs (5)
112
CertificateHandle =
Interop
.Crypto.X509UpRef(target.Handle);
309
using SafeOcspRequestHandle ocspRequest =
Interop
.Crypto.X509BuildOcspRequest(subject, issuer);
310
byte[] rentedBytes = ArrayPool<byte>.Shared.Rent(
Interop
.Crypto.GetOcspRequestDerSize(ocspRequest));
311
int encodingSize =
Interop
.Crypto.EncodeOcspRequest(ocspRequest, rentedBytes);
324
if (!
Interop
.Crypto.X509DecodeOcspToExpiration(ret, ocspRequest, subject, issuerHandles.AsSpan(0, _privateIntermediateCertificates.Length + 1), out DateTimeOffset expiration))
System\Net\Security\SslStreamPal.Unix.cs (32)
17
return status.Exception ?? new
Interop
.OpenSsl.SslException((int)status.ErrorCode);
76
Interop
.Ssl.SslErrorCode errorCode =
Interop
.OpenSsl.Encrypt((SafeSslHandle)securityContext, input.Span, ref token);
101
bytesWritten =
Interop
.OpenSsl.Decrypt(
107
out
Interop
.Ssl.SslErrorCode errorCode);
119
private static SecurityStatusPal MapNativeErrorCode(
Interop
.Ssl.SslErrorCode errorCode) =>
122
Interop
.Ssl.SslErrorCode.SSL_ERROR_RENEGOTIATE => new SecurityStatusPal(SecurityStatusPalErrorCode.Renegotiate),
123
Interop
.Ssl.SslErrorCode.SSL_ERROR_ZERO_RETURN => new SecurityStatusPal(SecurityStatusPalErrorCode.ContextExpired),
124
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_X509_LOOKUP => new SecurityStatusPal(SecurityStatusPalErrorCode.CredentialsNeeded),
125
Interop
.Ssl.SslErrorCode.SSL_ERROR_NONE or
126
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_READ => new SecurityStatusPal(SecurityStatusPalErrorCode.OK),
127
_ => new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, new
Interop
.OpenSsl.SslException((int)errorCode))
140
throw
Interop
.OpenSsl.CreateSslException(SR.net_ssl_invalid_certificate);
145
bindingHandle =
Interop
.OpenSsl.QueryChannelBinding(
158
SecurityStatusPal status =
Interop
.OpenSsl.SslRenegotiate((SafeSslHandle)context, out _);
166
Interop
.Ssl.SslSetVerifyPeer((SafeSslHandle)context, failIfNoPeerCert: sslAuthenticationOptions.CertValidationDelegate is null);
186
Interop
.OpenSsl.UpdateClientCertificate((SafeSslHandle)context!, sslAuthenticationOptions);
202
context =
Interop
.OpenSsl.AllocateSslHandle(sslAuthenticationOptions);
205
SecurityStatusPalErrorCode errorCode =
Interop
.OpenSsl.DoSslHandshake((SafeSslHandle)context, inputBuffer, out consumed, ref token);
224
errorCode =
Interop
.OpenSsl.DoSslHandshake((SafeSslHandle)context, inputBuffer.Slice(consumed), out int c, ref token);
230
if (token.Size == 0 &&
Interop
.Ssl.IsSslRenegotiatePending((SafeSslHandle)context))
232
errorCode =
Interop
.OpenSsl.DoSslHandshake((SafeSslHandle)context, inputBuffer.Slice(consumed), out int c, ref token);
262
Interop
.Ssl.SslSetQuietShutdown((SafeSslHandle)context, 0);
264
int status =
Interop
.Ssl.SslShutdown((SafeSslHandle)context);
268
status =
Interop
.Ssl.SslShutdown((SafeSslHandle)context);
274
Interop
.Ssl.SslErrorCode code =
Interop
.Ssl.SslGetError((SafeSslHandle)context, status);
275
if (code ==
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_READ ||
276
code ==
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_WRITE)
280
else if (code ==
Interop
.Ssl.SslErrorCode.SSL_ERROR_SSL)
283
return new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError,
Interop
.Crypto.CreateOpenSslCryptographicException());
287
return new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, new
Interop
.OpenSsl.SslException((int)code));
System\Net\Security\TlsContext.OpenSsl.cs (1)
58
ctx =
Interop
.OpenSsl.GetOrCreateSslContextHandle(sessionOptions, allowCached: false, enableResume: enableResume);
System\Net\Security\TlsSession.OpenSsl.cs (26)
139
_peekBio =
Interop
.Ssl.BioNewSocketReplay(_pendingFdSocket, ReadOnlySpan<byte>.Empty);
144
throw
Interop
.OpenSsl.CreateSslException(SR.net_ssl_read_bio_failed_error);
150
int rc =
Interop
.Ssl.BioPeekTlsFrame(_peekBio, out byte* framePtr, out int frameLen);
221
if (
Interop
.Ssl.BioGetReplayPrefix(_peekBio, out byte* ptr, out int len) == 1 && len > 0)
257
int ret =
Interop
.Ssl.SslDoHandshake(ssl, out
Interop
.Ssl.SslErrorCode err, processPeer: true);
295
int ret =
Interop
.Ssl.SslDoHandshake(ssl, out
Interop
.Ssl.SslErrorCode err, processPeer: !flushingRequest);
296
bool writeBlocked = err ==
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_WRITE;
317
!
Interop
.Ssl.IsSslStateOK(ssl) ||
318
Interop
.Ssl.IsSslRenegotiatePending(ssl))
368
SecurityStatusPal status =
Interop
.OpenSsl.SslRenegotiate((SafeSslHandle)_securityContext, out _);
408
int ret =
Interop
.Ssl.SslRead(ssl, ref MemoryMarshal.GetReference(buffer), buffer.Length, out
Interop
.Ssl.SslErrorCode err);
436
int ret =
Interop
.Ssl.SslWrite(ssl, ref MemoryMarshal.GetReference(buffer), buffer.Length, out
Interop
.Ssl.SslErrorCode err);
452
SafeSslHandle handle =
Interop
.OpenSsl.AllocateSslHandle(_options);
466
private static TlsOperationStatus MapSslError(
Interop
.Ssl.SslErrorCode error, int result, string sslErrorTemplate)
470
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_READ => TlsOperationStatus.NeedMoreData,
471
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_WRITE => TlsOperationStatus.DestinationTooSmall,
472
Interop
.Ssl.SslErrorCode.SSL_ERROR_ZERO_RETURN => TlsOperationStatus.Closed,
477
private static
Interop
.OpenSsl.SslException CreateDiagnosticSslException(
Interop
.Ssl.SslErrorCode error, int result, string sslErrorTemplate)
479
Exception? detail =
Interop
.OpenSsl.GetSslError(result, error);
480
Interop
.Crypto.ErrClearError();
481
return new
Interop
.OpenSsl.SslException(SR.Format(sslErrorTemplate, error), detail);