From c759eeee1eff4b345e538d9a6c5272fbf4029109 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 23 Mar 2015 00:11:52 +0100 Subject: [PATCH] fix backwards compatibility for unencrypted repos --- attic/key.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/attic/key.py b/attic/key.py index 340124691..591f4e9ec 100644 --- a/attic/key.py +++ b/attic/key.py @@ -652,16 +652,19 @@ def legacy_parser(all_data, key_type): # all rather hardcoded """ offset = 1 if key_type == PlaintextKey.TYPE: + mac_type = SHA256.TYPE mac = None + cipher_type = PLAIN.TYPE iv = None data = all_data[offset:] else: + mac_type = HMAC_SHA256.TYPE mac = all_data[offset:offset+32] + cipher_type = AES_CTR_HMAC.TYPE iv = PREFIX + all_data[offset+32:offset+40] data = all_data[offset+40:] - meta = Meta(compr_type=6, key_type=key_type, - mac_type=HMAC_SHA256.TYPE, cipher_type=AES_CTR_HMAC.TYPE, - iv=iv, legacy=True) + meta = Meta(compr_type=6, key_type=key_type, mac_type=mac_type, + cipher_type=cipher_type, iv=iv, legacy=True) return mac, meta, data def parser00(all_data):