summaryrefslogtreecommitdiff
path: root/tests/crypto_test.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2017-08-17 10:19:23 -0700
committerDylan Baker <dylan@pnwbakers.com>2017-08-17 10:59:49 -0700
commit50a9d4e8ac32c8763b78657ccabd56e01a169ea5 (patch)
tree9ea79f3669ed6610247c1f2583df613d351872f7 /tests/crypto_test.py
parent707843b7da81e794d336eb0b9e69d62b3d6a0e02 (diff)
alot/crypto: make keys required for detached_signature_for
This function is always passed a key to sign with, and not passing one leads to the first available signing key in the keyring being selected otherwise, which is problematic if one has two signing keys.
Diffstat (limited to 'tests/crypto_test.py')
-rw-r--r--tests/crypto_test.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/crypto_test.py b/tests/crypto_test.py
index bd46adf2..d481d64e 100644
--- a/tests/crypto_test.py
+++ b/tests/crypto_test.py
@@ -111,7 +111,7 @@ class TestDetachedSignatureFor(unittest.TestCase):
def test_valid_signature_generated(self):
to_sign = "this is some text.\nit is more than nothing.\n"
with gpg.core.Context() as ctx:
- _, detached = crypto.detached_signature_for(to_sign, ctx.get_key(FPR))
+ _, detached = crypto.detached_signature_for(to_sign, [ctx.get_key(FPR)])
with tempfile.NamedTemporaryFile(delete=False) as f:
f.write(detached)
@@ -133,7 +133,7 @@ class TestVerifyDetached(unittest.TestCase):
def test_verify_signature_good(self):
to_sign = "this is some text.\nIt's something\n."
with gpg.core.Context() as ctx:
- _, detached = crypto.detached_signature_for(to_sign, ctx.get_key(FPR))
+ _, detached = crypto.detached_signature_for(to_sign, [ctx.get_key(FPR)])
try:
crypto.verify_detached(to_sign, detached)
@@ -144,7 +144,7 @@ class TestVerifyDetached(unittest.TestCase):
to_sign = "this is some text.\nIt's something\n."
similar = "this is some text.\r\n.It's something\r\n."
with gpg.core.Context() as ctx:
- _, detached = crypto.detached_signature_for(to_sign, ctx.get_key(FPR))
+ _, detached = crypto.detached_signature_for(to_sign, [ctx.get_key(FPR)])
with self.assertRaises(GPGProblem):
crypto.verify_detached(similar, detached)