summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi/src
AgeCommit message (Collapse)Author
2020-11-27openpgp: Add Cert::merge_public and Cert::merge_public_and_secret.Justus Winter
- Secret key material is not authenticated by OpenPGP, so care must be taken when merging certificates. - Rename Cert::merge to Cert::merge_public_and_secret. - Add new function Cert::merge_public. This function can be used to merge certificates from untrusted sources as it ignores secret key material that cannot be authenticated by OpenPGP. - Fixes #584.
2020-11-26openpgp: Add a lifetime to CertBuilder.Justus Winter
- This will allow us to use the CertBuilder to change certificates with detached secret keys in the future. - Fixes #608.
2020-11-11openpgp-ffi: Add test.Justus Winter
- See #611.
2020-11-06ffi, openpgp-ffi: Handle non_exhaustive enum.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-14Use 'Examples' for the examples section.Justus Winter
- See #480.
2020-10-14Replace most 'extern crate' directives with 'use'.Justus Winter
- See #480.
2020-10-13openpgp-ffi: Make pgp_key_pair_as_signer consume the key pair.Justus Winter
- This was actually assumed by pgp_signer_new, leading to a double free if the key pair was later freed.
2020-10-13openpgp-ffi: Fix leak.Justus Winter
2020-10-09ffi: Add key flag accessors for ValidKeyAmalgamation.Neal H. Walfield
- Add pgp_valid_key_amalgamation_for_certification, pgp_valid_key_amalgamation_for_signing, pgp_valid_key_amalgamation_for_authentication, pgp_valid_key_amalgamation_for_storage_encryption, and pgp_valid_key_amalgamation_for_transport_encryption.
2020-10-09openpgp: Make Recipient::set_keyid easier to use.Justus Winter
2020-10-02openpgp: Rename Cert::merge_packets to Cert::insert_packets.Justus Winter
- This is closer to collection types such as HashMap, and distinguishes the function from Cert::merge that merges two certificates. - See #572.
2020-09-22openpgp: Hide stream::Encryptor::aead_algo from public API.Wiktor Kwapisiewicz
- Mark `aead_algo` as available only during tests, - Remove support for AEAD from `sop`, - Mark `aead` parameter in FFI as unused, - openpgp-ffi: Drop `aead_algo` argument from `pgp_encryptor_new`, - Fixes #550.
2020-09-21ffi: Fix improper_ctypes_definitions warnings.Nora Widdecke
- Rust 1.46.0 warns that the callback function types are not FFI-safe. This declares them `extern fn`, as the compiler suggests.
2020-09-16openpgp: Update backsig when changing expiration time.Justus Winter
- When updating the expiration time of signing-capable subkeys, also create a new primary key binding signature. - Fixes #534.
2020-08-12openpgp: Change accessors to return all issuers.Neal H. Walfield
- Unlike the `Signature Creation Time` subpacket, there are legitimate reasons to have multiple `Issuer` subpackets and `Issuer Fingerprint` subpackets. - Rename `SubpacketAreas::issuer` to `SubpacketAreas::issuers` and return all `Issuer` subpackets. - Likewise, Rename `SubpacketAreas::issuer_fingerprint` to `SubpacketAreas::issuer_fingerprints` and return all `Issuer Fingerprint` subpackets. - Change `sq` to list all issuers. Deduplicate first, however.
2020-08-05openpgp: Don't implement Default for the Bitflags types.Justus Winter
- See #525.
2020-08-03openpgp: Don't use doc comments with macros.Neal H. Walfield
- rustc 1.43 considers this an error.
2020-06-17openpgp-ffi: Wrap the password handling functionality.Neal H. Walfield
- Wrap functions to create a password-protected certificate (`pgp_cert_builder_set_password`), and to work with keys that are password protected (`pgp_key_has_unencrypted_secret`, `pgp_key_decrypt_secret`).
2020-06-17openpgp-ffi: Forward the inspect callback to the wrapped helper.Neal H. Walfield
- When implementing `VerificationHelper` for `DHelper`, we forgot to forward the `inspect` callback to the wrapped `vhelper`. - Do it.
2020-06-17openpgp-ffi: Restore convenience function.Neal H. Walfield
- Restore the function `pgp_cert_revoke_in_place`.
2020-06-17openpgp-ffi: Change return type.Neal H. Walfield
- Change `pgp_user_id_amalgamation_user_id` and `pgp_valid_user_id_amalgamation_user_id` to return a `pgp_packet_t`, not a `pgp_user_id_t`. - Most functions work with `pgp_packet_t`s, not `pgp_user_id_t`s.
2020-05-28openpgp: Change the `decrypt` proxy in the decryption helper.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. - Fixes #507.
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-28openpgp-ffi: Make pgp_cert_parser_from_bytes' buffer argument const.Alexander Kjäll
2020-05-25ffi: Gracefully handle encrypted secret keys in pgp_pkesk_decrypt.Justus Winter
- Fixes #510.
2020-05-13openpgp: Unawkwardify Encryptor::add_password.Justus Winter
2020-05-08openpgp: Don't make CertParser generic over the iterator's typeNeal H. Walfield
- Fix `CertParser::iter`'s type to be a `Box<'a + Iterator<Item=Result<Packet>>>` rather than trying to be generic.
2020-05-08openpgp: Remove the PacketSource::PacketParser variant.Neal H. Walfield
- Now that `PacktSource::Iter` returns a `Result<Packet>` instead of a `Packet`, we can implement `PacketSource::PacketParser` in terms of `PacktSource::Iter`.
2020-05-08openpgp: Change CertParser to take a fallible iteratorNeal H. Walfield
- Change `CertParser` to take a fallible iterator. - This change allows the iterator to propagate parse errors as such. Otherwise, parse errors are indistinguishable from EOF.
2020-05-07openpgp: Use a builder to construct Decryptor.Justus Winter
- See #498.
2020-05-07openpgp: Use a builder to construct Verifier.Justus Winter
- See #498.
2020-05-07openpgp: Use a builder to construct DetachedVerifier.Justus Winter
- See #498.
2020-05-06openpgp: Streamline iteration over MessageStructure.Justus Winter
- Implement IntoIter and Deref to &'a [MessageLayer<'a>], drop the custom iteration structs.
2020-05-06openpgp: Don't merge signatures in Cert::set_expiration_time.Justus Winter
- Align Cert::set_expiration_time with KeyAmalgamation::set_expiration_time, i.e. return the signatures instead of merging them directly. - Fixes #491.
2020-04-29openpgp: Fix ValidKeyAmalgamation::set_expiration_time's return typeNeal H. Walfield
- Change `ValidKeyAmalgamation::set_expiration_time` to return a `Result<Vec<Signature>>` instead of a `Result<Vec<Packet>>`.
2020-04-29openpgp: Change Cert::merge_packets to take an IntoIterator.Neal H. Walfield
- Change `Cert::merge_packets` to take an `IntoIterator` instead of a vector. - This change simplifies the most common case of passing in a single packet, and doesn't make the second most common case of passing in a vector of packets any more complicated.
2020-04-28openpgp: Convert `Cert::from_packet_pile` into `TryFrom`Wiktor Kwapisiewicz
- Drop `Cert::from_packet_pile`. - Fixes #462.
2020-04-28openpgp: Rework Cert::revoke_in_place.Neal H. Walfield
- Rename `Cert::revoke_in_place` to `Cert::revoke`. - Return the revocation certificate; don't merge it. - Fixes #485.
2020-04-28openpgp: Rename Cert::revoked, etc. to revocation_statusNeal H. Walfield
- Rename `Cert::revoked`, `ValidCert::revoked`, `ValidAmalgamation::revoked`, and `ComponentBundle::revoked` to revocation_status to more accurately match what it does. - Don't rename `ValidComponentAmalgamationIter::revoked` or `ValidKeyAmalgamationIter::revoked`. They don't return the revocation status; they check whether the key is revoked.
2020-04-26openpgp: Add a reference time to Cert::set_expiration_time.Neal H. Walfield
- Don't assume that the current binding signature should be used; include a reference time.
2020-04-20openpgp: Add armor::Writer::with_headers.Justus Winter
- Add a new constructor that takes headers. This allows us to make the header argument polymorphic.
2020-04-16Revert "openpgp: Make PacketParserResult a std::result::Result."Justus Winter
This reverts commit 2e1eec5fe4157a391a13554ff7df3075cfe043cc.
2020-04-15openpgp: Drop Cert::primary_userid.Justus Winter
- Fixes #484.
2020-04-15openpgp: Drop Cert::alive.Justus Winter
- See #484.
2020-04-10openpgp: Make cert::amalgamation::key a public moduleNeal H. Walfield
- Make `cert::amalgamation::key` a public module. - Move `cert::amalgamation::keyiter` to `cert::amalgamation::key::iter`. Have `cert::amalgamation::key` export its public symbols.
2020-04-09openpgp: Make PacketParserResult a std::result::Result.Justus Winter
- This avoids the partial implementation imitating std::option::Option, replacing it with std::result::Result. - As a benefit, std::result::Result is in the prelude, simplifying a lot of parsing loops.
2020-04-08openpgp: Add some type aliases.Neal H. Walfield
2020-04-08openpgp: Move methods mapping and inspect to VerificationHelper.Justus Winter
2020-04-08openpgp: Change key's role function names.Wiktor Kwapisiewicz
- Change `mark_role_primary` to `role_into_primary`. - Change `mark_role_primary_ref` to `role_as_primary`. - Change `mark_role_subordinate` to `role_into_subordinate`. - Change `mark_role_subordinate_ref` to `role_as_subordinate`. - Change `mark_role_unspecified` to `role_into_unspecified`. - Change `mark_role_unspecified_ref` to `role_as_unspecified`. - Fixes #452.