Skip to content

OpenSSL 3.0.18 private key export not working when passphrase is defined #1590

@Phatkone

Description

@Phatkone

Affected Page URL

https://www.php.net/manual/en/function.openssl-pkey-export.php

Describe the bug

Tested on PHP 8.4.14 w/ OpenSSL mod 3.0.13 and bug not present, but on PHP 8.4.14 with OpenSSL mod 3.0.18 I am unable to export password encrypted private keys.

the private key exports without issue when the password is null/left out. tested with simple strings and complicated strings and got the same result both times.

Steps to reproduce

  1. generate private key (tested using sha256 digest alg and 4196 key bits)
  2. export private key using openssl_pkey_export with the password defined.

Expected behavior

expect to get an encrypted private key exported.

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions