Skip to content

Commit

Permalink
windows: reorder items
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Aug 29, 2024
1 parent a370164 commit cc1222a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ use pki_types::CertificateDer;
use schannel::cert_context::ValidUses;
use schannel::cert_store::CertStore;

static PKIX_SERVER_AUTH: &str = "1.3.6.1.5.5.7.3.1";

fn usable_for_rustls(uses: ValidUses) -> bool {
match uses {
ValidUses::All => true,
ValidUses::Oids(strs) => strs
.iter()
.any(|x| x == PKIX_SERVER_AUTH),
}
}

pub fn load_native_certs() -> Result<Vec<CertificateDer<'static>>, Error> {
let mut certs = Vec::new();

Expand All @@ -28,3 +17,14 @@ pub fn load_native_certs() -> Result<Vec<CertificateDer<'static>>, Error> {

Ok(certs)
}

fn usable_for_rustls(uses: ValidUses) -> bool {
match uses {
ValidUses::All => true,
ValidUses::Oids(strs) => strs
.iter()
.any(|x| x == PKIX_SERVER_AUTH),
}
}

static PKIX_SERVER_AUTH: &str = "1.3.6.1.5.5.7.3.1";

0 comments on commit cc1222a

Please sign in to comment.