Port to Sequoia 0.20.0.

parent 2c5097db
This diff is collapsed.
......@@ -21,7 +21,7 @@ indicatif = { version = "0.12" }
lazy_static = "1.4"
rayon = "1.2"
rlimit = "0.2.1"
sequoia-openpgp = "0.19"
sequoia-openpgp = "0.20"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tempfile = "3.1"
......
......@@ -69,7 +69,7 @@ impl EncryptDecryptRoundtrip {
cert.primary_key()
.key().clone().parts_into_secret()?.into_keypair()?;
let new_sig = uid.bind(&mut primary_keypair, &cert, builder)?;
let cert = cert.merge_packets(Some(new_sig))?;
let cert = cert.insert_packets(Some(new_sig))?;
let key = cert.as_tsk().to_vec()?;
let cert = cert.to_vec()?;
......
......@@ -87,11 +87,8 @@ impl ConsumerTest for RecipientIDs {
let recipients =
cert.keys().with_policy(crate::tests::P, None)
.for_transport_encryption()
.map(|key| {
let mut r = Recipient::from(key);
r.set_keyid(openpgp::KeyID::wildcard());
r
});
.map(|key| Recipient::from(key)
.set_keyid(openpgp::KeyID::wildcard()));
let message = Encryptor::for_recipients(message, recipients)
.symmetric_algo(SymmetricAlgorithm::AES256)
.build()?;
......@@ -109,11 +106,8 @@ impl ConsumerTest for RecipientIDs {
let recipients =
cert.keys().with_policy(crate::tests::P, None)
.for_transport_encryption()
.map(|key| {
let mut r = Recipient::from(key);
r.set_keyid(cert.keyid());
r
});
.map(|key| Recipient::from(key)
.set_keyid(cert.keyid()));
let message = Encryptor::for_recipients(message, recipients)
.symmetric_algo(SymmetricAlgorithm::AES256)
.build()?;
......@@ -131,11 +125,8 @@ impl ConsumerTest for RecipientIDs {
let recipients =
cert.keys().with_policy(crate::tests::P, None)
.for_transport_encryption()
.map(|key| {
let mut r = Recipient::from(key);
r.set_keyid("AAAA BBBB CCCC DDDD".parse().unwrap());
r
});
.map(|key| Recipient::from(key)
.set_keyid("AAAA BBBB CCCC DDDD".parse().unwrap()));
let message = Encryptor::for_recipients(message, recipients)
.symmetric_algo(SymmetricAlgorithm::AES256)
.build()?;
......
......@@ -3,7 +3,10 @@ use std::time::{Duration, SystemTime};
use sequoia_openpgp as openpgp;
use openpgp::{
armor,
crypto::S2K,
crypto::{
S2K,
mpi::SecretKeyChecksum,
},
types::{
Features,
HashAlgorithm,
......@@ -16,7 +19,6 @@ use openpgp::{
signature::{SignatureBuilder, subpacket::*},
},
parse::Parse,
serialize::SerializeInto,
};
use crate::{
......@@ -229,6 +231,7 @@ impl ConsumerTest for DetachedPrimary {
primary.clone()
.add_secret(key::SecretKeyMaterial::Encrypted(
key::Encrypted::new(stub, 0.into(),
Some(SecretKeyChecksum::SHA1),
vec![].into()))).0
.into()
},
......@@ -253,11 +256,6 @@ impl ConsumerTest for DetachedPrimary {
make_test("SecKey[0xff stub] SecSubkey", vec![
{
// Some minor trickery to change the S2K usage
// field from 0xfe (i.e. SHA1-checksum'ed, what
// Sequoia emits) to 0xff (16 bit checksum, what
// GnuPG emits for stubs). Of course, the stub is
// not checksum'ed at all.
let stub = S2K::Unknown {
tag: 101,
parameters:
......@@ -267,15 +265,12 @@ impl ConsumerTest for DetachedPrimary {
0x55, // 'U'
1].into()),
};
let mut buf = openpgp::Packet::from(primary.clone()
primary.clone()
.add_secret(key::SecretKeyMaterial::Encrypted(
key::Encrypted::new(stub, 0.into(),
Some(SecretKeyChecksum::Sum16),
vec![].into()))).0
).to_vec()?;
let o = buf.len() - 8; // Offset of S2K usage field.
assert_eq!(buf[o], 0xfe);
buf[o] = 0xff;
openpgp::Packet::from_bytes(&buf)?
.into()
},
userid.clone().into(),
userid_binding.clone().into(),
......
......@@ -654,7 +654,7 @@ impl DetachedSignVerifyRoundtrip {
.key().clone().parts_into_secret()?.into_keypair()?;
let new_sig = uid.bind(
&mut primary_keypair, &cert, builder)?;
let cert = cert.merge_packets(Some(new_sig))?;
let cert = cert.insert_packets(Some(new_sig))?;
let key = cert.as_tsk().to_vec()?;
let cert = cert.to_vec()?;
......
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