@@ -469,9 +469,9 @@ void php_openssl_store_errors()
469469 errors = OPENSSL_G (errors );
470470
471471 do {
472- errors -> top = (errors -> top + 1 ) % ERR_NUM_ERRORS ;
472+ errors -> top = (errors -> top + 1 ) % PHP_OPENSSL_ERR_BUFFER_SIZE ;
473473 if (errors -> top == errors -> bottom ) {
474- errors -> bottom = (errors -> bottom + 1 ) % ERR_NUM_ERRORS ;
474+ errors -> bottom = (errors -> bottom + 1 ) % PHP_OPENSSL_ERR_BUFFER_SIZE ;
475475 }
476476 errors -> buffer [errors -> top ] = error_code ;
477477 } while ((error_code = ERR_get_error ()));
@@ -685,7 +685,7 @@ static void php_openssl_add_assoc_name_entry(zval * val, char * key, X509_NAME *
685685
686686static void php_openssl_add_assoc_asn1_string (zval * val , char * key , ASN1_STRING * str ) /* {{{ */
687687{
688- add_assoc_stringl (val , key , (char * )str -> data , str -> length );
688+ add_assoc_stringl (val , key , (const char * )ASN1_STRING_get0_data ( str ), ASN1_STRING_length ( str ) );
689689}
690690/* }}} */
691691
@@ -718,12 +718,12 @@ static time_t php_openssl_asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
718718 }
719719
720720 if (timestr_len < 13 && timestr_len != 11 ) {
721- php_error_docref (NULL , E_WARNING , "Unable to parse time string %s correctly" , timestr -> data );
721+ php_error_docref (NULL , E_WARNING , "Unable to parse time string %s correctly" , ASN1_STRING_get0_data ( timestr ) );
722722 return (time_t )- 1 ;
723723 }
724724
725725 if (ASN1_STRING_type (timestr ) == V_ASN1_GENERALIZEDTIME && timestr_len < 15 ) {
726- php_error_docref (NULL , E_WARNING , "Unable to parse time string %s correctly" , timestr -> data );
726+ php_error_docref (NULL , E_WARNING , "Unable to parse time string %s correctly" , ASN1_STRING_get0_data ( timestr ) );
727727 return (time_t )- 1 ;
728728 }
729729
@@ -1982,8 +1982,8 @@ static int openssl_x509v3_subjectAltName(BIO *bio, X509_EXTENSION *extension)
19821982 }
19831983
19841984 extension_data = X509_EXTENSION_get_data (extension );
1985- p = extension_data -> data ;
1986- length = extension_data -> length ;
1985+ p = ASN1_STRING_get0_data ( extension_data ) ;
1986+ length = ASN1_STRING_length ( extension_data ) ;
19871987 if (method -> it ) {
19881988 names = (GENERAL_NAMES * ) (ASN1_item_d2i (NULL , & p , length ,
19891989 ASN1_ITEM_ptr (method -> it )));
@@ -6709,7 +6709,7 @@ PHP_FUNCTION(openssl_error_string)
67096709 RETURN_FALSE ;
67106710 }
67116711
6712- OPENSSL_G (errors )-> bottom = (OPENSSL_G (errors )-> bottom + 1 ) % ERR_NUM_ERRORS ;
6712+ OPENSSL_G (errors )-> bottom = (OPENSSL_G (errors )-> bottom + 1 ) % PHP_OPENSSL_ERR_BUFFER_SIZE ;
67136713 val = OPENSSL_G (errors )-> buffer [OPENSSL_G (errors )-> bottom ];
67146714
67156715 if (val ) {
0 commit comments