|
12 | 12 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
13 | 13 | // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
14 | 14 |
|
15 | | -use super::dns_name::{self, DnsNameRef, WildcardDnsNameRef}; |
| 15 | +use super::dns_name::{self, DnsNameRef}; |
16 | 16 | use super::ip_address::{self, IpAddrRef}; |
17 | 17 | use super::name::SubjectNameRef; |
18 | 18 | use crate::der::{self, FromDer}; |
@@ -258,13 +258,13 @@ enum Subtrees { |
258 | 258 | ExcludedSubtrees, |
259 | 259 | } |
260 | 260 |
|
261 | | -struct NameIterator<'a> { |
| 261 | +pub(crate) struct NameIterator<'a> { |
262 | 262 | subject_alt_name: Option<untrusted::Reader<'a>>, |
263 | 263 | subject_directory_name: Option<untrusted::Input<'a>>, |
264 | 264 | } |
265 | 265 |
|
266 | 266 | impl<'a> NameIterator<'a> { |
267 | | - fn new( |
| 267 | + pub(crate) fn new( |
268 | 268 | subject: Option<untrusted::Input<'a>>, |
269 | 269 | subject_alt_name: Option<untrusted::Input<'a>>, |
270 | 270 | ) -> Self { |
@@ -312,28 +312,6 @@ impl<'a> Iterator for NameIterator<'a> { |
312 | 312 | } |
313 | 313 | } |
314 | 314 |
|
315 | | -pub(crate) fn list_cert_dns_names<'names>( |
316 | | - cert: &'names crate::EndEntityCert<'names>, |
317 | | -) -> impl Iterator<Item = &'names str> { |
318 | | - let cert = &cert.inner(); |
319 | | - NameIterator::new(Some(cert.subject), cert.subject_alt_name).filter_map(|result| { |
320 | | - let presented_id = match result.ok()? { |
321 | | - GeneralName::DnsName(presented) => presented, |
322 | | - _ => return None, |
323 | | - }; |
324 | | - |
325 | | - // if the name could be converted to a DNS name, return it; otherwise, |
326 | | - // keep going. |
327 | | - match DnsNameRef::try_from_ascii(presented_id.as_slice_less_safe()) { |
328 | | - Ok(dns_name) => Some(dns_name.as_str()), |
329 | | - Err(_) => match WildcardDnsNameRef::try_from_ascii(presented_id.as_slice_less_safe()) { |
330 | | - Ok(wildcard_dns_name) => Some(wildcard_dns_name.as_str()), |
331 | | - Err(_) => None, |
332 | | - }, |
333 | | - } |
334 | | - }) |
335 | | -} |
336 | | - |
337 | 315 | // It is *not* valid to derive `Eq`, `PartialEq, etc. for this type. In |
338 | 316 | // particular, for the types of `GeneralName`s that we don't understand, we |
339 | 317 | // don't even store the value. Also, the meaning of a `GeneralName` in a name |
|
0 commit comments