diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2024-05-03 15:02:28 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2024-05-29 15:53:49 +0200 |
commit | 448dbc12f5fd4bd8d90ef7d9d4d616723b983462 (patch) | |
tree | 6a77df6fc9b2bc63c0d1f60d3202fda081265fe3 /openpgp | |
parent | e7f7361a9030e7b129e61d409b96bea92db2e60b (diff) |
openpgp: Allow deconstructing Unknown packets into the parse error.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/NEWS | 1 | ||||
-rw-r--r-- | openpgp/src/packet/unknown.rs | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/openpgp/NEWS b/openpgp/NEWS index 876d5b6f..0e50791d 100644 --- a/openpgp/NEWS +++ b/openpgp/NEWS @@ -32,6 +32,7 @@ - Key::<UnknownParts, _>::steal_secret - Key4::<PublicParts, _>::steal_secret - Key4::<UnknownParts, _>::steal_secret + - packet::Unknown::into_error - The RustCrypto backend now supports ECDH and ECDSA over the NIST curve P-384. - The RustCrypto backend now supports ECDH and ECDSA over the NIST diff --git a/openpgp/src/packet/unknown.rs b/openpgp/src/packet/unknown.rs index 48b7da1e..7216bf19 100644 --- a/openpgp/src/packet/unknown.rs +++ b/openpgp/src/packet/unknown.rs @@ -153,6 +153,11 @@ impl Unknown { ::std::mem::replace(&mut self.error, error) } + /// Returns the error. + pub fn into_error(self) -> anyhow::Error { + self.error + } + /// Best effort Ord implementation. /// /// The Cert canonicalization needs to order Unknown packets. |