Skip to content

Commit

Permalink
fixed decrypter
Browse files Browse the repository at this point in the history
  • Loading branch information
debebantur committed May 27, 2024
1 parent 490cc0e commit d4609d5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/proc/interaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ func ProcConn(s storage.StorageInteractor, cr crypt.Crypter, ycl *client.YClient
defer readerFromOldBucket.Close()

if msg.Decrypt {
fromReader, err = cr.Decrypt(readerFromOldBucket)
oldCr, err := crypt.NewCrypto(&instanceCnf.CryptoCnf)
if err != nil {
ylogger.Zero.Error().Err(err).Msg("failed to configure decrypter")
failed = append(failed, objectMetas[i])
continue
}
fromReader, err = oldCr.Decrypt(readerFromOldBucket)
if err != nil {
ylogger.Zero.Error().Err(err).Msg("failed to decrypt object")
failed = append(failed, objectMetas[i])
Expand Down

0 comments on commit d4609d5

Please sign in to comment.