Age | Commit message (Collapse) | Author |
|
|
|
- See #471.
|
|
|
|
- See #471.
|
|
This reverts commit 2e1eec5fe4157a391a13554ff7df3075cfe043cc.
|
|
- This avoids the partial implementation imitating
std::option::Option, replacing it with std::result::Result.
- As a benefit, std::result::Result is in the prelude, simplifying a
lot of parsing loops.
|
|
- Writers should be finalized, builders should be built.
|
|
- Rename to DEFAULT_MAX_RECURSION_DEPTH to better reflect the fact
that it is not a absolute maximum, but only the default. Make it
public so that the documentation can refer to that.
|
|
- Fixes #387.
|
|
- The `Generic::data_helper` was not sufficiently careful when
dealing with errors. In particular:
- If `Generic::data_hard(1)` was called, and an error occured, and
nothing was buffered or read, `Generic::data_helper` would
return the empty string instead of the error.
- If `Generic::data(n)` was called, and an error occured, but some
data (< n bytes) was buffered, `Generic::data_helper` would
return the error instead of the data that was read.
- Fix these bugs.
- Also, simplify the code and don't save whether we hit EOF or the
error (which we can only return once, anyway). Instead, rely on
the underlying reader to return EOF or the error again.
- Fixes #174.
|
|
Newer Rust compilers requre `dyn` marking trait objects.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
- A drawback of this change is that currently AsRef<[u8]> is not
implemented for [u8; _], only for specific lengths. This is a
compiler limitation that may be lifted in the future. This
limitation required fixing some tests, notably those using
include_bytes!.
- Fixes #296.
|
|
- This introduces a configurable limit for
non-data (i.e. non-container) packets. This prevents a trivial
DoS on our parser, which previously assumed that all non-data
packets can be buffered.
- Fixes #242.
|
|
- This is the result of running `cargo fix --edition`, with some
manual adjustments.
- The vast majority of changes merely qualify module paths with
'crate::'.
- Two instances of adding an anonymous pattern to a trait's
function.
- `async` is a keyword in Rust 2018, and hence it needs to be
escaped (e.g. in the case of the net::r#async module).
- The manual adjustments were needed due to various shortcomings of
the analysis employed by `cargo fix`, e.g. unexpanded macros,
procedural macros, lalrpop grammars.
|
|
|
|
- Use the new framework instead of including the files everywhere.
|
|
- To ease debugging, include the path of the packet that caused the
parse error.
|
|
|
|
- Rename Header::plausible to Header::valid.
- Tighten the validity checks.
- Add a future_compatible option that makes unknown packets valid.
|
|
- For example, `buffered_reader::BufferedReaderMemory` is now called
`buffered_reader::Memory`. This makes the type names less unwieldy.
- Fixes #206.
|
|
- Fixes #30.
|
|
- Currently, the PacketParserBuilder uses a heuristic to detect
whether to push an ASCII armor decoder on the input.
- Introduce a tri-state to the builder to allow the caller to
control enable the heuristic, unconditionally push a decoder, or
unconditionally treat the data as binary data.
|
|
- Trait Parse introduces a uniform interface to parse packets,
messages, keys, and related data structures.
|
|
- Also, split out the code.
|
|
|
|
- Add a basic check to the PacketParserBuilder to see if the message
could be a binary OpenPGP message. If not, push an ASCII-Armor
decoder.
|
|
- The packet parser supports tracing its execution.
- There is little need to enable this on a per-PacketParser basis.
- As such, make tracing a compile-time only option.
|
|
- The packet parser's recursive depth can be computed from the path,
which we now track. As such, don't track the recursive depth
separately, just derive it from the path.
|
|
|
|
- Use the new reader either directly, or make sure that calls to
from_file(..) use it down the call chain.
|
|
|
|
|
|
- Add a MessageValidator to the PacketParserState struct.
- Update it after parsing each packet's header.
- Add methods to the PacketParser to query the MessageValidator.
|
|
- Instead of passing PacketParser::state around by reference or
making copies, move it.
|
|
- Move all state (currently just settings) that is relevant to the
packet parser, as opposed to just the current packet, in a
single field.
|
|
- In the future, we want to return some summary information about a
parsed packet sequence after the packet sequence is fully parsed.
Currently, PacketParser::next() and PacketParser::recurse()
consume the PacketParser and return None on EOF. Thus, even if
the summary information were stored in the PacketParser, it
becomes inaccessible on EOF.
- This change introduces a new type, PacketParserResult, that
contains either a PacketParser or a PacketParserEOF.
PacketParserEOF is returned on EOF instead of None. Since it is a
struct, it can hold only any information that we want to return to
the caller.
|
|
- This is the result of executing
find . \( -type f -and \( -name '*.rs' -or -name '*.h' \) \) \
-exec sed -i -e 's/,\([^[:space:]]\)/, \1/g' {} \;
with one manual tweak in 'parse.rs'.
|
|
- The `BufferedReader` trait is primarily an implementation detail.
Thus, we avoid exporting Foo::from_buffered_reader constructors,
and making public structures generic over `BufferedReader`.
|
|
- The parse module includes functionality related to
the *implementation* of the `PacketParser`. The `Message`-related
functionality simply uses this API. Thus, move it to the
`message` module.
|
|
- Continue to declutter the parse.rs.
|