summaryrefslogtreecommitdiffstats
path: root/guide
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2019-11-09 23:55:02 +0100
committerNeal H. Walfield <neal@pep.foundation>2019-11-10 00:05:23 +0100
commitb8e5ef908ee211daee84a0782a115ae7fc003ec0 (patch)
tree360698ced26dc36aad015e11b89137d613b89208 /guide
parent365862ed513057900c0d6c106ec51dff0a09693e (diff)
openpgp: Distinguish bad signatures from those that are not alive.
- Return a different `VerificationResult` for signatures that are not alive (BadSignature) from signatures that are actually bad (BadCheck).
Diffstat (limited to 'guide')
-rw-r--r--guide/src/chapter_01.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/guide/src/chapter_01.md b/guide/src/chapter_01.md
index 76fee1a9..fad70067 100644
--- a/guide/src/chapter_01.md
+++ b/guide/src/chapter_01.md
@@ -119,6 +119,9 @@ fn main() {
# match results.get(0) {
# Some(VerificationResult::GoodChecksum(..)) =>
# good = true,
+# Some(VerificationResult::NotAlive(_)) =>
+# return Err(failure::err_msg(
+# "Good, but not alive signature")),
# Some(VerificationResult::MissingKey(_)) =>
# return Err(failure::err_msg(
# "Missing key to verify signature")),
@@ -261,6 +264,9 @@ fn generate() -> openpgp::Result<openpgp::TPK> {
# match results.get(0) {
# Some(VerificationResult::GoodChecksum(..)) =>
# good = true,
+# Some(VerificationResult::NotAlive(_)) =>
+# return Err(failure::err_msg(
+# "Good, but not alive signature")),
# Some(VerificationResult::MissingKey(_)) =>
# return Err(failure::err_msg(
# "Missing key to verify signature")),
@@ -403,6 +409,9 @@ fn sign(sink: &mut Write, plaintext: &str, tsk: &openpgp::TPK)
# match results.get(0) {
# Some(VerificationResult::GoodChecksum(..)) =>
# good = true,
+# Some(VerificationResult::NotAlive(_)) =>
+# return Err(failure::err_msg(
+# "Good, but not alive signature")),
# Some(VerificationResult::MissingKey(_)) =>
# return Err(failure::err_msg(
# "Missing key to verify signature")),
@@ -556,6 +565,9 @@ impl<'a> VerificationHelper for Helper<'a> {
match results.get(0) {
Some(VerificationResult::GoodChecksum(..)) =>
good = true,
+ Some(VerificationResult::NotAlive(_)) =>
+ return Err(failure::err_msg(
+ "Good, but not alive signature")),
Some(VerificationResult::MissingKey(_)) =>
return Err(failure::err_msg(
"Missing key to verify signature")),