Remove some redundant code Remove some lingering commented out code and the methods we didn't end up using in the final implementation. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
diff --git a/main.py b/main.py index d12844c..2e732e3 100755 --- a/main.py +++ b/main.py
@@ -222,13 +222,6 @@ return hval -def dkim_canonicalize_body(body: bytes) -> bytes: - # We only do simple for body (relaxed is unsuitable for patches), - # so we just replace all trailing blank lines with a single CRLF - body = re.sub(rb'[\r\n]*$', b'', body) + b'\r\n' - return body - - def get_public_key(source: str, keytype: str, identity: str, selector: str) -> Optional[bytes]: chunks = identity.split('@', 1) if len(chunks) != 2: @@ -445,12 +438,6 @@ def verify_openpgp(sigdata: bytes, pk: Optional[bytes]) -> Optional[bytes]: - # We can't pass both the detached sig and the content on stdin, so - # use a temporary directory - # with tempfile.TemporaryDirectory(suffix='.patch-att-poc') as tmpdir: - # - # with open(savefile, 'wb') as fh: - # fh.write(dsig) bsigdata = base64.b64decode(sigdata) vrfyargs = ['--verify', '--output', '-', '--status-fd=2'] if pk is not None: