@@ -984,21 +984,6 @@ static int php_openssl_set_local_cert(SSL_CTX *ctx, php_stream *stream) /* {{{ *
984
984
}
985
985
/* }}} */
986
986
987
- #define PHP_SSL_MAX_VERSION_LEN 32
988
-
989
- static char * php_openssl_cipher_get_version (const SSL_CIPHER * c , char * buffer , size_t max_len ) /* {{{ */
990
- {
991
- const char * version = SSL_CIPHER_get_version (c );
992
-
993
- strncpy (buffer , version , max_len );
994
- if (max_len <= strlen (version )) {
995
- buffer [max_len - 1 ] = 0 ;
996
- }
997
-
998
- return buffer ;
999
- }
1000
- /* }}} */
1001
-
1002
987
#if PHP_OPENSSL_API_VERSION < 0x10100
1003
988
static int php_openssl_get_crypto_method_ctx_flags (int method_flags ) /* {{{ */
1004
989
{
@@ -1843,7 +1828,6 @@ static zend_array *php_openssl_capture_session_meta(SSL *ssl_handle) /* {{{ */
1843
1828
char * proto_str ;
1844
1829
long proto = SSL_version (ssl_handle );
1845
1830
const SSL_CIPHER * cipher = SSL_get_current_cipher (ssl_handle );
1846
- char version_str [PHP_SSL_MAX_VERSION_LEN ];
1847
1831
1848
1832
switch (proto ) {
1849
1833
#ifdef HAVE_TLS13
@@ -1876,8 +1860,7 @@ static zend_array *php_openssl_capture_session_meta(SSL *ssl_handle) /* {{{ */
1876
1860
add_assoc_string (& meta_arr , "protocol" , proto_str );
1877
1861
add_assoc_string (& meta_arr , "cipher_name" , (char * ) SSL_CIPHER_get_name (cipher ));
1878
1862
add_assoc_long (& meta_arr , "cipher_bits" , SSL_CIPHER_get_bits (cipher , NULL ));
1879
- add_assoc_string (& meta_arr , "cipher_version" ,
1880
- php_openssl_cipher_get_version (cipher , version_str , PHP_SSL_MAX_VERSION_LEN ));
1863
+ add_assoc_string (& meta_arr , "cipher_version" , SSL_CIPHER_get_version (cipher ));
1881
1864
1882
1865
return Z_ARR (meta_arr );
1883
1866
}
@@ -2450,7 +2433,6 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val
2450
2433
if (sslsock -> ssl_active ) {
2451
2434
zval tmp ;
2452
2435
char * proto_str ;
2453
- char version_str [PHP_SSL_MAX_VERSION_LEN ];
2454
2436
const SSL_CIPHER * cipher ;
2455
2437
2456
2438
array_init (& tmp );
@@ -2477,8 +2459,7 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val
2477
2459
add_assoc_string (& tmp , "protocol" , proto_str );
2478
2460
add_assoc_string (& tmp , "cipher_name" , (char * ) SSL_CIPHER_get_name (cipher ));
2479
2461
add_assoc_long (& tmp , "cipher_bits" , SSL_CIPHER_get_bits (cipher , NULL ));
2480
- add_assoc_string (& tmp , "cipher_version" ,
2481
- php_openssl_cipher_get_version (cipher , version_str , PHP_SSL_MAX_VERSION_LEN ));
2462
+ add_assoc_string (& tmp , "cipher_version" , SSL_CIPHER_get_version (cipher ));
2482
2463
2483
2464
#ifdef HAVE_TLS_ALPN
2484
2465
{
0 commit comments