Skip to content

Commit

Permalink
Additional Auto-Type improvements based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
droidmonkey committed Feb 14, 2021
1 parent f3e37d9 commit cfdfcd0
Show file tree
Hide file tree
Showing 8 changed files with 186 additions and 162 deletions.
2 changes: 1 addition & 1 deletion docs/topics/DatabaseOperations.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ image::database_security.png[]
+
.Database credentials
image::database_security_credentials.png[]

+
WARNING: Consider creating a backup of your YubiKey. Please refer to <<Creating a YubiKey backup>>

5. Encryption settings allows you to change the average time it takes to encrypt and decrypt the database. The longer time that is chosen, the harder it will be to brute force attack your database. *We recommend a setting of one second.*
Expand Down
310 changes: 167 additions & 143 deletions src/autotype/AutoType.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/autotype/AutoType.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private slots:
void resetAutoTypeState();

static QList<QSharedPointer<AutoTypeAction>>
parseActions(const QString& entrySequence, const Entry* entry, QString* error = nullptr);
parseSequence(const QString& entrySequence, const Entry* entry, QString& error, bool syntaxOnly = false);

QMutex m_inAutoType;
QMutex m_inGlobalAutoTypeDialog;
Expand Down
14 changes: 7 additions & 7 deletions src/autotype/mac/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
set(autotype_mac_SOURCES AutoTypeMac.cpp)

add_library(keepassx-autotype-cocoa MODULE ${autotype_mac_SOURCES})
set_target_properties(keepassx-autotype-cocoa PROPERTIES LINK_FLAGS "-framework Foundation -framework AppKit -framework Carbon")
target_link_libraries(keepassx-autotype-cocoa ${PROGNAME} Qt5::Core Qt5::Widgets)
add_library(keepassxc-autotype-cocoa MODULE ${autotype_mac_SOURCES})
set_target_properties(keepassxc-autotype-cocoa PROPERTIES LINK_FLAGS "-framework Foundation -framework AppKit -framework Carbon")
target_link_libraries(keepassxc-autotype-cocoa ${PROGNAME} Qt5::Core Qt5::Widgets)

if(WITH_APP_BUNDLE)
add_custom_command(TARGET keepassx-autotype-cocoa
add_custom_command(TARGET keepassxc-autotype-cocoa
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libkeepassx-autotype-cocoa.so ${PLUGIN_INSTALL_DIR}/libkeepassx-autotype-cocoa.so
COMMAND ${MACDEPLOYQT_EXE} ${PROGNAME}.app -executable=${PLUGIN_INSTALL_DIR}/libkeepassx-autotype-cocoa.so -no-plugins 2> /dev/null
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libkeepassxc-autotype-cocoa.so ${PLUGIN_INSTALL_DIR}/libkeepassxc-autotype-cocoa.so
COMMAND ${MACDEPLOYQT_EXE} ${PROGNAME}.app -executable=${PLUGIN_INSTALL_DIR}/libkeepassxc-autotype-cocoa.so -no-plugins 2> /dev/null
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src
COMMENT "Deploying autotype plugin")
else()
install(TARGETS keepassx-autotype-cocoa
install(TARGETS keepassxc-autotype-cocoa
BUNDLE DESTINATION . COMPONENT Runtime
LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR} COMPONENT Runtime)
endif()
4 changes: 2 additions & 2 deletions src/autotype/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(autotype_test_SOURCES AutoTypeTest.cpp)

add_library(keepassx-autotype-test MODULE ${autotype_test_SOURCES})
target_link_libraries(keepassx-autotype-test keepassx_core ${autotype_LIB} Qt5::Core Qt5::Widgets)
add_library(keepassxc-autotype-test MODULE ${autotype_test_SOURCES})
target_link_libraries(keepassxc-autotype-test keepassx_core ${autotype_LIB} Qt5::Core Qt5::Widgets)
6 changes: 3 additions & 3 deletions src/autotype/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(autotype_win_SOURCES AutoTypeWindows.cpp)

add_library(keepassx-autotype-windows MODULE ${autotype_win_SOURCES})
target_link_libraries(keepassx-autotype-windows keepassx_core ${autotype_LIB} Qt5::Core Qt5::Widgets)
install(TARGETS keepassx-autotype-windows
add_library(keepassxc-autotype-windows MODULE ${autotype_win_SOURCES})
target_link_libraries(keepassxc-autotype-windows keepassx_core ${autotype_LIB} Qt5::Core Qt5::Widgets)
install(TARGETS keepassxc-autotype-windows
BUNDLE DESTINATION . COMPONENT Runtime
LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR} COMPONENT Runtime)
6 changes: 3 additions & 3 deletions src/autotype/xcb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ include_directories(SYSTEM ${X11_X11_INCLUDE_PATH})

set(autotype_XCB_SOURCES AutoTypeXCB.cpp)

add_library(keepassx-autotype-xcb MODULE ${autotype_XCB_SOURCES})
target_link_libraries(keepassx-autotype-xcb keepassx_core Qt5::Core Qt5::Widgets Qt5::X11Extras ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_XTest_LIB})
install(TARGETS keepassx-autotype-xcb
add_library(keepassxc-autotype-xcb MODULE ${autotype_XCB_SOURCES})
target_link_libraries(keepassxc-autotype-xcb keepassx_core Qt5::Core Qt5::Widgets Qt5::X11Extras ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_XTest_LIB})
install(TARGETS keepassxc-autotype-xcb
BUNDLE DESTINATION . COMPONENT Runtime
LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR} COMPONENT Runtime)
4 changes: 2 additions & 2 deletions tests/TestAutoType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void TestAutoType::initTestCase()
config()->set(Config::Security_AutoTypeAsk, false);
AutoType::createTestInstance();

QPluginLoader loader(resources()->pluginPath("keepassx-autotype-test"));
QPluginLoader loader(resources()->pluginPath("keepassxc-autotype-test"));
loader.setLoadHints(QLibrary::ResolveAllSymbolsHint);
QVERIFY(loader.instance());

Expand Down Expand Up @@ -312,7 +312,7 @@ void TestAutoType::testAutoTypeResults_data()
QTest::newRow("T-CONV HEX") << QString("{T-CONV:/{USERNAME}/HEX/}") << QString("557365726e616d65");
QTest::newRow("T-CONV URI ENCODE") << QString("{T-CONV:/{URL}/URI/}") << QString("https%3A%2F%2Fexample.com");
QTest::newRow("T-CONV URI DECODE") << QString("{T-CONV:/{S:attr2}/URI-DEC/}") << QString("decode me");
QTest::newRow("T-REPLACE-RX") << QString("{T-REPLACE-RX:/{USERNAME}/User/Pass/}") << QString("Passname");
QTest::newRow("T-REPLACE-RX") << QString("{T-REPLACE-RX:/{USERNAME}/(User)/$1Pass/}") << QString("UserPassname");
}

void TestAutoType::testAutoTypeSyntaxChecks()
Expand Down

0 comments on commit cfdfcd0

Please sign in to comment.