@@ -492,9 +492,9 @@ void php_openssl_store_errors(void)
492492 errors = OPENSSL_G (errors );
493493
494494 do {
495- errors -> top = (errors -> top + 1 ) % ERR_NUM_ERRORS ;
495+ errors -> top = (errors -> top + 1 ) % PHP_OPENSSL_ERR_BUFFER_SIZE ;
496496 if (errors -> top == errors -> bottom ) {
497- errors -> bottom = (errors -> bottom + 1 ) % ERR_NUM_ERRORS ;
497+ errors -> bottom = (errors -> bottom + 1 ) % PHP_OPENSSL_ERR_BUFFER_SIZE ;
498498 }
499499 errors -> buffer [errors -> top ] = error_code ;
500500 } while ((error_code = ERR_get_error ()));
@@ -739,7 +739,7 @@ static void php_openssl_add_assoc_name_entry(zval * val, char * key, X509_NAME *
739739
740740static void php_openssl_add_assoc_asn1_string (zval * val , char * key , ASN1_STRING * str ) /* {{{ */
741741{
742- add_assoc_stringl (val , key , (char * )str -> data , str -> length );
742+ add_assoc_stringl (val , key , (const char * )ASN1_STRING_get0_data ( str ), ASN1_STRING_length ( str ) );
743743}
744744/* }}} */
745745
@@ -772,12 +772,12 @@ static time_t php_openssl_asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
772772 }
773773
774774 if (timestr_len < 13 ) {
775- php_error_docref (NULL , E_WARNING , "Unable to parse time string %s correctly" , timestr -> data );
775+ php_error_docref (NULL , E_WARNING , "Unable to parse time string %s correctly" , ASN1_STRING_get0_data ( timestr ) );
776776 return (time_t )- 1 ;
777777 }
778778
779779 if (ASN1_STRING_type (timestr ) == V_ASN1_GENERALIZEDTIME && timestr_len < 15 ) {
780- php_error_docref (NULL , E_WARNING , "Unable to parse time string %s correctly" , timestr -> data );
780+ php_error_docref (NULL , E_WARNING , "Unable to parse time string %s correctly" , ASN1_STRING_get0_data ( timestr ) );
781781 return (time_t )- 1 ;
782782 }
783783
@@ -2040,8 +2040,8 @@ static int openssl_x509v3_subjectAltName(BIO *bio, X509_EXTENSION *extension)
20402040 }
20412041
20422042 extension_data = X509_EXTENSION_get_data (extension );
2043- p = extension_data -> data ;
2044- length = extension_data -> length ;
2043+ p = ASN1_STRING_get0_data ( extension_data ) ;
2044+ length = ASN1_STRING_length ( extension_data ) ;
20452045 if (method -> it ) {
20462046 names = (GENERAL_NAMES * ) (ASN1_item_d2i (NULL , & p , length ,
20472047 ASN1_ITEM_ptr (method -> it )));
@@ -7226,7 +7226,7 @@ PHP_FUNCTION(openssl_error_string)
72267226 RETURN_FALSE ;
72277227 }
72287228
7229- OPENSSL_G (errors )-> bottom = (OPENSSL_G (errors )-> bottom + 1 ) % ERR_NUM_ERRORS ;
7229+ OPENSSL_G (errors )-> bottom = (OPENSSL_G (errors )-> bottom + 1 ) % PHP_OPENSSL_ERR_BUFFER_SIZE ;
72307230 val = OPENSSL_G (errors )-> buffer [OPENSSL_G (errors )-> bottom ];
72317231
72327232 if (val ) {
0 commit comments