summaryrefslogtreecommitdiff
path: root/tickets/b6df8a5d7d3d4b7e8c2ddf8c95cfc33d/Maildir/new/1455998996.M920926P17339Q60.exolobe1
blob: ae7a06327a2aefa2ddf2a9be5c65f164a3118726 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Return-Path: <obnam-dev-bounces@obnam.org>
X-Original-To: distix@pieni.net
Delivered-To: distix@pieni.net
Received: from bagpuss.pepperfish.net (bagpuss.pepperfish.net [148.251.8.16])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pieni.net (Postfix) with ESMTPS id 4C1122B256
	for <distix@pieni.net>; Fri, 25 Sep 2015 07:38:19 +0200 (CEST)
Received: from platypus.pepperfish.net (unknown [10.112.100.20])
	by bagpuss.pepperfish.net (Postfix) with ESMTP id EC46EBD7;
	Fri, 25 Sep 2015 06:38:18 +0100 (BST)
Received: from ip6-localhost ([::1] helo=platypus.pepperfish.net)
	by platypus.pepperfish.net with esmtp (Exim 4.80 #2 (Debian))
	id 1ZfLi6-0006wV-RV; Fri, 25 Sep 2015 06:38:18 +0100
Received: from inmail0 ([10.112.100.10] helo=mx0.pepperfish.net)
 by platypus.pepperfish.net with esmtp (Exim 4.80 #2 (Debian))
 id 1ZfLi5-0006wM-5i
 for <obnam-dev@obnam.org>; Fri, 25 Sep 2015 06:38:17 +0100
Received: from mail-io0-f178.google.com ([209.85.223.178])
 by mx0.pepperfish.net with esmtps (TLS1.2:RSA_ARCFOUR_SHA1:128)
 (Exim 4.80) (envelope-from <mathstuf@gmail.com>) id 1ZfLi3-0005Qv-EW
 for obnam-dev@obnam.org; Fri, 25 Sep 2015 06:38:17 +0100
Received: by iofb144 with SMTP id b144so100673132iof.1
 for <obnam-dev@obnam.org>; Thu, 24 Sep 2015 22:38:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:cc:subject:date:message-id:in-reply-to:references;
 bh=fRAc5sfGe0QxSZTtfPDwPDfLRoGy+aZN5h1N63E45zc=;
 b=YqilPFJfWgxU8dLhVIJs85ob1iXtS4KskjQ7I5/777Csys19hyz3qk1unWGC1FLBYZ
 gsSFGB+4esiA7WZd6ZIai9Y/FAbuXdb3KbCmUF/eNGrJ1A2Zvs8huOH2APZiRLdWw9z4
 NwfJN9N7bYdKVXB0mRPxV8Xw+5Pnu6ooEgzDJ7veH5DPaZnZtqFJl4YJLg4HveQsMs9/
 uYAl7acTGx6ThfC3l+MKwFO2LOsIRfvZkl63af2uznNmWirGfqNhgK4e6WWQjItGEy+Q
 xlhpzduilC/Et6NboDikM4dj6ivq6YJ5kWQzInzIOR/z+NxwqDAo7fi7uPZb8MjUx0FI
 AjPg==
X-Received: by 10.107.170.32 with SMTP id t32mr4531020ioe.173.1443159483060;
 Thu, 24 Sep 2015 22:38:03 -0700 (PDT)
Received: from localhost (26.sub-70-209-128.myvzw.com. [70.209.128.26])
 by smtp.gmail.com with ESMTPSA id a193sm1035451ioe.37.2015.09.24.22.38.01
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 24 Sep 2015 22:38:01 -0700 (PDT)
From: Ben Boeckel <mathstuf@gmail.com>
To: obnam-dev@obnam.org
Date: Fri, 25 Sep 2015 01:37:51 -0400
Message-Id: <1443159474-27126-2-git-send-email-mathstuf@gmail.com>
X-Mailer: git-send-email 2.5.3
In-Reply-To: <1443159474-27126-1-git-send-email-mathstuf@gmail.com>
References: <1441948936-12526-1-git-send-email-mathstuf@gmail.com>
 <1443159474-27126-1-git-send-email-mathstuf@gmail.com>
X-Spam-Score: -0.5
X-Spam-Score-int: -4
X-Spam-Bar: /
X-Scanned-By: pepperfish.net, Fri, 25 Sep 2015 06:38:17 +0100
X-Spam-Report: Content analysis details: (-0.5 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 1.0 PPF_FROM_CONTAINS_MAIL The From header contains 'mail'
 1.2 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (mathstuf[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
 domain
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
 not necessarily valid
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
 trust [209.85.223.178 listed in list.dnswl.org]
X-ACL-Warn: message may be spam
X-Scan-Signature: 7f2245552c28d1e693ee8fc7a1f06879
Cc: Ben Boeckel <mathstuf@gmail.com>
Subject: [PATCH v4 1/4] encryption: refactor _gpg_pipe to use _gpg
X-BeenThere: obnam-dev@obnam.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Obnam development discussions <obnam-dev-obnam.org>
List-Unsubscribe: <http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/obnam-dev-obnam.org>,
 <mailto:obnam-dev-request@obnam.org?subject=unsubscribe>
List-Archive: <http://listmaster.pepperfish.net/pipermail/obnam-dev-obnam.org>
List-Post: <mailto:obnam-dev@obnam.org>
List-Help: <mailto:obnam-dev-request@obnam.org?subject=help>
List-Subscribe: <http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/obnam-dev-obnam.org>,
 <mailto:obnam-dev-request@obnam.org?subject=subscribe>
Sender: obnam-dev-bounces@obnam.org
Errors-To: obnam-dev-bounces@obnam.org

Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
---
 obnamlib/encryption.py | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/obnamlib/encryption.py b/obnamlib/encryption.py
index 7030359..d76193c 100644
--- a/obnamlib/encryption.py
+++ b/obnamlib/encryption.py
@@ -90,21 +90,14 @@ def _gpg_pipe(args, data, passphrase):
     os.write(keypipe[1], passphrase + '\n')
     os.close(keypipe[1])
 
-    # Actually run gpg.
-
-    argv = ['gpg', '--passphrase-fd', str(keypipe[0]), '-q', '--batch',
-            '--no-textmode'] + args
-    tracing.trace('argv=%s', repr(argv))
-    p = subprocess.Popen(argv, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
-                         stderr=subprocess.PIPE)
-    out, err = p.communicate(data)
+    try:
+        out = _gpg(args + ['--passphrase-fd', str(keypipe[0])], stdin=data)
+    except: # pragma: no cover
+        os.close(keypipe[0])
+        raise
 
     os.close(keypipe[0])
 
-    # Return output data, or deal with errors.
-    if p.returncode:  # pragma: no cover
-        raise GpgError(returncode=p.returncode, stderr=err)
-
     return out
 
 
-- 
2.5.3


_______________________________________________
obnam-dev mailing list
obnam-dev@obnam.org
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/obnam-dev-obnam.org