From a9519bca3918615c3bef781c81f6c42708c85e76 Mon Sep 17 00:00:00 2001 From: Facundo Tuesca Date: Sat, 13 Apr 2024 21:38:58 +0200 Subject: [PATCH] Address review comments --- src/rust/src/x509/extensions.rs | 3 +-- src/rust/src/x509/ocsp_req.rs | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rust/src/x509/extensions.rs b/src/rust/src/x509/extensions.rs index c1764d77434e..929f17ce3575 100644 --- a/src/rust/src/x509/extensions.rs +++ b/src/rust/src/x509/extensions.rs @@ -9,7 +9,6 @@ use crate::error::{CryptographyError, CryptographyResult}; use crate::x509::{certificate, sct}; use crate::{types, x509}; use pyo3::prelude::PyAnyMethods; -use pyo3::pybacked::PyBackedBytes; fn encode_general_subtrees<'a>( py: pyo3::Python<'a>, @@ -52,7 +51,7 @@ pub(crate) fn encode_authority_key_identifier<'a>( } else { None }; - let serial_bytes: PyBackedBytes; + let serial_bytes; let authority_cert_serial_number = if let Some(authority_cert_serial_number) = aki.authority_cert_serial_number { serial_bytes = py_uint_to_big_endian_bytes(py, authority_cert_serial_number)?; diff --git a/src/rust/src/x509/ocsp_req.rs b/src/rust/src/x509/ocsp_req.rs index 2301f56212c0..d15ba50722a3 100644 --- a/src/rust/src/x509/ocsp_req.rs +++ b/src/rust/src/x509/ocsp_req.rs @@ -171,7 +171,8 @@ fn create_ocsp_request( builder: &pyo3::Bound<'_, pyo3::PyAny>, ) -> CryptographyResult { let builder_request = builder.getattr(pyo3::intern!(py, "_request"))?; - let ka = cryptography_keepalive::KeepAlive::new(); + let serial_number_bytes; + //let ka = cryptography_keepalive::KeepAlive::new(); // Declare outside the if-block so the lifetimes are right. let (py_cert, py_issuer, py_hash, issuer_name_hash, issuer_key_hash): ( @@ -189,8 +190,8 @@ fn create_ocsp_request( (issuer_name_hash, issuer_key_hash, py_serial, py_hash) = builder .getattr(pyo3::intern!(py, "_request_hash"))? .extract()?; - let serial_number_bytes = ka.add(py_uint_to_big_endian_bytes(py, py_serial)?); - let serial_number = asn1::BigInt::new(serial_number_bytes).unwrap(); + serial_number_bytes = py_uint_to_big_endian_bytes(py, py_serial)?; + let serial_number = asn1::BigInt::new(&serial_number_bytes).unwrap(); ocsp::certid_new_from_hash( py, &issuer_name_hash,