diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-01-21 09:28:55 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-01-21 09:28:55 +0100 |
commit | b36219a18a1dab941bf48aeea508bae4d4858aad (patch) | |
tree | 3f3eaa6403a2520cdebf048e5dc2145352340fb9 /openpgp/src/cert/builder.rs | |
parent | 213f3204087f363c00d9ec42a48c034c6edeae1b (diff) |
openpgp: Enforce that KeyAmalgamations have a binding signature.
- ValidKeyIter enforces that KeyAmalgamations have a valid binding
signature.
- Enforce this constraint when constructing a KeyAmalgamation and
when modifying a KeyAmalgamation's policy.
Diffstat (limited to 'openpgp/src/cert/builder.rs')
-rw-r--r-- | openpgp/src/cert/builder.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/openpgp/src/cert/builder.rs b/openpgp/src/cert/builder.rs index 24172b0b..c5adc427 100644 --- a/openpgp/src/cert/builder.rs +++ b/openpgp/src/cert/builder.rs @@ -678,15 +678,15 @@ mod tests { .for_signing() .nth(0).unwrap(); assert!(ka.alive().is_ok()); - assert!(ka.clone().set_time(now + 290 * s).alive().is_ok()); - assert!(! ka.clone().set_time(now + 310 * s).alive().is_ok()); + assert!(ka.clone().set_time(now + 290 * s).unwrap().alive().is_ok()); + assert!(! ka.clone().set_time(now + 310 * s).unwrap().alive().is_ok()); let ka = cert.keys().policy(now).alive().revoked(false) .for_authentication() .nth(0).unwrap(); assert!(ka.alive().is_ok()); - assert!(ka.clone().set_time(now + 590 * s).alive().is_ok()); - assert!(! ka.clone().set_time(now + 610 * s).alive().is_ok()); + assert!(ka.clone().set_time(now + 590 * s).unwrap().alive().is_ok()); + assert!(! ka.clone().set_time(now + 610 * s).unwrap().alive().is_ok()); } #[test] @@ -708,7 +708,7 @@ mod tests { assert_eq!(cert.keys().policy(None).count(), 2); for ka in cert.keys().policy(None) { assert_eq!(ka.key().creation_time(), UNIX_EPOCH); - assert_eq!(ka.binding_signature().unwrap() + assert_eq!(ka.binding_signature() .signature_creation_time().unwrap(), UNIX_EPOCH); } |