diff --git a/pgpy/packet/packets.py b/pgpy/packet/packets.py index cd494137..1dae50df 100644 --- a/pgpy/packet/packets.py +++ b/pgpy/packet/packets.py @@ -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): @@ -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] diff --git a/pgpy/pgp.py b/pgpy/pgp.py index f34a25fb..b3e47a11 100644 --- a/pgpy/pgp.py +++ b/pgpy/pgp.py @@ -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