Skip to content
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

[WIP, RFC] Add support for displaying TOTP keys as QR codes #964

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ option(WITH_APP_BUNDLE "Enable Application Bundle for OS X" ON)
option(WITH_XC_AUTOTYPE "Include Auto-Type." ON)
option(WITH_XC_HTTP "Include KeePassHTTP and Custom Icon Downloads." OFF)
option(WITH_XC_YUBIKEY "Include YubiKey support." OFF)
option(WITH_XC_TOTPDISPLAYKEY "Enable displaying TOTP keys as QR codes." OFF)

# Process ui files automatically from source files
set(CMAKE_AUTOUIC ON)
Expand Down Expand Up @@ -159,6 +160,10 @@ if(WITH_DEV_BUILD)
add_definitions(-DQT_DEPRECATED_WARNINGS -DGCRYPT_NO_DEPRECATED)
endif()

if(WITH_XC_TOTPDISPLAYKEY)
add_definitions(-DWITH_XC_TOTPDISPLAYKEY)
endif()

if(MINGW)
set(CMAKE_RC_COMPILER_INIT windres)
enable_language(RC)
Expand Down
9 changes: 0 additions & 9 deletions COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@ Files: share/icons/database/C65_W.png
Copyright: none
License: public-domain

Files: src/crypto/salsa20/*
Copyright: none
License: public-domain

Files: src/streams/qtiocompressor.*
src/streams/QtIOCompressor
tests/modeltest.*
Expand All @@ -241,8 +237,3 @@ Files: src/gui/KMessageWidget.h
Copyright: 2011 Aurélien Gâteau <[email protected]>
2014 Dominik Haumann <[email protected]>
License: LGPL-2.1

Files: src/totp/base32.cpp
src/totp/base32.h
Copyright: 2010 Google Inc.
License: Apache 2.0
201 changes: 0 additions & 201 deletions LICENSE.APACHE-2.0

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ cmake accepts the following options:
-DWITH_XC_AUTOTYPE=[ON|OFF] Enable/Disable Auto-Type (default: ON)
-DWITH_XC_HTTP=[ON|OFF] Enable/Disable KeePassHTTP and custom icon downloads (default: OFF)
-DWITH_XC_YUBIKEY=[ON|OFF] Enable/Disable YubiKey HMAC-SHA1 authentication support (default: OFF)
-DWITH_XC_TOTPDISPLAYKEY=[ON|OFF] Enable/Disable Support for displaying TOTP keys as QR codes (default: OFF)

-DWITH_TESTS=[ON|OFF] Enable/Disable building of unit tests (default: ON)
-DWITH_GUI_TESTS=[ON|OFF] Enable/Disable building of GUI tests (default: OFF)
Expand Down
19 changes: 17 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ set(keepassx_SOURCES
core/Tools.cpp
core/Translator.cpp
core/Uuid.cpp
core/Base32.h
core/Base32.cpp
core/Optional.h
cli/Utils.cpp
cli/Utils.h
crypto/Crypto.cpp
Expand Down Expand Up @@ -145,8 +148,6 @@ set(keepassx_SOURCES
streams/qtiocompressor.cpp
streams/StoreDataStream.cpp
streams/SymmetricCipherStream.cpp
totp/base32.h
totp/base32.cpp
totp/totp.h
totp/totp.cpp
)
Expand Down Expand Up @@ -176,6 +177,7 @@ set(keepassx_SOURCES_MAINEXE
add_feature_info(AutoType WITH_XC_AUTOTYPE "Automatic password typing")
add_feature_info(KeePassHTTP WITH_XC_HTTP "Browser integration compatible with ChromeIPass and PassIFox")
add_feature_info(YubiKey WITH_XC_YUBIKEY "YubiKey HMAC-SHA1 challenge-response")
add_feature_info(TotpDisplayKey WITH_XC_TOTPDISPLAYKEY "Display TOTP keys as QR codes")

add_subdirectory(http)
if(WITH_XC_HTTP)
Expand Down Expand Up @@ -210,6 +212,18 @@ else()
list(APPEND keepassx_SOURCES keys/drivers/YubiKeyStub.cpp)
endif()

if(WITH_XC_TOTPDISPLAYKEY)
find_path(QRENCODE_INCLUDE_DIR qrencode.h)
find_library(QRENCODE_LIBRARY qrencode)
set(keepassx_SOURCES ${keepassx_SOURCES}
gui/TotpKeyDisplayDialog.h
gui/TotpKeyDisplayDialog.cpp
core/QRCode.h
core/QRCode_p.h
core/QRCode.cpp
)
endif()

add_library(autotype STATIC ${autotype_SOURCES})
target_link_libraries(autotype Qt5::Core Qt5::Widgets)

Expand All @@ -221,6 +235,7 @@ set_target_properties(keepassx_core PROPERTIES COMPILE_DEFINITIONS KEEPASSX_BUIL
target_link_libraries(keepassx_core
${keepasshttp_LIB}
${autotype_LIB}
${QRENCODE_LIBRARY}
${YUBIKEY_LIBRARIES}
${ZXCVBN_LIBRARIES}
Qt5::Core
Expand Down
Loading