Skip to content

replace ERR_NUM_ERRORS with PHP_OPENSSL_ERR_BUFFER_SIZE#21579

Merged
bukka merged 1 commit intophp:masterfrom
jordikroon:fix/gh-21382
Apr 2, 2026
Merged

replace ERR_NUM_ERRORS with PHP_OPENSSL_ERR_BUFFER_SIZE#21579
bukka merged 1 commit intophp:masterfrom
jordikroon:fix/gh-21382

Conversation

@jordikroon
Copy link
Copy Markdown
Contributor

The latest version of OpenSSL removed ERR_NUM_ERRORS from the public API thus we cannot rely on it anymore.

Fixes #21382

Copy link
Copy Markdown
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disclosure: I don't know OpenSSL well.

Looks like php_openssl_errors is modeled after ERR_STATE, which became opaque, thus hiding ERR_NUM_ERRORS. I looked at how OPENSSL_G(errors) is used and there don't seem to be any cases where diverging buffer sizes would be problematic.

Copy link
Copy Markdown
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine. We might consider targeting lower branches depending how much we will need to change for OpenSSL 4 (meaning if we support it on stable branches). I guess it is fine for master for now and we can backport later...

@bukka bukka merged commit 266f85f into php:master Apr 2, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error: ‘ERR_NUM_ERRORS’

3 participants