remove obsolete tag handling functionality from crypto.py
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Mon, 10 Apr 2017 07:34:32 +0000 (09:34 +0200)
committerPhilipp Gesang <philipp.gesang@intra2net.com>
Mon, 7 Aug 2017 12:02:46 +0000 (14:02 +0200)
The GCM tag does no longer occur independent of a PDT header so
these are no longer relevant.

deltatar/crypto.py

index 5bfefe7..35bf87b 100755 (executable)
@@ -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
 ###############################################################################