Call openssl_pkey_export with $config and log errors.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2020-07-12 20:22:36 +02:00 committed by backportbot[bot]
parent 72b59cbc14
commit ec36e02741
1 changed files with 4 additions and 1 deletions

View File

@ -225,7 +225,10 @@ class LoginFlowV2Service {
throw new \RuntimeException('Could not initialize keys');
}
openssl_pkey_export($res, $privateKey);
if (openssl_pkey_export($res, $privateKey, null, $config) === false) {
$this->logOpensslError();
throw new \RuntimeException('OpenSSL reported a problem');
}
// Extract the public key from $res to $pubKey
$publicKey = openssl_pkey_get_details($res);