From 8533e23b3d490b86018e3e227e623475ff498c6f Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 28 Mar 2017 14:28:06 +0200 Subject: [PATCH] return collected fixed iv parts from .close() when encrypting Provisional implementation for dumping the IVs in the info file that will be superseded once the crypto context can be provided to tarfile by the user. --- deltatar/crypto.py | 2 +- deltatar/tarfile.py | 41 ++++++++++++++++++++++++----------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/deltatar/crypto.py b/deltatar/crypto.py index 8c826b3..fa8a2cf 100755 --- a/deltatar/crypto.py +++ b/deltatar/crypto.py @@ -466,7 +466,7 @@ class Encrypt (Crypto): self.ctsize, self.enc.tag) if ok is False: raise Exception ("XXX error constructing header: %r" % hdr) ## we need to converge on a sensible error handling strategy - return data, hdr + return data, hdr, self.pfx def process (self, buf): diff --git a/deltatar/tarfile.py b/deltatar/tarfile.py index 1d84365..0431d5f 100644 --- a/deltatar/tarfile.py +++ b/deltatar/tarfile.py @@ -117,8 +117,9 @@ GNU_FORMAT = 1 # GNU tar format PAX_FORMAT = 2 # POSIX.1-2001 (pax) format DEFAULT_FORMAT = GNU_FORMAT -DELTATAR_HEADER_VERSION = 1 -DELTATAR_PARAMETER_VERSION = 1 +DELTATAR_HEADER_VERSION = 1 +DELTATAR_PARAMETER_VERSION = 1 +DELTATAR_PDTCRYPT_EXTENSION = "pdtcrypt" GZ_FMT_HEADER = b"