File tree Expand file tree Collapse file tree 4 files changed +10
-8
lines changed
Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " rs-pwsafe"
3- version = " 0.0.6 "
3+ version = " 0.0.7 "
44edition = " 2021"
55description = " A readonly implementation of the pwsafe file format"
66readme = " README.md"
Original file line number Diff line number Diff 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 ( _) => ( ) ,
Original file line number Diff line number Diff line change 22//!
33//! A libary to read pw-safe files and decrypt them
44//! currently only version 3 is supported
5+ extern crate core;
6+
57mod pwsfile;
68pub mod pwserrors;
79pub mod pwsdb;
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments