summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-02-20 13:26:01 +0100
committerNeal H. Walfield <neal@pep.foundation>2020-02-20 16:19:46 +0100
commit2164d2e3db8c66ab98164465eaf821eb7765a760 (patch)
tree081b05d1d974b972d339d0ab61f74fadecf9f1a5
parentf35f03635b319ece2c93f43db96ddc7cb30b5236 (diff)
openpgp: Rename the Amalgamation trait to ValidAmalgamation.
- The Amalgamation trait only applies to ValidComponents. Rename it accordingly.
-rw-r--r--autocrypt/src/lib.rs2
-rw-r--r--openpgp-ffi/src/cert.rs2
-rw-r--r--openpgp-ffi/src/parse/stream.rs2
-rw-r--r--openpgp/src/cert/amalgamation.rs4
-rw-r--r--openpgp/src/cert/builder.rs2
-rw-r--r--openpgp/src/cert/component_iter.rs4
-rw-r--r--openpgp/src/cert/components.rs2
-rw-r--r--openpgp/src/cert/key_amalgamation.rs7
-rw-r--r--openpgp/src/cert/keyiter.rs4
-rw-r--r--openpgp/src/cert/mod.rs6
-rw-r--r--openpgp/src/cert/revoke.rs4
-rw-r--r--openpgp/src/parse/stream.rs2
-rw-r--r--openpgp/src/serialize/cert.rs2
-rw-r--r--tool/src/commands/inspect.rs2
14 files changed, 23 insertions, 22 deletions
diff --git a/autocrypt/src/lib.rs b/autocrypt/src/lib.rs
index f2aee4e9..f5f5988c 100644
--- a/autocrypt/src/lib.rs
+++ b/autocrypt/src/lib.rs
@@ -27,7 +27,7 @@ pub use openpgp::Result;
use openpgp::Packet;
use openpgp::packet::SKESK;
use openpgp::Cert;
-use openpgp::cert::components::Amalgamation;
+use openpgp::cert::components::ValidAmalgamation;
use openpgp::parse::{
Parse,
PacketParserResult, PacketParser,
diff --git a/openpgp-ffi/src/cert.rs b/openpgp-ffi/src/cert.rs
index 0c4b2e83..988e958f 100644
--- a/openpgp-ffi/src/cert.rs
+++ b/openpgp-ffi/src/cert.rs
@@ -23,10 +23,10 @@ use self::openpgp::{
CertParser,
CertRevocationBuilder,
components::{
- Amalgamation,
KeyIter,
UserIDBundle,
UserIDBundleIter,
+ ValidAmalgamation,
ValidKeyIter,
},
},
diff --git a/openpgp-ffi/src/parse/stream.rs b/openpgp-ffi/src/parse/stream.rs
index 6e549352..9c6a8de5 100644
--- a/openpgp-ffi/src/parse/stream.rs
+++ b/openpgp-ffi/src/parse/stream.rs
@@ -16,7 +16,7 @@ use libc::{c_int, c_void, time_t};
extern crate sequoia_openpgp as openpgp;
use self::openpgp::{
- cert::components::Amalgamation,
+ cert::components::ValidAmalgamation,
crypto::SessionKey,
types::SymmetricAlgorithm,
packet::{
diff --git a/openpgp/src/cert/amalgamation.rs b/openpgp/src/cert/amalgamation.rs
index 5cd7e8b7..64f5adf3 100644
--- a/openpgp/src/cert/amalgamation.rs
+++ b/openpgp/src/cert/amalgamation.rs
@@ -200,7 +200,7 @@ impl<'a, C> ValidComponentAmalgamation<'a, C>
}
/// Represents a component under a given policy.
-pub trait Amalgamation<'a> {
+pub trait ValidAmalgamation<'a> {
/// Returns the certificate that the component came from.
fn cert(&self) -> &'a Cert;
@@ -377,7 +377,7 @@ pub trait Amalgamation<'a> {
}
}
-impl<'a, C> Amalgamation<'a> for ValidComponentAmalgamation<'a, C> {
+impl<'a, C> ValidAmalgamation<'a> for ValidComponentAmalgamation<'a, C> {
// NOTE: No docstring, because ComponentAmalgamation has the same method.
// Returns the certificate that the component came from.
fn cert(&self) -> &'a Cert {
diff --git a/openpgp/src/cert/builder.rs b/openpgp/src/cert/builder.rs
index a971c737..00676576 100644
--- a/openpgp/src/cert/builder.rs
+++ b/openpgp/src/cert/builder.rs
@@ -428,7 +428,7 @@ impl CertBuilder {
#[cfg(test)]
mod tests {
use super::*;
- use crate::cert::components::Amalgamation;
+ use crate::cert::components::ValidAmalgamation;
use crate::packet::signature::subpacket::{SubpacketTag, SubpacketValue};
use crate::types::PublicKeyAlgorithm;
use crate::policy::StandardPolicy as P;
diff --git a/openpgp/src/cert/component_iter.rs b/openpgp/src/cert/component_iter.rs
index 4776602d..ff844ac8 100644
--- a/openpgp/src/cert/component_iter.rs
+++ b/openpgp/src/cert/component_iter.rs
@@ -8,8 +8,8 @@ use crate::{
components::{
ComponentBundle,
ComponentBundleIter,
- Amalgamation,
ComponentAmalgamation,
+ ValidAmalgamation,
ValidComponentAmalgamation,
},
},
@@ -182,7 +182,7 @@ impl<'a, C> ValidComponentIter<'a, C> {
/// # use openpgp::Result;
/// # use openpgp::cert::CertBuilder;
/// use openpgp::types::RevocationStatus;
- /// use openpgp::cert::components::Amalgamation;
+ /// use openpgp::cert::components::ValidAmalgamation;
/// use sequoia_openpgp::policy::StandardPolicy;
///
/// # fn main() { f().unwrap(); }
diff --git a/openpgp/src/cert/components.rs b/openpgp/src/cert/components.rs
index e8c94376..3965e65f 100644
--- a/openpgp/src/cert/components.rs
+++ b/openpgp/src/cert/components.rs
@@ -25,8 +25,8 @@ use super::{
canonical_signature_order,
};
pub use super::amalgamation::{
- Amalgamation,
ComponentAmalgamation,
+ ValidAmalgamation,
ValidComponentAmalgamation,
};
pub use super::key_amalgamation::{
diff --git a/openpgp/src/cert/key_amalgamation.rs b/openpgp/src/cert/key_amalgamation.rs
index 6209ddce..f0e5c50b 100644
--- a/openpgp/src/cert/key_amalgamation.rs
+++ b/openpgp/src/cert/key_amalgamation.rs
@@ -7,8 +7,8 @@ use failure::ResultExt;
use crate::{
Cert,
cert::components::{
- Amalgamation,
KeyBundle,
+ ValidAmalgamation,
},
Error,
packet::key,
@@ -273,7 +273,8 @@ impl<'a, P: key::KeyParts> From<ValidKeyAmalgamation<'a, P>>
}
}
-impl<'a, P: 'a + key::KeyParts> Amalgamation<'a> for ValidKeyAmalgamation<'a, P>
+impl<'a, P: 'a + key::KeyParts> ValidAmalgamation<'a>
+ for ValidKeyAmalgamation<'a, P>
{
// NOTE: No docstring, because KeyAmalgamation has the same method.
// Returns the certificate that the component came from.
@@ -451,7 +452,7 @@ impl<'a, P: key::KeyParts> ValidPrimaryKeyAmalgamation<'a, P> {
}
}
-impl<'a, P: 'a + key::KeyParts> Amalgamation<'a>
+impl<'a, P: 'a + key::KeyParts> ValidAmalgamation<'a>
for ValidPrimaryKeyAmalgamation<'a, P>
{
// NOTE: No docstring, because KeyAmalgamation has the same method.
diff --git a/openpgp/src/cert/keyiter.rs b/openpgp/src/cert/keyiter.rs
index 8f6240eb..fd53e06b 100644
--- a/openpgp/src/cert/keyiter.rs
+++ b/openpgp/src/cert/keyiter.rs
@@ -12,9 +12,9 @@ use crate::{
cert::{
Cert,
components::{
- Amalgamation,
KeyBundle,
UnfilteredKeyBundleIter,
+ ValidAmalgamation,
},
KeyAmalgamation,
ValidKeyAmalgamation,
@@ -767,7 +767,7 @@ impl<'a, P: 'a + key::KeyParts> ValidKeyIter<'a, P>
/// # use openpgp::Result;
/// # use openpgp::cert::CertBuilder;
/// use openpgp::types::RevocationStatus;
- /// use openpgp::cert::components::Amalgamation;
+ /// use openpgp::cert::components::ValidAmalgamation;
/// use sequoia_openpgp::policy::StandardPolicy;
///
/// # fn main() { f().unwrap(); }
diff --git a/openpgp/src/cert/mod.rs b/openpgp/src/cert/mod.rs
index f34a2df7..988ef3fb 100644
--- a/openpgp/src/cert/mod.rs
+++ b/openpgp/src/cert/mod.rs
@@ -48,11 +48,11 @@ mod builder;
mod bindings;
pub mod components;
use components::{
- Amalgamation,
ComponentBundle,
PrimaryKeyBundle,
UnfilteredKeyBundleIter,
UnknownBundleIter,
+ ValidAmalgamation,
ValidComponentAmalgamation,
};
mod component_iter;
@@ -252,7 +252,7 @@ type UnknownBindings = ComponentBundles<Unknown>;
/// on self signatures can be used to express preferences for
/// algorithms and key management. Furthermore, the key holder's
/// OpenPGP implementation can express its feature set.
-pub trait Preferences<'a>: components::Amalgamation<'a> {
+pub trait Preferences<'a>: components::ValidAmalgamation<'a> {
/// Returns symmetric algorithms that the key holder prefers.
///
/// The algorithms are ordered according by the key holder's
@@ -1533,7 +1533,7 @@ impl<'a> CertAmalgamation<'a> {
#[cfg(test)]
mod test {
use crate::serialize::Serialize;
- use super::components::Amalgamation;
+ use super::components::ValidAmalgamation;
use crate::policy::StandardPolicy as P;
use crate::types::Curve;
use super::*;
diff --git a/openpgp/src/cert/revoke.rs b/openpgp/src/cert/revoke.rs
index bf0f40ad..523e9a24 100644
--- a/openpgp/src/cert/revoke.rs
+++ b/openpgp/src/cert/revoke.rs
@@ -274,7 +274,7 @@ impl Deref for SubkeyRevocationBuilder {
///
/// ```
/// # use sequoia_openpgp::{*, packet::*, types::*, cert::*};
-/// use sequoia_openpgp::cert::components::Amalgamation;
+/// use sequoia_openpgp::cert::components::ValidAmalgamation;
/// use sequoia_openpgp::policy::StandardPolicy;
///
/// # f().unwrap();
@@ -391,7 +391,7 @@ impl Deref for UserIDRevocationBuilder {
///
/// ```
/// # use sequoia_openpgp::{*, packet::*, types::*, cert::*};
-/// use sequoia_openpgp::cert::components::Amalgamation;
+/// use sequoia_openpgp::cert::components::ValidAmalgamation;
/// use sequoia_openpgp::policy::StandardPolicy;
///
/// # f().unwrap();
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs
index 06fd231c..ceca3e3c 100644
--- a/openpgp/src/parse/stream.rs
+++ b/openpgp/src/parse/stream.rs
@@ -44,7 +44,7 @@ use crate::{
packet::Signature,
Cert,
cert::components::{
- Amalgamation,
+ ValidAmalgamation,
ValidKeyAmalgamation,
},
crypto::SessionKey,
diff --git a/openpgp/src/serialize/cert.rs b/openpgp/src/serialize/cert.rs
index d7c94ab7..a74ebc35 100644
--- a/openpgp/src/serialize/cert.rs
+++ b/openpgp/src/serialize/cert.rs
@@ -664,7 +664,7 @@ impl<'a> SerializeInto for TSK<'a> {
mod test {
use super::*;
use crate::vec_truncate;
- use crate::cert::components::Amalgamation;
+ use crate::cert::components::ValidAmalgamation;
use crate::parse::Parse;
use crate::serialize::Serialize;
use crate::packet::key;
diff --git a/tool/src/commands/inspect.rs b/tool/src/commands/inspect.rs
index 3f8cd3bd..c0e038c6 100644
--- a/tool/src/commands/inspect.rs
+++ b/tool/src/commands/inspect.rs
@@ -4,7 +4,7 @@ use clap;
extern crate sequoia_openpgp as openpgp;
use crate::openpgp::{Packet, Result};
-use crate::openpgp::cert::components::Amalgamation;
+use crate::openpgp::cert::components::ValidAmalgamation;
use openpgp::packet::key::PublicParts;
use crate::openpgp::parse::{Parse, PacketParserResult};
use crate::openpgp::policy::Policy;