mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 14:56:33 +03:00
refactor: do not chain Autocrypt key verification to parsing
.and_then() and Ok() are unnecessary here.
This commit is contained in:
@@ -108,13 +108,11 @@ impl FromStr for Aheader {
|
|||||||
.remove("keydata")
|
.remove("keydata")
|
||||||
.context("keydata attribute is not found")
|
.context("keydata attribute is not found")
|
||||||
.and_then(|raw| {
|
.and_then(|raw| {
|
||||||
SignedPublicKey::from_base64(&raw).context("autocrypt key cannot be decoded")
|
SignedPublicKey::from_base64(&raw).context("Autocrypt key cannot be decoded")
|
||||||
})
|
|
||||||
.and_then(|key| {
|
|
||||||
key.verify_bindings()
|
|
||||||
.and(Ok(key))
|
|
||||||
.context("Autocrypt key cannot be verified")
|
|
||||||
})?;
|
})?;
|
||||||
|
public_key
|
||||||
|
.verify_bindings()
|
||||||
|
.context("Autocrypt key cannot be verified")?;
|
||||||
|
|
||||||
let prefer_encrypt = attributes
|
let prefer_encrypt = attributes
|
||||||
.remove("prefer-encrypt")
|
.remove("prefer-encrypt")
|
||||||
|
|||||||
Reference in New Issue
Block a user