|
|
|
@ -512,17 +512,17 @@ func (scm *StreamingCopyManager) createChunkFromData(data []byte, offset int64, |
|
|
|
if len(baseIV) > 0 { |
|
|
|
chunkIV, _ := calculateIVWithOffset(baseIV, offset) |
|
|
|
// Create chunk key with the chunk-specific IV
|
|
|
|
chunkSSEKey := &SSES3Key{ |
|
|
|
Key: sseKey.Key, |
|
|
|
KeyID: sseKey.KeyID, |
|
|
|
Algorithm: sseKey.Algorithm, |
|
|
|
IV: chunkIV, |
|
|
|
} |
|
|
|
chunkMetadata, serErr := SerializeSSES3Metadata(chunkSSEKey) |
|
|
|
if serErr != nil { |
|
|
|
return nil, fmt.Errorf("failed to serialize chunk SSE-S3 metadata: %w", serErr) |
|
|
|
} |
|
|
|
chunk.SseMetadata = chunkMetadata |
|
|
|
chunkSSEKey := &SSES3Key{ |
|
|
|
Key: sseKey.Key, |
|
|
|
KeyID: sseKey.KeyID, |
|
|
|
Algorithm: sseKey.Algorithm, |
|
|
|
IV: chunkIV, |
|
|
|
} |
|
|
|
chunkMetadata, serErr := SerializeSSES3Metadata(chunkSSEKey) |
|
|
|
if serErr != nil { |
|
|
|
return nil, fmt.Errorf("failed to serialize chunk SSE-S3 metadata: %w", serErr) |
|
|
|
} |
|
|
|
chunk.SseMetadata = chunkMetadata |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|