70 references to Crypto
System.Net.Security (70)
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 (28)
245Crypto.ErrClearError(); 447Crypto.ErrClearError(); 679throw Crypto.CreateOpenSslCryptographicException(); 695Crypto.ErrClearError(); 709int sendCount = Crypto.BioCtrlPending(context.OutputBio!); 726Crypto.ErrClearError(); 778int capacityNeeded = Crypto.BioCtrlPending(context.OutputBio!); 785Crypto.ErrClearError(); 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); 1162int bytes = Crypto.BioRead(bio, buffer); 1188Crypto.ErrPeekError() != 0 ? Crypto.CreateOpenSslCryptographicException() : // crypto error queue not empty 1196innerError = Interop.Crypto.CreateOpenSslCryptographicException(); 1236ulong errorVal = Crypto.ErrPeekLastError(); 1237Crypto.ErrClearError(); 1238string msg = SR.Format(message, Utf8StringMarshaller.ConvertToManaged(Crypto.ErrReasonErrorString(errorVal)));
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (7)
335SafeX509Handle dupCertHandle = Crypto.X509UpRef(chain[i].Handle); 336Crypto.CheckValidOpenSslHandle(dupCertHandle); 339Crypto.ErrClearError(); 358Crypto.CheckValidOpenSslHandle(ssl); 440SafeBioHandle readBio = Interop.Crypto.CreateMemoryBio(); 441SafeBioHandle writeBio = Interop.Crypto.CreateMemoryBio(); 539Interop.Crypto.ErrClearError();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (3)
53SafeX509Handle dupCertHandle = Crypto.X509UpRef(chain[i].Handle); 54Crypto.CheckValidOpenSslHandle(dupCertHandle); 57Crypto.ErrClearError();
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\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 (6)
62int count = Interop.Crypto.GetX509StackFieldCount(chainStack); 66IntPtr certPtr = Interop.Crypto.GetX509StackField(chainStack, i); 90Interop.Crypto.X509Destroy(remoteCertificate); 148int nameCount = Interop.Crypto.GetX509NameStackFieldCount(names); 159using (SafeSharedX509NameHandle nameHandle = Interop.Crypto.GetX509NameStackField(names, i)) 161X500DistinguishedName dn = Interop.Crypto.LoadX500Name(nameHandle);
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 (1)
266return new SecurityStatusPal(SecurityStatusPalErrorCode.InternalError, Interop.Crypto.CreateOpenSslCryptographicException());