Don't continue when key couldn't be created
This commit is contained in:
parent
167a12ef54
commit
8b6ace6629
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Util;
|
namespace Friendica\Util;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
|
@ -170,8 +171,7 @@ class Crypto
|
||||||
$result = openssl_pkey_new($openssl_options);
|
$result = openssl_pkey_new($openssl_options);
|
||||||
|
|
||||||
if (empty($result)) {
|
if (empty($result)) {
|
||||||
Logger::notice('new_keypair: failed');
|
throw new Exception('Key creation failed');
|
||||||
return [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = ['prvkey' => '', 'pubkey' => '', 'vapid' => ''];
|
$response = ['prvkey' => '', 'pubkey' => '', 'vapid' => ''];
|
||||||
|
|
Loading…
Reference in a new issue