diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock index 6f9af66f872d..973d86535114 100644 --- a/src/rust/Cargo.lock +++ b/src/rust/Cargo.lock @@ -16,9 +16,9 @@ checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" [[package]] name = "asn1" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f56417796de18d5398ee1ba4058d061a9be1bcfdef9a46f73e96e94f5bb21e0" +checksum = "9680a48fea09cb1af33dc233179b9723674ca43ad9e5c9d01ab6ad1c3c58c0dc" dependencies = [ "asn1_derive", "chrono", @@ -26,9 +26,9 @@ dependencies = [ [[package]] name = "asn1_derive" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be3a3360bd6e363428f7ce00ccd251efcd2639b6942ab22e5f322a452aa6f079" +checksum = "f828598cd99548327735aae5db2852e3d78d1508ed81543f204b8ca3cf3ba859" dependencies = [ "proc-macro2", "quote", diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml index 0d0f66f26f53..df187bfa4e2b 100644 --- a/src/rust/Cargo.toml +++ b/src/rust/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] lazy_static = "1" pyo3 = { version = "0.14.1" } -asn1 = { version = "0.5.3", default-features = false, features = ["derive"] } +asn1 = { version = "0.6", default-features = false, features = ["derive"] } chrono = { version = "0.4", default-features = false, features = ["alloc"] } ouroboros = "0.10" diff --git a/src/rust/src/x509.rs b/src/rust/src/x509.rs index b2ef945ef82a..0dae8b72706a 100644 --- a/src/rust/src/x509.rs +++ b/src/rust/src/x509.rs @@ -255,9 +255,9 @@ struct UnvalidatedIA5String<'a>(&'a str); impl<'a> asn1::SimpleAsn1Readable<'a> for UnvalidatedIA5String<'a> { const TAG: u8 = 0x16; fn parse_data(data: &'a [u8]) -> asn1::ParseResult { - Ok(UnvalidatedIA5String( - std::str::from_utf8(data).map_err(|_| asn1::ParseError::InvalidValue)?, - )) + Ok(UnvalidatedIA5String(std::str::from_utf8(data).map_err( + |_| asn1::ParseError::new(asn1::ParseErrorKind::InvalidValue), + )?)) } } @@ -500,8 +500,8 @@ fn parse_name_attribute( .import("cryptography.x509.name")? .getattr("_ASN1_TYPE_TO_ENUM")?; let py_tag = tag_enum.get_item(attribute.value.tag().to_object(py))?; - let py_data = - std::str::from_utf8(attribute.value.data()).map_err(|_| asn1::ParseError::InvalidValue)?; + let py_data = std::str::from_utf8(attribute.value.data()) + .map_err(|_| asn1::ParseError::new(asn1::ParseErrorKind::InvalidValue))?; Ok(x509_module .call_method1("NameAttribute", (oid, py_data, py_tag))? .to_object(py))