298 references to Interop
System.Net.Security (298)
src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (6)
123
_error =
Interop
.Sys.ConvertErrorPlatformToPal(errno);
140
get { return _rawErrno == -1 ? (_rawErrno =
Interop
.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; }
145
return
Interop
.Sys.StrError(RawErrno);
219
public static
Interop
.ErrorInfo Info(this
Interop
.Error error)
221
return new
Interop
.ErrorInfo(error);
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs (2)
84
Interop
.NetSecurityNative.Status minStat;
85
Interop
.NetSecurityNative.Status displayCallStatus = isMinor ?
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (1)
62
Interop
.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)
143
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
153
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
162
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OCSP.cs (2)
107
Interop
.Crypto.OcspRequestDestroy(handle);
122
Interop
.Crypto.OcspResponseDestroy(handle);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (11)
108
if (!
Interop
.Ssl.Capabilities.Tls13Supported)
269
Interop
.Ssl.SslCtxSetAlpnSelectCb(sslCtx, &AlpnServerSelectCallback, IntPtr.Zero);
306
Interop
.Ssl.SslSetClientCertCallback(ssl, 0);
352
if (!
Interop
.Ssl.Capabilities.Tls13Supported ||
395
Debug.Assert(
Interop
.Ssl.SslGetData(sslHandle) == IntPtr.Zero);
397
Interop
.Ssl.SslSetData(sslHandle, GCHandle.ToIntPtr(alpnHandle));
402
if (
Interop
.Ssl.SslSetAlpnProtos(sslHandle, sslAuthenticationOptions.ApplicationProtocols) != 0)
504
int ret =
Interop
.Ssl.SslRenegotiate(sslContext, out Ssl.SslErrorCode errorCode);
781
IntPtr cert =
Interop
.Ssl.SslGetCertificate(ssl);
782
Interop
.Ssl.SslSessionSetData(session, cert);
873
innerError =
Interop
.Crypto.CreateOpenSslCryptographicException();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (11)
385
SafeBioHandle readBio =
Interop
.Crypto.CreateMemoryBio();
386
SafeBioHandle writeBio =
Interop
.Crypto.CreateMemoryBio();
387
SafeSslHandle handle =
Interop
.Ssl.SslCreate(context);
404
Interop
.Ssl.SslSetBio(handle, readBio, writeBio);
416
Interop
.Ssl.SslSetAcceptState(handle);
420
Interop
.Ssl.SslSetConnectState(handle);
454
Interop
.Ssl.SslSetData(handle, IntPtr.Zero);
460
Interop
.Ssl.SslDestroy(h); // will free the handles underlying _readBio and _writeBio
469
int retVal =
Interop
.Ssl.SslShutdown(handle);
477
retVal =
Interop
.Ssl.SslShutdown(handle);
483
Interop
.Crypto.ErrClearError();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (11)
135
Interop
.Ssl.SslCtxSetData(handle, IntPtr.Zero);
141
Interop
.Ssl.SessionFree(session);
151
Interop
.Ssl.SslCtxDestroy(handle);
165
Interop
.Ssl.SslCtxSetData(this, (IntPtr)_gch);
185
Interop
.Ssl.SessionSetHostname(session, namePtr);
208
Interop
.Ssl.SslCtxRemoveSession(this, oldSession);
209
Interop
.Ssl.SessionFree(oldSession);
241
Interop
.Ssl.SessionFree(oldSession);
258
Debug.Assert(
Interop
.Ssl.SslGetData(sslHandle) == IntPtr.Zero);
259
Interop
.Ssl.SslSetData(sslHandle, (IntPtr)_gch);
267
Interop
.Ssl.SslSetSession(sslHandle, session);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs (1)
73
Interop
.Crypto.RecursiveFreeX509Stack(handle);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs (1)
86
Interop
.Crypto.X509StoreCtxDestroy(handle);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs (2)
18
Interop
.Crypto.Asn1ObjectFree(handle);
38
Interop
.Crypto.Asn1OctetStringFree(handle);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\GssSafeHandles.cs (35)
20
Interop
.NetSecurityNative.Status minorStatus;
21
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.ImportUserName(
24
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
27
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
37
Interop
.NetSecurityNative.Status minorStatus;
38
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.ImportPrincipalName(
41
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
44
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
57
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.ReleaseName(out _, ref handle);
59
return status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE;
78
Interop
.NetSecurityNative.Status status;
79
Interop
.NetSecurityNative.Status minorStatus;
81
status =
Interop
.NetSecurityNative.AcquireAcceptorCred(out minorStatus, out retHandle);
82
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
84
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
94
public static SafeGssCredHandle Create(string username, string password,
Interop
.NetSecurityNative.PackageType packageType)
96
if (packageType ==
Interop
.NetSecurityNative.PackageType.NTLM && !s_IsNtlmInstalled.Value)
98
throw new
Interop
.NetSecurityNative.GssApiException(
99
Interop
.NetSecurityNative.Status.GSS_S_BAD_MECH,
112
Interop
.NetSecurityNative.Status status;
113
Interop
.NetSecurityNative.Status minorStatus;
116
status =
Interop
.NetSecurityNative.InitiateCredSpNego(out minorStatus, userHandle, out retHandle);
120
status =
Interop
.NetSecurityNative.InitiateCredWithPassword(out minorStatus, packageType, userHandle, password, Encoding.UTF8.GetByteCount(password), out retHandle);
123
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
126
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
145
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.ReleaseCred(out _, ref handle);
147
return status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE;
152
return
Interop
.NetSecurityNative.IsNtlmInstalled();
170
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.DeleteSecContext(out _, ref handle);
172
return status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE;
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (1)
34
return
Interop
.Crypto.BioDestroy(h);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs (3)
37
Interop
.Crypto.X509Destroy(handle);
57
Interop
.Crypto.X509CrlDestroy(handle);
77
Interop
.Crypto.X509StoreDestroy(handle);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs (1)
19
Interop
.Crypto.X509ExtensionDestroy(handle);
src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (4)
37
using (SafeX509Handle certHandle =
Interop
.Crypto.X509UpRef(remoteCertificate.Handle))
43
hostNameMatch =
Interop
.Crypto.CheckX509IpAddress(certHandle, addressBytes, addressBytes.Length, hostName, hostName.Length);
51
hostNameMatch =
Interop
.Crypto.CheckX509Hostname(certHandle, matchName, matchName.Length);
55
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
System\Net\CertificateValidationPal.Unix.cs (13)
39
IntPtr remoteCertificate =
Interop
.OpenSsl.GetPeerCertificate((SafeSslHandle)securityContext);
58
Interop
.OpenSsl.GetPeerCertificateChain((SafeSslHandle)securityContext))
62
int count =
Interop
.Crypto.GetX509StackFieldCount(chainStack);
66
IntPtr certPtr =
Interop
.Crypto.GetX509StackField(chainStack, i);
90
Interop
.Crypto.X509Destroy(remoteCertificate);
105
if (!
Interop
.Ssl.SslSessionReused(ssl))
109
return
Interop
.Ssl.SslGetCertificate(ssl) != IntPtr.Zero;
123
IntPtr session =
Interop
.Ssl.SslGetSession(ssl);
125
return
Interop
.Ssl.SslSessionGetData(session) != IntPtr.Zero;
141
using (SafeSharedX509NameStackHandle names =
Interop
.Ssl.SslGetClientCAList((SafeSslHandle)securityContext))
148
int nameCount =
Interop
.Crypto.GetX509NameStackFieldCount(names);
159
using (SafeSharedX509NameHandle nameHandle =
Interop
.Crypto.GetX509NameStackField(names, i))
161
X500DistinguishedName dn =
Interop
.Crypto.LoadX500Name(nameHandle);
System\Net\NegotiateAuthenticationPal.Unix.cs (111)
50
catch (
Interop
.NetSecurityNative.GssApiException gex)
73
catch (
Interop
.NetSecurityNative.GssApiException gex)
98
private
Interop
.NetSecurityNative.GssFlags _requestedContextFlags;
99
private
Interop
.NetSecurityNative.GssFlags _contextFlags;
103
private readonly
Interop
.NetSecurityNative.PackageType _packageType;
107
public override bool IsSigned => (_contextFlags &
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG) != 0;
109
public override bool IsEncrypted => (_contextFlags &
Interop
.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG) != 0;
111
public 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 :
170
Interop
.NetSecurityNative.GssFlags contextFlags = clientOptions.RequiredProtectionLevel switch
172
ProtectionLevel.Sign =>
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG,
173
ProtectionLevel.EncryptAndSign =>
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG |
Interop
.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG,
177
contextFlags |= clientOptions.RequireMutualAuthentication ?
Interop
.NetSecurityNative.GssFlags.GSS_C_MUTUAL_FLAG : 0;
181
TokenImpersonationLevel.Identification =>
Interop
.NetSecurityNative.GssFlags.GSS_C_IDENTIFY_FLAG,
182
TokenImpersonationLevel.Delegation =>
Interop
.NetSecurityNative.GssFlags.GSS_C_DELEG_FLAG,
202
if (_packageType ==
Interop
.NetSecurityNative.PackageType.NTLM)
206
throw new
Interop
.NetSecurityNative.GssApiException(
Interop
.NetSecurityNative.Status.GSS_S_NO_CRED, 0, SR.net_ntlm_not_possible_default_cred);
211
throw new
Interop
.NetSecurityNative.GssApiException(
Interop
.NetSecurityNative.Status.GSS_S_BAD_NAME, 0, SR.net_nego_not_supported_empty_target_with_defaultcreds);
224
Interop
.NetSecurityNative.GssFlags contextFlags = serverOptions.RequiredProtectionLevel switch
226
ProtectionLevel.Sign =>
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG,
227
ProtectionLevel.EncryptAndSign =>
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG |
Interop
.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG,
336
Interop
.NetSecurityNative.GssBuffer encryptedBuffer = default;
339
Interop
.NetSecurityNative.Status minorStatus;
341
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.WrapBuffer(
348
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
367
Interop
.NetSecurityNative.GssBuffer decryptedBuffer = default(
Interop
.NetSecurityNative.GssBuffer);
370
Interop
.NetSecurityNative.Status minorStatus;
371
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer);
372
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
376
Interop
.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered,
395
Interop
.NetSecurityNative.GssBuffer decryptedBuffer = default(
Interop
.NetSecurityNative.GssBuffer);
398
Interop
.NetSecurityNative.Status minorStatus;
399
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer);
400
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
406
Interop
.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered,
426
Interop
.NetSecurityNative.GssBuffer micBuffer = default;
429
Interop
.NetSecurityNative.Status minorStatus;
430
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.GetMic(
435
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
437
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
452
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.VerifyMic(
457
return status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE;
460
private static
Interop
.NetSecurityNative.PackageType GetPackageType(string package)
464
return
Interop
.NetSecurityNative.PackageType.Negotiate;
468
return
Interop
.NetSecurityNative.PackageType.NTLM;
472
return
Interop
.NetSecurityNative.PackageType.Kerberos;
477
throw new
Interop
.NetSecurityNative.GssApiException(
Interop
.NetSecurityNative.Status.GSS_S_UNAVAILABLE, 0);
509
catch (Exception ex) when (ex is not
Interop
.NetSecurityNative.GssApiException)
512
throw new
Interop
.NetSecurityNative.GssApiException(
Interop
.NetSecurityNative.Status.GSS_S_BAD_NAME, 0);
518
Interop
.NetSecurityNative.GssBuffer token = default(
Interop
.NetSecurityNative.GssBuffer);
522
Interop
.NetSecurityNative.Status status
523
=
Interop
.NetSecurityNative.GetUser(out var minorStatus,
527
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
529
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
553
Interop
.NetSecurityNative.GssFlags requestedContextFlags,
558
ref
Interop
.NetSecurityNative.GssFlags contextFlags)
569
Interop
.NetSecurityNative.PackageType.NTLM => "NTLM",
570
Interop
.NetSecurityNative.PackageType.Kerberos => "Kerberos",
580
Interop
.NetSecurityNative.GssBuffer token = default(
Interop
.NetSecurityNative.GssBuffer);
581
Interop
.NetSecurityNative.Status status;
582
Interop
.NetSecurityNative.Status minorStatus;
596
status =
Interop
.NetSecurityNative.InitSecContext(out minorStatus,
611
status =
Interop
.NetSecurityNative.InitSecContext(out minorStatus,
623
if ((status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE) &&
624
(status !=
Interop
.NetSecurityNative.Status.GSS_S_CONTINUE_NEEDED))
631
Interop
.NetSecurityNative.GssApiException gex = new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
640
if (status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
646
Interop
.NetSecurityNative.PackageType.NTLM => "NTLM",
647
Interop
.NetSecurityNative.PackageType.Kerberos => "Kerberos",
658
contextFlags = (
Interop
.NetSecurityNative.GssFlags)outputFlags;
660
return status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE ?
683
ref
Interop
.NetSecurityNative.GssFlags contextFlags)
687
Interop
.NetSecurityNative.GssBuffer token = default(
Interop
.NetSecurityNative.GssBuffer);
690
Interop
.NetSecurityNative.Status status;
691
Interop
.NetSecurityNative.Status minorStatus;
692
status =
Interop
.NetSecurityNative.AcceptSecContext(out minorStatus,
700
if ((status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE) &&
701
(status !=
Interop
.NetSecurityNative.Status.GSS_S_CONTINUE_NEEDED))
703
Interop
.NetSecurityNative.GssApiException gex = new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
713
contextFlags = (
Interop
.NetSecurityNative.GssFlags)outputFlags;
717
if (status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
749
internal static NegotiateAuthenticationStatusCode GetErrorCode(
Interop
.NetSecurityNative.GssApiException exception)
753
case
Interop
.NetSecurityNative.Status.GSS_S_NO_CRED:
755
case
Interop
.NetSecurityNative.Status.GSS_S_BAD_BINDINGS:
757
case
Interop
.NetSecurityNative.Status.GSS_S_CREDENTIALS_EXPIRED:
759
case
Interop
.NetSecurityNative.Status.GSS_S_DEFECTIVE_TOKEN:
761
case
Interop
.NetSecurityNative.Status.GSS_S_DEFECTIVE_CREDENTIAL:
763
case
Interop
.NetSecurityNative.Status.GSS_S_BAD_SIG:
765
case
Interop
.NetSecurityNative.Status.GSS_S_BAD_MECH:
766
case
Interop
.NetSecurityNative.Status.GSS_S_UNAVAILABLE:
768
case
Interop
.NetSecurityNative.Status.GSS_S_NO_CONTEXT:
779
return
Interop
.NetSecurityNative.IsNtlmInstalled();
System\Net\Security\CipherSuitesPolicyPal.Linux.cs (4)
10
using OpenSsl =
Interop
.OpenSsl;
11
using Ssl =
Interop
.Ssl;
25
if (!
Interop
.Ssl.Capabilities.Tls13Supported)
49
string? name =
Interop
.Ssl.GetOpenSslCipherSuiteName(
System\Net\Security\NegotiateStream.cs (12)
818
NegotiateAuthenticationStatusCode.BadBinding => (int)
Interop
.SECURITY_STATUS.BadBinding,
819
NegotiateAuthenticationStatusCode.Unsupported => (int)
Interop
.SECURITY_STATUS.Unsupported,
820
NegotiateAuthenticationStatusCode.MessageAltered => (int)
Interop
.SECURITY_STATUS.MessageAltered,
821
NegotiateAuthenticationStatusCode.ContextExpired => (int)
Interop
.SECURITY_STATUS.ContextExpired,
822
NegotiateAuthenticationStatusCode.CredentialsExpired => (int)
Interop
.SECURITY_STATUS.CertExpired,
823
NegotiateAuthenticationStatusCode.InvalidCredentials => (int)
Interop
.SECURITY_STATUS.LogonDenied,
824
NegotiateAuthenticationStatusCode.InvalidToken => (int)
Interop
.SECURITY_STATUS.InvalidToken,
825
NegotiateAuthenticationStatusCode.UnknownCredentials => (int)
Interop
.SECURITY_STATUS.UnknownCredentials,
826
NegotiateAuthenticationStatusCode.QopNotSupported => (int)
Interop
.SECURITY_STATUS.QopNotSupported,
827
NegotiateAuthenticationStatusCode.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)
13
Protocol = (int)MapProtocolVersion(
Interop
.Ssl.SslGetVersion(sslContext));
14
ReadOnlySpan<byte> alpn =
Interop
.Ssl.SslGetAlpnSelected(sslContext);
32
TlsResumed =
Interop
.Ssl.SslSessionReused(sslContext);
40
if (!
Interop
.Ssl.SslGetCurrentCipherId(ssl, out cipherSuite))
42
throw
Interop
.OpenSsl.CreateSslException(SR.net_ssl_get_connection_info_failed);
System\Net\Security\SslStreamCertificateContext.Linux.cs (5)
102
CertificateHandle =
Interop
.Crypto.X509UpRef(target.Handle);
299
using SafeOcspRequestHandle ocspRequest =
Interop
.Crypto.X509BuildOcspRequest(subject, issuer);
300
byte[] rentedBytes = ArrayPool<byte>.Shared.Rent(
Interop
.Crypto.GetOcspRequestDerSize(ocspRequest));
301
int encodingSize =
Interop
.Crypto.EncodeOcspRequest(ocspRequest, rentedBytes);
314
if (!
Interop
.Crypto.X509DecodeOcspToExpiration(ret, ocspRequest, subject, issuerHandles.AsSpan(0, _privateIntermediateCertificates.Length + 1), out DateTimeOffset expiration))
System\Net\Security\SslStreamPal.Unix.cs (32)
17
return status.Exception ?? new
Interop
.OpenSsl.SslException((int)status.ErrorCode);
69
Interop
.Ssl.SslErrorCode errorCode =
Interop
.OpenSsl.Encrypt((SafeSslHandle)securityContext, input.Span, ref token);
87
int resultSize =
Interop
.OpenSsl.Decrypt((SafeSslHandle)securityContext, buffer, out
Interop
.Ssl.SslErrorCode errorCode);
105
private static SecurityStatusPal MapNativeErrorCode(
Interop
.Ssl.SslErrorCode errorCode) =>
108
Interop
.Ssl.SslErrorCode.SSL_ERROR_RENEGOTIATE => new SecurityStatusPal(SecurityStatusPalErrorCode.Renegotiate),
109
Interop
.Ssl.SslErrorCode.SSL_ERROR_ZERO_RETURN => new SecurityStatusPal(SecurityStatusPalErrorCode.ContextExpired),
110
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_X509_LOOKUP => new SecurityStatusPal(SecurityStatusPalErrorCode.CredentialsNeeded),
111
Interop
.Ssl.SslErrorCode.SSL_ERROR_NONE or
112
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_READ => new SecurityStatusPal(SecurityStatusPalErrorCode.OK),
113
_ => new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, new
Interop
.OpenSsl.SslException((int)errorCode))
126
throw
Interop
.OpenSsl.CreateSslException(SR.net_ssl_invalid_certificate);
131
bindingHandle =
Interop
.OpenSsl.QueryChannelBinding(
144
SecurityStatusPal status =
Interop
.OpenSsl.SslRenegotiate((SafeSslHandle)context, out _);
168
Interop
.OpenSsl.UpdateClientCertificate((SafeSslHandle)context!, sslAuthenticationOptions);
184
context =
Interop
.OpenSsl.AllocateSslHandle(sslAuthenticationOptions);
187
SecurityStatusPalErrorCode errorCode =
Interop
.OpenSsl.DoSslHandshake((SafeSslHandle)context, inputBuffer, ref token);
207
errorCode =
Interop
.OpenSsl.DoSslHandshake((SafeSslHandle)context, ReadOnlySpan<byte>.Empty, ref token);
212
if (token.Size == 0 &&
Interop
.Ssl.IsSslRenegotiatePending((SafeSslHandle)context))
214
errorCode =
Interop
.OpenSsl.DoSslHandshake((SafeSslHandle)context, ReadOnlySpan<byte>.Empty, ref token);
226
token.Status = new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError,
Interop
.OpenSsl.CreateSslException(SR.net_alpn_failed));
252
Interop
.Ssl.SslSetQuietShutdown((SafeSslHandle)context, 0);
254
int status =
Interop
.Ssl.SslShutdown((SafeSslHandle)context);
258
status =
Interop
.Ssl.SslShutdown((SafeSslHandle)context);
264
Interop
.Ssl.SslErrorCode code =
Interop
.Ssl.SslGetError((SafeSslHandle)context, status);
265
if (code ==
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_READ ||
266
code ==
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_WRITE)
270
else if (code ==
Interop
.Ssl.SslErrorCode.SSL_ERROR_SSL)
273
return new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError,
Interop
.Crypto.CreateOpenSslCryptographicException());
277
return new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, new
Interop
.OpenSsl.SslException((int)code));