Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Commod0re committed Jul 31, 2014
1 parent 288e693 commit 52d0c41
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
9 changes: 9 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
Changelog
*********

v0.2.3
======

PGPy v0.2.3 is a bugfix release

Bugs Fixed
----------
* Fixed an issue where explicitly selecting a key and then trying to validate with it would erroneously raise an exception as though the wrong key were selected.

v0.2.2
======

Expand Down
2 changes: 1 addition & 1 deletion pgpy/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ def verify(self, subject, signature):
raise PGPError("Key {key} is not loaded!".format(key=self.using if self.using is not None else skeyid))

# respect the selected key, even if it's not the one that was used to generate the signature to be verified
if self.using is not None and self.using != skeyid:
if self.using is not None and (not self.using == skeyid):
raise PGPError("Wrong key selected")

# if we get to this point, it should be safe to assume that the requested public key is loaded
Expand Down
10 changes: 4 additions & 6 deletions tests/test_4_PGPKeyring.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ def pytest_generate_tests(metafunc):

if 'invkeysel' in metafunc.fixturenames:
args['invkeysel'] = [ 'DEADBEEF',
'CAFEBABE',
'1DEE7EFFF55B51578F0E40AB127AB47A',
'0'*40,
gpg_getfingerprint('TestRSA-1024')[1:] ]
'CAFEBABE',
'1DEE7EFFF55B51578F0E40AB127AB47A',
'0'*40,
gpg_getfingerprint('TestRSA-1024')[1:] ]
ids = ['deadbeef', 'cafebabe', '16-byte', '40-null', 'truncated']

if 'export' in metafunc.fixturenames:
Expand Down Expand Up @@ -169,8 +169,6 @@ def test_sign_unicode(self, keyring, gpg_verify):

with keyring.key("TestRSA-1024"):
sig = keyring.sign(sigstr)

with keyring.key():
keyring.verify(sigstr, sig)

# now verify the signature
Expand Down

0 comments on commit 52d0c41

Please sign in to comment.