updated-packages

This commit is contained in:
RafficMohammed
2023-01-08 00:13:22 +05:30
parent 3ff7df7487
commit da241bacb6
12659 changed files with 563377 additions and 510538 deletions

View File

@@ -3,6 +3,7 @@ namespace Aws\Crypto;
use GuzzleHttp\Psr7;
use GuzzleHttp\Psr7\LimitStream;
use Psr\Http\Message\StreamInterface;
trait DecryptionTrait
{
@@ -35,12 +36,13 @@ trait DecryptionTrait
/**
* Builds an AesStreamInterface using cipher options loaded from the
* MetadataEnvelope and MaterialsProvider.
* MetadataEnvelope and MaterialsProvider. Can decrypt data from both the
* legacy and V2 encryption client workflows.
*
* @param string $cipherText Plain-text data to be encrypted using the
* materials, algorithm, and data provided.
* @param MaterialsProvider $provider A provider to supply and encrypt
* materials used in encryption.
* @param MaterialsProviderInterface $provider A provider to supply and encrypt
* materials used in encryption.
* @param MetadataEnvelope $envelope A storage envelope for encryption
* metadata to be read from.
* @param array $cipherOptions Additional verification options.
@@ -52,9 +54,9 @@ trait DecryptionTrait
*
* @internal
*/
protected function decrypt(
public function decrypt(
$cipherText,
MaterialsProvider $provider,
MaterialsProviderInterface $provider,
MetadataEnvelope $envelope,
array $cipherOptions = []
) {
@@ -79,18 +81,18 @@ trait DecryptionTrait
$envelope[MetadataEnvelope::CONTENT_CRYPTO_SCHEME_HEADER]
);
$decryptionSteam = $this->getDecryptingStream(
$decryptionStream = $this->getDecryptingStream(
$cipherText,
$cek,
$cipherOptions
);
unset($cek);
return $decryptionSteam;
return $decryptionStream;
}
private function getTagFromCiphertextStream(
Psr7\Stream $cipherText,
StreamInterface $cipherText,
$tagLength
) {
$cipherTextSize = $cipherText->getSize();
@@ -106,7 +108,7 @@ trait DecryptionTrait
}
private function getStrippedCiphertextStream(
Psr7\Stream $cipherText,
StreamInterface $cipherText,
$tagLength
) {
$cipherTextSize = $cipherText->getSize();
@@ -141,7 +143,7 @@ trait DecryptionTrait
$cek,
$cipherOptions
) {
$cipherTextStream = Psr7\stream_for($cipherText);
$cipherTextStream = Psr7\Utils::streamFor($cipherText);
switch ($cipherOptions['Cipher']) {
case 'gcm':
$cipherOptions['Tag'] = $this->getTagFromCiphertextStream(