}
/* }}} */
-#define PHP_SSL_MAX_VERSION_LEN 32
-
-static char *php_openssl_cipher_get_version(const SSL_CIPHER *c, char *buffer, size_t max_len) /* {{{ */
-{
- const char *version = SSL_CIPHER_get_version(c);
-
- strncpy(buffer, version, max_len);
- if (max_len <= strlen(version)) {
- buffer[max_len - 1] = 0;
- }
-
- return buffer;
-}
-/* }}} */
-
#if PHP_OPENSSL_API_VERSION < 0x10100
static int php_openssl_get_crypto_method_ctx_flags(int method_flags) /* {{{ */
{
char *proto_str;
long proto = SSL_version(ssl_handle);
const SSL_CIPHER *cipher = SSL_get_current_cipher(ssl_handle);
- char version_str[PHP_SSL_MAX_VERSION_LEN];
switch (proto) {
#ifdef HAVE_TLS13
add_assoc_string(&meta_arr, "protocol", proto_str);
add_assoc_string(&meta_arr, "cipher_name", (char *) SSL_CIPHER_get_name(cipher));
add_assoc_long(&meta_arr, "cipher_bits", SSL_CIPHER_get_bits(cipher, NULL));
- add_assoc_string(&meta_arr, "cipher_version",
- php_openssl_cipher_get_version(cipher, version_str, PHP_SSL_MAX_VERSION_LEN));
+ add_assoc_string(&meta_arr, "cipher_version", SSL_CIPHER_get_version(cipher));
return Z_ARR(meta_arr);
}
if (sslsock->ssl_active) {
zval tmp;
char *proto_str;
- char version_str[PHP_SSL_MAX_VERSION_LEN];
const SSL_CIPHER *cipher;
array_init(&tmp);
add_assoc_string(&tmp, "protocol", proto_str);
add_assoc_string(&tmp, "cipher_name", (char *) SSL_CIPHER_get_name(cipher));
add_assoc_long(&tmp, "cipher_bits", SSL_CIPHER_get_bits(cipher, NULL));
- add_assoc_string(&tmp, "cipher_version",
- php_openssl_cipher_get_version(cipher, version_str, PHP_SSL_MAX_VERSION_LEN));
+ add_assoc_string(&tmp, "cipher_version", SSL_CIPHER_get_version(cipher));
#ifdef HAVE_TLS_ALPN
{