]> git.mxchange.org Git - friendica.git/commitdiff
Don't continue when key couldn't be created
authorMichael <heluecht@pirati.ca>
Sun, 15 Aug 2021 06:45:48 +0000 (06:45 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 15 Aug 2021 06:45:48 +0000 (06:45 +0000)
src/Util/Crypto.php

index 1ff0e19c3c8f1b081f8714501f189109948a7e6e..85efb9e8ae9e7b8318b30fe2135a8e2e844c9bf5 100644 (file)
@@ -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' => ''];