Skip to content

Stdlib: openssl_pkcs12_read/export/export_to_file() — PKCS#12 keystore API (#6420)#18530

Merged
PurHur merged 2 commits into
masterfrom
stdlib-openssl-pkcs12-6420
Jul 13, 2026
Merged

Stdlib: openssl_pkcs12_read/export/export_to_file() — PKCS#12 keystore API (#6420)#18530
PurHur merged 2 commits into
masterfrom
stdlib-openssl-pkcs12-6420

Conversation

@PurHur

@PurHur PurHur commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement openssl_pkcs12_read(), openssl_pkcs12_export(), and openssl_pkcs12_export_to_file() on the VM via ext/openssl/VmOpensslPkcs12Native.php (libcrypto FFI; php-src ext/openssl/pkcs12.c).
  • Wire by-ref $certificates / $output indices in BuiltinByRefParams and add compliance + maintainer round-trip guards.
  • Refresh spine includes + gen-0 sidecar stamp for new ext/openssl/* inventory files.

php-src reference

  • ext/openssl/pkcs12.cPHP_FUNCTION(openssl_pkcs12_read|export|export_to_file)
  • PKCS12_create(..., 0, 0, 0, 0, 0) default cipher/MAC params (OpenSSL 3 PBES2 defaults)

Test plan

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/maintainer_openssl_pkcs12.php
php -d memory_limit=1536M vendor/bin/phpunit --filter openssl_pkcs12_roundtrip
php -d memory_limit=1536M vendor/bin/phpunit --filter BuiltinByRefParamsTest
./script/check-generated-docs.sh
php script/check-selfhost-spine-coverage-sync.php
php script/check-selfhost-spine-sidecar-sync.php
'

Verification output (Jul 2026):

  • maintainer_openssl_pkcs12.phpok
  • openssl_pkcs12_roundtrip VMTest → OK (2 tests)
  • BuiltinByRefParamsTest → OK (18 tests)
  • check-generated-docs.sh → all in sync
  • spine coverage + sidecar sync → OK

Closes #6420

Made with Cursor

Add PKCS#12 keystore read/write via ext/openssl FFI (php-src pkcs12.c),
with by-ref output wiring and compliance round-trip coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve conflicts with openssl_x509_verify landing; dedupe spine
XmlrpcExtensionPolicy include and refresh docs to 4751/4751.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur

PurHur commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

Maintainer triage (2026-07-13): test plan and php-src refs look good, but GitHub reports mergeable: CONFLICTING. Please rebase onto current main (touches docs/bootstrap-inventory.md, spine sidecar, gen-0 stamp — likely conflict zone) before merge review.

Local spot-check: function_exists('openssl_pkcs12_read') is false on VM vs true on Zend in Docker — this PR should close that gap once merged.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: openssl_pkcs12_read/export/export_to_file() — PKCS#12 keystore API missing (ext/openssl/pkcs12.c)

1 participant