Skip to content

Commit 373d647

Browse files
Merge pull request #12 from Komplementariteten/perp_v0.1
- Test Fixes
2 parents 57f52ad + d234741 commit 373d647

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rs-pwsafe"
3-
version = "0.0.6"
3+
version = "0.0.7"
44
edition = "2021"
55
description = "A readonly implementation of the pwsafe file format"
66
readme = "README.md"

src/bin/pw-safe-lookup.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@ fn main() {
3232
}
3333
};
3434

35-
/* println!("Please enter the pw-safe password:");
35+
println!("Please enter the pw-safe password:");
3636
let mut pw_str = String::new();
37-
let _ = io::stdin().read_line(&mut pw_str); */
38-
let pw_str = "PswSafe123".to_string();
39-
37+
let _ = io::stdin().read_line(&mut pw_str);
4038

4139
match file.unlock(&pw_str.trim()) {
4240
Ok(_) => (),

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
//!
33
//! A libary to read pw-safe files and decrypt them
44
//! currently only version 3 is supported
5+
extern crate core;
6+
57
mod pwsfile;
68
pub mod pwserrors;
79
pub mod pwsdb;

src/pwsdb/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,14 @@ mod tests {
192192
let mut safe = PwSafeEncrypted::new();
193193
assert!(safe.check_format(&data_buf).is_ok());
194194
assert!(safe.load(&data_buf).is_ok());
195-
let pt = match safe.unlock("PswSafe123".to_string()) {
195+
let pt = match safe.prepare_db("PswSafe123".to_string()) {
196+
Ok(d) => d,
197+
Err(e) => panic!("{:?}", e)
198+
};
199+
let db: PwDb = match pt.try_into() {
196200
Ok(d) => d,
197201
Err(e) => panic!("{:?}", e)
198202
};
199-
let mut db = PwDb::new();
200-
let _ = db.load(pt);
201203
assert!(db.header.len() > 0);
202204
}
203205
}

0 commit comments

Comments
 (0)