Skip to content

Regression: openssl_pkey_get_public()/openssl_get_publickey()/openssl_pkey_get_details() still missing (re-#6559, ext/openssl/openssl.c) #20240

Closed

Description

@PurHur

Category

stdlib · php-src-strict · ext/openssl key/cert leftover (re-#6559)

Problem

Private-key load ships (openssl_pkey_get_private). Public-key load + details remain unregistered despite closed #6559:

Repro Zend 8.2+ VM (2026-07-17)
function_exists('openssl_pkey_get_private') 1 1
function_exists('openssl_pkey_get_public') 1 0
function_exists('openssl_get_publickey') 1 0
function_exists('openssl_pkey_get_details') 1 0

openssl_get_publickey is the historical alias of openssl_pkey_get_public in php-src.

php-src reference

  • php/php-src ext/openssl/openssl.c — PHP_FUNCTION(openssl_pkey_get_public), PHP_FUNCTION(openssl_pkey_get_details)
  • Alias: openssl_get_publickey → openssl_pkey_get_public

PHP implementation target

  • Mirror ext/openssl/openssl_pkey_get_private.php / VmOpenssl private-key path for public PEM/cert input
  • openssl_pkey_get_details → bits/type/key material array like Zend
  • Register aliases in ext/openssl/Module.php; PHP-in-PHP / existing OpenSSL host bridge; no new C logic tables

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "foreach ([\"openssl_pkey_get_private\",\"openssl_pkey_get_public\",\"openssl_get_publickey\",\"openssl_pkey_get_details\"] as \$f) echo \$f, \"=\", (int)function_exists(\$f), PHP_EOL;"
'

Expected: all =1. Today: only openssl_pkey_get_private=1.

Done when (php-src-strict)

  • All four symbols registered when openssl advertises
  • Load public key from PEM / X.509; openssl_pkey_get_details returns Zend-shaped array keys (bits, key, type, …)
  • Alias openssl_get_publickey === openssl_pkey_get_public behavior
  • Compliance .phpt; php-src-strict; no php-compiler-strict shortcut

Related

Activity

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

    @PurHur
    OwnerAuthor

    claim: PHP Compiler Ext — I/O & Crypto — starting this run

    Trust probe (before implement):

    • php script/bootstrap-inventory.php --check → OK 5515/5515
    • ./script/release-readiness.sh --json → user_release_ready: yes (north-star5-fast ok, vm-driver-probe ok)
  3. PurHur commented on Jul 17, 2026

    @PurHur
    OwnerAuthor

    Merged via #20249

    Verification:

    • Issue repro: all four symbols function_exists = 1 on VM
    • openssl_pkey_get_details returns bits/key/type/rsa; public key rsa = n,e only
    • ./script/phpunit.sh --filter openssl_pkey → OK (9 tests)
    • inventory 5518/5518 + spine sync + generated docs OK
  4. PurHur commented on Jul 17, 2026

    @PurHur
    OwnerAuthor

    Merged #20249 → 3679bb4c2e

    Rebased on master after initial conflict on generated inventory; squash-merge succeeded.

    Verification (post-rebase): ./script/phpunit.sh --filter openssl_pkey_get_public → OK (2 tests); inventory 5517/5517 + spine sync.

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:vmVirtual machinebugSomething 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