Update to support the latest KeePassXC

This commit is contained in:
varjolintu
2021-01-16 14:39:56 +02:00
parent 211ae91e36
commit 338735e6f4
4 changed files with 90 additions and 90 deletions
Generated
+25 -25
View File
@@ -1,91 +1,91 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.0.3" version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789"
[[package]] [[package]]
name = "byteorder" name = "byteorder"
version = "1.1.0" version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff81738b726f5d099632ceaffe7fb65b90212e8dce59d518729e7e8634032d3d"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.18" version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2119ea4867bd2b8ed3aecab467709720b2d55b1bcfe09f772fd68066eaf15275"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
version = "0.1.5" version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3"
[[package]] [[package]]
name = "keepassxc-proxy" name = "keepassxc-proxy"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder",
"named_pipe 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "named_pipe",
"nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "nix",
] ]
[[package]] [[package]]
name = "kernel32-sys" name = "kernel32-sys"
version = "0.2.2" version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
dependencies = [ dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-build",
] ]
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.43" version = "0.2.43"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"
[[package]] [[package]]
name = "named_pipe" name = "named_pipe"
version = "0.2.4" version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "516fe2b5b1131f912a3d4e0cbfec369ca9a65f89d477c15d86ef0fc376faaa55"
dependencies = [ dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi",
] ]
[[package]] [[package]]
name = "nix" name = "nix"
version = "0.11.0" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17"
dependencies = [ dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags",
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", "cc",
"cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "libc",
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "void",
] ]
[[package]] [[package]]
name = "void" name = "void"
version = "1.0.2" version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
[[package]] [[package]]
name = "winapi" name = "winapi"
version = "0.2.8" version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
[[package]] [[package]]
name = "winapi-build" name = "winapi-build"
version = "0.1.1" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
[metadata]
"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789"
"checksum byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff81738b726f5d099632ceaffe7fb65b90212e8dce59d518729e7e8634032d3d"
"checksum cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "2119ea4867bd2b8ed3aecab467709720b2d55b1bcfe09f772fd68066eaf15275"
"checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"
"checksum named_pipe 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "516fe2b5b1131f912a3d4e0cbfec369ca9a65f89d477c15d86ef0fc376faaa55"
"checksum nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17"
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
"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"
+3 -3
View File
@@ -4,11 +4,11 @@ Application that works as a proxy between Native Messaging browser extension and
This is still under development. Installing the proxy needs manual changes to JSON scripts installed for Native Messaging. This is still under development. Installing the proxy needs manual changes to JSON scripts installed for Native Messaging.
See [this page](https://developer.chrome.com/extensions/nativeMessaging) for further information. See [this page](https://developer.chrome.com/extensions/nativeMessaging) for further information.
keepassxc-proxy listens stdin from keepassxc-browser extension and transfers the data to Unix domain socket `XDG_RUNTIME_DIR` or `/tmp/kpxc_server` which KeePassXC listens. keepassxc-proxy listens stdin from keepassxc-browser extension and transfers the data to Unix domain socket `XDG_RUNTIME_DIR` or `/tmp/org.keepassxc.KeePassXC.BrowserServer` which KeePassXC listens.
With Windows this is a named pipe under `keepassxc\<username>\kpxc_server`. With Windows this is a named pipe under `org.keepassxc.KeePassXC.BrowserServer\<username>`.
``` ```
Copyright (C) 2017-2018 Sami Vänttinen <sami.vanttinen@protonmail.com> Copyright (C) 2017-2021 Sami Vänttinen <sami.vanttinen@protonmail.com>
Copyright (C) 2017-2018 Andy Brandt <andy@brandt.tech> Copyright (C) 2017-2018 Andy Brandt <andy@brandt.tech>
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
+2 -2
View File
@@ -34,7 +34,7 @@ impl<W: Write> Write for ProxySocket<W> {
#[cfg(windows)] #[cfg(windows)]
pub fn connect(buffer_size: u32) -> io::Result<ProxySocket<PipeClient>> { pub fn connect(buffer_size: u32) -> io::Result<ProxySocket<PipeClient>> {
let username = env::var("USERNAME").unwrap(); let username = env::var("USERNAME").unwrap();
let pipe_name = format!("\\\\.\\pipe\\keepassxc\\{}\\kpxc_server", username); let pipe_name = format!("\\\\.\\pipe\\keepassxc\\{}\\org.keepassxc.KeePassXC.BrowserServer", username);
let client = PipeClient::connect(pipe_name)?; let client = PipeClient::connect(pipe_name)?;
Ok(ProxySocket { inner: client }) Ok(ProxySocket { inner: client })
} }
@@ -43,7 +43,7 @@ pub fn connect(buffer_size: u32) -> io::Result<ProxySocket<PipeClient>> {
pub fn connect(buffer_size: u32) -> io::Result<ProxySocket<UnixStream>> { pub fn connect(buffer_size: u32) -> io::Result<ProxySocket<UnixStream>> {
use std::time::Duration; use std::time::Duration;
let socket_name = "kpxc_server"; let socket_name = "org.keepassxc.KeePassXC.BrowserServer";
let socket: String; let socket: String;
if let Ok(dir) = if cfg!(target_os = "macos") {env::var("TMPDIR") } else { env::var("XDG_RUNTIME_DIR") } { if let Ok(dir) = if cfg!(target_os = "macos") {env::var("TMPDIR") } else { env::var("XDG_RUNTIME_DIR") } {
socket = format!("{}/{}", dir, socket_name); socket = format!("{}/{}", dir, socket_name);