Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
|
|
- Use php_try! to parse secret keys, so that truncated keys are
turned into an unknown packet.
|
|
|
|
|
|
- Implement `From<'a mut io::Write>` for the writer stack. While
this may be neat in some situations, if you have a concrete
writer `sink`, you need to do some acrobatics to use it, e.g.:
Signer::new((&mut sink as &mut io::Write).into(), ...)
|
|
- Do not expose the `writer::Stackable` trait in the API. Instead,
use a tuple struct to wrap boxed objects of this kind.
- Add and use `writer::Stack::finalize()` and
`writer::Stack::finalize_all()` to pop one or all writers from the
stack.
|
|
- MPI encoding can drop leading zero bytes, we need to add them back
prior to feeding the signature to nettle.
|
|
|
|
|
|
- Instead of having an owned and a referencing version, just copy
the byte(s) when constructing a KeyFlags object. In almost all
cases it will be just one byte.
|
|
- Also, simplify the example accordingly.
- Add an example for a normal signature.
|
|
|
|
|
|
- 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 necessary to use Fingerprints as keys in hash maps.
|
|
- Also make it return Subpacket instead of SubpacketRaw.
|
|
- This implements the low-level functionality necessary to create
signatures using RSA, DSA, ECDSA, and EdDSA.
|
|
|
|
|
|
|
|
|
|
- Format the SubpacketArea as a list instead of a map, and avoid
printing the tag in the subpacket.
|
|
|
|
|
|
- Embedded signatures must be serialized without the frame.
|
|
- Avoid out-of-bounds slicing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Add a type alias for the subpacket length, and implement parsing
and serializing as trait methods.
|
|
|
|
- Return an Error::InvalidArgument when trying to parse a ciphertext
with a signature algorithm specifier, or a signature with an
encryption one.
|
|
- Fixes #8.
|
|
|
|
|
|
|
|
- sqv only checked whether an *unvalidated* TPK was wanted; it needs
to double-check that this is really the case after validating the
TPK.
Consider the case where key X is needed to validate a signature
and the keyring contains two keys: Mallory's and Alice's, and both
have key X as a subkey, but the back-sig is only valid for Alice's
key. The current code will use Mallory's key, and the signature
validation will fail. If we had double checked, then we'd have
discarded Mallory's key, and correctly used Alice's.
- To fix this problem, this commit changes the code to use the new
TPKParser::unvalidated_tpk_filter, which is not only simpler to
use, but takes care of this double checking.
|
|
- Validating self-signatures is computationally expensive. When
searching a keyring, it would be faster to filter, validate and
then recheck, than to validate and filter.
- Because handing out unvalidated TPKs will inevitably result in an
unvalidated TPK being used in a context where it should have been
validated, we provide this new interface,
`TPKParser::unvalidated_tpk_filter`, which is similar to Rust's
`Iterator::filter` method. Using a callback means that the user
has to go out of their way to propagate the unvalidated TPK, which
will hopefully prevents the unvalidated TPK from being used in a
context where a validated TPK is required.
|
|
|
|
- Also, make armor::Reader use a buffered reader. This allows us to
peek into the buffer to find the footer, even if we didn't request
enough data to see it.
- Fixes #7.
|
|
- Previously, we joined two Strings. Now we just use the &'static
str.
|