Skip to content

Commit

Permalink
Fix zeroize on language (#31)
Browse files Browse the repository at this point in the history
* Fix zeroize on Language enum

* Version bump

* Formatting
  • Loading branch information
maciejhirsz authored Sep 22, 2021
1 parent 2bafd5d commit b12ff5b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tiny-bip39"
version = "0.8.0"
version = "0.8.1"
authors = [
"Stephen Oliver <[email protected]>",
"Maciej Hirsz <[email protected]>",
Expand Down
4 changes: 1 addition & 3 deletions src/language.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::error::ErrorKind;
use crate::util::{Bits, Bits11};
use rustc_hash::FxHashMap;
use zeroize::Zeroize;

pub struct WordMap {
inner: FxHashMap<&'static str, Bits11>,
Expand Down Expand Up @@ -113,8 +112,7 @@ mod lazy {
///
/// [Mnemonic]: ./mnemonic/struct.Mnemonic.html
/// [Seed]: ./seed/struct.Seed.html
#[derive(Debug, Clone, Copy, PartialEq, Zeroize)]
#[zeroize(drop)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Language {
English,
#[cfg(feature = "chinese-simplified")]
Expand Down
2 changes: 1 addition & 1 deletion src/mnemonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl Mnemonic {
// this also validates the checksum and phrase length before returning the entropy so we
// can store it. We don't use the validate function here to avoid having a public API that
// takes a phrase string and returns the entropy directly.
let entropy = Zeroizing::new( Mnemonic::phrase_to_entropy(&phrase, lang)?);
let entropy = Zeroizing::new(Mnemonic::phrase_to_entropy(&phrase, lang)?);

let mnemonic = Mnemonic {
phrase,
Expand Down

0 comments on commit b12ff5b

Please sign in to comment.