Skip to content

Commit f1202b3

Browse files
committed
Restore SemVer compatibility for verify_is_valid_tls_client_cert.
1 parent 60e688b commit f1202b3

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/end_entity.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,25 @@ impl<'a> EndEntityCert<'a> {
125125
)
126126
}
127127

128+
/// Backward-SemVer-compatible wrapper around `verify_is_valid_tls_client_cert_ext`.
129+
///
130+
/// Errors that aren't representable as an `Error` are mapped to `Error::UnknownIssuer`.
131+
pub fn verify_is_valid_tls_client_cert(
132+
&self,
133+
supported_sig_algs: &[&SignatureAlgorithm],
134+
trust_anchors: &TlsClientTrustAnchors,
135+
intermediate_certs: &[&[u8]],
136+
time: Time,
137+
) -> Result<(), Error> {
138+
self.verify_is_valid_tls_client_cert_ext(
139+
supported_sig_algs,
140+
trust_anchors,
141+
intermediate_certs,
142+
time,
143+
)
144+
.map_err(ErrorExt::into_error_lossy)
145+
}
146+
128147
/// Verifies that the end-entity certificate is valid for use by a TLS
129148
/// client.
130149
///
@@ -145,7 +164,7 @@ impl<'a> EndEntityCert<'a> {
145164
&TlsClientTrustAnchors(trust_anchors): &TlsClientTrustAnchors,
146165
intermediate_certs: &[&[u8]],
147166
time: Time,
148-
) -> Result<(), Error> {
167+
) -> Result<(), ErrorExt> {
149168
verify_cert::build_chain(
150169
verify_cert::EKU_CLIENT_AUTH,
151170
supported_sig_algs,
@@ -154,7 +173,6 @@ impl<'a> EndEntityCert<'a> {
154173
&self.inner,
155174
time,
156175
)
157-
.map_err(ErrorExt::into_error_lossy)
158176
}
159177

160178
/// Verifies that the certificate is valid for the given DNS host name.

0 commit comments

Comments
 (0)