Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify code that was randomly overly complicated #12158

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci-constraints-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ check-sdist==1.2.0 ; python_full_version >= '3.8'
# via cryptography (pyproject.toml)
click==8.1.7
# via cryptography (pyproject.toml)
colorama==0.4.6 ; (platform_system != 'Windows' and sys_platform == 'win32') or platform_system == 'Windows' or os_name == 'nt'
colorama==0.4.6 ; os_name == 'nt' or (platform_system == 'Windows' and sys_platform != 'win32') or sys_platform == 'win32'
# via
# build
# click
Expand Down
13 changes: 5 additions & 8 deletions src/rust/src/x509/csr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,14 @@ impl CertificateSigningRequest {
}

#[getter]
fn is_signature_valid(
slf: pyo3::PyRef<'_, Self>,
py: pyo3::Python<'_>,
) -> CryptographyResult<bool> {
let public_key = slf.public_key(py)?;
fn is_signature_valid(&self, py: pyo3::Python<'_>) -> CryptographyResult<bool> {
let public_key = self.public_key(py)?;
Ok(sign::verify_signature_with_signature_algorithm(
py,
public_key,
&slf.raw.borrow_dependent().signature_alg,
slf.raw.borrow_dependent().signature.as_bytes(),
&asn1::write_single(&slf.raw.borrow_dependent().csr_info)?,
&self.raw.borrow_dependent().signature_alg,
self.raw.borrow_dependent().signature.as_bytes(),
&asn1::write_single(&self.raw.borrow_dependent().csr_info)?,
)
.is_ok())
}
Expand Down
Loading