Port to Sequoia 0.15.0.

parent fe9c6a81
......@@ -632,7 +632,7 @@ dependencies = [
[[package]]
name = "nettle"
version = "5.0.3"
version = "6.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -710,7 +710,7 @@ dependencies = [
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rlimit 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"sequoia-openpgp 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
"sequoia-openpgp 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -1106,7 +1106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "sequoia-openpgp"
version = "0.14.0"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -1119,7 +1119,7 @@ dependencies = [
"lalrpop-util 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"memsec 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"nettle 5.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"nettle 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"quickcheck 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -1542,7 +1542,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9"
"checksum memsec 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ccabb92f665f997bcb4f3ade019a8e07315148d8bcef3e65fbc5dbd65a22eb04"
"checksum miniz_oxide 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6f3f74f726ae935c3f514300cc6773a0c9492abc5e972d42ba0c0ebb88757625"
"checksum nettle 5.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c40aad15a496df1ae843b5ca10cef328e64d04854404464f464fd5e11aa6d77d"
"checksum nettle 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6fd54cf3d08c0437fa65b09721983a87c447da440fb02b497292bdcab1632a4f"
"checksum nettle-sys 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b8629333ff5f3b74d251dae253e383cda9242410fac4244a4fe855469be101fb"
"checksum new_debug_unreachable 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f40f005c60db6e03bae699e414c58bf9aa7ea02a2d0b9bfbcf19286cc4c82b30"
"checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6"
......@@ -1598,7 +1598,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d"
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
"checksum sequoia-openpgp 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a21df36cb0b83413e1f1e5ad15a295aaedcd1e464fd0f575115abef9b4b852ca"
"checksum sequoia-openpgp 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "48a87738b1408d284f3e272c8d1ad0d954f154a0398ce1ed42a206d2d1c91cee"
"checksum serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4b39bd9b0b087684013a792c59e3e07a46a01d2322518d8a1104641a0b1be0"
"checksum serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8"
"checksum serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)" = "2f72eb2a68a7dc3f9a691bfda9305a1c017a6215e5a4545c258500d2099a37c2"
......
......@@ -21,7 +21,7 @@ indicatif = { version = "0.12" }
lazy_static = "1.4"
rayon = "1.2"
rlimit = "0.2.1"
sequoia-openpgp = "0.14"
sequoia-openpgp = "0.15"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tempfile = "3.1"
......
use failure::ResultExt;
use sequoia_openpgp as openpgp;
use openpgp::cert::components::Amalgamation;
use openpgp::cert::prelude::*;
use openpgp::types::{Features, KeyFlags};
use openpgp::parse::Parse;
use openpgp::serialize::SerializeInto;
......@@ -51,7 +51,7 @@ impl EncryptDecryptRoundtrip {
-> Result<EncryptDecryptRoundtrip>
{
// Change the cipher preferences of CERT.
let uid = cert.primary_userid(super::p(), None).unwrap();
let uid = cert.primary_userid(super::P, None).unwrap();
let mut builder = openpgp::packet::signature::Builder::from(
uid.binding_signature().clone())
.set_preferred_symmetric_algorithms(vec![cipher])?;
......@@ -137,11 +137,11 @@ impl ProducerConsumerTest for EncryptDecryptRoundtrip {
let mut algos = Vec::new();
'search: for p in pp.children() {
if let openpgp::Packet::PKESK(p) = p {
for ka in cert.keys().with_policy(super::p(), None).secret()
for ka in cert.keys().with_policy(super::P, None).secret()
.key_flags(mode.clone())
{
let mut keypair = ka.key().clone().into_keypair()?;
if let Ok((a, _)) = p.decrypt(&mut keypair) {
if let Ok((a, _)) = p.decrypt(&mut keypair, None) {
if a == cipher {
ok = true;
break 'search;
......
use sequoia_openpgp as openpgp;
use openpgp::cert::components::Amalgamation;
use openpgp::cert::prelude::*;
use openpgp::types::{
Features,
KeyFlags,
......@@ -103,7 +103,7 @@ impl ConsumerTest for EncryptionKeyFlags {
self.cert.primary_key()
.key().clone().mark_parts_secret()?.into_keypair()?;
let uid =
self.cert.userids().with_policy(super::p(), None).nth(0).unwrap();
self.cert.userids().with_policy(super::P, None).nth(0).unwrap();
let cert_stem: Vec<openpgp::Packet> = vec![
self.cert.primary_key().key().clone().into(),
uid.userid().clone().into(),
......
......@@ -55,7 +55,7 @@ impl ConsumerTest for CompressionSupport {
use CompressionAlgorithm::*;
for &c in &[Uncompressed, Zip, Zlib, BZip2] {
let recipient: Recipient =
cert.keys().with_policy(super::p(), None)
cert.keys().with_policy(super::P, None)
.for_transport_encryption()
.nth(0).unwrap().key().into();
......
......@@ -3,7 +3,7 @@ use std::convert::TryInto;
use failure::ResultExt;
use sequoia_openpgp as openpgp;
use openpgp::cert::components::Amalgamation;
use openpgp::cert::prelude::*;
use openpgp::types::{HashAlgorithm, SignatureType};
use openpgp::parse::Parse;
use openpgp::serialize::{Serialize, SerializeInto};
......@@ -455,7 +455,7 @@ impl DetachedSignVerifyRoundtrip {
-> Result<DetachedSignVerifyRoundtrip>
{
// Change the hash algorithm preferences of CERT.
let uid = cert.primary_userid(super::p(), None).unwrap();
let uid = cert.primary_userid(super::P, None).unwrap();
let builder = openpgp::packet::signature::Builder::from(
uid.binding_signature().clone())
.set_preferred_hash_algorithms(vec![hash])?;
......
......@@ -89,7 +89,7 @@ impl ConsumerTest for MessageStructure {
match layer {
'e' => {
let r: Recipient =
cert.keys().with_policy(super::p(), None)
cert.keys().with_policy(super::P, None)
.for_transport_encryption()
.nth(0).unwrap().key().into();
stack =
......@@ -103,7 +103,7 @@ impl ConsumerTest for MessageStructure {
},
's' => {
let signer =
cert.keys().with_policy(super::p(), None).for_signing().secret()
cert.keys().with_policy(super::P, None).for_signing().secret()
.nth(0).unwrap().key().clone()
.into_keypair().unwrap();
stack =
......@@ -173,7 +173,7 @@ impl ConsumerTest for RecursionDepth {
{
let r: Recipient =
cert.keys().with_policy(super::p(), None).for_transport_encryption()
cert.keys().with_policy(super::P, None).for_transport_encryption()
.nth(0).unwrap().key().into();
let stack = Message::new(&mut b);
......@@ -243,7 +243,7 @@ impl ConsumerTest for MarkerPacket {
marker.serialize(&mut b)?;
{
let signer =
cert.keys().with_policy(super::p(), None)
cert.keys().with_policy(super::P, None)
.for_signing().secret()
.nth(0).unwrap().key().clone()
.into_keypair().unwrap();
......@@ -257,11 +257,11 @@ impl ConsumerTest for MarkerPacket {
}, {
let test = "Marker + Encrypted Message";
let r: Recipient =
cert.keys().with_policy(super::p(), None)
cert.keys().with_policy(super::P, None)
.for_transport_encryption()
.nth(0).unwrap().key().into();
let signer =
cert.keys().with_policy(super::p(), None)
cert.keys().with_policy(super::P, None)
.for_signing().secret()
.nth(0).unwrap().key().clone()
.into_keypair().unwrap();
......
use sequoia_openpgp as openpgp;
use openpgp::policy::{Policy, StandardPolicy};
use openpgp::policy::StandardPolicy;
use crate::{
Data,
......@@ -20,14 +20,7 @@ mod messages;
mod ecc;
/// A StandardPolicy for the tests to use.
fn p() -> &'static dyn Policy {
/// XXX: This is a const fn in later versions of Sequoia.
lazy_static::lazy_static! {
static ref P: StandardPolicy = StandardPolicy::new();
}
&*P
}
const P: &StandardPolicy = &StandardPolicy::new();
/// Metadata for the tests.
pub trait Test {
......
......@@ -82,7 +82,7 @@ impl ConsumerTest for SymmetricEncryptionSupport {
{
let recipient: Recipient =
cert.keys().with_policy(super::p(), None)
cert.keys().with_policy(super::P, None)
.for_transport_encryption()
.nth(0).unwrap().key().into();
let msg = format!("Encrypted using {:?}.", cipher)
......@@ -95,7 +95,7 @@ impl ConsumerTest for SymmetricEncryptionSupport {
Ok(stack) => stack,
Err(_) => {
let recipient: Recipient =
cert.keys().with_policy(super::p(), None)
cert.keys().with_policy(super::P, None)
.for_transport_encryption()
.nth(0).unwrap().key().into();
// Cipher is not supported by Sequoia, look
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment