Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ancwrd1 committed Feb 21, 2025
1 parent db28fba commit eb11dcf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
9 changes: 3 additions & 6 deletions src/cert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,9 @@ impl CertContext {
);

for (index, element) in elements.iter().enumerate() {
if index != 0 {
if 0 != ((**element).TrustStatus.dwInfoStatus
& CERT_TRUST_IS_SELF_SIGNED)
{
break;
}
if index != 0 && 0 != ((**element).TrustStatus.dwInfoStatus
& CERT_TRUST_IS_SELF_SIGNED) {
break;
}

let context = (**element).pCertContext;
Expand Down
2 changes: 1 addition & 1 deletion src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl CngSigner {

unsafe {
let status = BCryptHash(
alg as *mut core::ffi::c_void,
alg,
std::ptr::null_mut(), // pbSecret
0, // cbSecret
message.as_ptr() as *mut u8,
Expand Down
9 changes: 3 additions & 6 deletions src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,9 @@ impl CertStore {
CERT_SHA256_HASH_PROP_ID,
prop_data.as_mut_ptr() as *mut c_void,
&mut prop_data_len,
) != 0
{
if prop_data[..prop_data_len as usize] == sha256_hash[..] {
let cert = CertDuplicateCertificateContext(cert);
certs.push(CertContext::new_owned(cert))
}
) != 0 && prop_data[..prop_data_len as usize] == sha256_hash[..] {
let cert = CertDuplicateCertificateContext(cert);
certs.push(CertContext::new_owned(cert))
}
}
}
Expand Down

0 comments on commit eb11dcf

Please sign in to comment.