From 8b6ace6629ab4fe229c4c35ff388efe320602a16 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 15 Aug 2021 06:45:48 +0000 Subject: [PATCH] Don't continue when key couldn't be created --- src/Util/Crypto.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Util/Crypto.php b/src/Util/Crypto.php index 1ff0e19c3c..85efb9e8ae 100644 --- a/src/Util/Crypto.php +++ b/src/Util/Crypto.php @@ -21,6 +21,7 @@ namespace Friendica\Util; +use Exception; use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\System; @@ -170,8 +171,7 @@ class Crypto $result = openssl_pkey_new($openssl_options); if (empty($result)) { - Logger::notice('new_keypair: failed'); - return []; + throw new Exception('Key creation failed'); } $response = ['prvkey' => '', 'pubkey' => '', 'vapid' => ''];