Skip to content

Commit 1f2a8a2

Browse files
committed
trust_anchor/end_entity: rework deprecation notes.
In 0.101.2 we deprecated the `TlsServerTrustAnchors` and `TlsClientTrustAnchors` types along with the `EndEntity::verify_is_valid_tls_server_cert` and `EndEntity::verify_is_valid_tls_client_cert` functions that used them. However, only the `EndEntity` deprecations had a `note` pointing to the preferred replacement, and the text was quite terse. This commit adds notes to the trust anchor types that were missing these, and updates the end entity verification deprecation notes to be more user-friendly.
1 parent bef457f commit 1f2a8a2

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

src/end_entity.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,13 @@ impl<'a> EndEntityCert<'a> {
143143
/// `time` is the time for which the validation is effective (usually the
144144
/// current time).
145145
#[allow(deprecated)]
146-
#[deprecated(since = "0.101.2", note = "Use `verify_for_usage` instead")]
146+
#[deprecated(
147+
since = "0.101.2",
148+
note = "The per-usage trust anchor representations and verification functions are deprecated in \
149+
favor of the general-purpose `TrustAnchor` type and `EndEntity::verify_for_usage` function. \
150+
The new `verify_for_usage` function expresses trust anchor and end entity purpose with the \
151+
key usage argument."
152+
)]
147153
pub fn verify_is_valid_tls_server_cert(
148154
&self,
149155
supported_sig_algs: &[&SignatureAlgorithm],
@@ -173,7 +179,13 @@ impl<'a> EndEntityCert<'a> {
173179
/// the time for which the validation is effective (usually the current
174180
/// time).
175181
#[allow(deprecated)]
176-
#[deprecated(since = "0.101.2", note = "Use `verify_for_usage` instead")]
182+
#[deprecated(
183+
since = "0.101.2",
184+
note = "The per-usage trust anchor representations and verification functions are deprecated in \
185+
favor of the general-purpose `TrustAnchor` type and `EndEntity::verify_for_usage` function. \
186+
The new `verify_for_usage` function expresses trust anchor and end entity purpose with the \
187+
key usage argument."
188+
)]
177189
pub fn verify_is_valid_tls_client_cert(
178190
&self,
179191
supported_sig_algs: &[&SignatureAlgorithm],

src/trust_anchor.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,24 @@ pub struct TrustAnchor<'a> {
2424
}
2525

2626
/// Trust anchors which may be used for authenticating servers.
27-
#[deprecated(since = "0.101.2")]
27+
#[deprecated(
28+
since = "0.101.2",
29+
note = "The per-usage trust anchor representations and verification functions are deprecated in \
30+
favor of the general-purpose `TrustAnchor` type and `EndEntity::verify_for_usage` function. \
31+
The new `verify_for_usage` function expresses trust anchor and end entity purpose with the \
32+
key usage argument."
33+
)]
2834
#[derive(Debug)]
2935
pub struct TlsServerTrustAnchors<'a>(pub &'a [TrustAnchor<'a>]);
3036

3137
/// Trust anchors which may be used for authenticating clients.
32-
#[deprecated(since = "0.101.2")]
38+
#[deprecated(
39+
since = "0.101.2",
40+
note = "The per-usage trust anchor representations and verification functions are deprecated in \
41+
favor of the general-purpose `TrustAnchor` type and `EndEntity::verify_for_usage` function. \
42+
The new `verify_for_usage` function expresses trust anchor and end entity purpose with the \
43+
key usage argument."
44+
)]
3345
#[derive(Debug)]
3446
pub struct TlsClientTrustAnchors<'a>(pub &'a [TrustAnchor<'a>]);
3547

0 commit comments

Comments
 (0)