summaryrefslogtreecommitdiffstats
path: root/openpgp/src/cert/builder.rs
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-06-19 14:46:06 +0200
committerNeal H. Walfield <neal@pep.foundation>2020-06-19 15:08:59 +0200
commit33dfdc57f5f785c3c28320bf45b3b267eec3a85a (patch)
treee0bdf14578d7cd3855721143864586400195ae36 /openpgp/src/cert/builder.rs
parent3146a41bf0d9cbc97412136df2035af436b8185f (diff)
openpgp: Change how SignatureBuilder emits the sig's creation time.
- Currently, `SignatureBuilder` sets the `Signature Creation Time` subpacket when it is instantiated, or uses any existing `Signature Creation Time` when it is converted using `From`. - This can be problematic: usually, we want the current time. - Change the behavior to emit a `Signature Creation Time` subpakcet when the signature is generated, unless this behavior is explicitly overridden.
Diffstat (limited to 'openpgp/src/cert/builder.rs')
-rw-r--r--openpgp/src/cert/builder.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/openpgp/src/cert/builder.rs b/openpgp/src/cert/builder.rs
index 4243cb2f..23c84792 100644
--- a/openpgp/src/cert/builder.rs
+++ b/openpgp/src/cert/builder.rs
@@ -923,7 +923,7 @@ impl CertBuilder {
self.primary.flags = self.primary.flags.set_certification(true);
}
- // Generate & and self-sign primary key.
+ // Generate & self-sign primary key.
let (primary, sig) = self.primary_key(creation_time)?;
let mut signer = primary.clone().into_keypair().unwrap();
@@ -936,7 +936,8 @@ impl CertBuilder {
}));
packets.push(sig.clone().into());
- let sig = signature::SignatureBuilder::from(sig.clone());
+ let sig = signature::SignatureBuilder::from(sig.clone())
+ .set_signature_creation_time(creation_time)?;
// Remove subpackets that needn't be copied into the binding
// signatures.