int netconn_get_cipher_strength( netconn_t *conn ) { #ifdef SONAME_LIBSSL #if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x0090707f) const SSL_CIPHER *cipher; #else SSL_CIPHER *cipher; #endif int bits = 0; if (!conn->secure) return 0; if (!(cipher = pSSL_get_current_cipher( conn->ssl_conn ))) return 0; pSSL_CIPHER_get_bits( cipher, &bits ); return bits; #else return 0; #endif }
int NETCON_GetCipherStrength(netconn_t *connection) { #ifdef SONAME_LIBSSL #if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x0090707f) const SSL_CIPHER *cipher; #else SSL_CIPHER *cipher; #endif int bits = 0; if (!connection->ssl_s) return 0; cipher = pSSL_get_current_cipher(connection->ssl_s); if (!cipher) return 0; pSSL_CIPHER_get_bits(cipher, &bits); return bits; #else return 0; #endif }