summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi
AgeCommit message (Collapse)Author
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.
2020-04-08openpgp: Specialize stream::Message, make Cookie private.Justus Winter
- Previously, Message was polymorphic over the cookie. However, the writer stack framework only has one user, and it likely ever will, so I don't really see the point in complicating our interface.
2020-04-08openpgp: Rename Encryptor::sym_algo to symmetric_algo.Justus Winter
- This aligns it with AED::symmetric_algo and SKESK::symmetric_algo.
2020-04-06openpgp: Rename as_slice to as_bytes.Nora Widdecke
- KeyID::as_slice and KeyID::from_bytes mirror each other. This should be reflected in the functions' names. Also, as_bytes is more descriptive. - Same for Fingerprint::as_slice and Fingerprint::as_bytes. - KeyHandle::as_slice renamed for consistency.
2020-04-06openpgp: Rename VerificationHelper::get_public_keys to get_certs.Justus Winter
2020-04-03openpgp: Rename ComponentBundleIter to ComponentAmalgamationIter.Neal H. Walfield
- Rename `ComponentBundleIter` to `ComponentAmalgamationIter` and `ValidComponentBundleIter` to `ValidComponentAmalgamationIter`. - Move module from cert::bundle to cert::amalgamation. - Fixes 8ebaf6e4ada1cea0b9e6f6dfee61c22cfdc9748c.
2020-04-03Release 0.16.0.v0.16.0Justus Winter
2020-04-03openpgp: Unawkwardify the streaming encryptor.Justus Winter
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-04-03openpgp: Convert `CertParser::from_packet_parser` to `From<PacketParserResult>`Wiktor Kwapisiewicz
2020-04-03openpgp: Convert Cert::from_packet_parser into TryFrom<PacketParserResult>Wiktor Kwapisiewicz
2020-04-03openpgp: Unify Message and writer::Stack, hide writers.Justus Winter
- Previously, Message::new returned a writer::Stack, and Message was just an empty struct. Unify the types. This makes sense, because if you have a message, and encrypt it, you get a message. - Make the writer module private. This is an implementation detail.
2020-04-03openpgp: Move key_amalgamation.rs to amalgamation/key.rs.Neal H. Walfield
2020-04-03openpgp: Rename KeyIter to KeyAmalgamationIterNeal H. Walfield
- Rename `KeyIter` to `KeyAmalgamationIter`, `ValidKeyIter` to `ValidKeyAmalgamationIter`. - Rename `cert/keyiter.rs` to `cert/amalgamation/iter.rs`.
2020-04-03openpgp: Rename ComponentIter to ComponentBundleIterNeal H. Walfield
- Rename `ComponentIter` to `ComponentBundleIter`, which is more accurate. - Rename the module from `cert/component_iter.rs` to `cert/bundle/iter.rs`.
2020-04-02openpgp-ffi: Use UserIDAmalgamations, not UserIDBundles.Neal H. Walfield
- Add the `UserID`, `UserIDAmalgamation` and `ValidUserIDAmalgamation` types, and some associated methods. - Replace the use of `UserIDBundle` with `UserIDAmalgamation` and `ValidUserIDAmalgamation`.
2020-04-02openpgp-ffo: Fix typo.Neal H. Walfield
2020-04-02openpgp-ffi: A Rust bool is a C _Bool, not a C int.Neal H. Walfield
- Cf. c4f087f886bd66f4177093569db615dc1c1e9e1d
2020-04-02openpgp: Move the writer module to serialize::stream.Justus Winter
2020-04-02openpgp: Drop Fingerprint::from_hex in favor of FromStr.Justus Winter
- See #462.
2020-04-02openpgp: Drop KeyID::from_hex in favor of FromStr.Justus Winter
- See #462.
2020-03-31ffi: Move around UNIX-specifix importIgor Matuszewski
2020-03-27openpgp: Explain binding signature lookup failures.Justus Winter
- If looking up a binding signature fails, don't merely return None, but an Err(_) that explains the lookup failure. For example, a binding signature may be present, but it may not meet the policy. - Fixes #460.
2020-03-26Remove redundant field names.Wiktor Kwapisiewicz
2020-03-26openpgp: Have validated components return a validated cert.Neal H. Walfield
- Change ValidAmalgamation::cert to return a `&ValidCert` instead of a `Cert`. - Fixes #454.
2020-03-25openpgp: Improve performance of detached signature verification.Justus Winter
- Previously, we transformed data and detached signatures into signed messages on the fly, then used the streaming Verifier to verify the message. However, this introduces a nontrivial overhead, even if unnecessary copies are carefully avoided. - Instead, specialize the streaming Decryptor to handle detached signatures. use crypto::hash_buffered_reader to compute the hashes over the data, then attach the computed signatures to the signature packets, and use Decryptor's verification machinery. - While this is arguably less elegant, it is much simpler, and a lot faster. Notably, if we operate on files and can mmap them into memory, we can compute the hash in one call to the compression function. Verification of detached signatures is an important use case, so this speedup outweighs the loss of elegance. - Fixes #457.
2020-03-23openpgp-ffi: Add pgp_valid_key_amalgamation_with_policy.Neal H. Walfield
- Expose ValidKeyAmalgamation::with_policy in the C FFI.
2020-03-20openpgp: Add a function to set the expiry of subkeys using the FFI.Neal H. Walfield
- Expose `ValidKeyAmalgamation::set_expiration_time` to the C FFI.
2020-03-20openpgp-ffi: Change key iterator to return key amalgamations.Neal H. Walfield
- Introduce `KeyAmalgamation` and `ValidKeyAmalgamation` to the C FFI. - Change pgp_cert_key_iter_next and pgp_cert_valid_key_iter_next to return them instead of keys.
2020-03-20openpgp: Remove `to_hex` in KeyHandle, KeyID and Fingerprint.Wiktor Kwapisiewicz
- Replace all usages of `to_hex` with formatting string with :X specifier. - Fixes #456.
2020-03-18openpgp-ffi: Add pgp_cert_builder_set_creation_time.Neal H. Walfield
2020-03-13openpgp-ffi, ffi: Prevent capturing of c-tests's output.Justus Winter
- By explicitly printing to stderr, we can avoid the test's output from being captured by Rust's test framework.