summaryrefslogtreecommitdiffstats
path: root/openpgp/src/packet/pkesk.rs
AgeCommit message (Collapse)Author
2023-03-01openpgp: Add low-level ElGamal PKESK decryption test.Justus Winter
2023-01-06openpgp: Fix typos found by codespellDimitri Papadopoulos
These are typos in comments only.
2022-12-21openpgp: Adjust error messages on decryption failures.Wiktor Kwapisiewicz
2022-07-28openpgp: Fix subtraction with overflow.Justus Winter
- When the decryptor returns a short session key without reporting an error, an overflow occurs. Avoid this by using saturating subtraction. Then, the resulting range is empty, and an error will be reported just a few lines down. - Fixes #913.
2022-05-11openpgp: Use the new downcasting methods to reword some tests.Justus Winter
2022-05-11openpgp: Drop .skip(0), that's a NOP.Justus Winter
2021-12-13ipc, openpgp: Bump quickcheck to 1.0.3.Nora Widdecke
- Adapt to the new API: - Gen is now a struct, not a Trait, and replaces StdThreadGen. - The rand re-export has been removed. As a consequence, we need our own function to generate an arbitrary value from a range.
2021-09-30Improve error message for a malformed packetLars Wirzenius
Suggested by Neal Walfield. Found by clippy lint useless_format: https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
2021-09-16openpgp: Skip tests if a required algorithm is not supported.Justus Winter
2021-06-07openpgp: Add tests for crashes in Nettle, see CVE-2021-3580.Justus Winter
2021-04-09Lint: Use get() instead of iter().next().Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#iter_next_slice
2020-12-08openpgp: Use parens for assert_send_and_sync!.Azul
2020-12-08openpgp: Ensure public types are Send and Sync.Azul
- See #627.
2020-09-22openpgp: Remove `quickcheck` feature.Wiktor Kwapisiewicz
- Adjust code to test for `cfg(test)` only, - Remove `quickcheck` and `rand` from dependencies so that they stay only in dev-dependencies, - Remove mention of `x-quickcheck` feature from the documentation, - Fixes #545.
2020-08-13openpgp: Implement ECDH and RSA encryptionIgor Matuszewski
2020-06-15openpgp: Don't rely on Nettle in select testsIgor Matuszewski
2020-06-08openpgp: Introduce feature flag for quickcheck.Nora Widdecke
- Make quickcheck dependency optional. - Make quickcheck a dev-dependency for tests. - Fix doctests for - cert::ValidCert::user_attributes, - cert::builder::CertBuilder::add_user_attribute, - cert::revoke::UserAttributeRevocationBuilder - cert::revoke::UserAttributeRevocationBuilder::build. Doctests do not use cfg(test), so we cannot use quickcheck in there.
2020-05-28openpgp: Change PKESK::decrypt to return an Option<_>.Justus Winter
- Returning rich errors from this function may compromise secret key material due to Bleichenbacher-style attacks. Change the API to prevent this. - Hat tip to Hanno Böck. - See #507.
2020-05-11openpgp: Use {to,from}_be_bytes.Nora Widdecke
- Replace bitshifts with the conversion functions from the standard library.
2020-04-08openpgp: Rename crypto::mpis to crypto::mpiIgor Matuszewski
To be consistent; we don't use plural forms for modules anywhere else and Rust always uses singular forms.
2020-04-03Change function names to align to Rust naming conventions.Wiktor Kwapisiewicz
- Change `mark_parts_public` to `parts_into_public`, - Change `mark_parts_public_ref` to `parts_as_public`, - Change `mark_parts_secret` to `parts_into_secret`, - Change `mark_parts_secret_ref` to `parts_as_secret`, - Change `mark_parts_unspecified` to `parts_into_unspecified`, - Change `mark_parts_unspecified_ref` to `parts_as_unspecified`, - Fixes #452.
2020-03-31openpgp: Implement Arbitrary for OnePassSig, PKESK.Justus Winter
2020-03-27openpgp: Define equality using the serialized OpenPGP form.Justus Winter
- All packets should be considered equal if the serialized OpenPGP form is equal, modulo framing (i.e. CTB type, packet length encoding, partial body chunking). - In cases this may lead to surprising outcomes, discuss this in the documentation, and provide additional equality predicates. - Fixes #92.
2020-03-26Remove redundant field names.Wiktor Kwapisiewicz
2020-03-03openpgp: Only impl Serialize for objects that are normally exported.Neal H. Walfield
- Add two new traits: `Marshal` and `MarshalInto`. - Implement them instead of `Serialize` and `SerializeInto`. - Only implement `Serialize` and `SerializeInto` for data structures that are normally exported. - This should prevent users from accidentally serializing a bare signature (`Signature`) when they meant to serialize a signature packet (`Packet`), for instance. - Fixes #368.
2020-02-18openpgp: Improve tracking of secret keys.Justus Winter
- We use marker traits to track with the type system if a Key has secret key material attached. Previously, it was possible to subvert that by taking the secret key material using Key4::set_secret, creating a Key4<SecretParts, ..> without any secrets. - Related, the accessor functions returned an Option<SecretKeyMaterial> even for Key4<SecretParts, ..>. - Replace set_secret by add_secret and take_secret that also change the Key's type accordingly. Make the accessors infallible if we know we have a secret key, rename Key4<P, R>::secret to Key4<P, R>::optional_secret to make the distinction clear. - Fixes #435.
2020-02-17openpgp: Make PKESK3::for_recipient polymorphic over key parts.Justus Winter
2020-02-12openpgp: Add optional cipher argument to PKESK3::decrypt.Justus Winter
2020-02-12openpgp: Add optional plaintext length to Decryptor::decrypt.Justus Winter
- If we know the length of the plaintext, we can reduce the side-channel leakage of the RSA decryption operation.
2020-01-16openpgp: Consolidate public key encryption code.Justus Winter
2020-01-08openpgp: Explicitly implement PartialEq, Hash for packets.Justus Winter
- We explicitly exclude the common fields. - See #92.
2019-12-05openpgp: Make crypto::{Signer,Decryptor} non-polymorphic.Justus Winter
- These are low-level cryptographic traits that are not concerned with the role of a key. - Fixes #382.
2019-12-03openpgp: Remove all calls to Time::canonicalize.Justus Winter
- Now that we store timestamps in OpenPGP's native encoding, the canonicalization happens when converting to it.
2019-11-28Call TPKs Certificates, update identifiers, documentation.Justus Winter
- Fixes #387.
2019-11-25openpgp: Rename openpgp::constants to openpgp::types.Justus Winter
- Fixes #381.
2019-11-22openpgp: Make constructors specific to their public parts.Justus Winter
2019-11-22openpgp: Make conversions into Key<SecretParts, _> fallible.Justus Winter
- Fixes #380.
2019-11-21openpgp: Replace time crate with std::time.Justus Winter
- In sq and sqv, use chrono to interface with the user. - Fixes #341.
2019-09-27linting: Clear up bare trait object warningsDaniel Silverstone
Newer Rust compilers requre `dyn` marking trait objects. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-23openpgp: Use marker types to denote a Key's type.Neal H. Walfield
- In addition to providing some added protection, this allows us to implement 'From<Key<_, _>> for Packet'.
2019-08-23openpgp: Rename SubkeyBinding to KeyBinding.Neal H. Walfield
- Also rename the `subkey` method to `key`.
2019-08-23openpgp: Rename SecretKey to SecretKeyMaterial.Neal H. Walfield
- When the `SecretKey` type only refers to the secret key material and not a TPK-like thing, call it `SecretKeyMaterial`.
2019-07-15Prepare for Rust 2018.Justus Winter
- 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.
2019-07-02openpgp: Simplify SessionKey::new.Justus Winter
2019-06-28openpgp: Rework protection of mpis::SecretKey.Justus Winter
- Introduce a new type, ProtectedMPI, that uses crypto::mem::Protected for storing the MPI. Change mpis::SecretKey to use this. - Fixes #181.
2019-06-28openpgp: Make struct MPI opaque.Justus Winter
2019-06-27openpgp: Rework secret key handling.Justus Winter
- Introduce two new types, `Encrypted` and `Unencrypted`, to make the fields of enum `SecretKey` private. Add accessors, implement From<..> to make the new types ergonomic to use, update callsites.
2019-06-24openpgp: Use SessionKey to protect secrets during ECDH.Justus Winter
2019-06-24openpgp: Rename functions to 'encrypt' and 'decrypt'.Justus Winter
2019-05-30openpgp: Make PKESK::decrypt use crypto::Decryptor.Justus Winter