300 references to Interop
System.Net.Security (300)
src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (6)
123_error = Interop.Sys.ConvertErrorPlatformToPal(errno); 140get { return _rawErrno == -1 ? (_rawErrno = Interop.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; } 145return Interop.Sys.StrError(RawErrno); 219public static Interop.ErrorInfo Info(this Interop.Error error) 221return new Interop.ErrorInfo(error);
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs (2)
84Interop.NetSecurityNative.Status minStat; 85Interop.NetSecurityNative.Status displayCallStatus = isMinor ?
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (1)
62Interop.NetSecurityNative.ReleaseGssBuffer(_data, _length);
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs (19)
14[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_ReleaseGssBuffer")] 19[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_DisplayMinorStatus")] 25[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_DisplayMajorStatus")] 31[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_ImportUserName")] 38[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_ImportPrincipalName")] 45[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_ReleaseName")] 50[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_AcquireAcceptorCred")] 55[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_InitiateCredSpNego")] 61[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_InitiateCredWithPassword", StringMarshalling = StringMarshalling.Utf8)] 70[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_ReleaseCred")] 75[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_InitSecContext")] 89[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_InitSecContextEx")] 161[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_AcceptSecContext")] 192[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_DeleteSecContext")] 197[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_GetUser")] 203[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_Wrap")] 212[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_Unwrap")] 221[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_GetMic")] 229[LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_VerifyMic")]
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\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (3)
149throw Interop.Crypto.CreateOpenSslCryptographicException(); 159throw Interop.Crypto.CreateOpenSslCryptographicException(); 168throw Interop.Crypto.CreateOpenSslCryptographicException();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OCSP.cs (2)
107Interop.Crypto.OcspRequestDestroy(handle); 122Interop.Crypto.OcspResponseDestroy(handle);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (11)
108if (!Interop.Ssl.Capabilities.Tls13Supported) 269Interop.Ssl.SslCtxSetAlpnSelectCb(sslCtx, &AlpnServerSelectCallback, IntPtr.Zero); 306Interop.Ssl.SslSetClientCertCallback(ssl, 0); 352if (!Interop.Ssl.Capabilities.Tls13Supported || 395Debug.Assert(Interop.Ssl.SslGetData(sslHandle) == IntPtr.Zero); 397Interop.Ssl.SslSetData(sslHandle, GCHandle.ToIntPtr(alpnHandle)); 402if (Interop.Ssl.SslSetAlpnProtos(sslHandle, sslAuthenticationOptions.ApplicationProtocols) != 0) 504int ret = Interop.Ssl.SslRenegotiate(sslContext, out Ssl.SslErrorCode errorCode); 781IntPtr cert = Interop.Ssl.SslGetCertificate(ssl); 782Interop.Ssl.SslSessionSetData(session, cert); 873innerError = Interop.Crypto.CreateOpenSslCryptographicException();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (11)
385SafeBioHandle readBio = Interop.Crypto.CreateMemoryBio(); 386SafeBioHandle writeBio = Interop.Crypto.CreateMemoryBio(); 387SafeSslHandle handle = Interop.Ssl.SslCreate(context); 404Interop.Ssl.SslSetBio(handle, readBio, writeBio); 416Interop.Ssl.SslSetAcceptState(handle); 420Interop.Ssl.SslSetConnectState(handle); 454Interop.Ssl.SslSetData(handle, IntPtr.Zero); 460Interop.Ssl.SslDestroy(h); // will free the handles underlying _readBio and _writeBio 469int retVal = Interop.Ssl.SslShutdown(handle); 477retVal = Interop.Ssl.SslShutdown(handle); 483Interop.Crypto.ErrClearError();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (11)
135Interop.Ssl.SslCtxSetData(handle, IntPtr.Zero); 141Interop.Ssl.SessionFree(session); 151Interop.Ssl.SslCtxDestroy(handle); 165Interop.Ssl.SslCtxSetData(this, (IntPtr)_gch); 185Interop.Ssl.SessionSetHostname(session, namePtr); 208Interop.Ssl.SslCtxRemoveSession(this, oldSession); 209Interop.Ssl.SessionFree(oldSession); 241Interop.Ssl.SessionFree(oldSession); 258Debug.Assert(Interop.Ssl.SslGetData(sslHandle) == IntPtr.Zero); 259Interop.Ssl.SslSetData(sslHandle, (IntPtr)_gch); 267Interop.Ssl.SslSetSession(sslHandle, session);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs (1)
73Interop.Crypto.RecursiveFreeX509Stack(handle);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs (1)
86Interop.Crypto.X509StoreCtxDestroy(handle);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs (3)
18Interop.Crypto.Asn1ObjectFree(handle); 38Interop.Crypto.Asn1BitStringFree(handle); 58Interop.Crypto.Asn1OctetStringFree(handle);
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\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (1)
34return Interop.Crypto.BioDestroy(h);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs (3)
37Interop.Crypto.X509Destroy(handle); 57Interop.Crypto.X509CrlDestroy(handle); 77Interop.Crypto.X509StoreDestroy(handle);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs (2)
19Interop.Crypto.X509ExtensionDestroy(handle); 39Interop.Crypto.ExtendedKeyUsageDestroy(handle);
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 (111)
50catch (Interop.NetSecurityNative.GssApiException gex) 73catch (Interop.NetSecurityNative.GssApiException gex) 98private Interop.NetSecurityNative.GssFlags _requestedContextFlags; 99private Interop.NetSecurityNative.GssFlags _contextFlags; 103private readonly Interop.NetSecurityNative.PackageType _packageType; 107public override bool IsSigned => (_contextFlags & Interop.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG) != 0; 109public override bool IsEncrypted => (_contextFlags & Interop.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG) != 0; 111public override bool IsMutuallyAuthenticated => (_contextFlags & Interop.NetSecurityNative.GssFlags.GSS_C_MUTUAL_FLAG) != 0; 162(_contextFlags & Interop.NetSecurityNative.GssFlags.GSS_C_DELEG_FLAG) != 0 && Package != NegotiationInfoClass.NTLM ? TokenImpersonationLevel.Delegation : 163(_contextFlags & Interop.NetSecurityNative.GssFlags.GSS_C_IDENTIFY_FLAG) != 0 ? TokenImpersonationLevel.Identification : 170Interop.NetSecurityNative.GssFlags contextFlags = clientOptions.RequiredProtectionLevel switch 172ProtectionLevel.Sign => Interop.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG, 173ProtectionLevel.EncryptAndSign => Interop.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG | Interop.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG, 177contextFlags |= clientOptions.RequireMutualAuthentication ? Interop.NetSecurityNative.GssFlags.GSS_C_MUTUAL_FLAG : 0; 181TokenImpersonationLevel.Identification => Interop.NetSecurityNative.GssFlags.GSS_C_IDENTIFY_FLAG, 182TokenImpersonationLevel.Delegation => Interop.NetSecurityNative.GssFlags.GSS_C_DELEG_FLAG, 202if (_packageType == Interop.NetSecurityNative.PackageType.NTLM) 206throw new Interop.NetSecurityNative.GssApiException(Interop.NetSecurityNative.Status.GSS_S_NO_CRED, 0, SR.net_ntlm_not_possible_default_cred); 211throw new Interop.NetSecurityNative.GssApiException(Interop.NetSecurityNative.Status.GSS_S_BAD_NAME, 0, SR.net_nego_not_supported_empty_target_with_defaultcreds); 224Interop.NetSecurityNative.GssFlags contextFlags = serverOptions.RequiredProtectionLevel switch 226ProtectionLevel.Sign => Interop.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG, 227ProtectionLevel.EncryptAndSign => Interop.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG | Interop.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG, 336Interop.NetSecurityNative.GssBuffer encryptedBuffer = default; 339Interop.NetSecurityNative.Status minorStatus; 341Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.WrapBuffer( 348if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 367Interop.NetSecurityNative.GssBuffer decryptedBuffer = default(Interop.NetSecurityNative.GssBuffer); 370Interop.NetSecurityNative.Status minorStatus; 371Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer); 372if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 376Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 395Interop.NetSecurityNative.GssBuffer decryptedBuffer = default(Interop.NetSecurityNative.GssBuffer); 398Interop.NetSecurityNative.Status minorStatus; 399Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer); 400if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 406Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 426Interop.NetSecurityNative.GssBuffer micBuffer = default; 429Interop.NetSecurityNative.Status minorStatus; 430Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.GetMic( 435if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 437throw new Interop.NetSecurityNative.GssApiException(status, minorStatus); 452Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.VerifyMic( 457return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE; 460private static Interop.NetSecurityNative.PackageType GetPackageType(string package) 464return Interop.NetSecurityNative.PackageType.Negotiate; 468return Interop.NetSecurityNative.PackageType.NTLM; 472return Interop.NetSecurityNative.PackageType.Kerberos; 477throw new Interop.NetSecurityNative.GssApiException(Interop.NetSecurityNative.Status.GSS_S_UNAVAILABLE, 0); 509catch (Exception ex) when (ex is not Interop.NetSecurityNative.GssApiException) 512throw new Interop.NetSecurityNative.GssApiException(Interop.NetSecurityNative.Status.GSS_S_BAD_NAME, 0); 518Interop.NetSecurityNative.GssBuffer token = default(Interop.NetSecurityNative.GssBuffer); 522Interop.NetSecurityNative.Status status 523= Interop.NetSecurityNative.GetUser(out var minorStatus, 527if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 529throw new Interop.NetSecurityNative.GssApiException(status, minorStatus); 553Interop.NetSecurityNative.GssFlags requestedContextFlags, 558ref Interop.NetSecurityNative.GssFlags contextFlags) 569Interop.NetSecurityNative.PackageType.NTLM => "NTLM", 570Interop.NetSecurityNative.PackageType.Kerberos => "Kerberos", 580Interop.NetSecurityNative.GssBuffer token = default(Interop.NetSecurityNative.GssBuffer); 581Interop.NetSecurityNative.Status status; 582Interop.NetSecurityNative.Status minorStatus; 596status = Interop.NetSecurityNative.InitSecContext(out minorStatus, 611status = Interop.NetSecurityNative.InitSecContext(out minorStatus, 623if ((status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) && 624(status != Interop.NetSecurityNative.Status.GSS_S_CONTINUE_NEEDED)) 631Interop.NetSecurityNative.GssApiException gex = new Interop.NetSecurityNative.GssApiException(status, minorStatus); 640if (status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 646Interop.NetSecurityNative.PackageType.NTLM => "NTLM", 647Interop.NetSecurityNative.PackageType.Kerberos => "Kerberos", 658contextFlags = (Interop.NetSecurityNative.GssFlags)outputFlags; 660return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE ? 683ref Interop.NetSecurityNative.GssFlags contextFlags) 687Interop.NetSecurityNative.GssBuffer token = default(Interop.NetSecurityNative.GssBuffer); 690Interop.NetSecurityNative.Status status; 691Interop.NetSecurityNative.Status minorStatus; 692status = Interop.NetSecurityNative.AcceptSecContext(out minorStatus, 700if ((status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) && 701(status != Interop.NetSecurityNative.Status.GSS_S_CONTINUE_NEEDED)) 703Interop.NetSecurityNative.GssApiException gex = new Interop.NetSecurityNative.GssApiException(status, minorStatus); 713contextFlags = (Interop.NetSecurityNative.GssFlags)outputFlags; 717if (status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 749internal static NegotiateAuthenticationStatusCode GetErrorCode(Interop.NetSecurityNative.GssApiException exception) 753case Interop.NetSecurityNative.Status.GSS_S_NO_CRED: 755case Interop.NetSecurityNative.Status.GSS_S_BAD_BINDINGS: 757case Interop.NetSecurityNative.Status.GSS_S_CREDENTIALS_EXPIRED: 759case Interop.NetSecurityNative.Status.GSS_S_DEFECTIVE_TOKEN: 761case Interop.NetSecurityNative.Status.GSS_S_DEFECTIVE_CREDENTIAL: 763case Interop.NetSecurityNative.Status.GSS_S_BAD_SIG: 765case Interop.NetSecurityNative.Status.GSS_S_BAD_MECH: 766case Interop.NetSecurityNative.Status.GSS_S_UNAVAILABLE: 768case Interop.NetSecurityNative.Status.GSS_S_NO_CONTEXT: 779return Interop.NetSecurityNative.IsNtlmInstalled();
System\Net\Security\CipherSuitesPolicyPal.Linux.cs (4)
10using OpenSsl = Interop.OpenSsl; 11using Ssl = Interop.Ssl; 25if (!Interop.Ssl.Capabilities.Tls13Supported) 49string? name = Interop.Ssl.GetOpenSslCipherSuiteName(
System\Net\Security\NegotiateStream.cs (12)
818NegotiateAuthenticationStatusCode.BadBinding => (int)Interop.SECURITY_STATUS.BadBinding, 819NegotiateAuthenticationStatusCode.Unsupported => (int)Interop.SECURITY_STATUS.Unsupported, 820NegotiateAuthenticationStatusCode.MessageAltered => (int)Interop.SECURITY_STATUS.MessageAltered, 821NegotiateAuthenticationStatusCode.ContextExpired => (int)Interop.SECURITY_STATUS.ContextExpired, 822NegotiateAuthenticationStatusCode.CredentialsExpired => (int)Interop.SECURITY_STATUS.CertExpired, 823NegotiateAuthenticationStatusCode.InvalidCredentials => (int)Interop.SECURITY_STATUS.LogonDenied, 824NegotiateAuthenticationStatusCode.InvalidToken => (int)Interop.SECURITY_STATUS.InvalidToken, 825NegotiateAuthenticationStatusCode.UnknownCredentials => (int)Interop.SECURITY_STATUS.UnknownCredentials, 826NegotiateAuthenticationStatusCode.QopNotSupported => (int)Interop.SECURITY_STATUS.QopNotSupported, 827NegotiateAuthenticationStatusCode.OutOfSequence => (int)Interop.SECURITY_STATUS.OutOfSequence, 828_ => (int)Interop.SECURITY_STATUS.InternalError 937(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)
102CertificateHandle = Interop.Crypto.X509UpRef(target.Handle); 299using SafeOcspRequestHandle ocspRequest = Interop.Crypto.X509BuildOcspRequest(subject, issuer); 300byte[] rentedBytes = ArrayPool<byte>.Shared.Rent(Interop.Crypto.GetOcspRequestDerSize(ocspRequest)); 301int encodingSize = Interop.Crypto.EncodeOcspRequest(ocspRequest, rentedBytes); 314if (!Interop.Crypto.X509DecodeOcspToExpiration(ret, ocspRequest, subject, issuerHandles.AsSpan(0, _privateIntermediateCertificates.Length + 1), out DateTimeOffset expiration))
System\Net\Security\SslStreamPal.Unix.cs (32)
17return status.Exception ?? new Interop.OpenSsl.SslException((int)status.ErrorCode); 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); 105private static SecurityStatusPal MapNativeErrorCode(Interop.Ssl.SslErrorCode errorCode) => 108Interop.Ssl.SslErrorCode.SSL_ERROR_RENEGOTIATE => new SecurityStatusPal(SecurityStatusPalErrorCode.Renegotiate), 109Interop.Ssl.SslErrorCode.SSL_ERROR_ZERO_RETURN => new SecurityStatusPal(SecurityStatusPalErrorCode.ContextExpired), 110Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_X509_LOOKUP => new SecurityStatusPal(SecurityStatusPalErrorCode.CredentialsNeeded), 111Interop.Ssl.SslErrorCode.SSL_ERROR_NONE or 112Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_READ => new SecurityStatusPal(SecurityStatusPalErrorCode.OK), 113_ => new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, new Interop.OpenSsl.SslException((int)errorCode)) 126throw Interop.OpenSsl.CreateSslException(SR.net_ssl_invalid_certificate); 131bindingHandle = Interop.OpenSsl.QueryChannelBinding( 144SecurityStatusPal status = Interop.OpenSsl.SslRenegotiate((SafeSslHandle)context, out _); 168Interop.OpenSsl.UpdateClientCertificate((SafeSslHandle)context!, sslAuthenticationOptions); 184context = Interop.OpenSsl.AllocateSslHandle(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); 226token.Status = new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, Interop.OpenSsl.CreateSslException(SR.net_alpn_failed)); 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); 265if (code == Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_READ || 266code == Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_WRITE) 270else if (code == Interop.Ssl.SslErrorCode.SSL_ERROR_SSL) 273return new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, Interop.Crypto.CreateOpenSslCryptographicException()); 277return new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, new Interop.OpenSsl.SslException((int)code));