Skip to content

Add UnparseablePacket to properly deal with key blocks that include malformed/unsupported packets#1522

Merged
larabr merged 4 commits intoopenpgpjs:mainfrom
larabr:parse-unknown-packets
May 24, 2022
Merged

Add UnparseablePacket to properly deal with key blocks that include malformed/unsupported packets#1522
larabr merged 4 commits intoopenpgpjs:mainfrom
larabr:parse-unknown-packets

Conversation

@larabr
Copy link
Copy Markdown
Collaborator

@larabr larabr commented May 23, 2022

Fix #1420 : when parsing errors are being ignored, packets that fail to parse are now included in the resulting packet list as UnparseablePackets . This way, when parsing keys that contain unparsable (sub)key, we avoid associating the following non-key packets to the wrong key entity.

On serialization, UnparseablePackets are also included by writing their raw packet body as it was read.

@larabr larabr requested a review from twiss May 23, 2022 12:21
Copy link
Copy Markdown
Member

@twiss twiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, except one nitpick below

Comment thread openpgp.d.ts Outdated
@larabr larabr requested a review from twiss May 24, 2022 17:28
@larabr larabr changed the title Add UnparsablePacket to properly deal with key blocks that include malformed/unsupported packets Add UnparseablePacket to properly deal with key blocks that include malformed/unsupported packets May 24, 2022
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

Successfully merging this pull request may close these issues.

Unexpected parsing result when reading a key block that includes some unparsable key packets

2 participants