diff options
author | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2022-06-09 09:06:46 +0200 |
---|---|---|
committer | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2022-06-09 13:26:08 +0200 |
commit | dd44935e5a6ef1011d6ec6bc9bd7722187e511ec (patch) | |
tree | 313b8dad400fd1701d0038664bd6f0bd0bdb8758 /autocrypt/src | |
parent | aea7ba1a94ace78b1011b202e9884abccdab4012 (diff) |
openpgp: Rename PacketParser::{set_,}encrypted to processed.
- Convert `encrypted` to `processed`.
- Since `set_encrypted` is internal API it was directly renamed without
forwarder stub.
- `encrypted()` is public API thus the old function is converted to a
forwarder of the negation of `processed()`.
- `unprocessed()` marked as deprecated.
- Update docs and NEWS file.
- Fixes #845.
Diffstat (limited to 'autocrypt/src')
-rw-r--r-- | autocrypt/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/autocrypt/src/lib.rs b/autocrypt/src/lib.rs index e50dfd2b..392ded21 100644 --- a/autocrypt/src/lib.rs +++ b/autocrypt/src/lib.rs @@ -683,7 +683,7 @@ impl<'a> AutocryptSetupMessageParser<'a> { /// `AutocryptSetupMessageParser::parse()` to extract the /// `AutocryptSetupMessage`. pub fn decrypt(&mut self, passcode: &Password) -> Result<()> { - if ! self.pp.encrypted() { + if self.pp.processed() { return Err( Error::InvalidOperation("Already decrypted".into()).into()); } @@ -707,7 +707,7 @@ impl<'a> AutocryptSetupMessageParser<'a> { /// If the payload is malformed, returns /// `Error::MalformedMessage`. pub fn parse(self) -> Result<AutocryptSetupMessage> { - if self.pp.encrypted() { + if ! self.pp.processed() { return Err( Error::InvalidOperation("Not decrypted".into()).into()); } |