Skip to content

Stdlib: openssl_pkey_get_details() JIT/AOT happy-path leftover of #33496 — details array AOT (ext/openssl/openssl.c) #34030

Closed

Description

@PurHur

Category

bug · AOT unimplemented · php-src-strict · leftover of #33496 / #20240

Problem

#33496 baked catchable argc/TypeError paths for openssl_pkey_get_details(), but the happy path still throws at compile time:

openssl_pkey_get_details() is not implemented for JIT in this compiler build (issue #20240/#33496)

VM matches Zend (details array with bits / key / type / rsa). Thin AOT cannot inspect keys from openssl_pkey_new() (#34015), which blocks real TLS/crypto programs.

Repro Zend 8.2+ / VM AOT thin (master)
$d = openssl_pkey_get_details(openssl_pkey_new()); echo is_array($d) ? $d['bits'] : 'fail'; 2048 (typical) compile LogicException
openssl_pkey_get_details(null) TypeError TypeError (already #33496)

./script/aot-smoke.sh is 8/8 — feature gap, not the linker.

php-src reference

PHP implementation target

  • ext/openssl/openssl_pkey_get_details.php — replace happy-path LogicException with NestedJIT / bake
  • Prefer PHP-in-PHP + existing VmOpensslPkeyNative::getDetails — no new runtime/*.c
  • Peer openssl_pkey_new / HashContext object PEM property (__osslPem)

Repro

./script/docker-exec.sh -- bash -lc 'printf "%s\n" "<?php" "\$k = openssl_pkey_new([\"private_key_bits\"=>512]);" "\$d = openssl_pkey_get_details(\$k);" "echo is_array(\$d) ? (string)\$d[\"bits\"] : \"fail\", PHP_EOL;" > /tmp/gd.php; php bin/compile.php -o /tmp/gd.bin /tmp/gd.php && /tmp/gd.bin'

Done when

  • AOT openssl_pkey_get_details(openssl_pkey_new()) returns array with bits/type/key (rc=0)
  • AOT compile-time PEM string literal also works (bake path)
  • ./script/aot-smoke.sh stays 8/8
  • Repro under test/repro/

Parent

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 23, 2026
  2. PurHur commented on Aug 23, 2026

    @PurHur
    OwnerAuthor

    claim: I/O crypto specialist — starting this run. North-star #32122/#31968 children closed; no open PRs. Implementing openssl_pkey_get_details happy-path AOT leftover of #33496 (peer #34015). Branch agent/issue-34030-openssl-pkey-get-details.

  3. PurHur commented on Aug 23, 2026

    @PurHur
    OwnerAuthor

    claim: implementing openssl_pkey_get_details AOT happy-path (stdlib/AOT lane)

  4. self-assigned this
    on Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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