Skip to content

Conversation

@bshaffer
Copy link
Collaborator

@bshaffer bshaffer commented Dec 3, 2025

openssl in PHP 8.1 no longer uses type resource. AFAIK, no valid resource can be supplied to these functions, so they can be removed.

NOTE: This commit message merged incorrectly as add key size validation when it should have been what the PR title here is (fix: remove resource support)

@bshaffer bshaffer marked this pull request as draft December 3, 2025 16:02
@bshaffer bshaffer force-pushed the remove-resource-support branch from 346044e to f26448b Compare December 15, 2025 20:03
@bshaffer bshaffer changed the title chore!: remove resource support fix: remove resource support Dec 15, 2025
@bshaffer bshaffer marked this pull request as ready for review December 15, 2025 20:04
if (str_starts_with($alg, 'RS')) {
self::validateRsaKeyLength($key);
}
if (!$key = openssl_pkey_get_private($key)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is nit and something that I don't think it needs to be changed, but I find this logic a bit convoluted.

It might be good to separate these cases into their own methods like :

private function handleOpenSsl()
private function handleSodyumCrypto()

But this was already this way. Just think it would be a good cleanup for later.

@bshaffer bshaffer merged commit 81ed59e into main Dec 15, 2025
8 checks passed
@bshaffer bshaffer deleted the remove-resource-support branch December 15, 2025 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants