]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Crypto.php
Remove legacy_password test
[friendica.git] / src / Util / Crypto.php
index adee8cd60e4adb6a3814318b06810aab91fabf60..b2fad997003bd352a43ebda268f376478966fd16 100644 (file)
@@ -8,9 +8,6 @@ use Friendica\Core\Config;
 use ASN_BASE;
 use ASNValue;
 
-require_once 'library/ASNValue.class.php';
-require_once 'library/asn1.php';
-
 /**
  * @brief Crypto class
  */
@@ -96,7 +93,7 @@ class Crypto
                $modulus->SetIntBuffer($Modulus);
                $publicExponent = new ASNValue(ASNValue::TAG_INTEGER);
                $publicExponent->SetIntBuffer($PublicExponent);
-               $keySequenceItems = array($modulus, $publicExponent);
+               $keySequenceItems = [$modulus, $publicExponent];
                $keySequence = new ASNValue(ASNValue::TAG_SEQUENCE);
                $keySequence->SetSequence($keySequenceItems);
                //Encode bit string
@@ -125,7 +122,7 @@ class Crypto
                $modulus->SetIntBuffer($Modulus);
                $publicExponent = new ASNValue(ASNValue::TAG_INTEGER);
                $publicExponent->SetIntBuffer($PublicExponent);
-               $keySequenceItems = array($modulus, $publicExponent);
+               $keySequenceItems = [$modulus, $publicExponent];
                $keySequence = new ASNValue(ASNValue::TAG_SEQUENCE);
                $keySequence->SetSequence($keySequenceItems);
                //Encode bit string
@@ -221,11 +218,11 @@ class Crypto
         */
        public static function newKeypair($bits)
        {
-               $openssl_options = array(
+               $openssl_options = [
                        'digest_alg'       => 'sha1',
                        'private_key_bits' => $bits,
                        'encrypt_key'      => false
-               );
+               ];
 
                $conf = Config::get('system', 'openssl_conf_file');
                if ($conf) {
@@ -239,7 +236,7 @@ class Crypto
                }
 
                // Get private key
-               $response = array('prvkey' => '', 'pubkey' => '');
+               $response = ['prvkey' => '', 'pubkey' => ''];
 
                openssl_pkey_export($result, $response['prvkey']);