Skip to content

Commit 7ec3d08

Browse files
authored
Fix missing cipher on file decryption (#26)
Currently if a file was encrypted with any cipher other than the default, decryption would fail.
1 parent 855eb39 commit 7ec3d08

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/diffcrypt/file.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ def encrypt(key, cipher: DEFAULT_CIPHER)
3434
Encryptor.new(key, cipher: cipher).encrypt(read)
3535
end
3636

37+
# TODO: Add a test to verify this does descrypt properly
3738
def decrypt(key)
3839
return read unless encrypted?
3940

40-
Encryptor.new(key).decrypt(read)
41+
Encryptor.new(key, cipher: cipher).decrypt(read)
4142
end
4243

4344
def to_yaml

0 commit comments

Comments
 (0)