From e8f2f7b24e260f96609f90f2bb30a3fb3fea1a69 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Thu, 28 Nov 2019 22:23:02 +0100 Subject: [PATCH] Do not accept prefer-encrypt=reset value from emails Reset is an internal value that received messages should not be able to set. Also return an error on any value other than "mutual" and "nopreference", errors are converted to NoPreference by the caller. --- src/aheader.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aheader.rs b/src/aheader.rs index 676ee9306..47e374aef 100644 --- a/src/aheader.rs +++ b/src/aheader.rs @@ -44,8 +44,8 @@ impl str::FromStr for EncryptPreference { fn from_str(s: &str) -> Result { match s { "mutual" => Ok(EncryptPreference::Mutual), - "reset" => Ok(EncryptPreference::Reset), - _ => Ok(EncryptPreference::NoPreference), + "nopreference" => Ok(EncryptPreference::NoPreference), + _ => Err(()), } } }