diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2021-08-24 12:54:16 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2021-08-27 12:58:07 +0200 |
commit | 83e6668ed4b5692a0a52174031f99c1e76726f77 (patch) | |
tree | 14f455534e38c79df895d8abf9dac424fe3bbce0 /openpgp | |
parent | e5746684e84377dd8828f6a5a8ab4c0eec73c3ec (diff) |
ffi, openpgp: Cleanup links after cargo intraconv.
- openpgp: Make broken relative links absolute:
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+packet),\1crate::packet,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+cert),\1crate::cert,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+parse),\1crate::parse,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+policy),\1crate::policy,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+serialize),\1crate::serialize,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+armor),\1crate::armor,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+types),\1crate::types,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!] *(\[`PacketPile`\]):).*$,\1 crate::PacketPile,' {} +
- openpgp: Link to PacketParser and Policy structs, not the modules.
- ffi: Make links to sequoia_openpgp and sequoia_net absolute
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+sequoia_openpgp),\1sequoia_openpgp,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+sequoia_net),\1sequoia_net,' {} +
Diffstat (limited to 'openpgp')
42 files changed, 354 insertions, 373 deletions
diff --git a/openpgp/src/cert.rs b/openpgp/src/cert.rs index 15afacac..77c99091 100644 --- a/openpgp/src/cert.rs +++ b/openpgp/src/cert.rs @@ -113,19 +113,19 @@ //! [`ComponentAmalgamation`]: amalgamation::ComponentAmalgamation //! [`Parser` implementation]: struct.Cert.html#impl-Parse%3C%27a%2C%20Cert%3E //! [`Serialize` implementation]: struct.Cert.html#impl-Serialize%3C%27a%2C%20Cert%3E -//! [`UserID::certify`]: super::packet::UserID::certify() -//! [`UserAttribute::certify`]: super::packet::user_attribute::UserAttribute::certify() +//! [`UserID::certify`]: crate::packet::UserID::certify() +//! [`UserAttribute::certify`]: crate::packet::user_attribute::UserAttribute::certify() //! [`KeyAmalgamation`]: amalgamation::key -//! [`UserID::bind`]: super::packet::UserID::bind() -//! [`UserAttribute::bind`]: super::packet::user_attribute::UserAttribute::bind() -//! [`Key::bind`]: super::packet::Key::bind() -//! [`Signature::verify_direct_key`]: super::packet::Signature::verify_direct_key() -//! [`Signature::verify_userid_binding`]: super::packet::Signature::verify_userid_binding() -//! [`Signature::verify_user_attribute_binding`]: super::packet::Signature::verify_user_attribute_binding() +//! [`UserID::bind`]: crate::packet::UserID::bind() +//! [`UserAttribute::bind`]: crate::packet::user_attribute::UserAttribute::bind() +//! [`Key::bind`]: crate::packet::Key::bind() +//! [`Signature::verify_direct_key`]: crate::packet::Signature::verify_direct_key() +//! [`Signature::verify_userid_binding`]: crate::packet::Signature::verify_userid_binding() +//! [`Signature::verify_user_attribute_binding`]: crate::packet::Signature::verify_user_attribute_binding() //! [`ValidAmalgamation::revocation_keys`]: amalgamation::ValidAmalgamation::revocation_keys -//! [`Signature::verify_primary_key_revocation`]: super::packet::Signature::verify_primary_key_revocation() -//! [`Signature::verify_userid_revocation`]: super::packet::Signature::verify_userid_revocation() -//! [`Signature::verify_user_attribute_revocation`]: super::packet::Signature::verify_user_attribute_revocation() +//! [`Signature::verify_primary_key_revocation`]: crate::packet::Signature::verify_primary_key_revocation() +//! [`Signature::verify_userid_revocation`]: crate::packet::Signature::verify_userid_revocation() +//! [`Signature::verify_user_attribute_revocation`]: crate::packet::Signature::verify_user_attribute_revocation() use std::io; use std::collections::btree_map::BTreeMap; @@ -498,9 +498,9 @@ pub trait Preferences<'a>: seal::Sealed { /// signatures, and third-party revocations, as well as useful methods. /// /// [TPK and TSK data structures]: https://tools.ietf.org/html/rfc4880#section-11 -/// [`Key`]: super::packet::Key -/// [`UserID`]: super::packet::UserID -/// [`UserAttribute`]: super::packet::user_attribute::UserAttribute +/// [`Key`]: crate::packet::Key +/// [`UserID`]: crate::packet::UserID +/// [`UserAttribute`]: crate::packet::user_attribute::UserAttribute /// /// `Cert`s are canonicalized in the sense that their `Component`s are /// deduplicated, and their signatures and revocations are @@ -521,7 +521,7 @@ pub trait Preferences<'a>: seal::Sealed { /// secret key material, it is essential to first strip the secret key /// material from copies that came from an untrusted source. /// -/// [`Key::public_cmp`]: super::packet::Key::public_cmp() +/// [`Key::public_cmp`]: crate::packet::Key::public_cmp() /// /// Signatures are deduplicated using [their `Eq` implementation], /// which compares the data that is hashed and the MPIs. That is, it @@ -532,7 +532,7 @@ pub trait Preferences<'a>: seal::Sealed { /// This policy prevents an attacker from flooding a certificate with /// valid signatures that only differ in their unhashed data. /// -/// [their `Eq` implementation]: super::packet::Signature#a-note-on-equality +/// [their `Eq` implementation]: crate::packet::Signature#a-note-on-equality /// [the unhashed data]: https://tools.ietf.org/html/rfc4880#section-5.2.3 /// /// Self signatures and self revocations are checked for validity by @@ -549,10 +549,10 @@ pub trait Preferences<'a>: seal::Sealed { /// verification method, e.g., [`Signature::verify_userid_binding`] /// or [`Signature::verify_userid_revocation`]. /// -/// [`Policy`]: super::policy -/// [digest prefix]: super::packet::signature::Signature4::digest_prefix() -/// [`Signature::verify_userid_binding`]: super::packet::Signature::verify_userid_binding() -/// [`Signature::verify_userid_revocation`]: super::packet::Signature::verify_userid_revocation() +/// [`Policy`]: crate::policy::Policy +/// [digest prefix]: crate::packet::signature::Signature4::digest_prefix() +/// [`Signature::verify_userid_binding`]: crate::packet::Signature::verify_userid_binding() +/// [`Signature::verify_userid_revocation`]: crate::packet::Signature::verify_userid_revocation() /// /// If a signature or a revocation is not valid, /// we check to see whether it is simply out of place (i.e., belongs @@ -582,7 +582,7 @@ pub trait Preferences<'a>: seal::Sealed { /// data or generate a signature. Refer to [`Key::decrypt_secret`] /// for details. /// -/// [`Key::decrypt_secret`]: super::packet::Key::decrypt_secret() +/// [`Key::decrypt_secret`]: crate::packet::Key::decrypt_secret() /// /// # Filtering Certificates /// @@ -791,7 +791,7 @@ impl Cert { /// [`Key::decrypt_secret`] for details. /// /// [`Cert::keys`]: Cert::keys() - /// [`Key::decrypt_secret`]: super::packet::Key::decrypt_secret() + /// [`Key::decrypt_secret`]: crate::packet::Key::decrypt_secret() /// /// # Examples /// @@ -836,7 +836,7 @@ impl Cert { /// - There is a valid [hard revocation] (even if it is not live /// at time `t`, and even if there is a newer self signature). /// - /// [hard revocation]: super::types::RevocationType::Hard + /// [hard revocation]: crate::types::RevocationType::Hard /// /// Note: certificates and subkeys have different revocation /// criteria from [User IDs and User Attributes]. @@ -1136,7 +1136,7 @@ impl Cert { /// /// [`Cert::primary_key`]: Cert::primary_key() /// [`KeyAmalgamationIter::subkeys`]: amalgamation::key::KeyAmalgamationIter::subkeys() - /// [`Key::decrypt_secret`]: super::packet::Key::decrypt_secret() + /// [`Key::decrypt_secret`]: crate::packet::Key::decrypt_secret() /// /// # Examples /// @@ -1329,7 +1329,7 @@ impl Cert { /// appropriate. This means that **if you serialize the resulting /// packets, the secret key material will be serialized too**. /// - /// [`TSK`]: serialize::TSK + /// [`TSK`]: crate::serialize::TSK /// [`SecretKey`]: Packet::SecretKey /// [`SecretSubkey`]: Packet::SecretSubkey /// @@ -2800,10 +2800,9 @@ impl Cert { /// is alive (see [`ValidCert::alive`]) or revoked (see /// [`ValidCert::revoked`]). /// - /// [`ValidCert`]: cert::ValidCert - /// [`ValidateAmalgamation`]: cert::amalgamation::ValidateAmalgamation - /// [`ValidCert::alive`]: cert::ValidCert::alive() - /// [`ValidCert::revoked`]: cert::ValidCert::revoked() + /// [`ValidateAmalgamation`]: amalgamation::ValidateAmalgamation + /// [`ValidCert::alive`]: ValidCert::alive() + /// [`ValidCert::revoked`]: ValidCert::revoked() /// /// # Examples /// @@ -2980,7 +2979,7 @@ impl IntoIterator for Cert /// the certificate or any component is live. If you care about those /// things, then you need to check them separately. /// -/// [`Policy`]: super::policy +/// [`Policy`]: crate::policy::Policy /// [`Cert::with_policy`]: Cert::with_policy() /// /// # Examples @@ -3185,7 +3184,7 @@ impl<'a> ValidCert<'a> { /// - There is a valid [hard revocation] (even if it is not live /// at time `t`, and even if there is a newer self signature). /// - /// [hard revocation]: super::types::RevocationType::Hard + /// [hard revocation]: crate::types::RevocationType::Hard /// /// Note: certificates and subkeys have different revocation /// criteria from [User IDs and User Attributes]. @@ -3281,7 +3280,7 @@ impl<'a> ValidCert<'a> { /// can be used to decrypt data or generate a signature. Refer to /// [`Key::decrypt_secret`] for details. /// - /// [`Key::decrypt_secret`]: super::packet::Key::decrypt_secret() + /// [`Key::decrypt_secret`]: crate::packet::Key::decrypt_secret() /// /// # Examples /// @@ -3327,7 +3326,7 @@ impl<'a> ValidCert<'a> { /// [`Key::decrypt_secret`] for details. /// /// [`ValidKeyAmalgamationIter::subkeys`]: amalgamation::key::ValidKeyAmalgamationIter::subkeys() - /// [`Key::decrypt_secret`]: super::packet::Key::decrypt_secret() + /// [`Key::decrypt_secret`]: crate::packet::Key::decrypt_secret() /// /// # Examples /// @@ -3515,7 +3514,7 @@ impl<'a> ValidCert<'a> { /// the primary User ID. See the documentation of /// [`ValidCert::primary_userid`] for details. /// - /// [`ValidCert::primary_userid`]: IntoIter::primary_userid() + /// [`ValidCert::primary_userid`]: ValidCert::primary_userid() /// /// # Examples /// diff --git a/openpgp/src/cert/amalgamation.rs b/openpgp/src/cert/amalgamation.rs index b721acb6..b8db814c 100644 --- a/openpgp/src/cert/amalgamation.rs +++ b/openpgp/src/cert/amalgamation.rs @@ -210,12 +210,12 @@ //! ``` //! //! [`ComponentBundle`]: super::bundle -//! [`Signature`]: super::super::packet::signature +//! [`Signature`]: crate::packet::signature //! [`Cert`]: super //! [is supposed to]: https://tools.ietf.org/html/rfc4880#section-5.2.3.3 //! [`std::iter::map`]: std::iter::Map //! [MD5 collisions]: https://en.wikipedia.org/wiki/MD5 -//! [`Policy`]: super::super::policy +//! [`Policy`]: crate::policy::Policy //! [streaming verifier]: ../../parse/stream.html //! [Intended Recipients]: https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-09.html#name-intended-recipient-fingerpr //! [signature expirations]: https://tools.ietf.org/html/rfc4880#section-5.2.3.10 @@ -685,7 +685,7 @@ pub trait ValidAmalgamation<'a, C: 'a>: seal::Sealed /// [`Cert::userids`]: super::Cert::userids() /// [`Cert::primary_userid`]: super::Cert::primary_userid() /// [`Cert::user_attributes`]: super::Cert::user_attributes() -/// [`Cert::unknowns`]: super::Cert::unknown() +/// [`Cert::unknowns`]: super::Cert::unknowns() /// [`ComponentAmalgamation::with_policy`]: ValidateAmalgamation::with_policy() /// [See the module's documentation]: self #[derive(Debug, PartialEq)] @@ -1231,7 +1231,7 @@ where C: IntoIterator<Item = S>, /// # Ok(()) } /// ``` /// -/// [`Policy`]: super::super::policy +/// [`Policy`]: crate::policy::Policy #[derive(Debug)] pub struct ValidComponentAmalgamation<'a, C> { ca: ComponentAmalgamation<'a, C>, diff --git a/openpgp/src/cert/amalgamation/iter.rs b/openpgp/src/cert/amalgamation/iter.rs index a677aa37..afb20212 100644 --- a/openpgp/src/cert/amalgamation/iter.rs +++ b/openpgp/src/cert/amalgamation/iter.rs @@ -80,7 +80,7 @@ use crate::{ /// [`ComponentAmalgamationIter::with_policy`]: ComponentAmalgamationIter::with_policy() /// [`Cert::userids`]: super::Cert::userids() /// [`Cert::user_attributes`]: super::Cert::user_attributes() -/// [`Cert::unknowns`]: super::Cert::unknown() +/// [`Cert::unknowns`]: super::Cert::unknowns() /// [`Cert::keys`]: super::Cert::keys() pub struct ComponentAmalgamationIter<'a, C> { cert: &'a Cert, @@ -145,6 +145,8 @@ impl<'a, C> ComponentAmalgamationIter<'a, C> { /// Refer to the [`ValidateAmalgamation`] trait for a definition /// of a valid component. /// + /// [`ValidateAmalgamation`]: super::ValidateAmalgamation + /// /// # Examples /// /// ``` @@ -370,7 +372,7 @@ impl<'a, C> ValidComponentAmalgamationIter<'a, C> { /// However, this filter implements a typical policy, and does not /// preclude using `filter` to realize alternative policies. /// - /// [`RevocationStatus::Revoked`]: super::super::types::RevocationStatus::Revoked + /// [`RevocationStatus::Revoked`]: crate::types::RevocationStatus::Revoked pub fn revoked<T>(mut self, revoked: T) -> Self where T: Into<Option<bool>> { diff --git a/openpgp/src/cert/amalgamation/key.rs b/openpgp/src/cert/amalgamation/key.rs index 1e1c643c..d5c99153 100644 --- a/openpgp/src/cert/amalgamation/key.rs +++ b/openpgp/src/cert/amalgamation/key.rs @@ -237,12 +237,12 @@ //! ``` //! //! [`ComponentAmalgamation`]: super::ComponentAmalgamation -//! [`Key`]: super::super::super::packet::key +//! [`Key`]: crate::packet::key //! [`Cert::keys`]: super::super::Cert::keys() //! [`PrimaryKeyAmalgamation`]: super::PrimaryKeyAmalgamation //! [`SubordinateKeyAmalgamation`]: super::SubordinateKeyAmalgamation //! [`ErasedKeyAmalgamation`]: super::ErasedKeyAmalgamation -//! [`KeyRole::UnspecifiedRole`]: super::super::super::packet::key::KeyRole +//! [`KeyRole::UnspecifiedRole`]: crate::packet::key::KeyRole //! [`Policy` discussion]: super //! [This discussion]: https://crypto.stackexchange.com/a/12138 use std::time; @@ -432,8 +432,8 @@ pub trait PrimaryKey<'a, P, R>: seal::Sealed /// /// [`ComponentAmalgamation`]: super::ComponentAmalgamation /// [see the module's documentation]: self -/// [`Cert::primary_key`]: super::super::super::cert::Cert::primary_key() -/// [`Cert::keys`]: super::super::super::cert::Cert::keys() +/// [`Cert::primary_key`]: crate::cert::Cert::primary_key() +/// [`Cert::keys`]: crate::cert::Cert::keys() /// [`ValidateAmalgamation`]: super::ValidateAmalgamation /// [`KeyAmalgamation::with_policy`]: super::ValidateAmalgamation::with_policy() #[derive(Debug)] @@ -492,7 +492,7 @@ pub type SubordinateKeyAmalgamation<'a, P> /// to the type system. For details, see the [module-level /// documentation]. /// -/// [`Key`]: super::super::super::packet::key +/// [`Key`]: crate::packet::key /// [`KeyBundle`]: super::super::bundle /// [module-level documentation]: self pub type ErasedKeyAmalgamation<'a, P> @@ -915,7 +915,7 @@ impl<'a, P, R, R2> KeyAmalgamation<'a, P, R, R2> /// /// [`ValidComponentAmalgamation`]: super::ValidComponentAmalgamation /// [`ComponentAmalgamation`]: super::ComponentAmalgamation -/// [`Policy`]: super::super::super::policy +/// [`Policy`]: crate::policy::Policy /// [`ValidAmalgamation`]: super::ValidAmalgamation /// [`ValidAmalgamation::binding_signature`]: super::ValidAmalgamation::binding_signature() /// [`ValidateAmalgamation::with_policy`]: super::ValidateAmalgamation::with_policy @@ -1308,7 +1308,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// /// For a definition of liveness, see the [`key_alive`] method. /// - /// [`key_alive`]: super::super::super::packet::signature::subpacket::SubpacketAreas::key_alive() + /// [`key_alive`]: crate::packet::signature::subpacket::SubpacketAreas::key_alive() /// /// # Examples /// @@ -1928,7 +1928,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// # Ok(()) } /// ``` /// - /// [`ValidKeyAmalgamation::key_flags`]: PrimaryKey::key_flags() + /// [`ValidKeyAmalgamation::key_flags`]: ValidKeyAmalgamation::key_flags() pub fn has_any_key_flag<F>(&self, flags: F) -> bool where F: Borrow<KeyFlags> { @@ -1981,7 +1981,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// ``` /// /// [Section 12.1 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-5.2.3.21 - /// [`ValidKeyAmalgamation::key_flags`]: PrimaryKey::key_flags() + /// [`ValidKeyAmalgamation::key_flags`]: ValidKeyAmalgamation::key_flags() pub fn for_certification(&self) -> bool { self.has_any_key_flag(KeyFlags::empty().set_certification()) } @@ -2014,7 +2014,7 @@ impl<'a, P, R, R2> ValidKeyAmalgamation<'a, P, R, R2> /// # Ok(()) } /// ``` /// - /// [`ValidKeyAmalgamation::key_flags`]: PrimaryKey::key_flags() + /// [`ValidKeyAmalgamation::key_flags`]: ValidKeyAmalgamation::key_flags() pub fn for_signing(&self) -> bool { self.has_any_key_flag(KeyFlags::empty().set_signing()) } @@ -2047,7 +2047,7 @@ impl<'a, P, R, R2> Va |