Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/end_entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

use crate::{
cert, name, signed_data, verify_cert, DnsNameOrIpRef, DnsNameRef, Error, SignatureAlgorithm,
cert, name, signed_data, verify_cert, DnsNameRef, Error, SignatureAlgorithm, SubjectNameRef,
TLSClientTrustAnchors, TLSServerTrustAnchors, Time,
};
use core::convert::TryFrom;
Expand All @@ -27,7 +27,7 @@ use core::convert::TryFrom;
/// certificate is currently valid *for use by a TLS server*.
/// * `EndEntityCert.verify_is_valid_for_dns_name`: Verify that the server's
/// certificate is valid for the host that is being connected to.
/// * `EndEntityCert.verify_is_valid_for_dns_name_or_ip`: Verify that the server's
/// * `EndEntityCert.verify_is_valid_for_subject_name`: Verify that the server's
/// certificate is valid for the host or IP address that is being connected to.
///
/// * `EndEntityCert.verify_signature`: Verify that the signature of server's
Expand Down Expand Up @@ -151,12 +151,12 @@ impl<'a> EndEntityCert<'a> {
name::verify_cert_dns_name(self, dns_name)
}

/// Verifies that the certificate is valid for the given DNS host name or IP address.
pub fn verify_is_valid_for_dns_name_or_ip(
/// Verifies that the certificate is valid for the given Subject Name.
pub fn verify_is_valid_for_subject_name(
&self,
dns_name_or_ip: DnsNameOrIpRef,
subject_name: SubjectNameRef,
) -> Result<(), Error> {
name::verify_cert_dns_name_or_ip(self, dns_name_or_ip)
name::verify_cert_subject_name(self, subject_name)
}

/// Verifies the signature `signature` of message `msg` using the
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ pub use {
end_entity::EndEntityCert,
error::Error,
name::{
ip_address::InvalidIpAddressError, ip_address::IpAddressRef, DnsNameOrIpRef, DnsNameRef,
InvalidDnsNameError, InvalidDnsNameOrIpError,
ip_address::AddrParseError, ip_address::IpAddrRef, DnsNameRef, InvalidDnsNameError,
InvalidSubjectNameError, SubjectNameRef,
},
signed_data::{
SignatureAlgorithm, ECDSA_P256_SHA256, ECDSA_P256_SHA384, ECDSA_P384_SHA256,
Expand All @@ -63,7 +63,7 @@ pub use {

#[cfg(feature = "alloc")]
pub use {
name::{ip_address::IpAddress, DnsName},
name::{ip_address::IpAddr, DnsName},
signed_data::{
RSA_PKCS1_2048_8192_SHA256, RSA_PKCS1_2048_8192_SHA384, RSA_PKCS1_2048_8192_SHA512,
RSA_PKCS1_3072_8192_SHA384, RSA_PSS_2048_8192_SHA256_LEGACY_KEY,
Expand Down
6 changes: 3 additions & 3 deletions src/name.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015-2020 Brian Smith.
// Copyright 2022 Rafael Fernández López.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
Expand All @@ -21,9 +21,9 @@ pub use dns_name::DnsName;

#[allow(clippy::module_inception)]
mod name;
pub use name::{DnsNameOrIpRef, InvalidDnsNameOrIpError};
pub use name::{InvalidSubjectNameError, SubjectNameRef};

pub mod ip_address;

mod verify;
pub(super) use verify::{check_name_constraints, verify_cert_dns_name, verify_cert_dns_name_or_ip};
pub(super) use verify::{check_name_constraints, verify_cert_dns_name, verify_cert_subject_name};
Loading