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

pgpy.errors.PGPError: bytearray index out of range #459

Open
sharmaavi1996 opened this issue Aug 13, 2023 · 0 comments
Open

pgpy.errors.PGPError: bytearray index out of range #459

sharmaavi1996 opened this issue Aug 13, 2023 · 0 comments

Comments

@sharmaavi1996
Copy link

sharmaavi1996 commented Aug 13, 2023

Recently have started seeing this issue come up and was wondering if something has changed to cause this. We have not changed anything on our end. We are attempting to load public keys in .asc format and seeing this error with various different valid gpg public keys:

PGPy version: v0.6.0

line 51, in encrypt_client_secret
    key, _ = pgpy.PGPKey.from_file(recipient_file)
  File "/data/cicd/jenkins/.local/lib/python3.7/site-packages/pgpy/types.py", line 184, in from_file
    po = obj.parse(data)
  File "/data/cicd/jenkins/.local/lib/python3.7/site-packages/pgpy/pgp.py", line 2633, in parse
    for group in iter(group for _, group in itertools.groupby(getpkt, key=pktgrouper()) if not _.endswith('Opaque')):
  File "/data/cicd/jenkins/.local/lib/python3.7/site-packages/pgpy/pgp.py", line 2633, in <genexpr>
    for group in iter(group for _, group in itertools.groupby(getpkt, key=pktgrouper()) if not _.endswith('Opaque')):
  File "/data/cicd/jenkins/.local/lib/python3.7/site-packages/pgpy/pgp.py", line 2617, in _getpkt
    return Packet(d) if d else None
  File "/data/cicd/jenkins/.local/lib/python3.7/site-packages/pgpy/types.py", line 542, in __call__
    raise PGPError(str(ex)) from ex
    
      File "/data/cicd/jenkins/.local/lib/python3.7/site-packages/pgpy/types.py", line 539, in __call__
    obj.parse(packet)
  File "/data/cicd/jenkins/.local/lib/python3.7/site-packages/pgpy/packet/types.py", line 207, in parse
    super(Opaque, self).parse(packet)
  File "/data/cicd/jenkins/.local/lib/python3.7/site-packages/pgpy/packet/types.py", line 169, in parse
    self.header.parse(packet)
  File "/data/cicd/jenkins/.local/lib/python3.7/site-packages/pgpy/packet/types.py", line 102, in parse
    self._lenfmt = ((packet[0] & 0x40) >> 6)
IndexError: bytearray index out of range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant