Disable padding support.

- Our method of padding messages is not universally supported by
    consuming implementations:

      https://tests.sequoia-pgp.org/#Packet_excess_consumption

  - Disable it for now.  Once we support generating v6 OpenPGP
    messages, we can enable it again with the new padding packet.
This commit is contained in:
Justus Winter 2023-11-24 12:31:20 +01:00
parent 3983d42953
commit 0499e25675
No known key found for this signature in database
GPG Key ID: 686F55B4AB2B3386
2 changed files with 4 additions and 1 deletions

View File

@ -172,7 +172,7 @@ pub struct Command {
#[clap(
long = "compression",
value_name = "KIND",
default_value_t = CompressionMode::Pad,
default_value_t = CompressionMode::None,
help = "Selects compression scheme to use",
value_enum,
)]
@ -198,6 +198,7 @@ pub enum EncryptionMode {
#[derive(ValueEnum, Debug, Clone)]
pub enum CompressionMode {
None,
#[cfg(all(unix, not(unix)))] // Bottom, but: `cfg` predicate key cannot be a literal
Pad,
Zip,
Zlib,

View File

@ -16,6 +16,7 @@ use openpgp::serialize::stream::LiteralWriter;
use openpgp::serialize::stream::Message;
use openpgp::serialize::stream::Recipient;
use openpgp::serialize::stream::Signer;
#[cfg(all(unix, not(unix)))] // Bottom, but: `cfg` predicate key cannot be a literal
use openpgp::serialize::stream::padding::Padder;
use openpgp::types::CompressionAlgorithm;
use openpgp::types::KeyFlags;
@ -186,6 +187,7 @@ pub fn encrypt<'a, 'b: 'a>(
match compression {
CompressionMode::None => (),
#[cfg(all(unix, not(unix)))] // Bottom, but: `cfg` predicate key cannot be a literal
CompressionMode::Pad => sink = Padder::new(sink).build()?,
CompressionMode::Zip => sink =
Compressor::new(sink).algo(CompressionAlgorithm::Zip).build()?,