Skip to content

Register OpenSSLCertificate object types and openssl_x509_read() (#7268) - #8294

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-7268-openssl-object-types
Jun 13, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-7268-openssl-object-types

Conversation

@PurHur

@PurHur PurHur commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Register PHP 8.4 OpenSSLCertificate, OpenSSLAsymmetricKey, and OpenSSLCertificateSigningRequest internal classes in ext/openssl/BuiltinClasses.php (php-src ext/openssl/openssl.stub.php).
  • Implement openssl_x509_read() returning OpenSSLCertificate objects backed by PEM material via host OpenSSL validation (ext/openssl/xp.c).
  • Add deprecated openssl_free_key() noop matching Zend 8.4 behavior.

Closes #7268

php-src reference

  • ext/openssl/openssl.stub.php — object declarations
  • ext/openssl/xp.c — openssl_x509_read, openssl_free_key

PHP implementation

  • ext/openssl/VmOpensslObjects.php — class registration + cert lifecycle
  • ext/openssl/openssl_x509_read.php, ext/openssl/openssl_free_key.php

Verification

Issue repro:

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r "
foreach ([\"OpenSSLCertificate\", \"OpenSSLAsymmetricKey\", \"OpenSSLCertificateSigningRequest\"] as \$c) {
    echo \$c, \": \", class_exists(\$c, false) ? \"yes\" : \"no\", PHP_EOL;
}
"'

Output:

OpenSSLCertificate: yes
OpenSSLAsymmetricKey: yes
OpenSSLCertificateSigningRequest: yes

Targeted tests:

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter OpenSslObjectTypes'

Output:

OK (4 tests, 12 assertions)

Made with Cursor

…).

PHP 8.4 ext/openssl resource→object migration: register the three internal
classes, parse PEM certs via host OpenSSL into VM objects, and expose the
deprecated openssl_free_key() noop for parity.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 82fad0e into master Jun 13, 2026
@PurHur
PurHur deleted the agent/issue-7268-openssl-object-types branch June 13, 2026 05:13
PurHur added a commit that referenced this pull request Jun 13, 2026
) (#8296)

Regenerate docs/bootstrap-inventory.md after #8294 added
ext/openssl/BuiltinClasses.php, VmOpensslObjects.php, openssl_x509_read.php,
and openssl_free_key.php to the vm.php path.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant