diff options
Diffstat (limited to 'tool/src/commands/sign.rs')
-rw-r--r-- | tool/src/commands/sign.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tool/src/commands/sign.rs b/tool/src/commands/sign.rs index 51b098b7..59b1a3c1 100644 --- a/tool/src/commands/sign.rs +++ b/tool/src/commands/sign.rs @@ -109,7 +109,7 @@ fn sign_data(input: &mut dyn io::Read, output_path: Option<&str>, signer } else { // We want to wrap the data in a literal data packet. - LiteralWriter::new(signer, None, None, None) + LiteralWriter::new(signer).build() .context("Failed to create literal writer")? }; @@ -238,9 +238,15 @@ fn sign_message(input: &mut dyn io::Read, output_path: Option<&str>, }; // Create a literal writer to wrap the data in a literal // message packet. - let mut literal = - LiteralWriter::new(sink, l.format(), l.filename(), - l.date().map(|d| *d)) + let mut literal = LiteralWriter::new(sink).format(l.format()); + if let Some(f) = l.filename() { + literal = literal.filename(f)?; + } + if let Some(d) = l.date() { + literal = literal.date(*d)?; + } + + let mut literal = literal.build() .context("Failed to create literal writer")?; // Finally, just copy all the data. |