Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
facutuesca committed Apr 13, 2024
1 parent 229038f commit a9519bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/rust/src/x509/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down Expand Up @@ -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)?;
Expand Down
7 changes: 4 additions & 3 deletions src/rust/src/x509/ocsp_req.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ fn create_ocsp_request(
builder: &pyo3::Bound<'_, pyo3::PyAny>,
) -> CryptographyResult<OCSPRequest> {
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): (
Expand All @@ -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,
Expand Down

0 comments on commit a9519bc

Please sign in to comment.