From 1b71b5c3f5df1c88f61ac2c57abe791f47027143 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Sat, 8 Jul 2017 03:00:11 -0300 Subject: [style] fix naming from review --- src/leap/soledad/common/preamble.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/leap/soledad/common/preamble.py') diff --git a/src/leap/soledad/common/preamble.py b/src/leap/soledad/common/preamble.py index 72549031..d4065c38 100644 --- a/src/leap/soledad/common/preamble.py +++ b/src/leap/soledad/common/preamble.py @@ -15,9 +15,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . """ -Preamble is a metadata payload present on encrypted documents. It holds data -about encryption scheme, iv, document id and sync related data. - BLOB_SIGNATURE_MAGIC, -> used to differentiate from other data formats +Preamble is a binary packed metadata payload present on encrypted documents. It +holds data about encryption scheme, iv, document id and sync related data. + MAGIC, -> used to differentiate from other data formats ENC_SCHEME, -> cryptographic scheme (symmetric or asymmetric) ENC_METHOD, -> cipher used, such as AES-GCM or AES-CTR or GPG current_time, -> time.time() @@ -32,7 +32,7 @@ import time from collections import namedtuple PACMAN = struct.Struct('2sbbQ16s255p255pQ') LEGACY_PACMAN = struct.Struct('2sbbQ16s255p255p') # DEPRECATED -BLOB_SIGNATURE_MAGIC = '\x13\x37' +MAGIC = '\x13\x37' ENC_SCHEME = namedtuple('SCHEME', 'symkey external')(1, 2) ENC_METHOD = namedtuple('METHOD', 'aes_256_ctr aes_256_gcm pgp')(1, 2, 3) @@ -41,7 +41,7 @@ class InvalidPreambleException(Exception): pass -class Preamble: +class Preamble(object): def __init__(self, doc_id, rev, scheme, method, timestamp=0, iv='', magic=None, content_size=0): @@ -51,7 +51,7 @@ class Preamble: self.method = method self.iv = iv self.timestamp = int(timestamp) or int(time.time()) - self.magic = magic or BLOB_SIGNATURE_MAGIC + self.magic = magic or MAGIC self.content_size = int(content_size) def encode(self): -- cgit v1.2.3