Ejemplo n.º 1
0
        public void UpdateSslConnectionInfo(SafeDeleteContext securityContext)
        {
            SecPkgContext_ConnectionInfo interopConnectionInfo = default;
            bool success = SSPIWrapper.QueryBlittableContextAttributes(
                GlobalSSPI.SSPISecureChannel,
                securityContext,
                Interop.SspiCli.ContextAttribute.SECPKG_ATTR_CONNECTION_INFO,
                ref interopConnectionInfo);

            Debug.Assert(success);

            TlsCipherSuite           cipherSuite = default;
            SecPkgContext_CipherInfo cipherInfo  = default;

            success = SSPIWrapper.QueryBlittableContextAttributes(GlobalSSPI.SSPISecureChannel, securityContext, Interop.SspiCli.ContextAttribute.SECPKG_ATTR_CIPHER_INFO, ref cipherInfo);
            if (success)
            {
                cipherSuite = (TlsCipherSuite)cipherInfo.dwCipherSuite;
            }

            Protocol        = interopConnectionInfo.Protocol;
            DataCipherAlg   = interopConnectionInfo.DataCipherAlg;
            DataKeySize     = interopConnectionInfo.DataKeySize;
            DataHashAlg     = interopConnectionInfo.DataHashAlg;
            DataHashKeySize = interopConnectionInfo.DataHashKeySize;
            KeyExchangeAlg  = interopConnectionInfo.KeyExchangeAlg;
            KeyExchKeySize  = interopConnectionInfo.KeyExchKeySize;

            TlsCipherSuite = cipherSuite;

            ApplicationProtocol = GetNegotiatedApplicationProtocol(securityContext);
        }
Ejemplo n.º 2
0
 public SslConnectionInfo(SecPkgContext_ConnectionInfo interopConnectionInfo)
 {
     Protocol = interopConnectionInfo.Protocol;
     DataCipherAlg = interopConnectionInfo.DataCipherAlg;
     DataKeySize = interopConnectionInfo.DataKeySize;
     DataHashAlg = interopConnectionInfo.DataHashAlg;
     DataHashKeySize = interopConnectionInfo.DataHashKeySize;
     KeyExchangeAlg = interopConnectionInfo.KeyExchangeAlg;
     KeyExchKeySize = interopConnectionInfo.KeyExchKeySize;
 }
Ejemplo n.º 3
0
 public SslConnectionInfo(SecPkgContext_ConnectionInfo interopConnectionInfo)
 {
     Protocol        = interopConnectionInfo.Protocol;
     DataCipherAlg   = interopConnectionInfo.DataCipherAlg;
     DataKeySize     = interopConnectionInfo.DataKeySize;
     DataHashAlg     = interopConnectionInfo.DataHashAlg;
     DataHashKeySize = interopConnectionInfo.DataHashKeySize;
     KeyExchangeAlg  = interopConnectionInfo.KeyExchangeAlg;
     KeyExchKeySize  = interopConnectionInfo.KeyExchKeySize;
 }
Ejemplo n.º 4
0
 internal SchannelConnectionInfo(SecPkgContext_ConnectionInfo info)
 {
     Protocol          = (SchannelProtocolType)info.dwProtocol;
     CipherAlgorithm   = (SchannelAlgorithmType)info.aiCipher;
     CipherStrength    = info.dwCipherStrength;
     HashAlgorithm     = (SchannelAlgorithmType)info.aiHash;
     HashStrength      = info.dwHashStrength;
     ExchangeAlgorithm = (SchannelAlgorithmType)info.aiExch;
     ExchangeStrength  = info.dwExchStrength;
 }