Skip to content

Commit

Permalink
No need
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Mar 28, 2023
1 parent c153c5d commit ccfd221
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: Rust

on:
push:
# branches:
Expand All @@ -8,6 +6,10 @@ on:
# - "*"
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
CARGO_INCREMENTAL: 0
RUST_TEST_THREADS: 1
Expand All @@ -25,6 +27,11 @@ jobs:
channel: 1.46.0
steps:
- uses: actions/checkout@v3
# If targeting old cargo without sparse indices, fetch first
- uses: dtolnay/rust-toolchain@stable
if: matrix.channel != 'nightly'
- run: cargo fetch
if: matrix.channel != 'nightly'
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.channel }}
Expand All @@ -33,6 +40,7 @@ jobs:
uses: MinoruSekine/setup-scoop@main
- if: matrix.target == 'i686-pc-windows-gnu'
run: |
scoop install -a 32bit mingw-winlibs
scoop install -a 32bit mingw
Join-Path (Resolve-Path ~).Path "scoop\apps\mingw\current\bin" >> $env:GITHUB_PATH
- run: cargo +${{ matrix.channel }} build --tests --target ${{ matrix.target }}
- run: cargo +${{ matrix.channel }} test --target ${{ matrix.target }}
4 changes: 2 additions & 2 deletions src/bindings/cryptography.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ pub struct CRYPT_PRIVATE_KEY_INFO {
pub pAttributes: *mut CRYPT_ATTRIBUTES,
}

//#[link(name = "crypt32")]
#[link(name = "windows")] // crypt32
extern "system" {
pub fn CertDuplicateCertificateChain(
pChainContext: *const CERT_CHAIN_CONTEXT,
Expand Down Expand Up @@ -634,7 +634,7 @@ extern "system" {
) -> *mut CERT_CONTEXT;
}

//#[link(name = "advapi32")]
#[link(name = "windows")] // advapi32
extern "system" {
pub fn CryptReleaseContext(hProv: usize, dwFlags: u32) -> BOOL;
pub fn CryptImportKey(
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub type SEC_GET_KEY_FN = Option<
),
>;

//#[link(name = "secur32")]
#[link(name = "windows")] // secur32
extern "system" {
pub fn AcquireCredentialsHandleA(
pszPrincipal: *const u8,
Expand Down
2 changes: 1 addition & 1 deletion src/crypt_prov.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl ProviderType {
}
}

//#[link(name = "kernel32")]
#[link(name = "windows")] // kernel3
extern "system" {
fn LocalFree(hMem: isize) -> isize;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ncrypt_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct NcryptKey(Cryptography::NCRYPT_KEY_HANDLE);

impl Drop for NcryptKey {
fn drop(&mut self) {
//#[link(name = "ncrypt")]
#[link(name = "windows")] // ncrypt
extern "system" {
pub fn NCryptFreeObject(hObject: usize) -> i32;
}
Expand Down
8 changes: 4 additions & 4 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod time {
pub dwLowDateTime: u32,
pub dwHighDateTime: u32,
}
//#[link(name = "kernel32")]
#[link(name = "windows")] // kernel32
extern "system" {
pub fn GetSystemTime(lpSystemTime: *mut SYSTEMTIME);
pub fn SystemTimeToFileTime(
Expand Down Expand Up @@ -76,7 +76,7 @@ mod test_bindings {
pub rgExtension: *mut CERT_EXTENSION,
}

//#[link(name = "crypt32")]
#[link(name = "windows")] // crypt32
extern "system" {
pub fn CertCreateSelfSignCertificate(
hCryptProvOrNCryptKey: HCRYPTPROV_OR_NCRYPT_KEY_HANDLE,
Expand All @@ -100,7 +100,7 @@ mod test_bindings {
) -> BOOL;
}

//#[link(name = "advapi32")]
#[link(name = "windows")] // advapi32
extern "system" {
pub fn CryptGenKey(
hProv: usize,
Expand Down Expand Up @@ -633,7 +633,7 @@ test suite with SCHANNEL_RS_SKIP_SERVER_TESTS=1.
}

fn local_root_store() -> CertStore {
if env::var("APPVEYOR").is_ok() {
if env::var("APPVEYOR").is_ok() || env::var("CI").is_ok() {
CertStore::open_local_machine("Root").unwrap()
} else {
CertStore::open_current_user("Root").unwrap()
Expand Down

0 comments on commit ccfd221

Please sign in to comment.