Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPSv3: get the "nested" flag right #452

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions pgpy/packet/packets.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ def __bytearray__(self):
_bytes += bytearray([self.halg])
_bytes += bytearray([self.pubalg])
_bytes += binascii.unhexlify(self.signer.encode("latin-1"))
_bytes += bytearray([int(self.nested)])
_bytes += bytearray([int(not self.nested)])
return _bytes

def parse(self, packet):
Expand All @@ -735,7 +735,7 @@ def parse(self, packet):
self.signer = packet[:8]
del packet[:8]

self.nested = (packet[0] == 1)
self.nested = (packet[0] == 0)
del packet[0]


Expand Down
2 changes: 1 addition & 1 deletion pgpy/pgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ def __iter__(self):
##TODO: is it worth coming up with a way of disabling one-pass signing?
for sig in reversed(self._signatures):
ops = sig.make_onepass()
if sig is not self._signatures[-1]:
if sig is not self._signatures[0]:
ops.nested = True
yield ops

Expand Down