Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rework dns_names helper, remove alloc req. #178

Merged
merged 22 commits into from
Sep 20, 2023

Commits on Sep 18, 2023

  1. subject_name: remove comment about required feature

    We switched to using `doc_auto_cfg` to automatically indicate in
    Rustdocs when an item requires a particular feature. This comment about
    the `dns_name::DnsName` re-export requiring alloc isn't necessary
    anymore.
    cpu committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    4e2ef1b View commit details
    Browse the repository at this point in the history
  2. lib: remove unneeded manual docsrs cfg_attr

    We switched to `doc_auto_cfg` and don't need to manually annotate
    `cfg(feature ...)` annotations for docsrs purposes anymore.
    cpu committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    839cd93 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0682cec View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    12cd0ea View commit details
    Browse the repository at this point in the history
  5. end_entity: rework dns_names to return iter of &str

    This is what most consumers of the API are interested in, and avoids
    needing to export the `GeneralDnsNameRef` and `WildcardDnsNameRef`
    types.
    cpu committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    f5ace6d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    de8b2ec View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8d60950 View commit details
    Browse the repository at this point in the history
  8. tests: rework no_subject_alt_names test

    We can express this test with the `expect_cert_dns_names` helper.
    cpu committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    2350c2e View commit details
    Browse the repository at this point in the history
  9. tests: clean up unneeded bindings

    cpu committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    22cebce View commit details
    Browse the repository at this point in the history
  10. end_entity: fix dns_names rustdoc comment

    Prior to this commit the rustdoc comment on `EndEntityCert.dns_names`
    mentioned using `verify_is_valid_for_dns_name` and
    `verify_is_valid_for_at_least_one_dns_name`, but these functions don't
    exist anymore.
    
    This commit updates the comment to point to
    `EndEntityCert::verify_is_valid_for_subject_name`, and does so with
    a proper Rustdoc link so that future updates will be caught by `cargo
    doc` if we forget to fix this reference to match.
    cpu committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    7ffbabe View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2023

  1. end_entity: make dns_names infallible

    The purpose of the `dns_names` helper on an `EndEntityCert` is to
    provide users the opportunity to get information on the dNSName SAN
    values in a certificate for **non-validation** purposes. Checking that
    a certificate is valid for a particular name should always be done with
    `verify_is_valid_for_at_least_one_dns_name`.
    
    With that use-case in mind, we can make the `dns_names` helper easier
    for consumers to use by filtering out invalid general names, returning
    an `Iterator<Item = &'a str>` unconditionally, instead of
    a `Result`. This better matches the updated name validation semantics
    where we ignore `MalformedDnsIdentifier` errors to continue to try to
    find a valid name to validate against.
    cpu committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    8bf4fa9 View commit details
    Browse the repository at this point in the history
  2. lib: rm alloc req. for dns_names

    With the update to the `dns_names` function in the previous commit we
    can now make `EndEntity.dns_names` work without requiring `alloc`.
    cpu committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    807df74 View commit details
    Browse the repository at this point in the history
  3. subject_name: tidy up list_cert_dns_names

    Avoid combinator chaining, use explicit `match`.
    cpu committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    be4dba6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4332b8c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    415c387 View commit details
    Browse the repository at this point in the history
  6. Move GeneralDnsNameRef definition to the top

    djc authored and cpu committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    7aa0f8d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d0522c0 View commit details
    Browse the repository at this point in the history
  8. Use as_str() method to reference DnsNameRef contents

    The From impl feels a little unidiomatic because the DnsNameRef is not
    consumed. An AsRef impl would unnecessarily constrain the lifetime of
    the output value to `&self`, whereas it can live as long as `'a`.
    djc authored and cpu committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    b11327b View commit details
    Browse the repository at this point in the history
  9. Use as_str() method to reference WildcardDnsNameRef contents

    The From impl feels a little unidiomatic because the WildcardDnsNameRef is
    not consumed. An AsRef impl would unnecessarily constrain the lifetime of
    the output value to `&self`, whereas it can live as long as `'a`.
    djc authored and cpu committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    abf970c View commit details
    Browse the repository at this point in the history
  10. Use as_str() method to reference GeneralDnsNameRef contents

    The From impl feels a little unidiomatic because the GeneralDnsNameRef is
    not consumed. An AsRef impl would unnecessarily constrain the lifetime of
    the output value to `&self`, whereas it can live as long as `'a`.
    djc authored and cpu committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    f470c07 View commit details
    Browse the repository at this point in the history
  11. Remove API that is now unused

    djc authored and cpu committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    1e92abf View commit details
    Browse the repository at this point in the history
  12. cert: move list_cert_dns_names to Cert

    This commit lifts the free-standing `list_cert_dns_names` helper from
    the `subject_name` module to be associated with a `Cert`. Doing so also
    requires making the `subject_name::NameIterator` and
    `subject_name::WildcardDnsNameRef` `pub(crate)` visible.
    cpu committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    64fb1b7 View commit details
    Browse the repository at this point in the history