From c647a7fb8575dc11e83abf2647df85425f9e711d Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 22 Aug 2023 10:18:15 +0200 Subject: openpgp: Deprecate the PreferredAEADAlgorithms subpacket. --- openpgp/src/cert.rs | 1 + openpgp/src/packet/signature/subpacket.rs | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/openpgp/src/cert.rs b/openpgp/src/cert.rs index acb4e7ab..208783f9 100644 --- a/openpgp/src/cert.rs +++ b/openpgp/src/cert.rs @@ -4456,6 +4456,7 @@ macro_rules! impl_pref { // look on the primary User ID and then fall back to the // direct key signature. We need to be careful to handle // the case where there are no User IDs. + #[allow(deprecated)] if let Ok(u) = self.primary_userid() { u.$subpacket() } else if let Ok(sig) = self.direct_key_signature() { diff --git a/openpgp/src/packet/signature/subpacket.rs b/openpgp/src/packet/signature/subpacket.rs index 9be2842c..aee42e8d 100644 --- a/openpgp/src/packet/signature/subpacket.rs +++ b/openpgp/src/packet/signature/subpacket.rs @@ -301,12 +301,13 @@ pub enum SubpacketTag { /// /// [Section 5.2.3.28 of RFC 4880bis]: https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-09.html#section-5.2.3.28 IssuerFingerprint, - /// The AEAD algorithms that the certificate holder prefers (proposed). + + /// The AEAD algorithms that the certificate holder prefers (deprecated). /// - /// See [Section 5.2.3.8 of RFC 4880bis] for details. + /// See [Section 5.2.3.8 of draft-ietf-openpgp-rfc4880bis-09] for details. /// - /// [Section 5.2.3.8 of RFC 4880bis]: https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-09.html#section-5.2.3.8 - #[deprecated] + /// [Section 5.2.3.8 of draft-ietf-openpgp-rfc4880bis-09]: https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-09.html#section-5.2.3.8 + #[deprecated(note = "Use PreferredAEADCiphersuites instead")] PreferredAEADAlgorithms, /// Who the signed message was intended for (proposed). /// @@ -1687,12 +1688,13 @@ pub enum SubpacketValue { /// /// [Section 5.2.3.28 of RFC 4880bis]: https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-09.html#section-5.2.3.28 IssuerFingerprint(Fingerprint), - /// The AEAD algorithms that the certificate holder prefers (proposed). + + /// The AEAD algorithms that the certificate holder prefers (deprecated). /// - /// See [Section 5.2.3.8 of RFC 4880bis] for details. + /// See [Section 5.2.3.8 of draft-ietf-openpgp-rfc4880bis-09] for details. /// - /// [Section 5.2.3.8 of RFC 4880bis]: https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-09.html#section-5.2.3.8 - #[deprecated] + /// [Section 5.2.3.8 of draft-ietf-openpgp-rfc4880bis-09]: https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-09.html#section-5.2.3.8 + #[deprecated(note = "Use PreferredAEADCiphersuites instead")] PreferredAEADAlgorithms(Vec), /// Who the signed message was intended for (proposed). /// @@ -1740,6 +1742,7 @@ impl ArbitraryBounded for SubpacketValue { use self::SubpacketValue::*; use crate::arbitrary_helper::gen_arbitrary_from_range; + #[allow(deprecated)] loop { #[allow(deprecated)] break match gen_arbitrary_from_range(0..27, g) { @@ -3358,6 +3361,7 @@ impl SubpacketAreas { } /// Returns the value of the Preferred AEAD Algorithms subpacket. + #[deprecated(note = "Use preferred_aead_ciphersuites instead")] pub fn preferred_aead_algorithms(&self) -> Option<&[AEADAlgorithm]> { // array of one-octet values @@ -7030,6 +7034,7 @@ impl signature::SignatureBuilder { } /// Sets the Preferred AEAD Algorithms subpacket. + #[deprecated(note = "Use set_preferred_aead_ciphersuites instead")] pub fn set_preferred_aead_algorithms(mut self, preferences: Vec) -> Result -- cgit v1.2.3