Skip to content

Commit

Permalink
fixed decrypter (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
debebantur authored May 27, 2024
1 parent 490cc0e commit 209c2d4
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 209c2d4

Please sign in to comment.