Skip to content

Commit

Permalink
Upgrade to winapi-0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
malept committed Feb 17, 2018
1 parent 21059b7 commit 52dd06a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ hex = "0.3"
commoncrypto = "0.2"

[target.'cfg(target_os = "windows")'.dependencies]
advapi32-sys = "0.2"
winapi = "0.2"
winapi = { version = "0.3", features = ["minwindef", "wincrypt"] }

[target.'cfg(not(any(target_os = "windows", target_os = "macos")))'.dependencies]
openssl = "0.10"
9 changes: 5 additions & 4 deletions src/imp/cryptoapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
//! https://github.com/rust-lang/cargo/blob/0.10.0/src/cargo/util/sha256.rs
//! which is copyright (c) 2014 The Rust Project Developers under the MIT license.
use advapi32::{CryptAcquireContextW, CryptCreateHash, CryptDestroyHash, CryptGetHashParam,
CryptHashData, CryptReleaseContext};
use std::io;
use std::ptr;
use super::Algorithm;
use winapi::{CALG_MD5, CALG_SHA1, CALG_SHA_256, CALG_SHA_512, CRYPT_SILENT, CRYPT_VERIFYCONTEXT,
DWORD, HCRYPTHASH, HCRYPTPROV, HP_HASHVAL, PROV_RSA_AES};
use winapi::shared::minwindef::DWORD;
use winapi::um::wincrypt::{CALG_MD5, CALG_SHA1, CALG_SHA_256, CALG_SHA_512, CryptAcquireContextW,
CryptCreateHash, CryptDestroyHash, CryptGetHashParam, CryptHashData,
CryptReleaseContext, CRYPT_SILENT, CRYPT_VERIFYCONTEXT, HCRYPTHASH,
HCRYPTPROV, HP_HASHVAL, PROV_RSA_AES};

macro_rules! call {
($e: expr) => ({
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
#![warn(missing_docs)]

#[cfg(target_os = "windows")]
extern crate advapi32;
#[cfg(target_os = "macos")]
extern crate commoncrypto;
extern crate hex;
Expand Down

0 comments on commit 52dd06a

Please sign in to comment.