520 references to Interop
System.Net.Security (520)
_generated\0\LibraryImports.g.cs (172)
7internal static extern partial global::Interop.Error ConvertErrorPlatformToPal(int platformErrno); 15internal static extern partial int ConvertErrorPalToPlatform(global::Interop.Error error); 47internal static partial global::Interop.NetSecurityNative.Status DisplayMinorStatus(out global::Interop.NetSecurityNative.Status minorStatus, global::Interop.NetSecurityNative.Status statusValue, ref global::Interop.NetSecurityNative.GssBuffer buffer) 52global::Interop.NetSecurityNative.Status __retVal; 54fixed (global::Interop.NetSecurityNative.GssBuffer* __buffer_native = &buffer) 55fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 63static 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); 73internal static partial global::Interop.NetSecurityNative.Status DisplayMajorStatus(out global::Interop.NetSecurityNative.Status minorStatus, global::Interop.NetSecurityNative.Status statusValue, ref global::Interop.NetSecurityNative.GssBuffer buffer) 78global::Interop.NetSecurityNative.Status __retVal; 80fixed (global::Interop.NetSecurityNative.GssBuffer* __buffer_native = &buffer) 81fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 89static 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); 99internal static partial global::Interop.NetSecurityNative.Status ImportUserName(out global::Interop.NetSecurityNative.Status minorStatus, string inputName, int inputNameByteCount, out global::Microsoft.Win32.SafeHandles.SafeGssNameHandle outputName) 108global::Interop.NetSecurityNative.Status __retVal = default; 117fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 145static extern unsafe global::Interop.NetSecurityNative.Status __PInvoke(global::Interop.NetSecurityNative.Status* __minorStatus_native, byte* __inputName_native, int __inputNameByteCount_native, nint* __outputName_native); 155internal static partial global::Interop.NetSecurityNative.Status ImportPrincipalName(out global::Interop.NetSecurityNative.Status minorStatus, string inputName, int inputNameByteCount, out global::Microsoft.Win32.SafeHandles.SafeGssNameHandle outputName) 164global::Interop.NetSecurityNative.Status __retVal = default; 173fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 201static extern unsafe global::Interop.NetSecurityNative.Status __PInvoke(global::Interop.NetSecurityNative.Status* __minorStatus_native, byte* __inputName_native, int __inputNameByteCount_native, nint* __outputName_native); 211internal static partial global::Interop.NetSecurityNative.Status ReleaseName(out global::Interop.NetSecurityNative.Status minorStatus, ref nint inputName) 216global::Interop.NetSecurityNative.Status __retVal; 219fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 227static extern unsafe global::Interop.NetSecurityNative.Status __PInvoke(global::Interop.NetSecurityNative.Status* __minorStatus_native, nint* __inputName_native); 237internal static partial global::Interop.NetSecurityNative.Status AcquireAcceptorCred(out global::Interop.NetSecurityNative.Status minorStatus, out global::Microsoft.Win32.SafeHandles.SafeGssCredHandle outputCredHandle) 245global::Interop.NetSecurityNative.Status __retVal = default; 251fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 274static extern unsafe global::Interop.NetSecurityNative.Status __PInvoke(global::Interop.NetSecurityNative.Status* __minorStatus_native, nint* __outputCredHandle_native); 284internal 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) 293global::Interop.NetSecurityNative.Status __retVal = default; 302fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 330static extern unsafe global::Interop.NetSecurityNative.Status __PInvoke(global::Interop.NetSecurityNative.Status* __minorStatus_native, nint __desiredName_native, nint* __outputCredHandle_native); 340internal 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) 350global::Interop.NetSecurityNative.Status __retVal = default; 361fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 391static 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); 401internal static partial global::Interop.NetSecurityNative.Status ReleaseCred(out global::Interop.NetSecurityNative.Status minorStatus, ref nint credHandle) 406global::Interop.NetSecurityNative.Status __retVal; 409fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 417static extern unsafe global::Interop.NetSecurityNative.Status __PInvoke(global::Interop.NetSecurityNative.Status* __minorStatus_native, nint* __credHandle_native); 427private 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) 439global::Interop.NetSecurityNative.Status __retVal = default; 452fixed (global::Interop.NetSecurityNative.GssBuffer* __token_native = &token) 454fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 488static 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); 498private 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) 510global::Interop.NetSecurityNative.Status __retVal = default; 523fixed (global::Interop.NetSecurityNative.GssBuffer* __token_native = &token) 525fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 559static 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); 569private 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) 580global::Interop.NetSecurityNative.Status __retVal = default; 591fixed (global::Interop.NetSecurityNative.GssBuffer* __token_native = &token) 593fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 625static 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); 635internal static partial global::Interop.NetSecurityNative.Status DeleteSecContext(out global::Interop.NetSecurityNative.Status minorStatus, ref nint contextHandle) 640global::Interop.NetSecurityNative.Status __retVal; 643fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 651static extern unsafe global::Interop.NetSecurityNative.Status __PInvoke(global::Interop.NetSecurityNative.Status* __minorStatus_native, nint* __contextHandle_native); 661internal 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) 667global::Interop.NetSecurityNative.Status __retVal = default; 675fixed (global::Interop.NetSecurityNative.GssBuffer* __token_native = &token) 676fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 692static extern unsafe global::Interop.NetSecurityNative.Status __PInvoke(global::Interop.NetSecurityNative.Status* __minorStatus_native, nint __acceptContextHandle_native, global::Interop.NetSecurityNative.GssBuffer* __token_native); 702private 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) 709global::Interop.NetSecurityNative.Status __retVal = default; 718fixed (global::Interop.NetSecurityNative.GssBuffer* __outBuffer_native = &outBuffer) 719fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 738static 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); 748private 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) 756global::Interop.NetSecurityNative.Status __retVal = default; 764fixed (global::Interop.NetSecurityNative.GssBuffer* __outBuffer_native = &outBuffer) 765fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 784static 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); 794private 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) 800global::Interop.NetSecurityNative.Status __retVal = default; 808fixed (global::Interop.NetSecurityNative.GssBuffer* __outBuffer_native = &outBuffer) 809fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 825static 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); 835private 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) 841global::Interop.NetSecurityNative.Status __retVal = default; 849fixed (global::Interop.NetSecurityNative.Status* __minorStatus_native = &minorStatus) 865static 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); 2555internal static partial global::Interop.Ssl.SslErrorCode SslGetError(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, int ret) 2560global::Interop.Ssl.SslErrorCode __retVal = default; 2582static extern unsafe global::Interop.Ssl.SslErrorCode __PInvoke(nint __ssl_native, int __ret_native); 2592internal static extern partial global::Interop.Ssl.SslErrorCode SslGetError(nint ssl, int ret); 2918internal static partial int SslWrite(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, ref byte buf, int num, out global::Interop.Ssl.SslErrorCode error) 2933fixed (global::Interop.Ssl.SslErrorCode* __error_native = &error) 2953static extern unsafe int __PInvoke(nint __ssl_native, byte* __buf_native, int __num_native, global::Interop.Ssl.SslErrorCode* __error_native); 2963internal static partial int SslRead(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, ref byte buf, int num, out global::Interop.Ssl.SslErrorCode error) 2978fixed (global::Interop.Ssl.SslErrorCode* __error_native = &error) 2998static extern unsafe int __PInvoke(nint __ssl_native, byte* __buf_native, int __num_native, global::Interop.Ssl.SslErrorCode* __error_native); 3033internal static partial int SslRenegotiate(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, out global::Interop.Ssl.SslErrorCode error) 3047fixed (global::Interop.Ssl.SslErrorCode* __error_native = &error) 3063static extern unsafe int __PInvoke(nint __ssl_native, global::Interop.Ssl.SslErrorCode* __error_native); 3281internal static partial int SslDoHandshake(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, out global::Interop.Ssl.SslErrorCode error) 3296fixed (global::Interop.Ssl.SslErrorCode* __error_native = &error) 3315static extern unsafe int __PInvoke(nint __ssl_native, global::Interop.Ssl.SslErrorCode* __error_native); 3325internal 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) 3343fixed (global::Interop.Ssl.SslErrorCode* __errorCode_native = &errorCode) 3365static 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); 3375internal 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) 3392fixed (global::Interop.Ssl.SslErrorCode* __errorCode_native = &errorCode) 3413static 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); 3423internal 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) 3441fixed (global::Interop.Ssl.SslErrorCode* __errorCode_native = &errorCode) 3463static 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); 141get { return _rawErrno == -1 ? (_rawErrno = Interop.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; } 146return Interop.Sys.StrError(RawErrno); 220public static Interop.ErrorInfo Info(this Interop.Error error) 222return new Interop.ErrorInfo(error);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs (2)
85Interop.NetSecurityNative.Status minStat; 86Interop.NetSecurityNative.Status displayCallStatus = isMinor ?
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (1)
62Interop.NetSecurityNative.ReleaseGssBuffer(_data, _length);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs (19)
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")] 56[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_InitiateCredSpNego")] 62[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_InitiateCredWithPassword", StringMarshalling = StringMarshalling.Utf8)] 71[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_ReleaseCred")] 76[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_InitSecContext")] 90[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_InitSecContextEx")] 214[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_AcceptSecContext")] 288[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_DeleteSecContext")] 293[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_GetUser")] 299[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_Wrap")] 308[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_Unwrap")] 317[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_GetMic")] 325[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_VerifyMic")]
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs (2)
11[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_IsNtlmInstalled")] 15[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_EnsureGssInitialized")]
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (5)
153throw Interop.Crypto.CreateOpenSslCryptographicException(); 163throw Interop.Crypto.CreateOpenSslCryptographicException(); 172throw Interop.Crypto.CreateOpenSslCryptographicException(); 191throw Interop.Crypto.CreateOpenSslCryptographicException(); 200throw Interop.Crypto.CreateOpenSslCryptographicException();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OCSP.cs (2)
107Interop.Crypto.OcspRequestDestroy(handle); 122Interop.Crypto.OcspResponseDestroy(handle);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (30)
149if (!Interop.Ssl.Capabilities.Tls13Supported) 292Interop.Ssl.SslCtxSetAlpnSelectCb(sslCtx, &AlpnServerSelectCallback, IntPtr.Zero); 329Interop.Ssl.SslSetClientCertCallback(ssl, 0); 384if (!Interop.Ssl.Capabilities.Tls13Supported || 452if (Interop.Ssl.SslSetAlpnProtos(sslHandle, sslAuthenticationOptions.ApplicationProtocols) != 0) 554ushort[] rawAlgs = Interop.Ssl.GetDefaultSignatureAlgorithms(); 654ret = Interop.Ssl.SslSetSigalgs(sslHandle, pBuffer); 660ret = Interop.Ssl.SslSetClientSigalgs(sslHandle, pBuffer); 689int ret = Interop.Ssl.SslRenegotiate(sslContext, out Ssl.SslErrorCode errorCode); 1060Ssl.X509StoreCtxSetError(storeCtx, (int)Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_OK); 1081Ssl.X509StoreCtxSetError(storeCtx, (int)Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_OK); 1087Interop.Crypto.X509VerifyStatusCodeUniversal verifyError; 1090verifyError = Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_APPLICATION_VERIFICATION; 1113TlsAlertMessage.BadCertificate => Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_REJECTED, 1114TlsAlertMessage.UnknownCA => Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT, 1115TlsAlertMessage.CertificateRevoked => Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_REVOKED, 1116TlsAlertMessage.CertificateExpired => Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_HAS_EXPIRED, 1117TlsAlertMessage.UnsupportedCert => Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_INVALID_PURPOSE, 1118_ => Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_REJECTED, 1155Ssl.X509StoreCtxSetError(storeCtx, (int)Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_UNSPECIFIED); 1170using (SafeSharedX509StackHandle chainStack = Interop.Crypto.X509StoreCtxGetSharedUntrusted(storeHandle)) 1174int count = Interop.Crypto.GetX509StackFieldCount(chainStack); 1178IntPtr certPtr = Interop.Crypto.GetX509StackField(chainStack, i); 1189Interop.Ssl.SslUpdateOcspStaple(sslHandle, certificate.Handle); 1269IntPtr cert = Interop.Ssl.SslGetCertificate(ssl); 1274if (cert == IntPtr.Zero && Interop.Ssl.SslSessionReused(ssl)) 1276IntPtr currentSession = Interop.Ssl.SslGetSession(ssl); 1279cert = Interop.Ssl.SslSessionGetData(currentSession); 1283Interop.Ssl.SslSessionSetData(session, cert); 1387innerError = Interop.Crypto.CreateOpenSslCryptographicException();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (19)
99throw Interop.OpenSsl.CreateSslException(SR.net_ssl_get_default_sigalgs_failed); 558writeBio = Interop.Ssl.BioNewSocketReplay(socket!, ReadOnlySpan<byte>.Empty); 564readBio = Interop.Ssl.BioNewSocketReplay(socket!, replayPrefix); 565writeBio = Interop.Ssl.BioNewSocketReplay(socket!, ReadOnlySpan<byte>.Empty); 569readBio = Interop.Ssl.BioNewManagedSpan(); 570writeBio = Interop.Ssl.BioNewManagedSpan(); 573SafeSslHandle handle = Interop.Ssl.SslCreate(context); 583Interop.Ssl.SslSetData(handle, WeakGCHandle<SslAuthenticationOptions>.ToIntPtr(handle._authOptionsHandle)); 595Interop.Ssl.SslSetAcceptMovingWriteBuffer(handle); 600if (Interop.Ssl.SslSetFd(handle, socket!) != 1) 603throw Interop.OpenSsl.CreateSslException(SR.net_allocate_ssl_context_failed); 615Interop.Ssl.SslSetBio(handle, readBio, writeBio); 631Interop.Ssl.SslSetAcceptState(handle); 635Interop.Ssl.SslSetConnectState(handle); 667Interop.Ssl.SslSetData(handle, IntPtr.Zero); 674Interop.Ssl.SslDestroy(h); // will free the handles underlying _readBio and _writeBio 683int retVal = Interop.Ssl.SslShutdown(handle); 691retVal = Interop.Ssl.SslShutdown(handle); 697Interop.Crypto.ErrClearError();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (9)
145Interop.Ssl.SslCtxSetData(handle, IntPtr.Zero); 151Interop.Ssl.SessionFree(session); 161Interop.Ssl.SslCtxDestroy(handle); 175Interop.Ssl.SslCtxSetData(this, (IntPtr)_gch); 195Interop.Ssl.SessionSetHostname(session, namePtr); 218Interop.Ssl.SslCtxRemoveSession(this, oldSession); 219Interop.Ssl.SessionFree(oldSession); 251Interop.Ssl.SessionFree(oldSession); 272Interop.Ssl.SslSetSession(sslHandle, session);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs (1)
73Interop.Crypto.RecursiveFreeX509Stack(handle);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs (1)
86Interop.Crypto.X509StoreCtxDestroy(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs (2)
18Interop.Crypto.Asn1ObjectFree(handle); 38Interop.Crypto.Asn1OctetStringFree(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\GssSafeHandles.cs (35)
20Interop.NetSecurityNative.Status minorStatus; 21Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.ImportUserName( 24if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 27throw new Interop.NetSecurityNative.GssApiException(status, minorStatus); 37Interop.NetSecurityNative.Status minorStatus; 38Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.ImportPrincipalName( 41if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 44throw new Interop.NetSecurityNative.GssApiException(status, minorStatus); 57Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.ReleaseName(out _, ref handle); 59return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE; 78Interop.NetSecurityNative.Status status; 79Interop.NetSecurityNative.Status minorStatus; 81status = Interop.NetSecurityNative.AcquireAcceptorCred(out minorStatus, out retHandle); 82if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 84throw new Interop.NetSecurityNative.GssApiException(status, minorStatus); 94public static SafeGssCredHandle Create(string username, string password, Interop.NetSecurityNative.PackageType packageType) 96if (packageType == Interop.NetSecurityNative.PackageType.NTLM && !s_IsNtlmInstalled.Value) 98throw new Interop.NetSecurityNative.GssApiException( 99Interop.NetSecurityNative.Status.GSS_S_BAD_MECH, 112Interop.NetSecurityNative.Status status; 113Interop.NetSecurityNative.Status minorStatus; 116status = Interop.NetSecurityNative.InitiateCredSpNego(out minorStatus, userHandle, out retHandle); 120status = Interop.NetSecurityNative.InitiateCredWithPassword(out minorStatus, packageType, userHandle, password, Encoding.UTF8.GetByteCount(password), out retHandle); 123if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 126throw new Interop.NetSecurityNative.GssApiException(status, minorStatus); 145Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.ReleaseCred(out _, ref handle); 147return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE; 152return Interop.NetSecurityNative.IsNtlmInstalled(); 170Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.DeleteSecContext(out _, ref handle); 172return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE;
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (1)
34return Interop.Crypto.BioDestroy(h);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs (3)
39Interop.Crypto.X509Destroy(handle); 59Interop.Crypto.X509CrlDestroy(handle); 79Interop.Crypto.X509StoreDestroy(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs (1)
19Interop.Crypto.X509ExtensionDestroy(handle);
src\runtime\src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (4)
37using (SafeX509Handle certHandle = Interop.Crypto.X509UpRef(remoteCertificate.Handle)) 43hostNameMatch = Interop.Crypto.CheckX509IpAddress(certHandle, addressBytes, addressBytes.Length, hostName, hostName.Length); 51hostNameMatch = Interop.Crypto.CheckX509Hostname(certHandle, matchName, matchName.Length); 55throw Interop.Crypto.CreateOpenSslCryptographicException();
System\Net\CertificateValidationPal.Unix.cs (13)
39IntPtr remoteCertificate = Interop.OpenSsl.GetPeerCertificate((SafeSslHandle)securityContext); 58Interop.OpenSsl.GetPeerCertificateChain((SafeSslHandle)securityContext)) 62int count = Interop.Crypto.GetX509StackFieldCount(chainStack); 66IntPtr certPtr = Interop.Crypto.GetX509StackField(chainStack, i); 90Interop.Crypto.X509Destroy(remoteCertificate); 105if (!Interop.Ssl.SslSessionReused(ssl)) 109return Interop.Ssl.SslGetCertificate(ssl) != IntPtr.Zero; 123IntPtr session = Interop.Ssl.SslGetSession(ssl); 125return Interop.Ssl.SslSessionGetData(session) != IntPtr.Zero; 141using (SafeSharedX509NameStackHandle names = Interop.Ssl.SslGetClientCAList((SafeSslHandle)securityContext)) 148int nameCount = Interop.Crypto.GetX509NameStackFieldCount(names); 159using (SafeSharedX509NameHandle nameHandle = Interop.Crypto.GetX509NameStackField(names, i)) 161X500DistinguishedName dn = Interop.Crypto.LoadX500Name(nameHandle);
System\Net\NegotiateAuthenticationPal.Unix.cs (114)
43catch (Exception ex) when (ex is Interop.NetSecurityNative.GssApiException or TypeInitializationException) 48if (ex is Interop.NetSecurityNative.GssApiException gex) 67catch (Exception ex) when (ex is Interop.NetSecurityNative.GssApiException or TypeInitializationException) 73if (ex is Interop.NetSecurityNative.GssApiException gex) 93private Interop.NetSecurityNative.GssFlags _requestedContextFlags; 94private Interop.NetSecurityNative.GssFlags _contextFlags; 98private readonly Interop.NetSecurityNative.PackageType _packageType; 102public override bool IsSigned => (_contextFlags & Interop.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG) != 0; 104public override bool IsEncrypted => (_contextFlags & Interop.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG) != 0; 106public override bool IsMutuallyAuthenticated => (_contextFlags & Interop.NetSecurityNative.GssFlags.GSS_C_MUTUAL_FLAG) != 0; 157(_contextFlags & Interop.NetSecurityNative.GssFlags.GSS_C_DELEG_FLAG) != 0 && Package != NegotiationInfoClass.NTLM ? TokenImpersonationLevel.Delegation : 158(_contextFlags & Interop.NetSecurityNative.GssFlags.GSS_C_IDENTIFY_FLAG) != 0 ? TokenImpersonationLevel.Identification : 165Interop.NetSecurityNative.GssFlags contextFlags = clientOptions.RequiredProtectionLevel switch 167ProtectionLevel.Sign => Interop.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG, 168ProtectionLevel.EncryptAndSign => Interop.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG | Interop.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG, 172contextFlags |= clientOptions.RequireMutualAuthentication ? Interop.NetSecurityNative.GssFlags.GSS_C_MUTUAL_FLAG : 0; 176TokenImpersonationLevel.Identification => Interop.NetSecurityNative.GssFlags.GSS_C_IDENTIFY_FLAG, 177TokenImpersonationLevel.Delegation => Interop.NetSecurityNative.GssFlags.GSS_C_DELEG_FLAG, 197if (_packageType == Interop.NetSecurityNative.PackageType.NTLM) 201throw new Interop.NetSecurityNative.GssApiException(Interop.NetSecurityNative.Status.GSS_S_NO_CRED, 0, SR.net_ntlm_not_possible_default_cred); 206throw new Interop.NetSecurityNative.GssApiException(Interop.NetSecurityNative.Status.GSS_S_BAD_NAME, 0, SR.net_nego_not_supported_empty_target_with_defaultcreds); 219Interop.NetSecurityNative.GssFlags contextFlags = serverOptions.RequiredProtectionLevel switch 221ProtectionLevel.Sign => Interop.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG, 222ProtectionLevel.EncryptAndSign => Interop.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG | Interop.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG, 330Interop.NetSecurityNative.GssBuffer encryptedBuffer = default; 333Interop.NetSecurityNative.Status minorStatus; 335Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.WrapBuffer( 342if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 361Interop.NetSecurityNative.GssBuffer decryptedBuffer = default(Interop.NetSecurityNative.GssBuffer); 364Interop.NetSecurityNative.Status minorStatus; 365Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer); 366if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 370Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 389Interop.NetSecurityNative.GssBuffer decryptedBuffer = default(Interop.NetSecurityNative.GssBuffer); 392Interop.NetSecurityNative.Status minorStatus; 393Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer); 394if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 400Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 420Interop.NetSecurityNative.GssBuffer micBuffer = default; 423Interop.NetSecurityNative.Status minorStatus; 424Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.GetMic( 429if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 431throw new Interop.NetSecurityNative.GssApiException(status, minorStatus); 446Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.VerifyMic( 451return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE; 454private static Interop.NetSecurityNative.PackageType GetPackageType(string package) 458return Interop.NetSecurityNative.PackageType.Negotiate; 462return Interop.NetSecurityNative.PackageType.NTLM; 466return Interop.NetSecurityNative.PackageType.Kerberos; 471throw new Interop.NetSecurityNative.GssApiException(Interop.NetSecurityNative.Status.GSS_S_UNAVAILABLE, 0); 503catch (Exception ex) when (ex is not Interop.NetSecurityNative.GssApiException) 506throw new Interop.NetSecurityNative.GssApiException(Interop.NetSecurityNative.Status.GSS_S_BAD_NAME, 0); 512Interop.NetSecurityNative.GssBuffer token = default(Interop.NetSecurityNative.GssBuffer); 516Interop.NetSecurityNative.Status status 517= Interop.NetSecurityNative.GetUser(out var minorStatus, 521if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 523throw new Interop.NetSecurityNative.GssApiException(status, minorStatus); 547Interop.NetSecurityNative.GssFlags requestedContextFlags, 552ref Interop.NetSecurityNative.GssFlags contextFlags) 563Interop.NetSecurityNative.PackageType.NTLM => "NTLM", 564Interop.NetSecurityNative.PackageType.Kerberos => "Kerberos", 574Interop.NetSecurityNative.GssBuffer token = default(Interop.NetSecurityNative.GssBuffer); 575Interop.NetSecurityNative.Status status; 576Interop.NetSecurityNative.Status minorStatus; 584status = Interop.NetSecurityNative.InitSecContext(out minorStatus, 598status = Interop.NetSecurityNative.InitSecContext(out minorStatus, 610if ((status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) && 611(status != Interop.NetSecurityNative.Status.GSS_S_CONTINUE_NEEDED)) 618Interop.NetSecurityNative.GssApiException gex = new Interop.NetSecurityNative.GssApiException(status, minorStatus); 627if (status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 633Interop.NetSecurityNative.PackageType.NTLM => "NTLM", 634Interop.NetSecurityNative.PackageType.Kerberos => "Kerberos", 645contextFlags = (Interop.NetSecurityNative.GssFlags)outputFlags; 647return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE ? 669ref Interop.NetSecurityNative.GssFlags contextFlags) 673Interop.NetSecurityNative.GssBuffer token = default(Interop.NetSecurityNative.GssBuffer); 676Interop.NetSecurityNative.Status status; 677Interop.NetSecurityNative.Status minorStatus; 679status = Interop.NetSecurityNative.AcceptSecContext(out minorStatus, 688if ((status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) && 689(status != Interop.NetSecurityNative.Status.GSS_S_CONTINUE_NEEDED)) 691Interop.NetSecurityNative.GssApiException gex = new Interop.NetSecurityNative.GssApiException(status, minorStatus); 701contextFlags = (Interop.NetSecurityNative.GssFlags)outputFlags; 705if (status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 737internal static NegotiateAuthenticationStatusCode GetErrorCode(Interop.NetSecurityNative.GssApiException exception) 741case Interop.NetSecurityNative.Status.GSS_S_NO_CRED: 743case Interop.NetSecurityNative.Status.GSS_S_BAD_BINDINGS: 745case Interop.NetSecurityNative.Status.GSS_S_CREDENTIALS_EXPIRED: 747case Interop.NetSecurityNative.Status.GSS_S_DEFECTIVE_TOKEN: 749case Interop.NetSecurityNative.Status.GSS_S_DEFECTIVE_CREDENTIAL: 751case Interop.NetSecurityNative.Status.GSS_S_BAD_SIG: 753case Interop.NetSecurityNative.Status.GSS_S_BAD_MECH: 754case Interop.NetSecurityNative.Status.GSS_S_UNAVAILABLE: 756case Interop.NetSecurityNative.Status.GSS_S_FAILURE: 764case Interop.NetSecurityNative.Status.GSS_S_NO_CONTEXT: 775_ = Interop.NetSecurityNative.IsNtlmInstalled();
System\Net\Security\CipherSuitesPolicyPal.Linux.cs (4)
10using OpenSsl = Interop.OpenSsl; 11using Ssl = Interop.Ssl; 25if (!Interop.Ssl.Capabilities.Tls13Supported) 51string? name = Interop.Ssl.GetOpenSslCipherSuiteName(
System\Net\Security\NegotiateStream.cs (12)
824NegotiateAuthenticationStatusCode.BadBinding => (int)Interop.SECURITY_STATUS.BadBinding, 825NegotiateAuthenticationStatusCode.Unsupported => (int)Interop.SECURITY_STATUS.Unsupported, 826NegotiateAuthenticationStatusCode.MessageAltered => (int)Interop.SECURITY_STATUS.MessageAltered, 827NegotiateAuthenticationStatusCode.ContextExpired => (int)Interop.SECURITY_STATUS.ContextExpired, 828NegotiateAuthenticationStatusCode.CredentialsExpired => (int)Interop.SECURITY_STATUS.CertExpired, 829NegotiateAuthenticationStatusCode.InvalidCredentials => (int)Interop.SECURITY_STATUS.LogonDenied, 830NegotiateAuthenticationStatusCode.InvalidToken => (int)Interop.SECURITY_STATUS.InvalidToken, 831NegotiateAuthenticationStatusCode.UnknownCredentials => (int)Interop.SECURITY_STATUS.UnknownCredentials, 832NegotiateAuthenticationStatusCode.QopNotSupported => (int)Interop.SECURITY_STATUS.QopNotSupported, 833NegotiateAuthenticationStatusCode.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)
13Protocol = (int)MapProtocolVersion(Interop.Ssl.SslGetVersion(sslContext)); 14ReadOnlySpan<byte> alpn = Interop.Ssl.SslGetAlpnSelected(sslContext); 32TlsResumed = Interop.Ssl.SslSessionReused(sslContext); 40if (!Interop.Ssl.SslGetCurrentCipherId(ssl, out cipherSuite)) 42throw Interop.OpenSsl.CreateSslException(SR.net_ssl_get_connection_info_failed);
System\Net\Security\SslStreamCertificateContext.Linux.cs (5)
112CertificateHandle = Interop.Crypto.X509UpRef(target.Handle); 309using SafeOcspRequestHandle ocspRequest = Interop.Crypto.X509BuildOcspRequest(subject, issuer); 310byte[] rentedBytes = ArrayPool<byte>.Shared.Rent(Interop.Crypto.GetOcspRequestDerSize(ocspRequest)); 311int encodingSize = Interop.Crypto.EncodeOcspRequest(ocspRequest, rentedBytes); 324if (!Interop.Crypto.X509DecodeOcspToExpiration(ret, ocspRequest, subject, issuerHandles.AsSpan(0, _privateIntermediateCertificates.Length + 1), out DateTimeOffset expiration))
System\Net\Security\SslStreamPal.Unix.cs (31)
17return status.Exception ?? new Interop.OpenSsl.SslException((int)status.ErrorCode); 76Interop.Ssl.SslErrorCode errorCode = Interop.OpenSsl.Encrypt((SafeSslHandle)securityContext, input.Span, ref token); 101bytesWritten = Interop.OpenSsl.Decrypt( 107out Interop.Ssl.SslErrorCode errorCode); 119private static SecurityStatusPal MapNativeErrorCode(Interop.Ssl.SslErrorCode errorCode) => 122Interop.Ssl.SslErrorCode.SSL_ERROR_RENEGOTIATE => new SecurityStatusPal(SecurityStatusPalErrorCode.Renegotiate), 123Interop.Ssl.SslErrorCode.SSL_ERROR_ZERO_RETURN => new SecurityStatusPal(SecurityStatusPalErrorCode.ContextExpired), 124Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_X509_LOOKUP => new SecurityStatusPal(SecurityStatusPalErrorCode.CredentialsNeeded), 125Interop.Ssl.SslErrorCode.SSL_ERROR_NONE or 126Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_READ => new SecurityStatusPal(SecurityStatusPalErrorCode.OK), 127_ => new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, new Interop.OpenSsl.SslException((int)errorCode)) 140throw Interop.OpenSsl.CreateSslException(SR.net_ssl_invalid_certificate); 145bindingHandle = Interop.OpenSsl.QueryChannelBinding( 158SecurityStatusPal status = Interop.OpenSsl.SslRenegotiate((SafeSslHandle)context, out _); 182Interop.OpenSsl.UpdateClientCertificate((SafeSslHandle)context!, sslAuthenticationOptions); 198context = Interop.OpenSsl.AllocateSslHandle(sslAuthenticationOptions); 201SecurityStatusPalErrorCode errorCode = Interop.OpenSsl.DoSslHandshake((SafeSslHandle)context, inputBuffer, out consumed, ref token); 220errorCode = Interop.OpenSsl.DoSslHandshake((SafeSslHandle)context, inputBuffer.Slice(consumed), out int c, ref token); 226if (token.Size == 0 && Interop.Ssl.IsSslRenegotiatePending((SafeSslHandle)context)) 228errorCode = Interop.OpenSsl.DoSslHandshake((SafeSslHandle)context, inputBuffer.Slice(consumed), out int c, ref token); 258Interop.Ssl.SslSetQuietShutdown((SafeSslHandle)context, 0); 260int status = Interop.Ssl.SslShutdown((SafeSslHandle)context); 264status = Interop.Ssl.SslShutdown((SafeSslHandle)context); 270Interop.Ssl.SslErrorCode code = Interop.Ssl.SslGetError((SafeSslHandle)context, status); 271if (code == Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_READ || 272code == Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_WRITE) 276else if (code == Interop.Ssl.SslErrorCode.SSL_ERROR_SSL) 279return new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, Interop.Crypto.CreateOpenSslCryptographicException()); 283return new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, new Interop.OpenSsl.SslException((int)code));
System\Net\Security\TlsContext.OpenSsl.cs (1)
58ctx = Interop.OpenSsl.GetOrCreateSslContextHandle(sessionOptions, allowCached: false, enableResume: enableResume);
System\Net\Security\TlsSession.OpenSsl.cs (20)
130_peekBio = Interop.Ssl.BioNewSocketReplay(_pendingFdSocket, ReadOnlySpan<byte>.Empty); 135throw Interop.OpenSsl.CreateSslException(SR.net_ssl_read_bio_failed_error); 141int rc = Interop.Ssl.BioPeekTlsFrame(_peekBio, out byte* framePtr, out int frameLen); 210if (Interop.Ssl.BioGetReplayPrefix(_peekBio, out byte* ptr, out int len) == 1 && len > 0) 225int ret = Interop.Ssl.SslDoHandshake(ssl, out Interop.Ssl.SslErrorCode err); 249int ret = Interop.Ssl.SslRead(ssl, ref MemoryMarshal.GetReference(buffer), buffer.Length, out Interop.Ssl.SslErrorCode err); 273int ret = Interop.Ssl.SslWrite(ssl, ref MemoryMarshal.GetReference(buffer), buffer.Length, out Interop.Ssl.SslErrorCode err); 289SafeSslHandle handle = Interop.OpenSsl.AllocateSslHandle(_options); 303private static TlsOperationStatus MapSslError(Interop.Ssl.SslErrorCode error, int result, string sslErrorTemplate) 307Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_READ => TlsOperationStatus.NeedMoreData, 308Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_WRITE => TlsOperationStatus.DestinationTooSmall, 309Interop.Ssl.SslErrorCode.SSL_ERROR_ZERO_RETURN => TlsOperationStatus.Closed, 314private static Interop.OpenSsl.SslException CreateDiagnosticSslException(Interop.Ssl.SslErrorCode error, int result, string sslErrorTemplate) 316Exception? detail = Interop.OpenSsl.GetSslError(result, error); 317Interop.Crypto.ErrClearError(); 318return new Interop.OpenSsl.SslException(SR.Format(sslErrorTemplate, error), detail);