PluginProbe
Media Cloud Sync / 1.4.2
Media Cloud Sync v1.4.2
1.4.2 1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 All 36 releases
← All changes | includes/sdk/s3/Aws/Crypto/AesGcmDecryptingStream.php +4 -10 1.2.13 → 1.4.2 View file →
@@ -5,10 +5,8 @@
5 5 use Dudlewebs\WPMCS\s3\Aws\Exception\CryptoException;
6 6 use Dudlewebs\WPMCS\s3\GuzzleHttp\Psr7;
7 7 use Dudlewebs\WPMCS\s3\GuzzleHttp\Psr7\StreamDecoratorTrait;
8 8 use Dudlewebs\WPMCS\s3\Psr\Http\Message\StreamInterface;
9 -use Dudlewebs\WPMCS\s3\Aws\Crypto\Polyfill\AesGcm;
10 -use Dudlewebs\WPMCS\s3\Aws\Crypto\Polyfill\Key;
11 9 /**
12 10 * @internal Represents a stream of data to be gcm decrypted.
13 11 */
14 12 class AesGcmDecryptingStream implements AesStreamInterface
@@ -60,17 +58,13 @@
60 58 return $this->initializationVector;
61 59 }
62 60 public function createStream()
63 61 {
64 - if (\version_compare(\PHP_VERSION, '7.1', '<')) {
65 - return Psr7\Utils::streamFor(AesGcm::decrypt((string) $this->cipherText, $this->initializationVector, new Key($this->key), $this->aad, $this->tag, $this->keySize));
66 - } else {
67 - $result = \openssl_decrypt((string) $this->cipherText, $this->getOpenSslName(), $this->key, \OPENSSL_RAW_DATA, $this->initializationVector, $this->tag, $this->aad);
68 - if ($result === \false) {
69 - throw new CryptoException('The requested object could not be' . ' decrypted due to an invalid authentication tag.');
70 - }
71 - return Psr7\Utils::streamFor($result);
62 + $result = \openssl_decrypt((string) $this->cipherText, $this->getOpenSslName(), $this->key, \OPENSSL_RAW_DATA, $this->initializationVector, $this->tag, $this->aad);
63 + if ($result === \false) {
64 + throw new CryptoException('The requested object could not be ' . 'decrypted due to an invalid authentication tag.');
72 65 }
66 + return Psr7\Utils::streamFor($result);
73 67 }
74 68 public function isWritable() : bool
75 69 {
76 70 return \false;