-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple alternative in C# (dotnet core) #1
Comments
Actually this project was originally a Qt project in favor of a cross-platform solution. For some reason certain messages were always corrupted so I ditched the solution. I think Python is not so great for an easy cross-platform solution for a proxy, so maybe I'll get back to the Qt version, but without Qt's own packet serializer so it would be easier to do what you just did, write your own proxy :) |
What IDE are you using for QT development? I never developed for Qt, but would like to start a bit, so I'm looking for IDE with UI designer. I know, there was QtDesigner by Nokia, but it seems it's not free anymore. |
Qt Creator. It's free for GPL licensed projects. |
Nice and simple code btw. Did you use Mono for compiling the source under Linux? I'm not so familiar with the current state of C# in Linux. |
To be honest I never coded in dotnet before, neither Win or Linux, but wanted to try dotnet core under Linux. No I didn't used mono. I used docker image https://github.com/dotnet/dotnet-docker. There is complete toolchain in one single container (will not mess your system with mono libs) and the best thing is, you can create stand-alone apps for multiple platforms. Standalone apps includes all required runtime libs, so even your users don't have to install anything. Dotnetcore is limited to cli and asp.net apps though. |
This is a really nice solution. For this "official" project I'm leaning towards a Qt solution, especially if keepassxc-proxy will be bundled with the KeePassXC release and binaries. |
Sure. I agree. This is not intended as official solution. |
Still, I like the idea and the simplicity very much :) |
Just realized that my proxy and also probably python version both might have same bug. So how current implementation of proxy work:
So basically what it's loop with two steps. 1. and 2. But if response from KeePassXC never comes back, because KeePassXC is not open or user declined to accept dialog, proxy is deadlocked. Cannot accept new requests as it's waiting for response, which will never come. The fix should be easy and possible. Remark: I might be also wrong here. Just thinking out loud. |
Ok fixed in my variant of proxy by adding socket receive timeout. If proxy doesn't receive response in 5 seconds it will throw Edit: But two more issues popped up. :(
So it's more complicated then I thought ;-) But getting there. |
Thank you for finding the same bug I'm currently investigating :) If you look the Python script you can see the socket has a five second timeout. For some reason I couldn't get the Python thread with UDP receiving work properly. And I admit I'm not an expert with Python, so there's probably something I'm forgetting. I also wondered why stdin messages are being corrupted. Actually this doesn't happen in the Python script but messages are corrupted in the Qt version. I'm not sure if it has something to do with the Boost libraries. Maybe I'll try to switch to Qt's own UDP socket library. The decrypt error is because KeePassXC received a public key from keepassxc-browser every time keepassxc-browser is started. And this where it comes back to showing the correct status. Currently this is a situation which is unrecognized. If keepassxc-browser receives that error it should be noted and new keys must be exchanged. Sometimes you can see a "Reload" button in the popup. But just using that is not reliable. I will fix that to the next version (tomorrow maybe). It should work in a way that if keepassxc-browser received that error it transfers new keys to KeePassXC before next request. |
I hacked simple alternative for python script in C# - dotnet core. Mostly intended for Windows user, but development and testing was actually done in Ubuntu 16.04. It doesn't have any dependencies as it is dotnet self contained app. Also it doesn't show any unnecessary dialog as python script.
More information and source:
https://github.com/mauron85/chrome_native_messaging_host
The text was updated successfully, but these errors were encountered: