From ec36e02741a731b5589148e879bd31fc0d38f196 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Sun, 12 Jul 2020 20:22:36 +0200 Subject: [PATCH] Call openssl_pkey_export with $config and log errors. Signed-off-by: Daniel Kesselberg --- core/Service/LoginFlowV2Service.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/Service/LoginFlowV2Service.php b/core/Service/LoginFlowV2Service.php index a58a653172..2d5a30e257 100644 --- a/core/Service/LoginFlowV2Service.php +++ b/core/Service/LoginFlowV2Service.php @@ -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);