Skip to content

Stdlib: openssl_x509_export() JIT/AOT lowering missing — VM path only (ext/openssl/openssl.c) #32557

Closed

Description

@PurHur

Category

bug · AOT/JIT leftover of #20273 · openssl X.509 export

Problem

openssl_x509_export() works on the VM (ext/openssl/openssl_x509_export.php + VmOpensslX509Native::exportCertificatePem). JIT/AOT still throw LogicException: openssl_x509_export() is not implemented for JIT in this compiler build (issue #20273).

Thin-standalone AOT has no PHP FFI, so NestedJIT of the VM FFI path cannot call PEM_write_bio_X509. Bake the exported PEM in the compiler process from compile-time certificate literals, same as openssl_x509_verify() (#32535 leftover of #6595).

Repro Zend 8.2+ VM AOT (master)
openssl_x509_export($pem, $out) with PEM nowdoc true, $out contains BEGIN CERTIFICATE same compile abort, not implemented for JIT
invalid PEM warning + false warning + false compile abort

aot-smoke.sh is 8/8 on this tree — toolchain is fine; this is the feature.

php-src reference

PHP implementation target

  • ext/openssl/JitOpensslX509.php — bake VmOpensslX509Native::exportCertificatePem, write &$output via __value__writeString (peer JitOpensslSign::sign)
  • ext/openssl/openssl_x509_export.php — call() → JitOpensslX509::export
  • lib/BuiltinParamNames.php — certificate / output / no_text=
  • No new runtime/*.c

Repro

./script/aot-smoke.sh   # must stay 8/8
./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/xe.bin test/repro/issue_NNNN_openssl_x509_export_aot.php'

Done when

  • openssl_x509_export($pem, $out) AOT compile succeeds for compile-time PEM literals
  • VM and AOT $out contain BEGIN CERTIFICATE / END CERTIFICATE
  • invalid PEM returns false (VM may warn)
  • ./script/aot-smoke.sh stays 8/8
  • targeted phpunit filter green

Refs: #20273, #32535, #32527

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Aug 19, 2026
  2. PurHur commented on Aug 19, 2026

    @PurHur
    OwnerAuthor

    claim: implementer I/O-crypto-text — leftover of #20273; bake openssl_x509_export() for JIT/AOT from compile-time PEM (peer #32535). aot-smoke next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions