489 references to Interop
System.Net.Security (489)
_generated\0\LibraryImports.g.cs (169)
7
internal static extern partial global::
Interop
.Error ConvertErrorPlatformToPal(int platformErrno);
15
internal static extern partial int ConvertErrorPalToPlatform(global::
Interop
.Error error);
47
internal static partial global::
Interop
.NetSecurityNative.Status DisplayMinorStatus(out global::
Interop
.NetSecurityNative.Status minorStatus, global::
Interop
.NetSecurityNative.Status statusValue, ref global::
Interop
.NetSecurityNative.GssBuffer buffer)
50
global::
Interop
.NetSecurityNative.Status __retVal;
52
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __buffer_native = &buffer)
53
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
61
static 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);
70
internal static partial global::
Interop
.NetSecurityNative.Status DisplayMajorStatus(out global::
Interop
.NetSecurityNative.Status minorStatus, global::
Interop
.NetSecurityNative.Status statusValue, ref global::
Interop
.NetSecurityNative.GssBuffer buffer)
73
global::
Interop
.NetSecurityNative.Status __retVal;
75
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __buffer_native = &buffer)
76
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
84
static 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);
93
internal static partial global::
Interop
.NetSecurityNative.Status ImportUserName(out global::
Interop
.NetSecurityNative.Status minorStatus, string inputName, int inputNameByteCount, out global::Microsoft.Win32.SafeHandles.SafeGssNameHandle outputName)
100
global::
Interop
.NetSecurityNative.Status __retVal = default;
109
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
137
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, byte* __inputName_native, int __inputNameByteCount_native, nint* __outputName_native);
146
internal static partial global::
Interop
.NetSecurityNative.Status ImportPrincipalName(out global::
Interop
.NetSecurityNative.Status minorStatus, string inputName, int inputNameByteCount, out global::Microsoft.Win32.SafeHandles.SafeGssNameHandle outputName)
153
global::
Interop
.NetSecurityNative.Status __retVal = default;
162
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
190
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, byte* __inputName_native, int __inputNameByteCount_native, nint* __outputName_native);
199
internal static partial global::
Interop
.NetSecurityNative.Status ReleaseName(out global::
Interop
.NetSecurityNative.Status minorStatus, ref nint inputName)
202
global::
Interop
.NetSecurityNative.Status __retVal;
205
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
213
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint* __inputName_native);
222
internal static partial global::
Interop
.NetSecurityNative.Status AcquireAcceptorCred(out global::
Interop
.NetSecurityNative.Status minorStatus, out global::Microsoft.Win32.SafeHandles.SafeGssCredHandle outputCredHandle)
228
global::
Interop
.NetSecurityNative.Status __retVal = default;
234
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
257
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint* __outputCredHandle_native);
266
internal 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)
273
global::
Interop
.NetSecurityNative.Status __retVal = default;
282
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
310
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint __desiredName_native, nint* __outputCredHandle_native);
319
internal 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)
327
global::
Interop
.NetSecurityNative.Status __retVal = default;
338
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
368
static 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);
377
internal static partial global::
Interop
.NetSecurityNative.Status ReleaseCred(out global::
Interop
.NetSecurityNative.Status minorStatus, ref nint credHandle)
380
global::
Interop
.NetSecurityNative.Status __retVal;
383
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
391
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint* __credHandle_native);
400
private 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)
410
global::
Interop
.NetSecurityNative.Status __retVal = default;
423
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __token_native = &token)
425
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
459
static 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);
468
private 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)
478
global::
Interop
.NetSecurityNative.Status __retVal = default;
491
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __token_native = &token)
493
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
527
static 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);
536
private 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, ref byte inputBytes, int inputLength, ref global::
Interop
.NetSecurityNative.GssBuffer token, out uint retFlags, out bool isNtlmUsed)
545
global::
Interop
.NetSecurityNative.Status __retVal = default;
556
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __token_native = &token)
558
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
590
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint __acceptorCredHandle_native, nint* __acceptContextHandle_native, byte* __inputBytes_native, int __inputLength_native, global::
Interop
.NetSecurityNative.GssBuffer* __token_native, uint* __retFlags_native, int* __isNtlmUsed_native);
599
internal static partial global::
Interop
.NetSecurityNative.Status DeleteSecContext(out global::
Interop
.NetSecurityNative.Status minorStatus, ref nint contextHandle)
602
global::
Interop
.NetSecurityNative.Status __retVal;
605
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
613
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint* __contextHandle_native);
622
internal 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)
626
global::
Interop
.NetSecurityNative.Status __retVal = default;
634
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __token_native = &token)
635
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
651
static extern unsafe global::
Interop
.NetSecurityNative.Status __PInvoke(global::
Interop
.NetSecurityNative.Status* __minorStatus_native, nint __acceptContextHandle_native, global::
Interop
.NetSecurityNative.GssBuffer* __token_native);
660
private 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)
665
global::
Interop
.NetSecurityNative.Status __retVal = default;
674
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __outBuffer_native = &outBuffer)
675
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
694
static 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);
703
private 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)
709
global::
Interop
.NetSecurityNative.Status __retVal = default;
717
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __outBuffer_native = &outBuffer)
718
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
737
static 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);
746
private 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)
750
global::
Interop
.NetSecurityNative.Status __retVal = default;
758
fixed (global::
Interop
.NetSecurityNative.GssBuffer* __outBuffer_native = &outBuffer)
759
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
775
static 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);
784
private 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)
788
global::
Interop
.NetSecurityNative.Status __retVal = default;
796
fixed (global::
Interop
.NetSecurityNative.Status* __minorStatus_native = &minorStatus)
812
static 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);
2384
internal static partial global::
Interop
.Ssl.SslErrorCode SslGetError(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, int ret)
2387
global::
Interop
.Ssl.SslErrorCode __retVal = default;
2409
static extern unsafe global::
Interop
.Ssl.SslErrorCode __PInvoke(nint __ssl_native, int __ret_native);
2418
internal static extern partial global::
Interop
.Ssl.SslErrorCode SslGetError(nint ssl, int ret);
2720
internal static partial int SslWrite(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, ref byte buf, int num, out global::
Interop
.Ssl.SslErrorCode error)
2733
fixed (global::
Interop
.Ssl.SslErrorCode* __error_native = &error)
2753
static extern unsafe int __PInvoke(nint __ssl_native, byte* __buf_native, int __num_native, global::
Interop
.Ssl.SslErrorCode* __error_native);
2762
internal static partial int SslRead(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, ref byte buf, int num, out global::
Interop
.Ssl.SslErrorCode error)
2775
fixed (global::
Interop
.Ssl.SslErrorCode* __error_native = &error)
2795
static extern unsafe int __PInvoke(nint __ssl_native, byte* __buf_native, int __num_native, global::
Interop
.Ssl.SslErrorCode* __error_native);
2826
internal static partial int SslRenegotiate(global::Microsoft.Win32.SafeHandles.SafeSslHandle ssl, out global::
Interop
.Ssl.SslErrorCode error)
2838
fixed (global::
Interop
.Ssl.SslErrorCode* __error_native = &error)
2854
static extern unsafe int __PInvoke(nint __ssl_native, global::
Interop
.Ssl.SslErrorCode* __error_native);
2985
internal 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)
3001
fixed (global::
Interop
.Ssl.SslErrorCode* __errorCode_native = &errorCode)
3023
static 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);
3032
internal 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)
3047
fixed (global::
Interop
.Ssl.SslErrorCode* __errorCode_native = &errorCode)
3068
static 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);
3077
internal 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)
3093
fixed (global::
Interop
.Ssl.SslErrorCode* __errorCode_native = &errorCode)
3115
static 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);
141
get { return _rawErrno == -1 ? (_rawErrno =
Interop
.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; }
146
return
Interop
.Sys.StrError(RawErrno);
220
public static
Interop
.ErrorInfo Info(this
Interop
.Error error)
222
return new
Interop
.ErrorInfo(error);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs (2)
85
Interop
.NetSecurityNative.Status minStat;
86
Interop
.NetSecurityNative.Status displayCallStatus = isMinor ?
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (1)
62
Interop
.NetSecurityNative.ReleaseGssBuffer(_data, _length);
src\runtime\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\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)
153
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
163
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
172
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
191
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
200
throw
Interop
.Crypto.CreateOpenSslCryptographicException();
src\runtime\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\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (29)
149
if (!
Interop
.Ssl.Capabilities.Tls13Supported)
292
Interop
.Ssl.SslCtxSetAlpnSelectCb(sslCtx, &AlpnServerSelectCallback, IntPtr.Zero);
329
Interop
.Ssl.SslSetClientCertCallback(ssl, 0);
375
if (!
Interop
.Ssl.Capabilities.Tls13Supported ||
439
if (
Interop
.Ssl.SslSetAlpnProtos(sslHandle, sslAuthenticationOptions.ApplicationProtocols) != 0)
533
ushort[] rawAlgs =
Interop
.Ssl.GetDefaultSignatureAlgorithms();
633
ret =
Interop
.Ssl.SslSetSigalgs(sslHandle, pBuffer);
639
ret =
Interop
.Ssl.SslSetClientSigalgs(sslHandle, pBuffer);
668
int ret =
Interop
.Ssl.SslRenegotiate(sslContext, out Ssl.SslErrorCode errorCode);
1026
Ssl.X509StoreCtxSetError(storeCtx, (int)
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_OK);
1032
Interop
.Crypto.X509VerifyStatusCodeUniversal verifyError;
1035
verifyError =
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_APPLICATION_VERIFICATION;
1058
TlsAlertMessage.BadCertificate =>
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_REJECTED,
1059
TlsAlertMessage.UnknownCA =>
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT,
1060
TlsAlertMessage.CertificateRevoked =>
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_REVOKED,
1061
TlsAlertMessage.CertificateExpired =>
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_HAS_EXPIRED,
1062
TlsAlertMessage.UnsupportedCert =>
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_INVALID_PURPOSE,
1063
_ =>
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_CERT_REJECTED,
1100
Ssl.X509StoreCtxSetError(storeCtx, (int)
Interop
.Crypto.X509VerifyStatusCodeUniversal.X509_V_ERR_UNSPECIFIED);
1115
using (SafeSharedX509StackHandle chainStack =
Interop
.Crypto.X509StoreCtxGetSharedUntrusted(storeHandle))
1119
int count =
Interop
.Crypto.GetX509StackFieldCount(chainStack);
1123
IntPtr certPtr =
Interop
.Crypto.GetX509StackField(chainStack, i);
1134
Interop
.Ssl.SslUpdateOcspStaple(sslHandle, certificate.Handle);
1214
IntPtr cert =
Interop
.Ssl.SslGetCertificate(ssl);
1219
if (cert == IntPtr.Zero &&
Interop
.Ssl.SslSessionReused(ssl))
1221
IntPtr currentSession =
Interop
.Ssl.SslGetSession(ssl);
1224
cert =
Interop
.Ssl.SslSessionGetData(currentSession);
1228
Interop
.Ssl.SslSessionSetData(session, cert);
1329
innerError =
Interop
.Crypto.CreateOpenSslCryptographicException();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (13)
98
throw
Interop
.OpenSsl.CreateSslException(SR.net_ssl_get_default_sigalgs_failed);
481
SafeBioHandle readBio =
Interop
.Ssl.BioNewManagedSpan();
482
SafeBioHandle writeBio =
Interop
.Ssl.BioNewManagedSpan();
483
SafeSslHandle handle =
Interop
.Ssl.SslCreate(context);
493
Interop
.Ssl.SslSetData(handle, WeakGCHandle<SslAuthenticationOptions>.ToIntPtr(handle._authOptionsHandle));
502
Interop
.Ssl.SslSetBio(handle, readBio, writeBio);
514
Interop
.Ssl.SslSetAcceptState(handle);
518
Interop
.Ssl.SslSetConnectState(handle);
550
Interop
.Ssl.SslSetData(handle, IntPtr.Zero);
557
Interop
.Ssl.SslDestroy(h); // will free the handles underlying _readBio and _writeBio
566
int retVal =
Interop
.Ssl.SslShutdown(handle);
574
retVal =
Interop
.Ssl.SslShutdown(handle);
580
Interop
.Crypto.ErrClearError();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (9)
145
Interop
.Ssl.SslCtxSetData(handle, IntPtr.Zero);
151
Interop
.Ssl.SessionFree(session);
161
Interop
.Ssl.SslCtxDestroy(handle);
175
Interop
.Ssl.SslCtxSetData(this, (IntPtr)_gch);
195
Interop
.Ssl.SessionSetHostname(session, namePtr);
218
Interop
.Ssl.SslCtxRemoveSession(this, oldSession);
219
Interop
.Ssl.SessionFree(oldSession);
251
Interop
.Ssl.SessionFree(oldSession);
272
Interop
.Ssl.SslSetSession(sslHandle, session);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs (1)
73
Interop
.Crypto.RecursiveFreeX509Stack(handle);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs (1)
86
Interop
.Crypto.X509StoreCtxDestroy(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs (2)
18
Interop
.Crypto.Asn1ObjectFree(handle);
38
Interop
.Crypto.Asn1OctetStringFree(handle);
src\runtime\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\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (1)
34
return
Interop
.Crypto.BioDestroy(h);
src\runtime\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\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs (1)
19
Interop
.Crypto.X509ExtensionDestroy(handle);
src\runtime\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 (114)
43
catch (Exception ex) when (ex is
Interop
.NetSecurityNative.GssApiException or TypeInitializationException)
48
if (ex is
Interop
.NetSecurityNative.GssApiException gex)
67
catch (Exception ex) when (ex is
Interop
.NetSecurityNative.GssApiException or TypeInitializationException)
73
if (ex is
Interop
.NetSecurityNative.GssApiException gex)
93
private
Interop
.NetSecurityNative.GssFlags _requestedContextFlags;
94
private
Interop
.NetSecurityNative.GssFlags _contextFlags;
98
private readonly
Interop
.NetSecurityNative.PackageType _packageType;
102
public override bool IsSigned => (_contextFlags &
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG) != 0;
104
public override bool IsEncrypted => (_contextFlags &
Interop
.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG) != 0;
106
public 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 :
165
Interop
.NetSecurityNative.GssFlags contextFlags = clientOptions.RequiredProtectionLevel switch
167
ProtectionLevel.Sign =>
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG,
168
ProtectionLevel.EncryptAndSign =>
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG |
Interop
.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG,
172
contextFlags |= clientOptions.RequireMutualAuthentication ?
Interop
.NetSecurityNative.GssFlags.GSS_C_MUTUAL_FLAG : 0;
176
TokenImpersonationLevel.Identification =>
Interop
.NetSecurityNative.GssFlags.GSS_C_IDENTIFY_FLAG,
177
TokenImpersonationLevel.Delegation =>
Interop
.NetSecurityNative.GssFlags.GSS_C_DELEG_FLAG,
197
if (_packageType ==
Interop
.NetSecurityNative.PackageType.NTLM)
201
throw new
Interop
.NetSecurityNative.GssApiException(
Interop
.NetSecurityNative.Status.GSS_S_NO_CRED, 0, SR.net_ntlm_not_possible_default_cred);
206
throw new
Interop
.NetSecurityNative.GssApiException(
Interop
.NetSecurityNative.Status.GSS_S_BAD_NAME, 0, SR.net_nego_not_supported_empty_target_with_defaultcreds);
219
Interop
.NetSecurityNative.GssFlags contextFlags = serverOptions.RequiredProtectionLevel switch
221
ProtectionLevel.Sign =>
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG,
222
ProtectionLevel.EncryptAndSign =>
Interop
.NetSecurityNative.GssFlags.GSS_C_INTEG_FLAG |
Interop
.NetSecurityNative.GssFlags.GSS_C_CONF_FLAG,
331
Interop
.NetSecurityNative.GssBuffer encryptedBuffer = default;
334
Interop
.NetSecurityNative.Status minorStatus;
336
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.WrapBuffer(
343
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
362
Interop
.NetSecurityNative.GssBuffer decryptedBuffer = default(
Interop
.NetSecurityNative.GssBuffer);
365
Interop
.NetSecurityNative.Status minorStatus;
366
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer);
367
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
371
Interop
.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered,
390
Interop
.NetSecurityNative.GssBuffer decryptedBuffer = default(
Interop
.NetSecurityNative.GssBuffer);
393
Interop
.NetSecurityNative.Status minorStatus;
394
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer);
395
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
401
Interop
.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered,
421
Interop
.NetSecurityNative.GssBuffer micBuffer = default;
424
Interop
.NetSecurityNative.Status minorStatus;
425
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.GetMic(
430
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
432
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
447
Interop
.NetSecurityNative.Status status =
Interop
.NetSecurityNative.VerifyMic(
452
return status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE;
455
private static
Interop
.NetSecurityNative.PackageType GetPackageType(string package)
459
return
Interop
.NetSecurityNative.PackageType.Negotiate;
463
return
Interop
.NetSecurityNative.PackageType.NTLM;
467
return
Interop
.NetSecurityNative.PackageType.Kerberos;
472
throw new
Interop
.NetSecurityNative.GssApiException(
Interop
.NetSecurityNative.Status.GSS_S_UNAVAILABLE, 0);
504
catch (Exception ex) when (ex is not
Interop
.NetSecurityNative.GssApiException)
507
throw new
Interop
.NetSecurityNative.GssApiException(
Interop
.NetSecurityNative.Status.GSS_S_BAD_NAME, 0);
513
Interop
.NetSecurityNative.GssBuffer token = default(
Interop
.NetSecurityNative.GssBuffer);
517
Interop
.NetSecurityNative.Status status
518
=
Interop
.NetSecurityNative.GetUser(out var minorStatus,
522
if (status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
524
throw new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
548
Interop
.NetSecurityNative.GssFlags requestedContextFlags,
553
ref
Interop
.NetSecurityNative.GssFlags contextFlags)
564
Interop
.NetSecurityNative.PackageType.NTLM => "NTLM",
565
Interop
.NetSecurityNative.PackageType.Kerberos => "Kerberos",
575
Interop
.NetSecurityNative.GssBuffer token = default(
Interop
.NetSecurityNative.GssBuffer);
576
Interop
.NetSecurityNative.Status status;
577
Interop
.NetSecurityNative.Status minorStatus;
591
status =
Interop
.NetSecurityNative.InitSecContext(out minorStatus,
606
status =
Interop
.NetSecurityNative.InitSecContext(out minorStatus,
618
if ((status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE) &&
619
(status !=
Interop
.NetSecurityNative.Status.GSS_S_CONTINUE_NEEDED))
626
Interop
.NetSecurityNative.GssApiException gex = new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
635
if (status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
641
Interop
.NetSecurityNative.PackageType.NTLM => "NTLM",
642
Interop
.NetSecurityNative.PackageType.Kerberos => "Kerberos",
653
contextFlags = (
Interop
.NetSecurityNative.GssFlags)outputFlags;
655
return status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE ?
678
ref
Interop
.NetSecurityNative.GssFlags contextFlags)
682
Interop
.NetSecurityNative.GssBuffer token = default(
Interop
.NetSecurityNative.GssBuffer);
685
Interop
.NetSecurityNative.Status status;
686
Interop
.NetSecurityNative.Status minorStatus;
687
status =
Interop
.NetSecurityNative.AcceptSecContext(out minorStatus,
695
if ((status !=
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE) &&
696
(status !=
Interop
.NetSecurityNative.Status.GSS_S_CONTINUE_NEEDED))
698
Interop
.NetSecurityNative.GssApiException gex = new
Interop
.NetSecurityNative.GssApiException(status, minorStatus);
708
contextFlags = (
Interop
.NetSecurityNative.GssFlags)outputFlags;
712
if (status ==
Interop
.NetSecurityNative.Status.GSS_S_COMPLETE)
744
internal static NegotiateAuthenticationStatusCode GetErrorCode(
Interop
.NetSecurityNative.GssApiException exception)
748
case
Interop
.NetSecurityNative.Status.GSS_S_NO_CRED:
750
case
Interop
.NetSecurityNative.Status.GSS_S_BAD_BINDINGS:
752
case
Interop
.NetSecurityNative.Status.GSS_S_CREDENTIALS_EXPIRED:
754
case
Interop
.NetSecurityNative.Status.GSS_S_DEFECTIVE_TOKEN:
756
case
Interop
.NetSecurityNative.Status.GSS_S_DEFECTIVE_CREDENTIAL:
758
case
Interop
.NetSecurityNative.Status.GSS_S_BAD_SIG:
760
case
Interop
.NetSecurityNative.Status.GSS_S_BAD_MECH:
761
case
Interop
.NetSecurityNative.Status.GSS_S_UNAVAILABLE:
763
case
Interop
.NetSecurityNative.Status.GSS_S_FAILURE:
771
case
Interop
.NetSecurityNative.Status.GSS_S_NO_CONTEXT:
782
_ =
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)
51
string? name =
Interop
.Ssl.GetOpenSslCipherSuiteName(
System\Net\Security\NegotiateStream.cs (12)
826
NegotiateAuthenticationStatusCode.BadBinding => (int)
Interop
.SECURITY_STATUS.BadBinding,
827
NegotiateAuthenticationStatusCode.Unsupported => (int)
Interop
.SECURITY_STATUS.Unsupported,
828
NegotiateAuthenticationStatusCode.MessageAltered => (int)
Interop
.SECURITY_STATUS.MessageAltered,
829
NegotiateAuthenticationStatusCode.ContextExpired => (int)
Interop
.SECURITY_STATUS.ContextExpired,
830
NegotiateAuthenticationStatusCode.CredentialsExpired => (int)
Interop
.SECURITY_STATUS.CertExpired,
831
NegotiateAuthenticationStatusCode.InvalidCredentials => (int)
Interop
.SECURITY_STATUS.LogonDenied,
832
NegotiateAuthenticationStatusCode.InvalidToken => (int)
Interop
.SECURITY_STATUS.InvalidToken,
833
NegotiateAuthenticationStatusCode.UnknownCredentials => (int)
Interop
.SECURITY_STATUS.UnknownCredentials,
834
NegotiateAuthenticationStatusCode.QopNotSupported => (int)
Interop
.SECURITY_STATUS.QopNotSupported,
835
NegotiateAuthenticationStatusCode.OutOfSequence => (int)
Interop
.SECURITY_STATUS.OutOfSequence,
836
_ => (int)
Interop
.SECURITY_STATUS.InternalError
945
(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)
112
CertificateHandle =
Interop
.Crypto.X509UpRef(target.Handle);
309
using SafeOcspRequestHandle ocspRequest =
Interop
.Crypto.X509BuildOcspRequest(subject, issuer);
310
byte[] rentedBytes = ArrayPool<byte>.Shared.Rent(
Interop
.Crypto.GetOcspRequestDerSize(ocspRequest));
311
int encodingSize =
Interop
.Crypto.EncodeOcspRequest(ocspRequest, rentedBytes);
324
if (!
Interop
.Crypto.X509DecodeOcspToExpiration(ret, ocspRequest, subject, issuerHandles.AsSpan(0, _privateIntermediateCertificates.Length + 1), out DateTimeOffset expiration))
System\Net\Security\SslStreamPal.Unix.cs (31)
17
return status.Exception ?? new
Interop
.OpenSsl.SslException((int)status.ErrorCode);
76
Interop
.Ssl.SslErrorCode errorCode =
Interop
.OpenSsl.Encrypt((SafeSslHandle)securityContext, input.Span, ref token);
101
bytesWritten =
Interop
.OpenSsl.Decrypt(
107
out
Interop
.Ssl.SslErrorCode errorCode);
119
private static SecurityStatusPal MapNativeErrorCode(
Interop
.Ssl.SslErrorCode errorCode) =>
122
Interop
.Ssl.SslErrorCode.SSL_ERROR_RENEGOTIATE => new SecurityStatusPal(SecurityStatusPalErrorCode.Renegotiate),
123
Interop
.Ssl.SslErrorCode.SSL_ERROR_ZERO_RETURN => new SecurityStatusPal(SecurityStatusPalErrorCode.ContextExpired),
124
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_X509_LOOKUP => new SecurityStatusPal(SecurityStatusPalErrorCode.CredentialsNeeded),
125
Interop
.Ssl.SslErrorCode.SSL_ERROR_NONE or
126
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_READ => new SecurityStatusPal(SecurityStatusPalErrorCode.OK),
127
_ => new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, new
Interop
.OpenSsl.SslException((int)errorCode))
140
throw
Interop
.OpenSsl.CreateSslException(SR.net_ssl_invalid_certificate);
145
bindingHandle =
Interop
.OpenSsl.QueryChannelBinding(
158
SecurityStatusPal status =
Interop
.OpenSsl.SslRenegotiate((SafeSslHandle)context, out _);
182
Interop
.OpenSsl.UpdateClientCertificate((SafeSslHandle)context!, sslAuthenticationOptions);
198
context =
Interop
.OpenSsl.AllocateSslHandle(sslAuthenticationOptions);
201
SecurityStatusPalErrorCode errorCode =
Interop
.OpenSsl.DoSslHandshake((SafeSslHandle)context, inputBuffer, out consumed, ref token);
220
errorCode =
Interop
.OpenSsl.DoSslHandshake((SafeSslHandle)context, inputBuffer.Slice(consumed), out int c, ref token);
226
if (token.Size == 0 &&
Interop
.Ssl.IsSslRenegotiatePending((SafeSslHandle)context))
228
errorCode =
Interop
.OpenSsl.DoSslHandshake((SafeSslHandle)context, inputBuffer.Slice(consumed), out int c, ref token);
258
Interop
.Ssl.SslSetQuietShutdown((SafeSslHandle)context, 0);
260
int status =
Interop
.Ssl.SslShutdown((SafeSslHandle)context);
264
status =
Interop
.Ssl.SslShutdown((SafeSslHandle)context);
270
Interop
.Ssl.SslErrorCode code =
Interop
.Ssl.SslGetError((SafeSslHandle)context, status);
271
if (code ==
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_READ ||
272
code ==
Interop
.Ssl.SslErrorCode.SSL_ERROR_WANT_WRITE)
276
else if (code ==
Interop
.Ssl.SslErrorCode.SSL_ERROR_SSL)
279
return new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError,
Interop
.Crypto.CreateOpenSslCryptographicException());
283
return new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, new
Interop
.OpenSsl.SslException((int)code));