summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto
AgeCommit message (Collapse)Author
2021-01-19openpgp: Implement hashing for Third-Party Confirmations.Justus Winter
2021-01-11openpgp: Improve documentation.Justus Winter
2021-01-05openpgp: Make crypto backends responsible for IV.Nikhil Benesch
- Adjust the interface of crypto::symmetric::Mode so that the crypto backend is responsible for managing the IV rather than the caller. - The new API is one step towards facilitating a RustCrypto backend for Sequoia (see #333), as RustCrypto does not expose the IV modifications to the caller. - As a bonus, this commit introduces proper support for ECB mode. Previously callers that wanted ECB mode would request CBC mode, then hackily zero out the IV on each call. Nettle actually has proper support for ECB mode, just via a slightly different API.
2020-12-10openpgp: Add remaining assert_send_and_sync! calls.Azul
- See #615.
2020-12-10buffered-reader: Require Cookies to be Send and Sync.Azul
- This way the entire `BufferedReader<C>` will be `Send` and `Sync`. - Modify all other crates accordingly. - See #615.
2020-12-08openpgp: Tweak the assert_send_and_sync macro.Justus Winter
- Declare trait bounds using a where clause. It looks a bit odd if there is no bound, but not worse than before.
2020-12-08openpgp: Add assert_send_and_sync! for more types.Azul
- All types that are `Send` and `Sync` are checked now. - Fixes #627.
2020-12-08openpgp: Use parens for assert_send_and_sync!.Azul
2020-12-08openpgp: Add assert_send_and_sync! for more types.Azul
- With !928 merged more types are `Send` and `Sync` now. - See #627.
2020-12-08openpgp: Allow generic types in assert_send_and_sync!.Azul
- Use generics and the anonmymous lifetime in `assert_send_and_sync!`. - See 627.
2020-12-08openpgp: Ensure public types are Send and Sync.Azul
- See #627.
2020-12-07openpgp: Drop hash::Context in favor of a pub trait hash::Digest.Justus Winter
2020-12-07openpgp: Require Write for impl Digest.Justus Winter
2020-12-07openpgp: Add Digeset::algo.Justus Winter
2020-12-07openpgp: Make digest computation more robust.Justus Winter
2020-12-07openpgp: Make serialize::stream::Message Send + Sync.Justus Winter
- See #615.
2020-12-07openpgp: Make Digest Send + Sync.Justus Winter
2020-12-07openpgp: Require Mode to be Send + Sync.Justus Winter
2020-12-04openpgp: Use pure Rust EAX implementation under CNG backendIgor Matuszewski
- Fixes #556.
2020-12-04openpgp: Make Key::verify more low-level.Justus Winter
- Key::encrypt returns mpi::Ciphertext, not a PKESK packet. Similarly, change Key::verify to take a mpi::Signature instead of a Signature packet.
2020-11-27openpgp: Drop dependency on the digest crate.Justus Winter
2020-11-24openpgp: Move the compound hashing functions to SignatureFields.Justus Winter
2020-11-24openpgp: Align hashing of compound objects with primitive objects.Justus Winter
2020-11-24openpgp: seal Aead trait.Azul
- Seal the Aead trait so it cannot be implemented outside the openpgp crate. - This way we can extend the trait without breaking the API compatibility. - See #538.
2020-11-24openpgp: Avoid direct dependency on generic-array.Justus Winter
2020-11-18openpgp: Return iterator over bad signatures.Justus Winter
- This allows us to store verification errors with the signatures. - See #619.
2020-11-17openpgp: minor: fix typos.Azul
2020-11-13openpgp: Add the vectors from The first collision for full SHA-1.Justus Winter
2020-11-12openpgp: Add test vector from SHA-1 is a Shambles.Justus Winter
2020-11-12openpgp: Mitigate collision attacks on SHA-1.Justus Winter
- Use a collision detecting implementation of SHA-1. When a collision attack is detected, the algorithm employs a mitigation, changing the hash function to discriminate the colliding preimage.
2020-11-12openpgp: Make crypto::Hash::digest fallible.Justus Winter
2020-11-09buffered-reader: Add Debug trait bound to Cookie.Nora Widdecke
2020-11-06openpgp: Use non_exhaustive attribute.Nora Widdecke
- Fixes #563 - With an MSRV >= 1.40.0, we can use #[non_exhaustive], as mentioned in #406. - This is also a clippy lint: https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
2020-10-19buffered-reader: Make Generic::reader private and add accessors.Justus Winter
2020-10-13openpgp: Unbox the slice containing secrets.Justus Winter
- Previously, we stored secrets as boxed slices. However, with Rust managing the allocation using a smart pointer, we are worried about potential optimizations. For example, Rust could conceivably compact the heap: The borrow checker knows when no references exist, and this is an excellent opportunity to move the object on the heap because only one pointer needs to be updated. - Avoid this by unboxing the slice storing a raw pointer to the slice. - Fixes #577.
2020-10-13openpgp: Make Protected's methods not depend on the implementation.Justus Winter
2020-10-13openpgp: Explicitly implement Clone for Protected.Justus Winter
2020-10-13openpgp: Avoid possible reallocations in From::<Vec<u8>>.Justus Winter
2020-10-09openpgp: Don't rely on associate constants.Justus Winter
- Makes the crate compile with 1.39.
2020-10-08openpgp: Warn about possible reallocation in mem::ProtectedIgor Matuszewski
2020-10-08openpgp: Don't mark memory-safe Protected::into_vec as unsafeIgor Matuszewski
In general, `unsafe` is an escape hatch for when do we suspicious but actually memory-safe fiddling that the compiler can't understand. Copying the secret into a raw `Vec` may be risky from the security point of view but is not `unsafe` in the sense above. Use established practice of using long/unwieldy names for functions that need careful thought.
2020-10-08openpgp: Don't use Pin for Box-allocated secretsIgor Matuszewski
The pointed-to buffer is already immovable and *pinned* by `Box<[u8]>`. Moving `Box` value itself only moves the pointer and does not involve moving the backing storage.
2020-10-07openpgp: Align MPI parsing functions with trait Parse.Justus Winter
- Change mpi::*::parse to take a Reader instead of a AsRef<u8>. The former is a more general interface.
2020-10-06openpgp: Remove one unreachable thanks to newer match exhaustive checksIgor Matuszewski
2020-10-06openpgp: Implement two-octet checksums over secret key material.Justus Winter
- Also, rename methods to be more explicit.
2020-10-06openpgp: Use padding instead of alignment in one more placeIgor Matuszewski
2020-10-06openpgp: Create Protected first before zero-padding for CNGIgor Matuszewski
2020-10-06openpgp: Pad RSA ciphertext and ECC scalars for CNGIgor Matuszewski
We strip leading zeroes in our MPIs but CNG expects full-length values so make sure to add those back when interfacing with CNG.
2020-09-25openpgp: Either derive both Eq and Hash, or impl both.Justus Winter
- crypto::mpi::SecretKeyMaterial is the sole exception to this rule, because we are trying to compare them in constant time. Add a hint for clippy that this is okay. - KeyHandle no longer implements Eq, so there is no point in implementing Hash. Simply remove it. - Implement Hash for SubpacketLength by hashing the serialized form. Manually implement Eq for consistency. - Fixes #567.
2020-09-25openpgp: Fix deprecation notices.Nora Widdecke