aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2024-04-06 11:34:25 -0400
committerGitHub <noreply@github.com>2024-04-06 10:34:25 -0500
commita63af2fcf397a35c32a35766561ea28bfe03f676 (patch)
tree5e4a8634aa3757d492e56efe5eb9eafd62598cce /src
parent2ab8b23dd67295fb3ab8a1348c06535bc8040f33 (diff)
downloadpyca-cryptography-a63af2fcf397a35c32a35766561ea28bfe03f676.zip
pyca-cryptography-a63af2fcf397a35c32a35766561ea28bfe03f676.tar.gz
pyca-cryptography-a63af2fcf397a35c32a35766561ea28bfe03f676.tar.bz2
Fixed lifetime errors in `certificate.rs` with `gil-refs` disabled (#10760)
Diffstat (limited to 'src')
-rw-r--r--src/rust/src/x509/certificate.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rust/src/x509/certificate.rs b/src/rust/src/x509/certificate.rs
index 02c3f85..cbc8007 100644
--- a/src/rust/src/x509/certificate.rs
+++ b/src/rust/src/x509/certificate.rs
@@ -58,7 +58,7 @@ impl Certificate {
fn __repr__(&self, py: pyo3::Python<'_>) -> pyo3::PyResult<String> {
let subject = self.subject(py)?;
- let subject_repr = subject.repr()?.extract::<&str>()?;
+ let subject_repr = subject.repr()?.extract::<pyo3::pybacked::PyBackedStr>()?;
Ok(format!("<Certificate(subject={subject_repr}, ...)>"))
}
@@ -927,7 +927,7 @@ fn create_x509_certificate(
let spki_bytes = builder
.getattr(pyo3::intern!(py, "_public_key"))?
.call_method1(pyo3::intern!(py, "public_bytes"), (der, spki))?
- .extract::<&[u8]>()?;
+ .extract::<pyo3::pybacked::PyBackedBytes>()?;
let py_serial = builder
.getattr(pyo3::intern!(py, "_serial_number"))?
@@ -951,7 +951,7 @@ fn create_x509_certificate(
not_after: time_from_py(py, &py_not_after)?,
},
subject: x509::common::encode_name(py, &py_subject_name)?,
- spki: asn1::parse_single(spki_bytes)?,
+ spki: asn1::parse_single(&spki_bytes)?,
issuer_unique_id: None,
subject_unique_id: None,
raw_extensions: x509::common::encode_extensions(