mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
Rename x509-validation crate to verification for consistency with the Python API (#10039)
This commit is contained in:
parent
6f77f13e16
commit
0d3af2266e
12 changed files with 13 additions and 13 deletions
4
src/rust/Cargo.lock
generated
4
src/rust/Cargo.lock
generated
|
|
@ -90,7 +90,7 @@ dependencies = [
|
|||
"cryptography-cffi",
|
||||
"cryptography-openssl",
|
||||
"cryptography-x509",
|
||||
"cryptography-x509-validation",
|
||||
"cryptography-x509-verification",
|
||||
"foreign-types-shared",
|
||||
"once_cell",
|
||||
"openssl",
|
||||
|
|
@ -108,7 +108,7 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "cryptography-x509-validation"
|
||||
name = "cryptography-x509-verification"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"asn1",
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ pyo3 = { version = "0.20", features = ["abi3"] }
|
|||
asn1 = { version = "0.15.5", default-features = false }
|
||||
cryptography-cffi = { path = "cryptography-cffi" }
|
||||
cryptography-x509 = { path = "cryptography-x509" }
|
||||
cryptography-x509-validation = { path = "cryptography-x509-validation" }
|
||||
cryptography-x509-verification = { path = "cryptography-x509-verification" }
|
||||
cryptography-openssl = { path = "cryptography-openssl" }
|
||||
pem = { version = "3", default-features = false }
|
||||
openssl = "0.10.62"
|
||||
|
|
@ -41,5 +41,5 @@ members = [
|
|||
"cryptography-cffi",
|
||||
"cryptography-openssl",
|
||||
"cryptography-x509",
|
||||
"cryptography-x509-validation",
|
||||
"cryptography-x509-verification",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "cryptography-x509-validation"
|
||||
name = "cryptography-x509-verification"
|
||||
version = "0.1.0"
|
||||
authors = ["The cryptography developers <cryptography-dev@python.org>"]
|
||||
edition = "2021"
|
||||
|
|
@ -17,7 +17,7 @@ use std::str::FromStr;
|
|||
/// [RFC 1123 2.1]: https://datatracker.ietf.org/doc/html/rfc1123#section-2.1
|
||||
///
|
||||
/// ```rust
|
||||
/// # use cryptography_x509_validation::types::DNSName;
|
||||
/// # use cryptography_x509_verification::types::DNSName;
|
||||
/// assert_eq!(DNSName::new("foo.com").unwrap(), DNSName::new("FOO.com").unwrap());
|
||||
/// ```
|
||||
#[derive(Clone, Debug)]
|
||||
|
|
@ -59,7 +59,7 @@ impl<'a> DNSName<'a> {
|
|||
/// Return this `DNSName`'s parent domain, if it has one.
|
||||
///
|
||||
/// ```rust
|
||||
/// # use cryptography_x509_validation::types::DNSName;
|
||||
/// # use cryptography_x509_verification::types::DNSName;
|
||||
/// let domain = DNSName::new("foo.example.com").unwrap();
|
||||
/// assert_eq!(domain.parent().unwrap().as_str(), "example.com");
|
||||
/// ```
|
||||
|
|
@ -136,7 +136,7 @@ impl<'a> DNSConstraint<'a> {
|
|||
/// side of the name satisfies the name constraint.
|
||||
///
|
||||
/// ```rust
|
||||
/// # use cryptography_x509_validation::types::{DNSConstraint, DNSName};
|
||||
/// # use cryptography_x509_verification::types::{DNSConstraint, DNSName};
|
||||
/// let example_com = DNSName::new("example.com").unwrap();
|
||||
/// let badexample_com = DNSName::new("badexample.com").unwrap();
|
||||
/// let foo_example_com = DNSName::new("foo.example.com").unwrap();
|
||||
|
|
@ -217,7 +217,7 @@ impl IPAddress {
|
|||
/// Returns a new `IPAddress` with the first `prefix` bits of the `IPAddress`.
|
||||
///
|
||||
/// ```rust
|
||||
/// # use cryptography_x509_validation::types::IPAddress;
|
||||
/// # use cryptography_x509_verification::types::IPAddress;
|
||||
/// let ip = IPAddress::from_str("192.0.2.1").unwrap();
|
||||
/// assert_eq!(ip.mask(24), IPAddress::from_str("192.0.2.0").unwrap());
|
||||
/// ```
|
||||
|
|
@ -288,7 +288,7 @@ impl IPConstraint {
|
|||
/// Determines if the `addr` is within the `IPConstraint`.
|
||||
///
|
||||
/// ```rust
|
||||
/// # use cryptography_x509_validation::types::{IPAddress, IPConstraint};
|
||||
/// # use cryptography_x509_verification::types::{IPAddress, IPConstraint};
|
||||
/// let range_bytes = b"\xc6\x33\x64\x00\xff\xff\xff\x00";
|
||||
/// let range = IPConstraint::from_bytes(range_bytes).unwrap();
|
||||
/// assert!(range.matches(&IPAddress::from_str("198.51.100.42").unwrap()));
|
||||
|
|
@ -21,7 +21,7 @@ use cryptography_x509::extensions::{
|
|||
};
|
||||
use cryptography_x509::extensions::{Extension, SubjectAlternativeName};
|
||||
use cryptography_x509::{common, oid};
|
||||
use cryptography_x509_validation::ops::CryptoOps;
|
||||
use cryptography_x509_verification::ops::CryptoOps;
|
||||
use pyo3::{IntoPy, ToPyObject};
|
||||
use std::collections::hash_map::DefaultHasher;
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// for complete details.
|
||||
|
||||
use cryptography_x509::certificate::Certificate;
|
||||
use cryptography_x509_validation::{
|
||||
use cryptography_x509_verification::{
|
||||
ops::CryptoOps,
|
||||
policy::{Policy, Subject},
|
||||
trust_store::Store,
|
||||
|
|
@ -120,7 +120,7 @@ impl PyServerVerifier {
|
|||
);
|
||||
|
||||
let policy = self.as_policy();
|
||||
let chain = cryptography_x509_validation::verify(
|
||||
let chain = cryptography_x509_verification::verify(
|
||||
leaf.raw.borrow_dependent(),
|
||||
intermediates
|
||||
.iter()
|
||||
|
|
|
|||
Loading…
Reference in a new issue