Skip to content

Commit

Permalink
Merge pull request #327 from helium/madninja/fix_pwhash
Browse files Browse the repository at this point in the history
Fix pwhash, update crypto-rs
  • Loading branch information
madninja authored Aug 16, 2023
2 parents dccd1e6 + a81eb42 commit f6d2c16
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 22 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 33 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,48 @@ hmac = "0.12"
sha2 = "0.10"
base64 = ">=0.21"
bs58 = "0"
reqwest = {version = "0", default-features=false, features=["blocking", "rustls-tls"]}
pbkdf2 = {version = "0", default-features=false }
reqwest = { version = "0", default-features = false, features = [
"blocking",
"rustls-tls",
] }
pbkdf2 = { version = "0", default-features = false }
aes-gcm = "0"
shamirsecretsharing = {version="0.1.5", features=["have_libsodium"]}
shamirsecretsharing = { version = "0.1.5", features = ["have_libsodium"] }
lazy_static = "1"
rand = "0.8"
qr2term = "0.2"
serde = "1"
serde = "1"
serde_json = "1"
rust_decimal = {version = "1", features = ["serde-float"] }
rust_decimal = { version = "1", features = ["serde-float"] }
rust_decimal_macros = "1"
h3o = "0"
rayon = "1"
angry-purple-tiger = "0"
clap = {version = "4", features = ["derive"]}
helium-crypto = { version = "0.7.3", features = ["multisig", "solana"]}
helium-proto = { git = "https://github.com/helium/proto", branch="master"}
data-credits = { git = "https://github.com/helium/helium-program-library", features = ["no-entrypoint"], branch = "master" }
lazy-distributor = { git = "https://github.com/helium/helium-program-library", features = ["no-entrypoint"], branch = "master" }
helium-entity-manager = { git = "https://github.com/helium/helium-program-library", features = ["no-entrypoint"], branch = "master" }
helium-sub-daos = { git = "https://github.com/helium/helium-program-library", features = ["no-entrypoint"], branch = "master" }
circuit-breaker = { git = "https://github.com/helium/helium-program-library", features = ["no-entrypoint"], branch = "master" }
bubblegum-cpi = {git = "https://github.com/helium/account-compression-anchor-gen.git", features = ["cpi"]}
account-compression-cpi = {git = "https://github.com/helium/account-compression-anchor-gen.git", features = ["cpi"]}
spl-associated-token-account = { version = "*", features = [ "no-entrypoint" ] }
clap = { version = "4", features = ["derive"] }
helium-crypto = { version = "0.8.0", features = ["multisig", "solana"] }
helium-proto = { git = "https://github.com/helium/proto", branch = "master" }
data-credits = { git = "https://github.com/helium/helium-program-library", features = [
"no-entrypoint",
], branch = "master" }
lazy-distributor = { git = "https://github.com/helium/helium-program-library", features = [
"no-entrypoint",
], branch = "master" }
helium-entity-manager = { git = "https://github.com/helium/helium-program-library", features = [
"no-entrypoint",
], branch = "master" }
helium-sub-daos = { git = "https://github.com/helium/helium-program-library", features = [
"no-entrypoint",
], branch = "master" }
circuit-breaker = { git = "https://github.com/helium/helium-program-library", features = [
"no-entrypoint",
], branch = "master" }
bubblegum-cpi = { git = "https://github.com/helium/account-compression-anchor-gen.git", features = [
"cpi",
] }
account-compression-cpi = { git = "https://github.com/helium/account-compression-anchor-gen.git", features = [
"cpi",
] }
spl-associated-token-account = { version = "*", features = ["no-entrypoint"] }
solana-program = "*"
bincode = "1.3.3"
pyth-sdk-solana = "0"
Expand Down
4 changes: 2 additions & 2 deletions src/pwhash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ impl Pbkdf2 {
}

pub fn pwhash(&self, password: &[u8], hash: &mut [u8]) -> Result {
pbkdf2::pbkdf2::<Hmac<Sha256>>(password, &self.salt, self.iterations, hash)
.map_err(|e| anyhow!("Failed to hash password: {e}"))
pbkdf2::pbkdf2::<Hmac<Sha256>>(password, &self.salt, self.iterations, hash);
Ok(())
}

pub fn read(&mut self, reader: &mut dyn io::Read) -> Result {
Expand Down

0 comments on commit f6d2c16

Please sign in to comment.