File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,24 @@ def test_delete_reply_keypair(source_app, test_source):
268
268
assert source_app .crypto_util .getkey (fid ) is None
269
269
270
270
271
+ def test_delete_reply_keypair_pinentry_status_is_handled (source_app , test_source ,
272
+ mocker , capsys ):
273
+ """
274
+ Regression test for https://github.com/freedomofpress/securedrop/issues/4294
275
+ """
276
+ fid = test_source ['filesystem_id' ]
277
+
278
+ # Patch private python-gnupg method to reproduce the issue in #4294
279
+ mocker .patch ('pretty_bad_protocol._util._separate_keyword' ,
280
+ return_value = ('PINENTRY_LAUNCHED' , 'does not matter' ))
281
+
282
+ source_app .crypto_util .delete_reply_keypair (fid )
283
+
284
+ captured = capsys .readouterr ()
285
+ assert "ValueError: Unknown status message: 'PINENTRY_LAUNCHED'" not in captured .err
286
+ assert source_app .crypto_util .getkey (fid ) is None
287
+
288
+
271
289
def test_delete_reply_keypair_no_key (source_app ):
272
290
"""No exceptions should be raised when provided a filesystem id that
273
291
does not exist.
You can’t perform that action at this time.
0 commit comments