Workarounds for decrypting Research in Motion messages #383
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While writing a script to decrypt a number of older encrypted emails encrypted using Research in Motion 1.0 PGP software, I ran into a number of issues.
The main one is that I ran into a bunch of unsupported packets, including Opaque, SKEData and Trust. I added code to ignore them and ended up with the expected plaintext. I'm not sure what a proper solution would look like.
To other issue I ran into is that some the key files that I have seem to start with a non-primary key. The key parsing code tries to append it to the last key doing
keys[next(reversed(keys))] |= pgpobj
, but sincekeys
is empty this fails with an uncaught StopIteration. I worked around it by just treating it as a primary key ifkeys
is empty. I'm not sure what one is supposed to do in this case though.I'm not suggesting this PR is merged as-is, I'm putting this forward to document and report these issues, and offering a workaround that worked for my particular use case.