internal SslConnectionInfo(Interop.libssl.SSL_CIPHER cipher) { Protocol = (int)MapProtocol(cipher.algorithm_ssl); DataCipherAlg = (int)MapCipherAlgorithmType(cipher.algorithm_enc); KeyExchangeAlg = (int)MapExchangeAlgorithmType(cipher.algorithm_mkey); DataHashAlg = (int)MapHashAlgorithmType(cipher.algorithm_mac); // TODO (Issue #3362) map key sizes }
internal SslConnectionInfo(Interop.libssl.SSL_CIPHER cipher, string protocol) { Protocol = (int)MapProtocolVersion(protocol); DataCipherAlg = (int)MapCipherAlgorithmType((Interop.libssl.CipherAlgorithm)cipher.algorithm_enc); KeyExchangeAlg = (int)MapExchangeAlgorithmType((Interop.libssl.KeyExchangeAlgorithm)cipher.algorithm_mkey); DataHashAlg = (int)MapHashAlgorithmType((Interop.libssl.DataHashAlgorithm)cipher.algorithm_mac); DataKeySize = cipher.alg_bits; // TODO (Issue #3362) map key sizes }
public int QueryContextConnectionInfo(SafeDeleteContext securityContext, out SslConnectionInfo connectionInfo) { connectionInfo = null; try { Interop.libssl.SSL_CIPHER cipher = Interop.OpenSsl.GetConnectionInfo(securityContext.SslContext); connectionInfo = new SslConnectionInfo(cipher); return(0); } catch { return(-1); } }
public static int QueryContextConnectionInfo(SafeDeleteContext securityContext, out SslConnectionInfo connectionInfo) { string protocolVersion; connectionInfo = null; try { Interop.libssl.SSL_CIPHER cipher = Interop.OpenSsl.GetConnectionInfo(securityContext.SslContext, out protocolVersion); connectionInfo = new SslConnectionInfo(cipher, protocolVersion); return(0); } catch { return(-1); } }
public int QueryContextConnectionInfo(SafeDeleteContext securityContext, out SslConnectionInfo connectionInfo) { bool gotReference = false; connectionInfo = null; try { securityContext.DangerousAddRef(ref gotReference); Interop.libssl.SSL_CIPHER cipher = Interop.OpenSsl.GetConnectionInfo(securityContext.DangerousGetHandle()); connectionInfo = new SslConnectionInfo(cipher); return(0); } catch { return(-1); } finally { if (gotReference) { securityContext.DangerousRelease(); } } }