Skip to content

Stdlib: openssl_pbkdf2()/openssl_pbkdf2_scrypt() — OpenSSL KDF API missing (ext/openssl/kdf.c) #6488

Closed

Description

@PurHur

Category

stdlib

Problem

OpenSSL extension KDF helpers openssl_pbkdf2() and openssl_pbkdf2_scrypt() (PHP 7.4+) are undefined. Distinct from hash_pbkdf2() in ext/hash (#3773) — openssl_* uses OpenSSL EVP KDF/scrypt with $digest_method / $options semantics.

Password-based key derivation for TLS/crypto stacks expects these when ext/openssl is enabled.

php-src reference

Repro (today)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "
var_export(function_exists(\"openssl_pbkdf2\"));
echo \"\\n\";
var_export(function_exists(\"openssl_pbkdf2_scrypt\"));
echo \"\\n\";
"
'

Zend (with ext-openssl): true / true

This compiler: false / false

php-src-strict

Scope (this repo)

Done when

  • Repro: both functions exist and derive a known test vector matching Zend on same inputs
  • test/compliance/cases/stdlib/openssl_pbkdf2.phpt (+ scrypt variant or @group openssl skip without libssl)
  • docs/capabilities.md row after script/capability-matrix.php

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/compliance/VMTest.php --filter openssl_pbkdf2'

Activity

  1. added
    enhancementNew feature or request
    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 Jun 6, 2026
  2. PurHur commented on Jul 11, 2026

    @PurHur
    OwnerAuthor

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

  3. PurHur commented on Jul 11, 2026

    @PurHur
    OwnerAuthor

    Merged via #17977.

    Verification

    php bin/vm.php test/repro/maintainer_gap_openssl_pbkdf2.php  # ok
    vendor/bin/phpunit --filter 'OpensslModuleTest|openssl_pbkdf2'  # OK (8 tests)
    php script/bootstrap-inventory.php --check  # OK 4474/4474
    ./script/ci-fast.sh  # exit 0

    openssl_pbkdf2() derives keys via VmHashNative::hashPbkdf2() matching Zend test vectors. openssl_pbkdf2_scrypt() not in php-src PHP-8.4 stub — follow-up if php-src adds it.

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 machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web apps

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions