Skip to content

Commit c719313

Browse files
committed
PKCS7 fixes from code review
1 parent b18f7b1 commit c719313

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rust/src/pkcs7.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,13 @@ fn compute_pkcs7_signature_algorithm<'p>(
269269
rsa_padding: &'p pyo3::PyAny,
270270
) -> pyo3::PyResult<common::AlgorithmIdentifier<'static>> {
271271
let key_type = x509::sign::identify_key_type(py, private_key)?;
272-
let has_pss_padding = !rsa_padding.is_none() && rsa_padding.is_instance(types::PSS.get(py)?)?;
272+
let has_pss_padding = rsa_padding.is_instance(types::PSS.get(py)?)?;
273273
// For RSA signatures (with no PSS padding), the OID is always the same no matter the
274274
// digest algorithm. See RFC 3370 (section 3.2).
275275
if key_type == x509::sign::KeyType::Rsa && !has_pss_padding {
276276
Ok(common::AlgorithmIdentifier {
277277
oid: asn1::DefinedByMarker::marker(),
278-
params: common::AlgorithmParameters::Rsa(None),
278+
params: common::AlgorithmParameters::Rsa(Some(())),
279279
})
280280
} else {
281281
x509::sign::compute_signature_algorithm(py, private_key, hash_algorithm, rsa_padding)

0 commit comments

Comments
 (0)