| @@ -87,9 +87,9 @@ | ||
| 87 | 87 | * encrypting the plaintext data. |
| 88 | 88 | * @param array $cipherOptions Options for use in determining the cipher to |
| 89 | 89 | * be used for encrypting data. |
| 90 | 90 | * |
| 91 | - * @return [AesStreamInterface, string] | |
| 91 | + * @return array returns an array with two elements as follows: [string, AesStreamInterface] | |
| 92 | 92 | * |
| 93 | 93 | * @internal |
| 94 | 94 | */ |
| 95 | 95 | protected function getEncryptingStream(Stream $plaintext, $cek, &$cipherOptions) |
| @@ -96,9 +96,9 @@ | ||
| 96 | 96 | { |
| 97 | 97 | switch ($cipherOptions['Cipher']) { |
| 98 | 98 | case 'gcm': |
| 99 | 99 | $cipherOptions['TagLength'] = 16; |
| 100 | - $cipherTextStream = new AesGcmEncryptingStream($plaintext, $cek, $cipherOptions['Iv'], $cipherOptions['Aad'] = isset($cipherOptions['Aad']) ? $cipherOptions['Aad'] : null, $cipherOptions['TagLength'], $cipherOptions['KeySize']); | |
| 100 | + $cipherTextStream = new AesGcmEncryptingStream($plaintext, $cek, $cipherOptions['Iv'], $cipherOptions['Aad'] = isset($cipherOptions['Aad']) ? $cipherOptions['Aad'] : '', $cipherOptions['TagLength'], $cipherOptions['KeySize']); | |
| 101 | 101 | if (!empty($cipherOptions['Aad'])) { |
| 102 | 102 | \trigger_error("'Aad' has been supplied for content encryption" . " with " . $cipherTextStream->getAesName() . ". The" . " PHP SDK encryption client can decrypt an object" . " encrypted in this way, but other AWS SDKs may not be" . " able to.", \E_USER_WARNING); |
| 103 | 103 | } |
| 104 | 104 | $appendStream = new AppendStream([$cipherTextStream->createStream()]); |