From 8ca74dd4517a5c8e10238aea5cf1de7a36870240 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 14 Nov 2016 01:52:16 -0500 Subject: Cargo.lock: Upgrade to Rust 1.13.0 Rebuild the program with the latest stable version of Rust. --- Cargo.lock | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 826c61a..1570fa1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,3 +185,26 @@ dependencies = [ "pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[metadata] +"checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +"checksum clipboard 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "811169a9ffda99ed1841a6db3c48cffbab9a9101376f77fee3c14a7581ab933d" +"checksum clipboard-win 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "238830bd83336a8620cbc1d6edf6b9222f45a2c52d02c164348fb6b466277b21" +"checksum gag 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c606f5c0da18075916377e73de8aec7c140e1b6110a3cf26ae1f47873529b47e" +"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +"checksum libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "23e3757828fa702a20072c37ff47938e9dd331b92fac6e223d26d4b7a55f7ee2" +"checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +"checksum objc 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7c9311aa5acd7bee14476afa0f0557f564e9d0d61218a8b833d9b1f871fa5fba" +"checksum objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +"checksum objc_id 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e4730aa1c64d722db45f7ccc4113a3e2c465d018de6db4d3e7dfe031e8c8a297" +"checksum pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8cee804ecc7eaf201a4a207241472cc870e825206f6c031e3ee2a72fa425f2fa" +"checksum rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2791d88c6defac799c3f20d74f094ca33b9332612d9aef9078519c82e4fe04a5" +"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" +"checksum rustty 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "79f6dcee0d7566faf07bc34682cae87115e93aa2dd9a29c7b8408ec898bd17b0" +"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" +"checksum tempfile 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9270837a93bad1b1dac18fe67e786b3c960513af86231f6f4f57fddd594ff0c8" +"checksum term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3deff8a2b3b6607d6d7cc32ac25c0b33709453ca9cceac006caac51e963cf94a" +"checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47" +"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +"checksum windows-error 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dfa34b3180ad6b4fe63cbc4fb773da4a83c5b3db8db15789051a4785f2b43e58" +"checksum x11 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bfc828b6baf54ccdde44e0b5f16e035ab9c54f60a0f0c218fb5ddbc6ab38a2a9" -- cgit v1.2.3 From 5f24d24ab4054dbcaf47b40736604abdabb32d10 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 14 Nov 2016 01:56:15 -0500 Subject: Clear clipboard on quit The last thing copied from Passextract will stick around in your clipboard, potentially opening up your password to accidental pasting or a clipboard exploit. Pass deals with this in a nice way, by restoring your clipboard back to what was copied before after a set time delay. Here that same functionality is more difficult to achieve because the Clipboard crate can only deal with strings. So if for example you've copied a file, an image, a program's proprietary type, or some other binary data, it can't be restored with the Clipboard crate. Pass is able to do this because it uses the OS X `pbcopy`/`pbpaste` commands under the hood, which do support binary data. We could do that here I suppose, but it's easier and cross-platform to leverage a library. My heavy-handed solution to the problem of clipboard insecurity is to just overwrite the clipboard with an empty string when Passextract quits. The solution is not ideal because it doesn't preserve your past clipboard entry, and it forces you to keep the Passextract menu open until you paste the copied entry, but it's better than nothing when it comes to keeping the clipboard secure. If there's an error writing to the clipboard, Passextract will refuse to quit. --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 8e497c7..2a196d3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -117,7 +117,11 @@ fn main() { if let Some(Event::Key(ch)) = evt { match ch { 'q' | '\x03' => { - break; + // Clear the clipboard on quit + match clipboard_ctx.set_contents("".to_owned()) { + Ok(_) => break, + Err(_) => continue, + } } 'j' => { if selection.y < options.len() + 1 { -- cgit v1.2.3 From 5468de66d858ea1dfddc4abf9486dd11c259ac44 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 14 Nov 2016 02:14:02 -0500 Subject: README: Add a note about the clipboard being cleared on quit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 03c1913..cd876ac 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ The included Bash completion file provides the same tab completion options as In the interactive UI, the following commands are available: - q or Ctrl-C: Quit + q or Ctrl-C: Quit and clear the clipboard j: Move the selection down k: Move the selection up g: Move the selection to the top -- cgit v1.2.3 From ba6e1914ae0484662485c3f35efabadfa883d09d Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 14 Nov 2016 02:17:08 -0500 Subject: Cargo: Increase version v0.2.0 -> v0.3.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1570fa1..ee5552b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ [root] name = "passextract" -version = "0.2.0" +version = "0.3.0" dependencies = [ "clipboard 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustty 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 1cc070e..1e32be0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "passextract" -version = "0.2.0" +version = "0.3.0" [dependencies] clipboard = "0.1.2" -- cgit v1.2.3