]> source.dussan.org Git - nextcloud-server.git/commitdiff
Call openssl_pkey_export with $config and log errors. 21800/head
authorDaniel Kesselberg <mail@danielkesselberg.de>
Sun, 12 Jul 2020 18:22:36 +0000 (20:22 +0200)
committerDaniel Kesselberg <mail@danielkesselberg.de>
Sun, 12 Jul 2020 18:22:36 +0000 (20:22 +0200)
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
core/Service/LoginFlowV2Service.php

index a58a6531723415cee684e1d33ef31bac0a13e181..2d5a30e257c0fcdebd1a0bd7d2a2b55f17fbff8b 100644 (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);