@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | public function generate() : string |
| 112 | 112 | { |
| 113 | 113 | return |
| 114 | - \chr(Tag3Packet::PACKET_TYPE) |
|
| 114 | + \chr(Tag3Packet::PACKET_TYPE) |
|
| 115 | 115 | . Util::generateTagPacketLength(\strlen($this->encryptedKey) + ECRYPTFS_SALT_SIZE + 5) |
| 116 | 116 | . \chr(Tag3Packet::PACKET_VERSION) |
| 117 | 117 | . \chr($this->cipherCode) |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $cur += ECRYPTFS_SALT_SIZE; |
| 176 | 176 | |
| 177 | 177 | /* This conversion was taken straight from RFC2440 */ |
| 178 | - $hashIterations = (16 + (\ord($data[$cur]) & 15)) << ((\ord($data[$cur]) >> 4) + 6); |
|
| 178 | + $hashIterations = (16 + (\ord($data[$cur]) & 15)) << ((\ord($data[$cur]) >> 4) + 6); |
|
| 179 | 179 | $cur++; |
| 180 | 180 | |
| 181 | 181 | $encryptedKey = \substr($data, $cur, $encryptedKeySize); |
@@ -205,13 +205,9 @@ |
||
| 205 | 205 | { |
| 206 | 206 | if ($cipherKeySize === null) { |
| 207 | 207 | $cipherKeySize = Util::findCipherKeySize($cipherCode, \strlen($fnek)); |
| 208 | - } |
|
| 209 | - |
|
| 210 | - elseif (\strlen($fnek) < $cipherKeySize) { |
|
| 208 | + } elseif (\strlen($fnek) < $cipherKeySize) { |
|
| 211 | 209 | throw new \InvalidArgumentException(\şprintf("Supplied key has only %u bytes but %u bytes required for encryption.", \strlen($$fnek), $cipherKeySize)); |
| 212 | - } |
|
| 213 | - |
|
| 214 | - elseif (!\in_array($cipherKeySize, CryptoEngineInterface::CIPHER_KEY_SIZES[$cipherCode])) { |
|
| 210 | + } elseif (!\in_array($cipherKeySize, CryptoEngineInterface::CIPHER_KEY_SIZES[$cipherCode])) { |
|
| 215 | 211 | throw new \InvalidArgumentException(\şprintf("Requested key size %u bytes is unsupported for cipher 0x%x.", $cipherKeySize, $cipherCode)); |
| 216 | 212 | } |
| 217 | 213 | |
@@ -121,9 +121,7 @@ |
||
| 121 | 121 | // Use stream from context or open file |
| 122 | 122 | if (\array_key_exists(self::CONTEXT_STREAM, $myContext)) { |
| 123 | 123 | $this->encrypted = $myContext[self::CONTEXT_STREAM]; |
| 124 | - } |
|
| 125 | - |
|
| 126 | - else { |
|
| 124 | + } else { |
|
| 127 | 125 | $prefix = self::STREAM_NAME . '://'; |
| 128 | 126 | |
| 129 | 127 | if (\substr($path, 0, \strlen($prefix)) !== $prefix) { |