90 references to SafeSslHandle
System.Net.Security (90)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (13)
95internal static SafeChannelBindingHandle? QueryChannelBinding(SafeSslHandle context, ChannelBindingKind bindingType) 313internal static void UpdateClientCertificate(SafeSslHandle ssl, SslAuthenticationOptions sslAuthenticationOptions) 348internal static SafeSslHandle AllocateSslHandle(SslAuthenticationOptions sslAuthenticationOptions) 350SafeSslHandle? sslHandle = null; 393sslHandle = SafeSslHandle.Create(sslCtxHandle, sslAuthenticationOptions.IsServer); 594internal static unsafe void ConfigureSignatureAlgorithms(SafeSslHandle sslHandle, bool enablePss, bool enablePkcs1) 662internal static SecurityStatusPal SslRenegotiate(SafeSslHandle sslContext, out byte[]? outputBuffer) 674internal static SecurityStatusPalErrorCode DoSslHandshake(SafeSslHandle context, ReadOnlySpan<byte> input, ref ProtocolToken token) 755internal static Ssl.SslErrorCode Encrypt(SafeSslHandle context, ReadOnlySpan<byte> input, ref ProtocolToken outToken) 794internal static int Decrypt(SafeSslHandle context, Span<byte> buffer, out Ssl.SslErrorCode errorCode) 831internal static IntPtr GetPeerCertificate(SafeSslHandle context) 836internal static SafeSharedX509StackHandle GetPeerCertificateChain(SafeSslHandle context) 845private static void QueryUniqueChannelBinding(SafeSslHandle context, SafeChannelBindingHandle bindingHandle)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (52)
29internal static partial SafeSslHandle SslCreate(SafeSslContextHandle ctx); 32internal static partial SslErrorCode SslGetError(SafeSslHandle ssl, int ret); 38internal static partial void SslSetQuietShutdown(SafeSslHandle ssl, int mode); 44internal static partial void SslSetConnectState(SafeSslHandle ssl); 47internal static partial void SslSetAcceptState(SafeSslHandle ssl); 50internal static unsafe partial int SslSetAlpnProtos(SafeSslHandle ssl, byte* protos, int len); 53internal static partial IntPtr SslGetVersion(SafeSslHandle ssl); 57internal static partial bool SslSetTlsExtHostName(SafeSslHandle ssl, string host); 63internal static unsafe partial int SslSetSession(SafeSslHandle ssl, IntPtr session); 66internal static partial void SslGetAlpnSelected(SafeSslHandle ssl, out IntPtr protocol, out int len); 68internal static unsafe ReadOnlySpan<byte> SslGetAlpnSelected(SafeSslHandle ssl) 81internal static partial int SslWrite(SafeSslHandle ssl, ref byte buf, int num, out SslErrorCode error); 84internal static partial int SslRead(SafeSslHandle ssl, ref byte buf, int num, out SslErrorCode error); 105internal static partial int SslRenegotiate(SafeSslHandle ssl, out SslErrorCode error); 109internal static partial bool IsSslRenegotiatePending(SafeSslHandle ssl); 115internal static partial int SslShutdown(SafeSslHandle ssl); 118internal static partial void SslSetBio(SafeSslHandle ssl, SafeBioHandle rbio, SafeBioHandle wbio); 121internal static partial int SslDoHandshake(SafeSslHandle ssl, out SslErrorCode error); 125internal static partial bool IsSslStateOK(SafeSslHandle ssl); 135internal static partial IntPtr SslGetPeerCertificate(SafeSslHandle ssl); 138internal static partial IntPtr SslGetCertificate(SafeSslHandle ssl); 144private static partial SafeSharedX509StackHandle SslGetPeerCertChain_private(SafeSslHandle ssl); 146internal static SafeSharedX509StackHandle SslGetPeerCertChain(SafeSslHandle ssl) 154internal static partial int SslGetPeerFinished(SafeSslHandle ssl, IntPtr buf, int count); 157internal static partial int SslGetFinished(SafeSslHandle ssl, IntPtr buf, int count); 161internal static partial bool SslSessionReused(SafeSslHandle ssl); 164internal static partial IntPtr SslGetSession(SafeSslHandle ssl); 167private static partial SafeSharedX509NameStackHandle SslGetClientCAList_private(SafeSslHandle ssl); 171internal static partial bool SslGetCurrentCipherId(SafeSslHandle ssl, out int cipherId); 174private static partial IntPtr GetOpenSslCipherSuiteName(SafeSslHandle ssl, int cipherSuite, out int isTls12OrLower); 178internal static unsafe partial bool SslSetCiphers(SafeSslHandle ssl, byte* cipherList, byte* cipherSuites); 181internal static partial void SslSetVerifyPeer(SafeSslHandle ssl); 187internal static partial IntPtr SslGetData(SafeSslHandle ssl); 190internal static partial int SslSetData(SafeSslHandle ssl, IntPtr data); 196internal static partial int SslUseCertificate(SafeSslHandle ssl, SafeX509Handle certPtr); 199internal static partial int SslUsePrivateKey(SafeSslHandle ssl, SafeEvpPKeyHandle keyPtr); 202internal static unsafe partial void SslSetClientCertCallback(SafeSslHandle ssl, int set); 205internal static partial void SslSetPostHandshakeAuth(SafeSslHandle ssl, int value); 208internal static unsafe partial int SslSetSigalgs(SafeSslHandle ssl, byte* str); 211internal static unsafe partial int SslSetClientSigalgs(SafeSslHandle ssl, byte* str); 267internal static unsafe int SslSetAlpnProtos(SafeSslHandle ssl, List<SslApplicationProtocol> applicationProtocols) 275internal static unsafe int SslSetAlpnProtos(SafeSslHandle ssl, Span<byte> serializedProtocols) 285internal static partial bool SslAddExtraChainCert(SafeSslHandle ssl, SafeX509Handle x509); 289private static unsafe partial bool SslAddClientCAs(SafeSslHandle ssl, IntPtr* x509s, int count); 291internal static unsafe bool SslAddClientCAs(SafeSslHandle ssl, Span<IntPtr> x509handles) 300private static unsafe partial void CryptoNative_SslStapleOcsp(SafeSslHandle ssl, byte* buf, int len); 302internal static unsafe void SslStapleOcsp(SafeSslHandle ssl, ReadOnlySpan<byte> stapledResponse) 312internal static bool AddExtraChainCertificates(SafeSslHandle ssl, ReadOnlyCollection<X509Certificate2> chain) 331internal static string? GetOpenSslCipherSuiteName(SafeSslHandle ssl, TlsCipherSuite cipherSuite, out bool isTls12OrLower) 338internal static SafeSharedX509NameStackHandle SslGetClientCAList(SafeSslHandle ssl) 416public static SafeSslHandle Create(SafeSslContextHandle context, bool isServer) 420SafeSslHandle handle = Interop.Ssl.SslCreate(context);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (1)
247internal bool TrySetSession(SafeSslHandle sslHandle, string name)
System\Net\CertificateValidationPal.Unix.cs (4)
39IntPtr remoteCertificate = Interop.OpenSsl.GetPeerCertificate((SafeSslHandle)securityContext); 58Interop.OpenSsl.GetPeerCertificateChain((SafeSslHandle)securityContext)) 100if (ctx is not SafeSslHandle ssl) 141using (SafeSharedX509NameStackHandle names = Interop.Ssl.SslGetClientCAList((SafeSslHandle)securityContext))
System\Net\Security\CipherSuitesPolicyPal.Linux.cs (2)
37using (SafeSslHandle ssl = SafeSslHandle.Create(innerContext, false))
System\Net\Security\SslConnectionInfo.Linux.cs (2)
11public void UpdateSslConnectionInfo(SafeSslHandle sslContext) 37private static TlsCipherSuite SslGetCurrentCipherSuite(SafeSslHandle ssl)
System\Net\Security\SslStreamPal.Unix.cs (16)
69Interop.Ssl.SslErrorCode errorCode = Interop.OpenSsl.Encrypt((SafeSslHandle)securityContext, input.Span, ref token); 87int resultSize = Interop.OpenSsl.Decrypt((SafeSslHandle)securityContext, buffer, out Interop.Ssl.SslErrorCode errorCode); 132(SafeSslHandle)securityContext, 144SecurityStatusPal status = Interop.OpenSsl.SslRenegotiate((SafeSslHandle)context, out _); 160connectionInfo.UpdateSslConnectionInfo((SafeSslHandle)securityContext); 168Interop.OpenSsl.UpdateClientCertificate((SafeSslHandle)context!, sslAuthenticationOptions); 187SecurityStatusPalErrorCode errorCode = Interop.OpenSsl.DoSslHandshake((SafeSslHandle)context, inputBuffer, ref token); 207errorCode = Interop.OpenSsl.DoSslHandshake((SafeSslHandle)context, ReadOnlySpan<byte>.Empty, ref token); 212if (token.Size == 0 && Interop.Ssl.IsSslRenegotiatePending((SafeSslHandle)context)) 214errorCode = Interop.OpenSsl.DoSslHandshake((SafeSslHandle)context, ReadOnlySpan<byte>.Empty, ref token); 221SafeSslHandle sslContext = (SafeSslHandle)context; 252Interop.Ssl.SslSetQuietShutdown((SafeSslHandle)context, 0); 254int status = Interop.Ssl.SslShutdown((SafeSslHandle)context); 258status = Interop.Ssl.SslShutdown((SafeSslHandle)context); 264Interop.Ssl.SslErrorCode code = Interop.Ssl.SslGetError((SafeSslHandle)context, status);