Skip to content

Commit dfef043

Browse files
authored
Merge pull request #21804 from nextcloud/backport/21800/stable19
[stable19] Call openssl_pkey_export with $config and log errors.
2 parents 6506860 + ec36e02 commit dfef043

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/Service/LoginFlowV2Service.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ private function getKeyPair(): array {
225225
throw new \RuntimeException('Could not initialize keys');
226226
}
227227

228-
openssl_pkey_export($res, $privateKey);
228+
if (openssl_pkey_export($res, $privateKey, null, $config) === false) {
229+
$this->logOpensslError();
230+
throw new \RuntimeException('OpenSSL reported a problem');
231+
}
229232

230233
// Extract the public key from $res to $pubKey
231234
$publicKey = openssl_pkey_get_details($res);

0 commit comments

Comments
 (0)