From 3a965a1392652d6ea0f0e059d82f669caf93f990 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 19 Feb 2014 11:35:00 -0500 Subject: [PATCH] Remove intermediate string on decrypt --- lib/ansible/utils/vault.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/ansible/utils/vault.py b/lib/ansible/utils/vault.py index b41d0c39886..a7691d568a7 100644 --- a/lib/ansible/utils/vault.py +++ b/lib/ansible/utils/vault.py @@ -432,18 +432,13 @@ class AES(object): next_chunk = '' finished = False - out_data = '' - while not finished: chunk, next_chunk = next_chunk, cipher.decrypt(in_file.read(1024 * bs)) if len(next_chunk) == 0: padding_length = ord(chunk[-1]) chunk = chunk[:-padding_length] finished = True - out_data += chunk - - # write decrypted data to out stream - out_file.write(out_data) + out_file.write(chunk) # reset the stream pointer to the beginning if hasattr(out_file, 'seek'):