Merge pull request #16495 from nextcloud/fix/16378-cannot-get-key-from-parameter

Pass $configargs to openssl_pkey_export
This commit is contained in:
Morris Jobke 2019-07-22 13:22:53 +02:00 committed by GitHub
commit 9563c78674
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -316,7 +316,10 @@ class PublicKeyTokenProvider implements IProvider {
throw new \RuntimeException('OpenSSL reported a problem');
}
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);