summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-03-31 15:45:49 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-03-31 18:26:02 +0200
commitfab2a27aaf99a6e05057e8aaea6c5d0a949dca92 (patch)
treeb4aae1201adf33542d4c34448be86c14323554a1
parente86bcf0d1055a98949bfbb2c73d6d538845a0401 (diff)
openpgp: Implement Arbitrary for OnePassSig, PKESK.
-rw-r--r--openpgp/src/packet/one_pass_sig.rs6
-rw-r--r--openpgp/src/packet/pkesk.rs6
2 files changed, 12 insertions, 0 deletions
diff --git a/openpgp/src/packet/one_pass_sig.rs b/openpgp/src/packet/one_pass_sig.rs
index d3ff5fa8..dc40cf64 100644
--- a/openpgp/src/packet/one_pass_sig.rs
+++ b/openpgp/src/packet/one_pass_sig.rs
@@ -166,6 +166,12 @@ impl<'a> std::convert::TryFrom<&'a Signature> for OnePassSig3 {
}
}
+impl Arbitrary for super::OnePassSig {
+ fn arbitrary<G: Gen>(g: &mut G) -> Self {
+ OnePassSig3::arbitrary(g).into()
+ }
+}
+
impl Arbitrary for OnePassSig3 {
fn arbitrary<G: Gen>(g: &mut G) -> Self {
let mut ops = OnePassSig3::new(SignatureType::arbitrary(g));
diff --git a/openpgp/src/packet/pkesk.rs b/openpgp/src/packet/pkesk.rs
index 996b5a7a..b08dc8e2 100644
--- a/openpgp/src/packet/pkesk.rs
+++ b/openpgp/src/packet/pkesk.rs
@@ -171,6 +171,12 @@ impl From<PKESK3> for Packet {
}
}
+impl Arbitrary for super::PKESK {
+ fn arbitrary<G: Gen>(g: &mut G) -> Self {
+ PKESK3::arbitrary(g).into()
+ }
+}
+
impl Arbitrary for PKESK3 {
fn arbitrary<G: Gen>(g: &mut G) -> Self {
let (ciphertext, pk_algo) = loop {