GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( d13303...95b19d )
by Joni
01:57
created
examples/encrypt.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,4 +23,4 @@
 block discarded – undo
23 23
 // print the ciphertext along with the authentication tag
24 24
 // and the initialization vector
25 25
 echo bin2hex($ciphertext) . "\n" . bin2hex($auth_tag) . "\n" . bin2hex($iv) .
26
-     "\n";
26
+	 "\n";
Please login to merge, or discard this patch.
examples/explicit-decrypt.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 $key = "012345678901234567890123";
15 15
 // read ciphertext, authentication tag and initialization vector from the stdin
16 16
 list($ciphertext, $auth_tag, $iv) = array_map("hex2bin",
17
-    file("php://stdin", FILE_IGNORE_NEW_LINES));
17
+	file("php://stdin", FILE_IGNORE_NEW_LINES));
18 18
 // configure GCM object with AES-192 cipher and 13-bytes long authentication tag
19 19
 $gcm = new GCM(new AES192Cipher(), 13);
20 20
 // decrypt and authenticate
Please login to merge, or discard this patch.
examples/decrypt.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 $key = "some 128 bit key";
17 17
 // read ciphertext, authentication tag and initialization vector from the stdin
18 18
 list($ciphertext, $auth_tag, $iv) = array_map("hex2bin",
19
-    file("php://stdin", FILE_IGNORE_NEW_LINES));
19
+	file("php://stdin", FILE_IGNORE_NEW_LINES));
20 20
 // decrypt and authenticate
21 21
 $plaintext = AESGCM::decrypt($ciphertext, $auth_tag, $aad, $key, $iv);
22 22
 echo "$plaintext\n";
Please login to merge, or discard this patch.
examples/explicit-encrypt.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,4 +23,4 @@
 block discarded – undo
23 23
 // print the ciphertext along with the authentication tag
24 24
 // and the initialization vector
25 25
 echo bin2hex($ciphertext) . "\n" . bin2hex($auth_tag) . "\n" . bin2hex($iv) .
26
-     "\n";
26
+	 "\n";
Please login to merge, or discard this patch.
lib/GCM/Cipher/Cipher.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@
 block discarded – undo
7 7
  */
8 8
 interface Cipher
9 9
 {
10
-    /**
11
-     * Encrypt data.
12
-     *
13
-     * @param string $data Data to encrypt
14
-     * @param string $key Encryption key
15
-     * @return string Encrypted data
16
-     */
17
-    public function encrypt($data, $key);
10
+	/**
11
+	 * Encrypt data.
12
+	 *
13
+	 * @param string $data Data to encrypt
14
+	 * @param string $key Encryption key
15
+	 * @return string Encrypted data
16
+	 */
17
+	public function encrypt($data, $key);
18 18
 }
Please login to merge, or discard this patch.
lib/GCM/Cipher/AES/AESCipher.php 1 patch
Indentation   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -9,87 +9,87 @@
 block discarded – undo
9 9
  */
10 10
 abstract class AESCipher implements Cipher
