Commit Graph

3361 Commits

Author SHA1 Message Date
Jonathan White
125a81f2ed Implement 1Password Vault Import
* Support importing 1Password vaults (.opvault folders) into KDBX database
* Entry attributes are filled based on section and field name
* Expiration dates are set for entries
* Entry URL's are set from a wider array of fields
2019-05-19 18:21:34 -04:00
varjolintu
7ce6f9d3b1 Disable creating the default group 2019-05-19 00:22:11 -04:00
Jonathan White
ecaa4fd6ce Fix opening url's with non-http schema
* Fix #2427
* Changed the openUrl() function to use a QUrl object, which has the appropriate scheme set.
* Preview widget now passes url handling back to DatabaseWidget
2019-05-19 00:20:43 -04:00
Jonathan White
baa55d1597
Support Ubuntu Disco packages in snap 2019-05-16 18:03:29 -04:00
Jonathan White
63855346bf Fix global Auto-Type when database locked
* Store the currently active window right when the global keyboard shortcut is triggered
* Eliminate unnecessary window raise/lower and delays on macOS
* Remove duplicate addition of macutils symbols from mac Auto-Type plugin
* Fix tests to fake trigger a global autotype sequence
2019-05-12 12:37:50 -04:00
Aetf
e121f4bc28 Add Freedesktop.org Secret Storage Spec Server Side API (Fix #1403)
This plugin implements the Secret Storage specification version 0.2.
While running KeePassXC, it acts as a Secret Service server, registered
on DBus, so clients like seahorse, python-secretstorage, or other
implementations can connect and access the exposed database in KeePassXC.

Squashed commits:

- Initial code
- Add SessionAdaptor and fix build
- The skeletons for all dbus objects are in place
- Implement collection creation and deletion
- Emit collectionChanged signal
- Implement app-wise settings page
- Implement error message on GUI
- Implement settings
- Fix uuid to dbus path
- Implement app level settings
- Add freedesktop logo
- Implement database settings page
- Change database settings to a treeview
- Move all settings read/write to one place
- Rename SecretServiceOptionsPage to SettingsWidgetFdoSecrets
- Fix selected group can not be saved if the user hasn't click on the item
- Show selected group per database in app settings
- Disable editing of various readonly widgets
- Remove unused warning about non exposed database
- Fix method signature on dbus adaptors
- Fix type derived from DBusObject not recognized as QDBusContext
- Resolve a few TODOs around error handling
- Remove const when passing DBus exposed objects
- Move dismiss to PromptBase
- Implement per collection locking/unlocking
- Fix const correctness on Item::setSecret
- Implement SecretService::getSecrets
- Rework the signal connections around collections.
- Remove generateId from DBusObject
- Per spec, use encoded label as DBus object path for collections
- Fix some corner cases around collection name changes
- Implement alias
- Fix wrong alias dbus path
- Implement encryption per spec
- Cleanup SessionCipher
- Implement searchItems for SecretService
- Use Tools::uuidToHex
- Implement Item attributes and delete
- Implement createItem
- Always check if the database is unlocked before perform any operation
- Add missing ReadAlias/SetAlias on service
- Reorganize and fix OpenSession always returning empty output
- Overhaul error handling
- Make sure default alias is always present
- Remove collection aliases early in doDelete
- Handles all content types, fix setProperties not working
- Fix sometimes there is an extraneous leading zero when converting from MPI
- Fix session encryption negotiation
- Do not expose recycle bin
- Protect against the methods not called from DBus
- Also emit collectionChanged signal when lock state changes
- Show notification when entry secret is requested
- Add a README file
- Actually close session when client disconnects
- Gracefully return alternative label when collection is locked
- Reorganize, rename secretservice to fdosecrets
- Fix issues reported by clazy
- Unify UI strings and fix icon
- Implement a setting to skip confirmation when deleting entries from DBus
- Remove some unused debugging log
- Simply ignore errors when DBus context is not available. QtDBus won't set QDBusContext when deliver property get/set, and there is no way to get a QDBusMessage in property getter/setter.
- Simplify GcryptMPI using std::unique_ptr and add unit test
- Format code in fdosecrets
- Move DBusReturnImpl to details namespace
- Fix crash when locking a database: don't modify exposedGroup setting in customData when database is deleted
- Make sure Collection::searchItems works, whether it's locked or not
- Fix FdoSecrets::Collection becomes empty after a database reload
- Fix crash when looping while modifying the list
2019-05-12 12:35:42 -04:00
Aetf
d93f33f514 Improve existing code prior to implementing FDO Secrets
* DatabaseTabWidget::newDatabase returns the created DatabaseWidget
* Emit DatabaseTabWidget::databaseOpened signal before a new tab is added
* EntrySearcher can now search attribute values including custom ones
* Add Group::applyGroupIconTo to set the group icon on the supplied entry
* Implement desktop notifications through the system tray icon
* Add DatabaseWidget::deleteEntries to delete a list of entries
* Add Aes128 in SymmetricCipher::algorithmIvSize
* Add DatabaseWidget::databaseReplaced signal
* Add a helper class to override the message box's parent (prevent bugs)
2019-05-12 12:35:42 -04:00
varjolintu
fed8a56098 Add option for returning expired credentials 2019-05-09 10:31:51 -04:00
Jonathan White
bc891761b6
Merge branch 'release/2.4.2' into develop 2019-05-07 13:00:27 -04:00
Jonathan White
247b85fe69
Update INSTALL.md and cleanup CMakeLists.txt (#3074)
INSTALL.md
* Better organization of CMake options

CMakeLists.txt
* If WITH_XC_NETWORKING is disabled, also disable WITH_XC_UPDATECHECK
* Move KeeShare logic into KeeShare CMakeLists.txt
* Remove WITH_XC_KEESHARE_SECURE build option
* Attempt to find quazip, if found enable WITH_XC_KEESHARE_SECURE and build with secure container support
2019-05-07 12:56:55 -04:00
Jonathan White
faf7a2bbb3 Robust processing of tray icon triggers
* Support double click on tray icon to always toggle window to/from tray
* Single click on tray icon will bring window to front if in background, otherwise window is toggled
* Fixes #2956
2019-05-04 16:45:03 -04:00
varjolintu
ebe6649683 Lock database on switching user in macOS 2019-05-02 14:32:44 -04:00
Sami Vänttinen
e4eee897f9 Support Database Custom Data Merging (#3002)
* Introduce _LAST_MODIFIED custom data entry that stores the last modified datetime of the database's custom data entries
* Merge custom data from source database to target
* Modify tests to be aware of _LAST_MODIFIED entry
2019-05-01 18:35:08 -04:00
Janek Bevendorff
01a3d5b0ba Fix QuaZip find module on macOS and clean up code.
Finding libquazip failed on macOS due to path differences.
This patch also cleans up the find module's code, aligns it
with the coding style of the other CMake files and removes
clutter that is not needed for KeePassXC such as non-Msys
builds on Windows.
2019-05-01 18:25:32 -04:00
varjolintu
0f8d2986af Close popups when database is locked 2019-05-01 18:05:19 -04:00
Oirio Joshi
a2caa31eca Snap: fix theming (#3057)
Use gtk3 file chooser dialogs, mouse coursor theme if available and force fallback icon theme, fixes issue #2966
2019-04-25 10:39:06 -04:00
Jack Thomasson
1cbd395d71 multiple database with --pw-stdin (#2916)
* Updated utilities to unlock KDBX with OS password manager on macOS and Linux
* Use a static stream on stdin for --pw-stdin otherwise buffer loss eliminates subsequent passwords
* Update INSTALL requirements
2019-04-25 10:37:13 -04:00
Janek Bevendorff
d3a53a702e
Set console code page to CP_UTF8 on Windows if supported. (#3050)
Previously, we enforced code page 850 for all console input and output,
which breaks with non-western scripts. Since more recent Windows shells
are able to display Unicode properly, this patch now enforces UTF-8 and
falls back to code page 850 only if UTF-8 is unsupported.

Non-Windows systems default to UTF-8, but can override the codec
by setting the LANG environment variable to something other than C.

Resolves #3049.
2019-04-25 09:28:48 +02:00
Janek Bevendorff
13eb1c0bbd Improve resilience against memory attacks
To reduce residual fragments of secret data in memory after
deallocation, this patch replaces the global delete operator with a
version that zeros out previously allocated memory. It makes use of
the new C++14 sized deallocation, but provides an unsized fallback
with platform-specific size deductions.

This change is only a minor mitigation and cannot protect against
buffer reallocations by the operating system or non-C++ libraries.
Thus, we still cannot guarantee all memory to be wiped after free.

As a further improvement, this patch uses libgcrypt and libsodium
to write long-lived master key component hashes into a secure
memory area and wipe it afterwards.

The patch also fixes compiler flags not being set properly on macOS.
2019-04-21 09:39:28 -04:00
joshirio
c7898fdeee Snap: fix session database locking 2019-04-20 14:48:38 -04:00
Jonathan White
53796a216e Windows: use winqtdeploy instead of DeplyQt4 from CMake (#3025)
* Ensure Qt dlls find plugins in bundled directory
* Reduce complexity of deployment code
* Standardize use of CMAKE_BUILD_TYPE_LOWER for more robust comparisons

Fixes #3023. Fixes part of #1535.
2019-04-20 18:12:00 +02:00
Jonathan White
219a0f40ff Prevent infinite save loop when location is unavailable (#3026)
This bug impacted unsafe saves. When auto save after every change was enabled, an
unsafe save to a location that has become unavailable (eg, dismounted veracrypt drive),
the database modified signal would continually activate a save action that failed.
This caused an infinite loop.

When auto-save on exit was enabled, the database tab and the application itself refused to
close if saving failed for whatever reason.

The fixes in this commit prevent both of these scenarios from occurring.
2019-04-20 18:10:07 +02:00
Jonathan White
bbe7e8a45a Use QLocale for translation search instead of custom method (#3035)
Use built-in facilities of Qt to traverse QLocale::uiLanguages() to find a valid "most preferred"
language, but still respect user's choice in the application settings.
Fixes #3030. Fixes #1924.
2019-04-20 18:00:45 +02:00
Jonathan White
acd6847cd4 Support Ctrl+Enter shortcut on all dialogs with QPushButtonBox (#3039)
* Remove specific action from EditEntryWidget
* Implement key handling at the lowest level
* Fix #3036
2019-04-20 17:54:25 +02:00
Jonathan White
cb442f8c6e Don't mark entry edit as modified when attribute selection changes (#3041)
When selecting another attribute in the advanced tab, do not mark the entry as modified
(nothing was changed). Also do not mark as modified when the notes checkbox is
checked/unchecked (doesn't change entry). Fixes #3013.
2019-04-20 17:51:15 +02:00
Jonathan White
7d46ce3de1 Correct CLI help messages on Windows
* Prevents keepassxc-cli.exe -> keepassxc-cli show.exe
* Fixes #3032
2019-04-20 11:03:06 -04:00
Jonathan White
5b28610c6a Remove apply button from application settings 2019-04-17 08:57:51 -04:00
Jonathan White
42d34a1999 Made changes to streamline icon downloading process 2019-04-16 23:02:46 -04:00
Xaver Maierhofer
12e020b7c2 Add option to prefer DuckDuckGo 2019-04-16 23:02:46 -04:00
Allen Wild
7bd079d48d
add Lock Databases option to tray icon menu
This is useful when keepassxc is minimized/hidden to the tray, and all
the plumbing is already in place from the lock icon button in the main
window UI.
2019-04-16 21:09:51 -04:00
Jonathan White
a0c84dbd0d
Bump version numbers to 2.4.2 2019-04-16 21:09:42 -04:00
Jonathan White
ba4d68c76e
Bump version numbers to 2.5.0 2019-04-16 21:08:02 -04:00
Christian Kieschnick
7067a4d004 Fix canceling cancel request in edited group
In case of a modified group, pressing cancel in the confirmation dialog
of cancel led to discarding the changes instead of returning to the edit widget.
2019-04-16 10:07:46 -04:00
Jonathan White
663467e214 Fix macOS Toolbar Button color
* Correct color setting only if dark mode is enabled
2019-04-16 10:07:30 -04:00
Bryan Jacobs
04983ce4cd Support for RFC-compliant TOTP hashes #873 #1566
This implements support for SHA-256 and SHA-512 hash algorithms when
generating TOTP codes. These algorithms are specified by RFC6238. The
implementation is compatible with Google's OTP URL format, as well as
with the KeeOTP plugin for KeePass.

The implementation is not wired into the GUI, as the main project
developer expressed strong negative sentiment about adding more
options there. It is possible to configure codes by putting the
appropriate string into the entry's otp property, or using another
program with a less opinionated UI and a compatible on-disk format.
2019-04-15 14:23:26 -04:00
Toni Spets
61b1f8c966 Add free text filter to Auto-Type dialog (#2955)
* Fixes #2944
2019-04-15 14:19:58 -04:00
Weslly
7546ba7406
Remove hardcoded background color from search help widget 2019-04-15 14:14:56 -04:00
Weslly
8e19843db7 Remove hardcoded background color from search help widget 2019-04-13 18:21:42 -04:00
Gianluca Recchia
c3ae446fd9 Fix syntax highlighting in CONTRIBUTING.md (#2997)
Code snippets are now marked as cpp so that GitHub highlights them
correctly.
2019-04-13 16:31:43 +02:00
Jonathan White
d5d51d668f
Merge branch 'master' into develop 2019-04-12 18:23:23 -04:00
Jonathan White
7bafe65d17
Release 2.4.1
- Fix database deletion when using unsafe saves to a different file system [#2889]
- Fix opening databases with legacy key files that contain '/' [#2872]
- Fix opening database files from the command line [#2919]
- Fix crash when editing master key [#2836]
- Fix multiple issues with apply button behavior [#2947]
- Fix issues on application startup (tab order, --pw-stdin, etc.) [#2830]
- Fix building without WITH_XC_KEESHARE
- Fix reference entry coloring on macOS dark mode [#2984]
- Hide window when performing entry auto-type on macOS [#2969]
- Improve UX of update checker; reduce checks to every 7 days [#2968]
- KeeShare improvements [#2946, #2978, #2824]
- Re-enable Ctrl+C to copy password from search box [#2947]
- Add KeePassXC-Browser integration for Brave browser [#2933]
- SSH Agent: Re-Add keys on database unlock [#2982]
- SSH Agent: Only remove keys on app exit if they are removed on lock [#2985]
- CLI: Add --no-password option [#2708]
- CLI: Improve database extraction to XML [#2698]
- CLI: Don't call mandb on build [#2774]
- CLI: Add debug info [#2714]
- Improve support for Snap theming [#2832]
- Add support for building on Haiku OS [#2859]
- Ctrl+PgDn now goes to the next tab and Ctrl+PgUp to the previous
- Fix compiling on GCC 5 / Xenial [#2990]
- Add .gitrev output to tarball for third-party builds [#2970]
- Add WITH_XC_UPDATECHECK compile flag to toggle the update checker [#2968]
2019-04-12 18:12:12 -04:00
Jonathan White
5b007ece14
Update translations 2019-04-12 18:11:57 -04:00
Jonathan White
0d4318e466
Version bump to 2.4.1 2019-04-12 18:10:39 -04:00
Jonathan White
b97cc1d398
Reverse direction of CTRL+PGUP/PGDN
* Conform to standard selection direction
2019-04-12 16:37:13 -04:00
Weslly
fbba5b1420 Fix conditional build flags for yubikey and keeshare 2019-04-12 16:29:13 -04:00
Christian Kieschnick
05bee40f0a Fix duplicate icon add in export
SharedObserver did not check for already added icons add during export
leading to duplicate icons in the target db.
2019-04-12 16:14:23 -04:00
Jonathan White
771ecdba12
Fix missing function definition on macOS 2019-04-12 16:08:38 -04:00
ckieschnick
2eb82c8356 Improve file tracking in BulkFileWatcher (#2978)
Introduce modification-based change tracking in BulkFileWatcher to
reduce emitted signals caused by file changes within the same directory.
Resolves #2895.
2019-04-12 19:59:50 +02:00
Jonathan White
e7815787c7 Fix referenced entry color on macOS dark mode (#2984)
Introduce macUtils()->isDarkMode() function to detect Mojave dark
mode and correct reference entry text color. Fixes #860.
2019-04-12 19:57:49 +02:00
Jonathan White
cc27a367d6 Only remove keys on exit if they would remove on lock (#2985)
* Don't remove keys on app exit that would not be removed due to database locking.
* Restores behavior from 2.3.4
* Fixes #2980
2019-04-12 19:55:28 +02:00