Backport key handling fix from s3ssekms

This commit is contained in:
Bernd.Rederlechner@t-systems.com 2021-05-17 16:16:48 +00:00
parent 62555d7c0f
commit f9c92477b9
1 changed files with 4 additions and 4 deletions

View File

@ -105,11 +105,11 @@ trait S3ConnectionTrait {
* @return array with encryption parameters
*/
public function getSseKmsPutParameters(): array {
if (empty($this->sseKmsBucketKeyId)) {
if (!empty($this->sseKmsBucketKeyId)) {
return [
'ServerSideEncryption' => 'aws:kms',
];
} elseif (empty($this->sseKmsKeyId)) {
} elseif (!empty($this->sseKmsKeyId)) {
return [
'ServerSideEncryption' => 'aws:kms',
'SSEKMSKeyId' => $this->sseKmsKeyId,
@ -127,12 +127,12 @@ trait S3ConnectionTrait {
* @return array with encryption parameters
*/
public function getSseKmsGetParameters(): array {
if (empty($this->sseKmsBucketKeyId)) {
if (!empty($this->sseKmsBucketKeyId)) {
return [
'ServerSideEncryption' => 'aws:kms',
'SSEKMSKeyId' => $this->sseKmsBucketKeyId,
];
} elseif (empty($this->sseKmsKeyId)) {
} elseif (!empty($this->sseKmsKeyId)) {
return [
'ServerSideEncryption' => 'aws:kms',
'SSEKMSKeyId' => $this->sseKmsKeyId,