From 2aaed698897caa8b8ceeeea4141ef828e94c7a61 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 10 Apr 2017 09:34:32 +0200 Subject: [PATCH] remove obsolete tag handling functionality from crypto.py The GCM tag does no longer occur independent of a PDT header so these are no longer relevant. --- deltatar/crypto.py | 19 +------------------ 1 files changed, 1 insertions(+), 18 deletions(-) diff --git a/deltatar/crypto.py b/deltatar/crypto.py index 5bfefe7..35bf87b 100755 --- a/deltatar/crypto.py +++ b/deltatar/crypto.py @@ -234,7 +234,7 @@ def hdr_make (hdr): HDR_FMT = "I2n_header { version: %d, paramversion: %d, nacl: %s[%d]," \ - " iv: %s[%d], ctsize: %d, tag: %s[%d]}" + " iv: %s[%d], ctsize: %d, tag: %s[%d] }" def hdr_fmt (h): return HDR_FMT % (h["version"], h["paramversion"], @@ -275,23 +275,6 @@ def hdr_fmt_pretty (h): hex_spaced_of_bytes (h["tag"])) -def tag_fmt (t): - return struct.pack (AES_GCM_FMT_TAG, t) - - -def tag_read (data): - try: - tag, = struct.unpack (AES_GCM_FMT_TAG, data) - except Exception as exn: - return False, "error reading tag from [%r]: %s" % (data, str (exn)) - return True, tag - - -def tag_read_stream (source): - data = source.read (PDTCRYPT_TLR_SIZE_TAG) - return tag_read (data) - - ############################################################################### ## passthrough / null encryption ############################################################################### -- 1.7.1