From: Daniel Kesselberg Date: Sun, 12 Jul 2020 18:22:36 +0000 (+0200) Subject: Call openssl_pkey_export with $config and log errors. X-Git-Tag: v20.0.0beta1~263^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F21800%2Fhead;p=nextcloud-server.git Call openssl_pkey_export with $config and log errors. Signed-off-by: Daniel Kesselberg --- diff --git a/core/Service/LoginFlowV2Service.php b/core/Service/LoginFlowV2Service.php index a58a6531723..2d5a30e257c 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);