summaryrefslogtreecommitdiffstats
path: root/openpgp
AgeCommit message (Collapse)Author
2021-04-09Lint: Remove unecessary imports.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
2021-04-09Lint: Use next instead of nth(0).Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
2021-04-09Lint: Use is_empty().Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#len_zero - https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty
2021-04-09Lint: Remove redundant lifetime.Nora Widdecke
- Constants have by default a `'static` lifetime - https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
2021-04-09Lint: Remove redundant returns.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
2021-04-09Lint: Use matches! macro.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
2021-04-09Lint: Remove useless as_ref.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
2021-04-09Lint: Remove redundant closures.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
2021-04-09Lint: Use byte literals.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
2021-04-09Lint: Remove unnecessary conversions.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
2021-04-09Lint: Use lazy evaluation.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
2021-04-09openpgp, sq: Remove redundant semicolons.Wiktor Kwapisiewicz
- Compiling with 1.51 toolchains prints warnings about redundant semicolons. Remove them.
2021-04-08openpgp: Improve Packet::serialized_len.Justus Winter
- Use NetLength::gross_len that is both shorter and smart enough not to compute the net length twice.
2021-04-08openpgp: New test for SerializeInto::serialized_len.Justus Winter
2021-04-08openpgp: Improve Packet::arbitrary to also generate unknown packets.Justus Winter
2021-04-08openpgp: Fix Tag::arbitrary.Justus Winter
- Previously, we also generated Tag::Unknown(n) where n > 63.
2021-04-08openpgp: Fix serialized length computation.Justus Winter
- Packets without framing should return their net length.
2021-04-08openpgp: Improving debugging of SerializeInto::serialized_len.Justus Winter
2021-04-08openpgp: Use Serialize::export for keys for consistency.Justus Winter
2021-04-08openpgp: Import Deref at the top level.Justus Winter
2021-04-08openpgp: Fix checking for exportability.Justus Winter
- Fixes 54e223d1b0aecc458fdfd78f7ed6a14a2fd59cc6.
2021-04-08openpgp: Drop unused lifetime.Justus Winter
2021-04-08openpgp: Improve documentation.Justus Winter
2021-04-08Update MSRV to 1.48.0Nora Widdecke
- Update our MSRV to the one used in Debian bullseye, 1.48.0.
2021-04-06openpgp: Fix link.Justus Winter
2021-04-06openpgp: Fix SystemTime test.Nora Widdecke
- The size of SystemTime is an implementation detail of the standard library and does not give a direct indication whether values larger that i32::MAX will fit in it. - Adjust the test to observe if we are on a system can represent a large value as a SystemTime or not, and assert that the values are clamped correctly.
2021-04-06openpgp: Correct system_time_32_bit test.Daniel Kahn Gillmor
@nwalfield suggested this correction in #697
2021-04-06openpgp: Enable time_t overflow test on other 32-bit platforms.Daniel Kahn Gillmor
on Debian GNU/Linux systems, time_t is 4 octets for i386 (rust calls this platform target_arch "x86"), armel ("arm"), armhf ("arm"), and mipsel ("mips"). I've pulled these arch names from platforms [0]. [0] https://github.com/RustSec/platforms-crate/blob/main/src/target/arch.rs There are likely other platforms that have a 32-bit time_t (and indeed, some variants of 32-bit platforms like musl may have a 64-bit time_t [1]), so this gating mechanism still isn't quite right. But it's an improvement over the status quo of just gating on target_arch = "x86". [1] https://musl.libc.org/time64.html
2021-03-30Minor edits in documentation.Heiko
2021-03-30Fix terminology: certificate vs. certification.Heiko
2021-03-29Clarify/fix wording in documentation.Heiko
2021-03-25openpgp: Only record fields if we consume the data.Justus Winter
- Fixes #698.
2021-03-23openpgp: Short-circuit regex alternations with empty branches.Neal H. Walfield
- The regex 'a|b|' is an alternation of three branches: 'a', 'b', and ''. The last branch matches anything, so the alternation matches anything, and therefore the whole thing can be elided. - This is required for regex <= 1.3.7, which doesn't support empty alternations. - Unfortunately, this is the version in Debian Bullseye. - Fixes #694.
2021-03-22openpgp: Add test demonstrating that canonicalization is robust.Justus Winter
- At some point, invalid self-signatures would be mis-classified as third-party certifications by Cert::canonicalize. As a side-effect, invalid self-revocations would be considered third-party revocations, changing the certificates revocation status to CouldBe. Confusingly, also changing the digest prefix would break this mis-classification, resulting in a revocation status of NotAsFarAsWeKnow. - The underlying issue was fixed in 7afee60b7cf0f19559bfccd8c42fdc77f6b9c655. - Add a test that demonstrates that bad signatures are now recognized as such, and that the confusing behavior previously observed is now consistent. - Fixes #486.
2021-03-19openpgp: Simplify key serialization code.Justus Winter
2021-03-19openpgp: Align equality, serialization of Key packets.Justus Winter
- Previously, serializing Packet::PublicKey(k) would not serialize any secret key material on k, but when comparing Packet::PublicKey(k) with Packet::PublicKey(l), the secret key material would be significant. This is in conflict with our definition of equality, which states that two objects are considered equal if their canonical serialized form is equal. - Closely related, secret key material was considered significant when comparing Key<_, _> objects, and secret key material was emitted when they were serialized, even for objects of type Key<PublicParts, _>. - Align equality, serialization of Key<_, _> objects by ignoring any secret key material when comparing and serializing objects of type Key<PublicParts, _>. - Fixes #632 and #633.
2021-03-18openpgp: fix a few typos in docsEli Flanagan
2021-03-18openpgp: Use time-constant comparison for MDC.Wiktor Kwapisiewicz
- This avoids side-channel attacks on the MDC computed digest.
2021-03-17openpgp: Fix handling of malformed MDC packets.Justus Winter
- Tampering with MDC packets can be used to create decryption oracles. To defend against that, we need to respond with uniform error messages. - Thanks to Lara Bruseghini for bringing this to our attention. - Fixes #693.
2021-03-17openpgp: Improve tests related to encrypted keys.Justus Winter
- Add a test exercising key encryption. - Demonstrate that key packets are correctly replacing existing packets when using Cert::insert_packets.
2021-03-17openpgp: Rename keys to certs to avoid confusion.Justus Winter
2021-03-17openpgp: Ignore marker packets when verifying detached sigs.Justus Winter
- Fixes #686.
2021-03-17openpgp: Test that marker packets are ignored when parsing Certs.Justus Winter
- See #686.
2021-03-17openpgp: Test that marker packets are ignored when verifying.Justus Winter
- See #686.
2021-03-17openpgp: Add 1pa3pc test vector from dkgpg.Justus Winter
- See #335 and https://savannah.nongnu.org/bugs/index.php?60154
2021-03-05openpgp: Release 1.1.0.openpgp/v1.1.0Justus Winter
2021-03-05openpgp: Do not recommend padding by default.Justus Winter
- We discovered compatibility problems with the padding mechanism, so we should caution against its use when compatibility with certain implementations is required. Also, don't use padding in the module's example.
2021-03-05openpgp: Fix panic when verifying signatures.Wiktor Kwapisiewicz
- Signatures with no layers generated panic at runtime as zeroth index was not available. - Make `Decryptor::from_buffered_reader` return Err when no layers are available. - Fixes #682.
2021-03-05openpgp: Use fallible time operations.Nora Widdecke
- SystemTime +/- Duration may over-/underflow.
2021-03-05openpgp: Fix SystemTime from Timestamp on 32bit.Nora Widdecke
- SystemTime's underlying datatype may be only `i32`, e.g. on 32bit Unix. As OpenPGP's timestamp datatype is `u32`, there are timestamps (`i32::MAX + 1` to `u32::MAX`) which are not representable on such systems. - To keep the API stable, instead of making the conversion fallible, clamp those too large values to i32::MAX.