improve parsing of encrypted meta data for small files
authorLunar <lunar@anargeek.net>
Sun, 4 Mar 2012 09:43:43 +0000 (10:43 +0100)
committerLunar <lunar@anargeek.net>
Fri, 23 Mar 2012 17:11:28 +0000 (18:11 +0100)
lib/coquelicot/stored_file.rb

index 2eb122d..41092a6 100644 (file)
@@ -168,6 +168,7 @@ module Coquelicot
       yaml = ''
       buf = @file.read(BUFFER_LEN)
       content = @cipher.update(buf)
+      content << @cipher.final if @file.eof?
       raise BadKey.new unless content.start_with? YAML_START
       yaml << YAML_START
       block = content.split(YAML_START, 3)