From ac6d87e83f91ed61b160e7cdd968f4a6f3d68f34 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 16 Feb 2017 17:18:06 -0300 Subject: [style] add deprecation warning on legacy decoder --- client/src/leap/soledad/client/_crypto.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'client/src') diff --git a/client/src/leap/soledad/client/_crypto.py b/client/src/leap/soledad/client/_crypto.py index c4c6d336..f91084a4 100644 --- a/client/src/leap/soledad/client/_crypto.py +++ b/client/src/leap/soledad/client/_crypto.py @@ -22,6 +22,7 @@ Cryptographic operations for the soledad client import binascii import base64 import hashlib +import warnings import hmac import os import re @@ -278,6 +279,10 @@ class BlobDecryptor(object): try: if len(preamble) == LEGACY_PACMAN.size: + warnings.warn("Decrypting a legacy document without size. " + + "This will be deprecated in 0.12. Doc was: " + + "doc_id: %s rev: %s" % (self.doc_id, self.rev), + Warning) unpacked_data = LEGACY_PACMAN.unpack(preamble) magic, sch, meth, ts, iv, doc_id, rev = unpacked_data elif len(preamble) == PACMAN.size: -- cgit v1.2.3