mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-07-04 12:02:29 +00:00

Refactor & simplify the handling of the packet stream and errors in packet parsing & grammar validation. This PR also makes the following observable changes: - Packet parsing errors in not-yet-authenticated streams (i.e. SEIPDv1 with `allowUnauthenticatedStream: true`) get delayed until the decrypted data stream is authenticated (i.e. the MDC has been validated) - Non-critical unknown packets get turned into `UnparseablePacket` objects on the packet stream instead of being ignored - The grammar validation internals are changed to a state machine where each input packet is only checked once, for efficiency (before, the entire partial packet sequence was checked for every packet) Co-authored-by: larabr <larabr+github@protonmail.com>