11 11
 {
12
-    /**
13
-     * Mapping from key size in bits to AES cipher implementation class name.
14
-     *
15
-     * @internal
16
-     *
17
-     * @var array
18
-     */
19
-    const MAP_KEYSIZE_TO_CLS = array(
20
-        /* @formatter:off */
21
-        128 => AES128Cipher::class,
22
-        192 => AES192Cipher::class,
23
-        256 => AES256Cipher::class
24
-        /* @formatter:on */
25
-    );
12
+	/**
13
+	 * Mapping from key size in bits to AES cipher implementation class name.
14
+	 *
15
+	 * @internal
16
+	 *
17
+	 * @var array
18
+	 */
19
+	const MAP_KEYSIZE_TO_CLS = array(
20
+		/* @formatter:off */
21
+		128 => AES128Cipher::class,
22
+		192 => AES192Cipher::class,
23
+		256 => AES256Cipher::class
24
+		/* @formatter:on */
25
+	);
26 26
     
27
-    /**
28
-     * Get the cipher method name recognized by OpenSSL.
29
-     *
30
-     * @return string
31
-     */
32
-    abstract protected function _cipherName();
27
+	/**
28
+	 * Get the cipher method name recognized by OpenSSL.
29
+	 *
30
+	 * @return string
31
+	 */
32
+	abstract protected function _cipherName();
33 33
     
34
-    /**
35
-     * Get the key size in bytes.
36
-     *
37
-     * @return int
38
-     */
39
-    abstract protected function _keySize();
34
+	/**
35
+	 * Get the key size in bytes.
36
+	 *
37
+	 * @return int
38
+	 */
39
+	abstract protected function _keySize();
40 40
     
41
-    /**
42
-     * Get AES cipher instance by key length.
43
-     *
44
-     * @param int $len Key length in bytes
45
-     * @throws \UnexpectedValueException
46
-     * @return self
47
-     */
48
-    public static function fromKeyLength($len)
49
-    {
50
-        $bits = $len << 3;
51
-        if (!array_key_exists($bits, self::MAP_KEYSIZE_TO_CLS)) {
52
-            throw new \UnexpectedValueException(
53
-                "No AES implementation for $bits-bit key size.");
54
-        }
55
-        $cls = self::MAP_KEYSIZE_TO_CLS[$bits];
56
-        return new $cls();
57
-    }
41
+	/**
42
+	 * Get AES cipher instance by key length.
43
+	 *
44
+	 * @param int $len Key length in bytes
45
+	 * @throws \UnexpectedValueException
46
+	 * @return self
47
+	 */
48
+	public static function fromKeyLength($len)
49
+	{
50
+		$bits = $len << 3;
51
+		if (!array_key_exists($bits, self::MAP_KEYSIZE_TO_CLS)) {
52
+			throw new \UnexpectedValueException(
53
+				"No AES implementation for $bits-bit key size.");
54
+		}
55
+		$cls = self::MAP_KEYSIZE_TO_CLS[$bits];
56
+		return new $cls();
57
+	}
58 58
     
59
-    /**
60
-     *
61
-     * @see \GCM\Cipher\Cipher::encrypt()
62
-     * @throws \UnexpectedValueException If key size is incorrect
63
-     * @throws \RuntimeException For generic errors
64
-     * @return string
65
-     */
66
-    public function encrypt($data, $key)
67
-    {
68
-        $key_size = $this->_keySize();
69
-        if (strlen($key) != $key_size) {
70
-            throw new \UnexpectedValueException(
71
-                "Key size must be $key_size bytes.");
72
-        }
73
-        $result = openssl_encrypt($data, $this->_cipherName(), $key,
74
-            OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING);
75
-        if (false === $result) {
76
-            throw new \RuntimeException(
77
-                "openssl_encrypt() failed: " . self::_getLastOpenSSLError());
78
-        }
79
-        return $result;
80
-    }
59
+	/**
60
+	 *
61
+	 * @see \GCM\Cipher\Cipher::encrypt()
62
+	 * @throws \UnexpectedValueException If key size is incorrect
63
+	 * @throws \RuntimeException For generic errors
64
+	 * @return string
65
+	 */
66
+	public function encrypt($data, $key)
67
+	{
68
+		$key_size = $this->_keySize();
69
+		if (strlen($key) != $key_size) {
70
+			throw new \UnexpectedValueException(
71
+				"Key size must be $key_size bytes.");
72
+		}
73
+		$result = openssl_encrypt($data, $this->_cipherName(), $key,
74
+			OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING);
75
+		if (false === $result) {
76
+			throw new \RuntimeException(
77
+				"openssl_encrypt() failed: " . self::_getLastOpenSSLError());
78
+		}
79
+		return $result;
80
+	}
81 81
     
82
-    /**
83
-     * Get latest OpenSSL error message.
84
-     *
85
-     * @return string
86
-     */
87
-    protected static function _getLastOpenSSLError()
88
-    {
89
-        $msg = null;
90
-        while (false !== ($err = openssl_error_string())) {
91
-            $msg = $err;
92
-        }
93
-        return $msg;
94
-    }
82
+	/**
83
+	 * Get latest OpenSSL error message.
84
+	 *
85
+	 * @return string
86
+	 */
87
+	protected static function _getLastOpenSSLError()
88
+	{
89
+		$msg = null;
90
+		while (false !== ($err = openssl_error_string())) {
91
+			$msg = $err;
92
+		}
93
+		return $msg;
94
+	}
95 95
 }
Please login to merge, or discard this patch.
lib/GCM/Cipher/AES/AES256Cipher.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@
 block discarded – undo
7 7
  */
8 8
 class AES256Cipher extends AESCipher
9 9
 {
10
-    /**
11
-     *
12
-     * {@inheritdoc}
13
-     */
14
-    protected function _cipherName()
15
-    {
16
-        return "AES-256-ECB";
17
-    }
10
+	/**
11
+	 *
12
+	 * {@inheritdoc}
13
+	 */
14
+	protected function _cipherName()
15
+	{
16
+		return "AES-256-ECB";
17
+	}
18 18
     
19
-    /**
20
-     *
21
-     * {@inheritdoc}
22
-     */
23
-    protected function _keySize()
24
-    {
25
-        return 32;
26
-    }
19
+	/**
20
+	 *
21
+	 * {@inheritdoc}
22
+	 */
23
+	protected function _keySize()
24
+	{
25
+		return 32;
26
+	}
27 27
 }
Please login to merge, or discard this patch.
lib/GCM/Cipher/AES/AES192Cipher.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@
 block discarded – undo
7 7
  */
8 8
 class AES192Cipher extends AESCipher
9 9
 {
10
-    /**
11
-     *
12
-     * {@inheritdoc}
13
-     */
14
-    protected function _cipherName()
15
-    {
16
-        return "AES-192-ECB";
17
-    }
10
+	/**
11
+	 *
12
+	 * {@inheritdoc}
13
+	 */
14
+	protected function _cipherName()
15
+	{
16
+		return "AES-192-ECB";
17
+	}
18 18
     
19
-    /**
20
-     *
21
-     * {@inheritdoc}
22
-     */
23
-    protected function _keySize()
24
-    {
25
-        return 24;
26
-    }
19
+	/**
20
+	 *
21
+	 * {@inheritdoc}
22
+	 */
23
+	protected function _keySize()
24
+	{
25
+		return 24;
26
+	}
27 27
 }
Please login to merge, or discard this patch.
lib/GCM/Cipher/AES/AES128Cipher.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@
 block discarded – undo
7 7
  */
8 8
 class AES128Cipher extends AESCipher
9 9
 {
10
-    /**
11
-     *
12
-     * {@inheritdoc}
13
-     */
14
-    protected function _cipherName()
15
-    {
16
-        return "AES-128-ECB";
17
-    }
10
+	/**
11
+	 *
12
+	 * {@inheritdoc}
13
+	 */
14
+	protected function _cipherName()
15
+	{
16
+		return "AES-128-ECB";
17
+	}
18 18
     
19
-    /**
20
-     *
21
-     * {@inheritdoc}
22
-     */
23
-    protected function _keySize()
24
-    {
25
-        return 16;
26
-    }
19
+	/**
20
+	 *
21
+	 * {@inheritdoc}
22
+	 */
23
+	protected function _keySize()
24
+	{
25
+		return 16;
26
+	}
27 27
 }
Please login to merge, or discard this patch.