352 references to Interop
System.Net.Security (352)
LibraryImports.g.cs (33)
79private static partial int PathConf(string path, global::Interop.Sys.PathConfName name) 108static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.PathConfName __name_native); 117internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output) 130fixed (global::Interop.Sys.FileStatus* __output_native = &output) 149static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.FileStatus* __output_native); 158internal static partial int Stat(string path, out global::Interop.Sys.FileStatus output) 171fixed (global::Interop.Sys.FileStatus* __output_native = &output) 190static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native); 199internal static partial int LStat(string path, out global::Interop.Sys.FileStatus output) 212fixed (global::Interop.Sys.FileStatus* __output_native = &output) 231static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native); 610internal static partial nuint ZSTD_decompressStream(global::Microsoft.Win32.SafeHandles.SafeZstdDecompressHandle dctx, ref global::Interop.Zstd.ZstdOutBuffer output, ref global::Interop.Zstd.ZstdInBuffer input) 621fixed (global::Interop.Zstd.ZstdInBuffer* __input_native = &input) 622fixed (global::Interop.Zstd.ZstdOutBuffer* __output_native = &output) 638static extern unsafe nuint __PInvoke(nint __dctx_native, global::Interop.Zstd.ZstdOutBuffer* __output_native, global::Interop.Zstd.ZstdInBuffer* __input_native); 647internal static partial nuint ZSTD_DCtx_setParameter(global::Microsoft.Win32.SafeHandles.SafeZstdDecompressHandle dctx, global::Interop.Zstd.ZstdDParameter param, int value) 672static extern unsafe nuint __PInvoke(nint __dctx_native, global::Interop.Zstd.ZstdDParameter __param_native, int __value_native); 715internal static partial nuint ZSTD_DCtx_reset(global::Microsoft.Win32.SafeHandles.SafeZstdDecompressHandle dctx, global::Interop.Zstd.ZstdResetDirective reset) 740static extern unsafe nuint __PInvoke(nint __dctx_native, global::Interop.Zstd.ZstdResetDirective __reset_native); 749internal static partial nuint ZSTD_compressStream2(global::Microsoft.Win32.SafeHandles.SafeZstdCompressHandle cctx, ref global::Interop.Zstd.ZstdOutBuffer output, ref global::Interop.Zstd.ZstdInBuffer input, global::Interop.Zstd.ZstdEndDirective endOp) 760fixed (global::Interop.Zstd.ZstdInBuffer* __input_native = &input) 761fixed (global::Interop.Zstd.ZstdOutBuffer* __output_native = &output) 777static extern unsafe nuint __PInvoke(nint __cctx_native, global::Interop.Zstd.ZstdOutBuffer* __output_native, global::Interop.Zstd.ZstdInBuffer* __input_native, global::Interop.Zstd.ZstdEndDirective __endOp_native); 786internal static partial nuint ZSTD_CCtx_setParameter(global::Microsoft.Win32.SafeHandles.SafeZstdCompressHandle cctx, global::Interop.Zstd.ZstdCParameter param, int value) 811static extern unsafe nuint __PInvoke(nint __cctx_native, global::Interop.Zstd.ZstdCParameter __param_native, int __value_native); 854internal static partial nuint ZSTD_CCtx_reset(global::Microsoft.Win32.SafeHandles.SafeZstdCompressHandle cctx, global::Interop.Zstd.ZstdResetDirective reset) 879static extern unsafe nuint __PInvoke(nint __cctx_native, global::Interop.Zstd.ZstdResetDirective __reset_native);
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\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs (2)
85Interop.NetSecurityNative.Status minStat; 86Interop.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 (5)
171throw Interop.Crypto.CreateOpenSslCryptographicException(); 181throw Interop.Crypto.CreateOpenSslCryptographicException(); 190throw Interop.Crypto.CreateOpenSslCryptographicException(); 209throw Interop.Crypto.CreateOpenSslCryptographicException(); 218throw 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 (29)
140if (!Interop.Ssl.Capabilities.Tls13Supported) 283Interop.Ssl.SslCtxSetAlpnSelectCb(sslCtx, &AlpnServerSelectCallback, IntPtr.Zero); 320Interop.Ssl.SslSetClientCertCallback(ssl, 0); 366if (!Interop.Ssl.Capabilities.Tls13Supported || 430if (Interop.Ssl.SslSetAlpnProtos(sslHandle, sslAuthenticationOptions.ApplicationProtocols) != 0) 524ushort[] rawAlgs = Interop.Ssl.GetDefaultSignatureAlgorithms(); 624ret = Interop.Ssl.SslSetSigalgs(sslHandle, pBuffer); 630ret = Interop.Ssl.SslSetClientSigalgs(sslHandle, pBuffer); 659int ret = Interop.Ssl.SslRenegotiate(sslContext, out Ssl.SslErrorCode errorCode); 893Ssl.X509StoreCtxSetError(storeCtx, (int)Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_OK); 899Interop.Crypto.X509VerifyStatusCodeUniversal verifyError; 902verifyError = Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_APPLICATION_VERIFICATION; 925TlsAlertMessage.BadCertificate => Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_REJECTED, 926TlsAlertMessage.UnknownCA => Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT, 927TlsAlertMessage.CertificateRevoked => Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_REVOKED, 928TlsAlertMessage.CertificateExpired => Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_HAS_EXPIRED, 929TlsAlertMessage.UnsupportedCert => Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_INVALID_PURPOSE, 930_ => Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_REJECTED, 967Ssl.X509StoreCtxSetError(storeCtx, (int)Interop.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_UNSPECIFIED); 982using (SafeSharedX509StackHandle chainStack = Interop.Crypto.X509StoreCtxGetSharedUntrusted(storeHandle)) 986int count = Interop.Crypto.GetX509StackFieldCount(chainStack); 990IntPtr certPtr = Interop.Crypto.GetX509StackField(chainStack, i); 1001Interop.Ssl.SslUpdateOcspStaple(sslHandle, certificate.Handle); 1081IntPtr cert = Interop.Ssl.SslGetCertificate(ssl); 1086if (cert == IntPtr.Zero && Interop.Ssl.SslSessionReused(ssl)) 1088IntPtr currentSession = Interop.Ssl.SslGetSession(ssl); 1091cert = Interop.Ssl.SslSessionGetData(currentSession); 1095Interop.Ssl.SslSessionSetData(session, cert); 1196innerError = Interop.Crypto.CreateOpenSslCryptographicException();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (13)
98throw Interop.OpenSsl.CreateSslException(SR.net_ssl_get_default_sigalgs_failed); 440SafeBioHandle readBio = Interop.Crypto.CreateMemoryBio(); 441SafeBioHandle writeBio = Interop.Crypto.CreateMemoryBio(); 442SafeSslHandle handle = Interop.Ssl.SslCreate(context); 452Interop.Ssl.SslSetData(handle, WeakGCHandle<SslAuthenticationOptions>.ToIntPtr(handle._authOptionsHandle)); 461Interop.Ssl.SslSetBio(handle, readBio, writeBio); 473Interop.Ssl.SslSetAcceptState(handle); 477Interop.Ssl.SslSetConnectState(handle); 509Interop.Ssl.SslSetData(handle, IntPtr.Zero); 516Interop.Ssl.SslDestroy(h); // will free the handles underlying _readBio and _writeBio 525int retVal = Interop.Ssl.SslShutdown(handle); 533retVal = Interop.Ssl.SslShutdown(handle); 539Interop.Crypto.ErrClearError();
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\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 (2)
18Interop.Crypto.Asn1ObjectFree(handle); 38Interop.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 (1)
19Interop.Crypto.X509ExtensionDestroy(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 (113)
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, 331Interop.NetSecurityNative.GssBuffer encryptedBuffer = default; 334Interop.NetSecurityNative.Status minorStatus; 336Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.WrapBuffer( 343if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 362Interop.NetSecurityNative.GssBuffer decryptedBuffer = default(Interop.NetSecurityNative.GssBuffer); 365Interop.NetSecurityNative.Status minorStatus; 366Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer); 367if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 371Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 390Interop.NetSecurityNative.GssBuffer decryptedBuffer = default(Interop.NetSecurityNative.GssBuffer); 393Interop.NetSecurityNative.Status minorStatus; 394Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer); 395if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 401Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 421Interop.NetSecurityNative.GssBuffer micBuffer = default; 424Interop.NetSecurityNative.Status minorStatus; 425Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.GetMic( 430if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 432throw new Interop.NetSecurityNative.GssApiException(status, minorStatus); 447Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.VerifyMic( 452return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE; 455private static Interop.NetSecurityNative.PackageType GetPackageType(string package) 459return Interop.NetSecurityNative.PackageType.Negotiate; 463return Interop.NetSecurityNative.PackageType.NTLM; 467return Interop.NetSecurityNative.PackageType.Kerberos; 472throw new Interop.NetSecurityNative.GssApiException(Interop.NetSecurityNative.Status.GSS_S_UNAVAILABLE, 0); 504catch (Exception ex) when (ex is not Interop.NetSecurityNative.GssApiException) 507throw new Interop.NetSecurityNative.GssApiException(Interop.NetSecurityNative.Status.GSS_S_BAD_NAME, 0); 513Interop.NetSecurityNative.GssBuffer token = default(Interop.NetSecurityNative.GssBuffer); 517Interop.NetSecurityNative.Status status 518= Interop.NetSecurityNative.GetUser(out var minorStatus, 522if (status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 524throw new Interop.NetSecurityNative.GssApiException(status, minorStatus); 548Interop.NetSecurityNative.GssFlags requestedContextFlags, 553ref Interop.NetSecurityNative.GssFlags contextFlags) 564Interop.NetSecurityNative.PackageType.NTLM => "NTLM", 565Interop.NetSecurityNative.PackageType.Kerberos => "Kerberos", 575Interop.NetSecurityNative.GssBuffer token = default(Interop.NetSecurityNative.GssBuffer); 576Interop.NetSecurityNative.Status status; 577Interop.NetSecurityNative.Status minorStatus; 591status = Interop.NetSecurityNative.InitSecContext(out minorStatus, 606status = Interop.NetSecurityNative.InitSecContext(out minorStatus, 618if ((status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) && 619(status != Interop.NetSecurityNative.Status.GSS_S_CONTINUE_NEEDED)) 626Interop.NetSecurityNative.GssApiException gex = new Interop.NetSecurityNative.GssApiException(status, minorStatus); 635if (status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 641Interop.NetSecurityNative.PackageType.NTLM => "NTLM", 642Interop.NetSecurityNative.PackageType.Kerberos => "Kerberos", 653contextFlags = (Interop.NetSecurityNative.GssFlags)outputFlags; 655return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE ? 678ref Interop.NetSecurityNative.GssFlags contextFlags) 682Interop.NetSecurityNative.GssBuffer token = default(Interop.NetSecurityNative.GssBuffer); 685Interop.NetSecurityNative.Status status; 686Interop.NetSecurityNative.Status minorStatus; 687status = Interop.NetSecurityNative.AcceptSecContext(out minorStatus, 695if ((status != Interop.NetSecurityNative.Status.GSS_S_COMPLETE) && 696(status != Interop.NetSecurityNative.Status.GSS_S_CONTINUE_NEEDED)) 698Interop.NetSecurityNative.GssApiException gex = new Interop.NetSecurityNative.GssApiException(status, minorStatus); 708contextFlags = (Interop.NetSecurityNative.GssFlags)outputFlags; 712if (status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE) 744internal static NegotiateAuthenticationStatusCode GetErrorCode(Interop.NetSecurityNative.GssApiException exception) 748case Interop.NetSecurityNative.Status.GSS_S_NO_CRED: 750case Interop.NetSecurityNative.Status.GSS_S_BAD_BINDINGS: 752case Interop.NetSecurityNative.Status.GSS_S_CREDENTIALS_EXPIRED: 754case Interop.NetSecurityNative.Status.GSS_S_DEFECTIVE_TOKEN: 756case Interop.NetSecurityNative.Status.GSS_S_DEFECTIVE_CREDENTIAL: 758case Interop.NetSecurityNative.Status.GSS_S_BAD_SIG: 760case Interop.NetSecurityNative.Status.GSS_S_BAD_MECH: 761case Interop.NetSecurityNative.Status.GSS_S_UNAVAILABLE: 763case Interop.NetSecurityNative.Status.GSS_S_NO_CONTEXT: 774_ = 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)
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)
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); 71Interop.Ssl.SslErrorCode errorCode = Interop.OpenSsl.Encrypt((SafeSslHandle)securityContext, input.Span, ref token); 89int resultSize = Interop.OpenSsl.Decrypt((SafeSslHandle)securityContext, buffer, out Interop.Ssl.SslErrorCode errorCode); 107private static SecurityStatusPal MapNativeErrorCode(Interop.Ssl.SslErrorCode errorCode) => 110Interop.Ssl.SslErrorCode.SSL_ERROR_RENEGOTIATE => new SecurityStatusPal(SecurityStatusPalErrorCode.Renegotiate), 111Interop.Ssl.SslErrorCode.SSL_ERROR_ZERO_RETURN => new SecurityStatusPal(SecurityStatusPalErrorCode.ContextExpired), 112Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_X509_LOOKUP => new SecurityStatusPal(SecurityStatusPalErrorCode.CredentialsNeeded), 113Interop.Ssl.SslErrorCode.SSL_ERROR_NONE or 114Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_READ => new SecurityStatusPal(SecurityStatusPalErrorCode.OK), 115_ => new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, new Interop.OpenSsl.SslException((int)errorCode)) 128throw Interop.OpenSsl.CreateSslException(SR.net_ssl_invalid_certificate); 133bindingHandle = Interop.OpenSsl.QueryChannelBinding( 146SecurityStatusPal status = Interop.OpenSsl.SslRenegotiate((SafeSslHandle)context, out _); 170Interop.OpenSsl.UpdateClientCertificate((SafeSslHandle)context!, sslAuthenticationOptions); 186context = Interop.OpenSsl.AllocateSslHandle(sslAuthenticationOptions); 189SecurityStatusPalErrorCode errorCode = Interop.OpenSsl.DoSslHandshake((SafeSslHandle)context, inputBuffer, ref token); 209errorCode = Interop.OpenSsl.DoSslHandshake((SafeSslHandle)context, ReadOnlySpan<byte>.Empty, ref token); 214if (token.Size == 0 && Interop.Ssl.IsSslRenegotiatePending((SafeSslHandle)context)) 216errorCode = Interop.OpenSsl.DoSslHandshake((SafeSslHandle)context, ReadOnlySpan<byte>.Empty, ref token); 245Interop.Ssl.SslSetQuietShutdown((SafeSslHandle)context, 0); 247int status = Interop.Ssl.SslShutdown((SafeSslHandle)context); 251status = Interop.Ssl.SslShutdown((SafeSslHandle)context); 257Interop.Ssl.SslErrorCode code = Interop.Ssl.SslGetError((SafeSslHandle)context, status); 258if (code == Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_READ || 259code == Interop.Ssl.SslErrorCode.SSL_ERROR_WANT_WRITE) 263else if (code == Interop.Ssl.SslErrorCode.SSL_ERROR_SSL) 266return new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, Interop.Crypto.CreateOpenSslCryptographicException()); 270return new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, new Interop.OpenSsl.SslException((int)code));