summaryrefslogtreecommitdiffstats
path: root/openpgp
AgeCommit message (Collapse)Author
2023-10-26openpgp: Upgrade lalrpopPeter Michael Green
- Fixes #1060.
2023-10-26openpgp: Upgrade idnaNeal H. Walfield
2023-10-26openpgp: Drop generic-array direct dependencyNeal H. Walfield
- Use `cipher`'s reexport of `generic-array` instead of directly depending on `generic-array` and having to worry about synchronizing the versions.
2023-10-26openpgp: Upgrade ed25519Neal H. Walfield
2023-10-26openpgp: Upgrade dsaNeal H. Walfield
2023-10-26openpgp: Upgrade criterion from 0.4 to 0.5Alexander Kjäll
2023-10-26openpgp: Tighten win-crypto-ng version rangeNeal H. Walfield
- Require version 0.5.1.
2023-10-24openpgp: Upgrade regex-syntax.Neal H. Walfield
- Upgrade regex-syntax to 0.8. - Fixes #1056.
2023-10-13openpgp: Improve documentation.Neal H. Walfield
- `Cert::from_str`, `Cert::from_reader`, `Cert::from_file`, and `Cert::from_bytes` return an error if the input contains multiple certificates. - Improve the documentation to make that clearer, and suggest the use of `CertParser` to parse keyrings.
2023-10-11openpgp: Add non-allocating accessors for parsed User ID components.Justus Winter
- Now that we use OnceCell for the cache, we can hand out references to the cached data. This closes the gap between UserID and ConventionallyParsedUserID, hence I think this addresses the concern in #377. - Deprecate the allocating variants. - Fixes #377.
2023-10-10openpgp: Use OnceCell to cache the parsed user id.Justus Winter
- Behaves the same, but is much nicer.
2023-10-10openpgp: Add fuzz targets.Justus Winter
2023-10-10openpgp: Add a null crypto backend for fuzzing.Justus Winter
- Fixes #962.
2023-10-10openpgp: Drop assertion that does not hold.Justus Winter
- Instead, just accept that if other signature types come in, we miscompute the hash, and we'll reject the signature later on.
2023-10-06openpgp: Use CertBuilder::new() in doc tests to count reliably.David Runge
Adapt the doc tests of `KeyAmalgamationIter::secret()`, `KeyAmalgamationIter::unencrypted_secret()`, `ValidKeyAmalgamationIter::secret()` and `ValidKeyAmalgamationIter::unencrypted_secret()` to make use of `CertBuilder::new()` instead of `CertBuilder::general_purpose()` to be able to test for the amount of found keys more reliably. Signed-off-by: David Runge <dave@sleepmap.de>
2023-10-06openpgp: Add encrypted_secret filter for ValidKeyAmalgamationIter.David Runge
Add the new filter `encrypted_secret` to filter on whether secret key material is present and encrypted. Remove the `secret` field of `ValidKeyAmalgamationIter` and alter `ValidKeyAmalgamationIter::secret()` to set both `encrypted_secret` and `unencrypted_secret` to `Some(true)`. Closes https://gitlab.com/sequoia-pgp/sequoia/-/issues/1040 Signed-off-by: David Runge <dave@sleepmap.de>
2023-10-06openpgp: Add encrypted_secret filter for KeyAmalgamationIter.David Runge
- Add the private function `skip_secret()` to evaluate whether a secret key is skipped during filtering and provide a message in that case. - Add the new filter `encrypted_secret` to filter on whether secret key material is present and encrypted. Make use of the `skip_secret()` function to evaluate whether a key is skipped when filtering or not. - Remove the `secret` field of `KeyAmalgamationIter` and alter `KeyAmalgamationIter::secret()` to set both `encrypted_secret` and `unencrypted_secret` to `Some(true)`. Closes https://gitlab.com/sequoia-pgp/sequoia/-/issues/1040 Signed-off-by: David Runge <dave@sleepmap.de>
2023-10-02openpgp: Test that v3 revocation signatures are honored.Justus Winter
- Fixes #954.
2023-10-02openpgp: Only add issuer fingerprint information to v4 and up sigs.Justus Winter
2023-10-02openpgp: Update comment.Justus Winter
- We don't actually stop, and doing that seems like an optimization for a very unlikely case.
2023-10-02openpgp: Avoid clone.Justus Winter
2023-09-29openpgp: Change the hex parsing to accept odd number of nibbles.Justus Winter
- This came up as the new leak tests use our hex parsing functions to parse /proc/self/maps and apparently Linux will drop leading zeros from addresses. - Fix this by allowing these functions to operate on an odd number of nibbles. I see no reason no reason not to do that, except for the fact that we don't want to establish that it is okay to drop leading zeros from key IDs and fingerprints, hence I preserved the behavior of parsing key IDs and fingerprints.
2023-09-27openpgp: Fix SignatureBuilder::signature_expiration_time.Justus Winter
- SignatureBuilder::signature_expiration_time is broken. This is because SignatureBuilder doesn't actually implement signature_expiration_time. Instead, it is resolved via a Deref to the SubpacketAreas::signature_expiration_time. That function returns: creation_time subpacket + expiration_time subpacket, but the actual creation time in a SignatureBuilder may not yet have propagated to the subpacket area! - Fixes #998.
2023-09-27openpgp: Only mark creation time as overwritten once it really is.Justus Winter
2023-09-27openpgp: Impl Eq for Regex, RegexSet, add accessors for the raw REs.Justus Winter
- Fixes #973.
2023-09-26openpgp: Test for secret leaks during encryption and decryption.Justus Winter
2023-09-26openpgp: Zero the stack after using RustCrypto's block ciphers.Justus Winter
- Zeroing the stack is not something that upstream necessarily considers their responsibility, hence we need to do it. In any case, there is a bug in current versions of the AES crate that spills the symmetric key into the stack when using AES-NI or the ARMv8 Cryptography Extensions. - See https://github.com/RustCrypto/block-ciphers/issues/385.
2023-09-26openpgp: More ergonomic and robust interface to zero stacks.Justus Winter
- This is only effective if the value is computed by a function that is never inlined. Add a macro that takes care of that.
2023-09-26openpgp: Heap-allocate the ed25519_dalek::SigningKey.Justus Winter
- Stack allocated values may be moved freely by the Rust compiler leaving traces of the secret laying around the stack. Zeroize doesn't help with that. Heap allocate the secret instead, which prevents the moves.
2023-09-22openpgp: Add tests that scan for secrets leaking into the heap.Justus Winter
- Fixes #989.
2023-09-22openpgp: Enable the zeroize feature in the RustCrypto crates.Justus Winter
- Unfortunately, in all of the cipher crates other than the aes crate this doesn't do anything besides enabling cipher/zeroize.
2023-09-22openpgp: Clear the array after copying it to protected memory.Justus Winter
2023-09-22openpgp: Deduplicate code.Justus Winter
2023-09-22openpgp: Zero the stack after signing using ed25519-dalek.Justus Winter
2023-09-22openpgp: Enable the zeroize feature in the Dalek crates.Justus Winter
2023-09-21openpgp: Fix Encryptor's lifetime parameter.Neal H. Walfield
- `Encryptor` uses a single lifetime for two fields, which is too restrictive in some situations. - To avoid breaking the API, introduce `Encryptor2`, which is just `Encryptor` renamed, and with an added lifetime parameter, and make `Encryptor` a thin wrapper around `Encryptor2`. - Deprecate `Encryptor`. - See #1028.
2023-09-20openpgp: Compute one hash per signer in the streaming Singer.Justus Winter
- This way, we can accommodate signers with disjoint acceptable hash algorithm sets. - This also re-enables the use of Signer::hash_algo to select a preferred hash algorithm, if that is supported by the signer. - Fixes #1043 and #1045.
2023-09-20openpgp: Provide guidance on how to use sequoia-openpgp.Justus Winter
- Provide guidance for leaf crate and intermediate crates on how to use sequoia-openpgp, and how to handle the cryptographic backend features. - Fixes #987.
2023-09-19openpgp: Commit to two-pass processing of CSF messages.Justus Winter
- Previously, we did buffer the whole message, but the implementation was done in a way that would have allowed a constant-space operation with some more effort (maybe considerable). However, the crypto-refresh abandons the idea of doing one-pass processing of CSF messages on the basis that these kind of messages are meant to be human-readable, and hence should easily fit into memory. This means that we no longer need to know the hash functions (and salt in case of v6 signatures) before seeing the body, and indeed v6 CSF messages will no longer include any Hash headers.
2023-09-15Bump MSRV to 1.67.Wiktor Kwapisiewicz
- Fixes https://gitlab.com/sequoia-pgp/sequoia/-/issues/1038
2023-09-13openpgp: Drop the dependency on sha-1.Justus Winter
- When using the RustCrypto backend, we can avoid the dependency on sha-1 by relying on sha1collisiondetection. - See also #1051.
2023-09-12openpgp: Fix building without compression support.Justus Winter
2023-09-11openpgp: Migrate from x25519-dalek-ng to x25519-dalek v2.Wiktor Kwapisiewicz
- Fixes https://gitlab.com/sequoia-pgp/sequoia/-/issues/1051.
2023-09-05openpgp: Reuse `super::Backend::x25519_generate_key` in `generate_ecc`.Wiktor Kwapisiewicz
2023-09-05openpgp: Provide better error messages on curve25519 clamp failures.Wiktor Kwapisiewicz
2023-09-05openpgp: Upgrade ed25519_dalek to version 2.Wiktor Kwapisiewicz
- This solves the following issue reported to ed25519_dalek: https://rustsec.org/advisories/RUSTSEC-2022-0093 - Upgrade win_crypto_ng so that it allows usage of rand_core that is compatible with both win_crypto_ng and ed25519_dalek: https://github.com/emgre/win-crypto-ng/pull/48
2023-09-04openpgp: Implement conversion from const size arrays for Protected.Wiktor Kwapisiewicz
- This type of array is used by ed25519-dalek crate.
2023-09-04openpgp: Fix returning secret key as the public keyWiktor Kwapisiewicz
- Add regression unit test to catch this type of mistake in other backends.
2023-08-24openpgp: Add primary key binding signature to auth subkeys.Justus Winter
- Fixes #1019.
2023-08-24openpgp: Hand the plaintext length to decrypt_unwrap, if known.Justus Winter
- When using classical ECDH with the upcoming SEIPDv2, we cannot determine the expected plaintext length by looking at the cipher octet, because that is not included in the plaintext. Instead, we know it from the header of the SEIPDv2 packet, and hand the expected length to the low-level decryption functions.