summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-05-18 13:15:30 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-05-28 11:52:26 +0200
commit94dcb41c69c4e16f1f491a9b27148e90a0d713e7 (patch)
treeaea6795fb6867500f36a8e94cbe1a4e6a00ce0af /openpgp/src/parse.rs
parent47362eed301a4954af94afe84df16ab6eddecf8d (diff)
openpgp: Add a warning to PacketParser::decrypt.
Diffstat (limited to 'openpgp/src/parse.rs')
-rw-r--r--openpgp/src/parse.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/openpgp/src/parse.rs b/openpgp/src/parse.rs
index cf8cbfef..e84cca47 100644
--- a/openpgp/src/parse.rs
+++ b/openpgp/src/parse.rs
@@ -4762,6 +4762,17 @@ impl<'a> PacketParser<'a> {
/// }
/// # Ok(()) }
/// ```
+ ///
+ /// # Security Considerations
+ ///
+ /// This functions returns rich errors in case the decryption
+ /// fails. In combination with certain asymmetric algorithms
+ /// (RSA), this may lead to compromise of secret key material.
+ /// See [Section 14 of RFC 4880]. Do not relay these errors in
+ /// situations where an attacker can request decryption of
+ /// messages in an automated fashion.
+ ///
+ /// [Section 14 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-14
pub fn decrypt(&mut self, algo: SymmetricAlgorithm, key: &SessionKey)
-> Result<()>
{