Compare commits

...

45 Commits

Author SHA1 Message Date
luigi1111
e0faddf964 Merge pull request #2975
b54127e main: disable NetworkAccessBlockingFactory.h if Qt < 5.12 (selsta)
2020-06-30 14:43:32 -05:00
selsta
b54127e997 main: disable NetworkAccessBlockingFactory.h if Qt < 5.12
Due to a potential Qt bug qrc:///lang/languages.xml gets
blocked resulting in broken translations.
2020-06-30 04:21:14 +02:00
luigi1111
ccd8eb1c3a Merge pull request #2967
1c62ede Revert 'main: update balance only when wallet is synced' (selsta)
2020-06-24 13:36:53 -05:00
luigi1111
d5b165bde2 Merge pull request #2966
34439af build: set submodule to v0.16.0.1 (selsta)
2020-06-24 13:34:33 -05:00
luigi1111
c978027933 Merge pull request #2964
e1e862b cmake: implement Linux 'release-static' build target (xiphon)
2020-06-24 13:10:35 -05:00
luigi1111
9deec4dad0 Merge pull request #2957
749460f README: update donation fund address (selsta)
2020-06-24 13:08:55 -05:00
luigi1111
e306992ce8 Merge pull request #2955
f64dcde simple mode: enable settings log tab (selsta)
2020-06-24 13:07:53 -05:00
luigi1111
19daa074ca Merge pull request #2909
66e7696 QML: disable networking (selsta)
2020-06-24 13:06:57 -05:00
selsta
1c62edeff4 Revert "main: update balance only when wallet is synced"
This reverts commit 333c9ee311.
2020-06-24 04:02:27 +02:00
selsta
34439af67e build: set submodule to v0.16.0.1 2020-06-24 03:59:45 +02:00
xiphon
e1e862bce4 cmake: implement Linux 'release-static' build target 2020-06-21 02:03:26 +00:00
luigi1111
0b2e74cdb5 Merge pull request #2963
a3fc675 cmake: fix x11 linking (xiphon)
2020-06-19 16:58:28 -05:00
luigi1111
3fee17e564 Merge pull request #2933
1e7d829 openpgp: fix gcc 5.4.0 compilation (xiphon)
2020-06-19 16:56:05 -05:00
xiphon
1e7d8293cb openpgp: fix gcc 5.4.0 compilation 2020-06-19 21:53:47 +00:00
xiphon
a3fc6754e0 cmake: fix x11 linking 2020-06-19 21:50:42 +00:00
luigi1111
8354c251c5 Merge pull request #2962
27532dc cmake: fix USE_DEVICE_TREZOR option (xiphon)
2020-06-19 16:16:57 -05:00
luigi1111
8f5053bd61 Merge pull request #2961
52c090b cmake: downgrade minimum required boost version to 1.58 (xiphon)
2020-06-19 16:16:08 -05:00
luigi1111
92b0a115f4 Merge pull request #2959
c0e0626 SettingsLayout: ask password for password relevant setting (selsta)
2020-06-19 16:15:20 -05:00
luigi1111
6a3e1aaf40 Merge pull request #2950
d18af7d LeftPanel: simpifly color binding (selsta)
2020-06-19 16:14:31 -05:00
luigi1111
c32e11d3e8 Merge pull request #2947
333c9ee main: update balance only when wallet is synced (rating89us)
2020-06-19 16:13:48 -05:00
luigi1111
9580c19da3 Merge pull request #2937
c6d5c5d workflows: update msys2 setup action v0 -> v1 (selsta)
2020-06-19 16:12:52 -05:00
xiphon
27532dc1bf cmake: fix USE_DEVICE_TREZOR option 2020-06-17 14:04:35 +00:00
selsta
c0e0626b84 SettingsLayout: ask password for password relevant setting 2020-06-17 10:01:42 +02:00
selsta
c6d5c5dc3a workflows: update msys2 setup action v0 -> v1 2020-06-15 23:07:48 +02:00
selsta
749460fb46 README: update donation fund address 2020-06-15 22:23:19 +02:00
luigi1111
c9ee76c2ee Merge pull request #2943
ef5d855 openpgp: implement public subkeys support (xiphon)
2020-06-15 15:11:56 -05:00
luigi1111
94dbf179d5 Merge pull request #2942
ff4de8e updater: use monero tools::sha256sum (xiphon)
2020-06-15 15:10:47 -05:00
luigi1111
7deecbfdf6 Merge pull request #2941
e6f3057 windeploy_helper: add libgcrypt and update 65 -> 67 (selsta)
2020-06-15 15:09:58 -05:00
luigi1111
29a742ba26 Merge pull request #2928
7f0c199 workflows: Windows CMake 'release-win64' target CI (xiphon)
2020-06-15 15:09:08 -05:00
luigi1111
47559e51be Merge pull request #2927
1580c3a DaemonManager: remove max-concurrency upper bound (selsta)
2020-06-15 15:07:59 -05:00
selsta
f64dcde600 simple mode: enable settings log tab 2020-06-15 13:17:42 +02:00
xiphon
52c090b82f cmake: downgrade minimum required boost version to 1.58 2020-06-14 12:30:40 +00:00
selsta
d18af7da72 LeftPanel: simpifly color binding 2020-06-13 03:34:16 +02:00
rating89us
333c9ee311 main: update balance only when wallet is synced 2020-06-12 00:08:04 +02:00
xiphon
ff4de8e8f7 updater: use monero tools::sha256sum 2020-06-10 15:11:15 +00:00
xiphon
ef5d855950 openpgp: implement public subkeys support 2020-06-10 12:48:55 +00:00
selsta
e6f30578c0 windeploy_helper: add libgcrypt and update 65 -> 67 2020-06-10 00:38:07 +02:00
xiphon
7f0c19950b workflows: Windows CMake 'release-win64' target CI 2020-06-04 00:30:47 +00:00
selsta
1580c3a574 DaemonManager: remove max-concurrency upper bound 2020-05-29 13:58:53 +02:00
luigi1111
c8f4355e15 Merge pull request #2926
39561f8 cmake: workflows: implement 'release' Linux build target + CI (xiphon)
2020-05-28 12:55:08 -05:00
xiphon
39561f8ead cmake: workflows: implement 'release' Linux build target + CI 2020-05-28 14:51:52 +00:00
luigi1111
b15dbbb9b0 Merge pull request #2921
55cbc56 workflows: fix windows build (selsta)
2020-05-26 15:40:24 -05:00
luigi1111
a73a4363ec Update submodule to recent master (77a008f) 2020-05-26 13:10:17 -05:00
selsta
55cbc562b6 workflows: fix windows build 2020-05-24 23:34:31 +02:00
selsta
66e769603c QML: disable networking 2020-05-15 06:21:08 +02:00
24 changed files with 405 additions and 153 deletions

View File

@@ -19,9 +19,20 @@ jobs:
build-ubuntu: build-ubuntu:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain:
- name: "qmake"
cmd: "./build.sh"
- name: "cmake"
cmd: "USE_SINGLE_BUILDDIR=ON DEV_MODE=ON make release -j3"
name: build-ubuntu-${{ matrix.toolchain.name }}
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
with:
submodules: recursive
- name: remove bundled boost - name: remove bundled boost
run: sudo rm -rf /usr/local/share/boost run: sudo rm -rf /usr/local/share/boost
- name: set apt conf - name: set apt conf
@@ -36,22 +47,37 @@ jobs:
- name: install monero gui dependencies - name: install monero gui dependencies
run: sudo apt -y install qtbase5-dev qt5-default qtdeclarative5-dev qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-dialogs qml-module-qtquick-xmllistmodel qml-module-qt-labs-settings qml-module-qt-labs-folderlistmodel qttools5-dev-tools qml-module-qtquick-templates2 libqt5svg5-dev libgcrypt20-dev xvfb run: sudo apt -y install qtbase5-dev qt5-default qtdeclarative5-dev qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-dialogs qml-module-qtquick-xmllistmodel qml-module-qt-labs-settings qml-module-qt-labs-folderlistmodel qttools5-dev-tools qml-module-qtquick-templates2 libqt5svg5-dev libgcrypt20-dev xvfb
- name: build - name: build
run: ./build.sh run: ${{ matrix.toolchain.cmd }}
- name: test qml - name: test qml
run: xvfb-run -a build/release/bin/monero-wallet-gui --test-qml run: xvfb-run -a build/release/bin/monero-wallet-gui --test-qml
build-windows: build-windows:
runs-on: windows-latest runs-on: windows-latest
strategy:
fail-fast: false
matrix:
toolchain:
- name: "qmake"
cmd: "./build.sh release"
- name: "cmake"
cmd: "USE_SINGLE_BUILDDIR=ON DEV_MODE=ON make release-win64 -j2"
name: build-windows-${{ matrix.toolchain.name }}
defaults:
run:
shell: msys2 {0}
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: numworks/setup-msys2@v1 with:
- name: update pacman submodules: recursive
run: msys2do pacman -Syu --noconfirm - uses: eine/setup-msys2@v1
- name: install monero dependencies with:
run: msys2do pacman -S --noconfirm mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-protobuf-c mingw-w64-x86_64-libusb git mingw-w64-x86_64-qt5 mingw-w64-x86_64-libgcrypt update: true
install: mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-protobuf-c mingw-w64-x86_64-libusb git mingw-w64-x86_64-qt5 mingw-w64-x86_64-libgcrypt
- name: build - name: build
run: msys2do ./build.sh release run: |
sed -i 's/CONFIG\ +=\ qtquickcompiler//' monero-wallet-gui.pro
${{ matrix.toolchain.cmd }}
- name: test qml - name: test qml
run: msys2do build/release/bin/monero-wallet-gui --test-qml run: build/release/bin/monero-wallet-gui --test-qml

View File

@@ -10,12 +10,17 @@ set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")
option(STATIC "Link libraries statically, requires static Qt") option(STATIC "Link libraries statically, requires static Qt")
option(USE_DEVICE_TREZOR ON) option(USE_DEVICE_TREZOR "Trezor support compilation" ON)
option(ENABLE_PASS_STRENGTH_METER "Disable zxcvbn" OFF) option(ENABLE_PASS_STRENGTH_METER "Disable zxcvbn" OFF)
option(WITH_SCANNER "Enable webcam QR scanner" OFF) option(WITH_SCANNER "Enable webcam QR scanner" OFF)
option(DEV_MODE "Checkout latest monero master on build" OFF) option(DEV_MODE "Checkout latest monero master on build" OFF)
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake") list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(CheckLinkerFlag)
include(FindCcache)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON) set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOUIC ON)
@@ -26,7 +31,7 @@ endif()
set(BUILD_GUI_DEPS ON) set(BUILD_GUI_DEPS ON)
set(ARCH "x86-64") set(ARCH "x86-64")
set(BUILD_64 ON) set(BUILD_64 ON)
set(INSTALL_VENDORED_LIBUNBOUND=ON) set(INSTALL_VENDORED_LIBUNBOUND ${STATIC})
function (add_c_flag_if_supported flag var) function (add_c_flag_if_supported flag var)
string(REPLACE "-" "_" supported ${flag}_c) string(REPLACE "-" "_" supported ${flag}_c)
@@ -74,10 +79,7 @@ if(GIT_FOUND)
endif() endif()
endif() endif()
set(STATIC_OLD ${STATIC})
set(STATIC ON CACHE BOOL "Link libraries statically" FORCE)
add_subdirectory(monero) add_subdirectory(monero)
set(STATIC ${STATIC_OLD} CACHE BOOL "Link libraries statically" FORCE)
set_property(TARGET wallet_merged PROPERTY FOLDER "monero") set_property(TARGET wallet_merged PROPERTY FOLDER "monero")
get_directory_property(ARCH_WIDTH DIRECTORY "monero" DEFINITION ARCH_WIDTH) get_directory_property(ARCH_WIDTH DIRECTORY "monero" DEFINITION ARCH_WIDTH)
@@ -168,7 +170,7 @@ message(STATUS "libhidapi: libraries at ${HIDAPI_LIBRARIES}")
if(DEBUG) if(DEBUG)
set(Boost_DEBUG ON) set(Boost_DEBUG ON)
endif() endif()
find_package(Boost 1.62 REQUIRED COMPONENTS find_package(Boost 1.58 REQUIRED COMPONENTS
system system
filesystem filesystem
thread thread
@@ -196,21 +198,6 @@ if(MINGW)
string(REGEX MATCH "^[^/]:/[^/]*" msys2_install_path "${CMAKE_C_COMPILER}") string(REGEX MATCH "^[^/]:/[^/]*" msys2_install_path "${CMAKE_C_COMPILER}")
message(STATUS "MSYS location: ${msys2_install_path}") message(STATUS "MSYS location: ${msys2_install_path}")
set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include") set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/Qt/labs/folderlistmodel")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/Qt/labs/settings")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtGraphicalEffects")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtGraphicalEffects/private")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtMultimedia")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick.2")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Controls")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Controls.2")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Dialogs")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Dialogs/Private")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Layouts")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/PrivateWidgets")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Templates.2")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Window.2")
link_directories("${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/XmlListModel")
# This is necessary because otherwise CMake will make Boost libraries -lfoo # This is necessary because otherwise CMake will make Boost libraries -lfoo
# rather than a full path. Unfortunately, this makes the shared libraries get # rather than a full path. Unfortunately, this makes the shared libraries get
# linked due to a bug in CMake which misses putting -static flags around the # linked due to a bug in CMake which misses putting -static flags around the
@@ -223,41 +210,46 @@ endif()
set(QT5_LIBRARIES set(QT5_LIBRARIES
Qt5Core Qt5Core
Qt5Quick Qt5Quick
Qt5QuickControls2
Qt5Widgets Qt5Widgets
Qt5Gui Qt5Gui
Qt5Network Qt5Network
Qt5Qml Qt5Qml
Qt5Multimedia
Qt5Xml
Qt5XmlPatterns
Qt5Svg Qt5Svg
Qt5Xml
) )
if(WITH_SCANNER)
list(APPEND QT5_LIBRARIES Qt5Multimedia)
endif()
# TODO: drop this once we switch to Qt 5.14+ # TODO: drop this once we switch to Qt 5.14+
find_package(Qt5QmlModels QUIET) find_package(Qt5QmlModels QUIET)
if(Qt5QmlModels_FOUND) if(Qt5QmlModels_FOUND)
list(APPEND QT5_LIBRARIES Qt5QmlModels) list(APPEND QT5_LIBRARIES Qt5QmlModels)
endif() endif()
# TODO: drop this once we switch to Qt 5.12+
find_package(Qt5XmlPatterns QUIET)
if(Qt5XmlPatterns_FOUND)
list(APPEND QT5_LIBRARIES Qt5XmlPatterns)
endif()
foreach(QT5_MODULE ${QT5_LIBRARIES}) foreach(QT5_MODULE ${QT5_LIBRARIES})
find_package(${QT5_MODULE} REQUIRED) find_package(${QT5_MODULE} REQUIRED)
endforeach() endforeach()
find_package(PkgConfig) find_package(PkgConfig REQUIRED)
if(PKGCONFIG_FOUND) pkg_check_modules(QT5_PKG_CONFIG REQUIRED ${QT5_LIBRARIES})
pkg_check_modules(QT5_PKG_CONFIG ${QT5_LIBRARIES})
if(QT5_PKG_CONFIG_FOUND) if(QT5_PKG_CONFIG_FOUND)
set(QT5_PKG_CONFIG "QT5_PKG_CONFIG") set(QT5_PKG_CONFIG "QT5_PKG_CONFIG")
if(STATIC) if(STATIC)
set(QT5_PKG_CONFIG "${QT5_PKG_CONFIG}_STATIC") set(QT5_PKG_CONFIG "${QT5_PKG_CONFIG}_STATIC")
endif()
set(QT5_LIBRARIES ${${QT5_PKG_CONFIG}_LIBRARIES} ${${QT5_PKG_CONFIG}_LDFLAGS_OTHER})
include_directories(${${QT5_PKG_CONFIG}_INCLUDE_DIRS})
link_directories(${${QT5_PKG_CONFIG}_LIBRARY_DIRS})
endif() endif()
set(QT5_LIBRARIES ${${QT5_PKG_CONFIG}_LIBRARIES} ${${QT5_PKG_CONFIG}_LDFLAGS_OTHER})
include_directories(${${QT5_PKG_CONFIG}_INCLUDE_DIRS})
link_directories(${${QT5_PKG_CONFIG}_LIBRARY_DIRS})
endif() endif()
list(APPEND QT5_LIBRARIES list(APPEND QT5_LIBRARIES
@@ -268,37 +260,91 @@ list(APPEND QT5_LIBRARIES
) )
if(STATIC) if(STATIC)
set(QT5_LIBRARIES set(QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/Qt/labs/folderlistmodel)
qtquickcontrols2plugin # has to be the first one, depends on Qt5QuickControls2 list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/Qt/labs/settings)
${QT5_LIBRARIES} list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtGraphicalEffects)
declarative_multimedia list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtGraphicalEffects/private)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtMultimedia)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick.2)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Controls)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Controls.2)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Dialogs)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Dialogs/Private)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Layouts)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/PrivateWidgets)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Templates.2)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/Window.2)
list(APPEND QT5_EXTRA_PATHS ${QT5_PKG_CONFIG_Qt5Qml_PREFIX}/qml/QtQuick/XmlListModel)
set(QT5_EXTRA_LIBRARIES_LIST
qtquicktemplates2plugin
Qt5QuickTemplates2
qtquickcontrols2plugin
Qt5QuickControls2
dialogplugin dialogplugin
dialogsprivateplugin dialogsprivateplugin
qmlfolderlistmodelplugin qmlfolderlistmodelplugin
qmlsettingsplugin qmlsettingsplugin
qmlxmllistmodelplugin qmlxmllistmodelplugin
qquicklayoutsplugin qquicklayoutsplugin
)
if(UNIX AND NOT APPLE)
list(APPEND QT5_EXTRA_LIBRARIES_LIST
Qt5XcbQpa
xcb-static
Qt5ServiceSupport
)
endif()
if(WITH_SCANNER)
list(APPEND QT5_EXTRA_LIBRARIES_LIST
declarative_multimedia
Qt5MultimediaQuick_p
)
endif()
list(APPEND QT5_EXTRA_LIBRARIES_LIST
Qt5EventDispatcherSupport Qt5EventDispatcherSupport
Qt5FontDatabaseSupport Qt5FontDatabaseSupport
Qt5MultimediaQuick_p
Qt5PacketProtocol Qt5PacketProtocol
Qt5ThemeSupport Qt5ThemeSupport
qtgraphicaleffectsplugin qtgraphicaleffectsplugin
qtgraphicaleffectsprivate qtgraphicaleffectsprivate
qtquick2plugin qtquick2plugin
qtquickcontrolsplugin qtquickcontrolsplugin
qtquicktemplates2plugin
widgetsplugin widgetsplugin
windowplugin windowplugin
) )
set(QT5_EXTRA_LIBRARIES)
foreach(LIBRARY ${QT5_EXTRA_LIBRARIES_LIST})
find_library(${LIBRARY}_LIBRARY ${LIBRARY} PATHS ${QT5_EXTRA_PATHS})
list(APPEND QT5_EXTRA_LIBRARIES ${${LIBRARY}_LIBRARY})
endforeach()
if(MINGW) if(MINGW)
list(APPEND QT5_LIBRARIES qtfreetype) list(APPEND QT5_EXTRA_LIBRARIES qtfreetype)
if(CMAKE_BUILD_TYPE STREQUAL "Debug") if(CMAKE_BUILD_TYPE STREQUAL "Debug")
list(APPEND QT5_LIBRARIES D3D11 Dwrite D2d1) list(APPEND QT5_EXTRA_LIBRARIES D3D11 Dwrite D2d1)
endif() endif()
endif() endif()
set(QT5_LIBRARIES
${QT5_EXTRA_LIBRARIES}
${QT5_LIBRARIES}
)
if(UNIX AND NOT APPLE)
pkg_check_modules(X11_XCB REQUIRED x11-xcb)
pkg_check_modules(FONTCONFIG REQUIRED fontconfig)
list(APPEND QT5_LIBRARIES
${FONTCONFIG_STATIC_LIBRARIES}
${X11_XCB_STATIC_LIBRARIES}
)
endif()
endif() endif()
message(STATUS "Using Boost include dir at ${Boost_INCLUDE_DIRS}") message(STATUS "Using Boost include dir at ${Boost_INCLUDE_DIRS}")
@@ -399,9 +445,9 @@ if (WIN32)
add_linker_flag_if_supported(-Wl,--high-entropy-va LD_SECURITY_FLAGS) add_linker_flag_if_supported(-Wl,--high-entropy-va LD_SECURITY_FLAGS)
endif() endif()
add_linker_flag_if_supported(-static-libgcc STATIC_FLAGS)
add_linker_flag_if_supported(-static-libstdc++ STATIC_FLAGS)
if(STATIC) if(STATIC)
add_linker_flag_if_supported(-static-libgcc STATIC_FLAGS)
add_linker_flag_if_supported(-static-libstdc++ STATIC_FLAGS)
if(MINGW) if(MINGW)
add_linker_flag_if_supported(-static STATIC_FLAGS) add_linker_flag_if_supported(-static STATIC_FLAGS)
endif() endif()
@@ -412,6 +458,9 @@ endif()
add_c_flag_if_supported(-fno-strict-aliasing C_SECURITY_FLAGS) add_c_flag_if_supported(-fno-strict-aliasing C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-fno-strict-aliasing CXX_SECURITY_FLAGS) add_cxx_flag_if_supported(-fno-strict-aliasing CXX_SECURITY_FLAGS)
add_c_flag_if_supported(-fPIC C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-fPIC CXX_SECURITY_FLAGS)
message(STATUS "Using C security hardening flags: ${C_SECURITY_FLAGS}") message(STATUS "Using C security hardening flags: ${C_SECURITY_FLAGS}")
message(STATUS "Using C++ security hardening flags: ${CXX_SECURITY_FLAGS}") message(STATUS "Using C++ security hardening flags: ${CXX_SECURITY_FLAGS}")
message(STATUS "Using linker security hardening flags: ${LD_SECURITY_FLAGS}") message(STATUS "Using linker security hardening flags: ${LD_SECURITY_FLAGS}")

View File

@@ -263,6 +263,10 @@ Rectangle {
anchors.leftMargin: 58 anchors.leftMargin: 58
anchors.baseline: currencyLabel.baseline anchors.baseline: currencyLabel.baseline
color: MoneroComponents.Style.blackTheme ? "white" : "black" color: MoneroComponents.Style.blackTheme ? "white" : "black"
Binding on color {
when: balancePart1MouseArea.containsMouse || balancePart2MouseArea.containsMouse
value: MoneroComponents.Style.orange
}
text: { text: {
if (persistentSettings.fiatPriceEnabled && persistentSettings.fiatPriceToggle) { if (persistentSettings.fiatPriceEnabled && persistentSettings.fiatPriceToggle) {
return balanceFiatString.split('.')[0] + "." return balanceFiatString.split('.')[0] + "."
@@ -284,14 +288,6 @@ Rectangle {
hoverEnabled: true hoverEnabled: true
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onEntered: {
balancePart1.color = MoneroComponents.Style.orange
balancePart2.color = MoneroComponents.Style.orange
}
onExited: {
balancePart1.color = Qt.binding(function() { return MoneroComponents.Style.blackTheme ? "white" : "black" })
balancePart2.color = Qt.binding(function() { return MoneroComponents.Style.blackTheme ? "white" : "black" })
}
onClicked: { onClicked: {
console.log("Copied to clipboard"); console.log("Copied to clipboard");
clipboard.setText(balancePart1.text + balancePart2.text); clipboard.setText(balancePart1.text + balancePart2.text);
@@ -305,7 +301,7 @@ Rectangle {
anchors.left: balancePart1.right anchors.left: balancePart1.right
anchors.leftMargin: 2 anchors.leftMargin: 2
anchors.baseline: currencyLabel.baseline anchors.baseline: currencyLabel.baseline
color: MoneroComponents.Style.blackTheme ? "white" : "black" color: balancePart1.color
text: { text: {
if (persistentSettings.fiatPriceEnabled && persistentSettings.fiatPriceToggle) { if (persistentSettings.fiatPriceEnabled && persistentSettings.fiatPriceToggle) {
return balanceFiatString.split('.')[1] return balanceFiatString.split('.')[1]
@@ -315,11 +311,10 @@ Rectangle {
} }
font.pixelSize: 16 font.pixelSize: 16
MouseArea { MouseArea {
id: balancePart2MouseArea
hoverEnabled: true hoverEnabled: true
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onEntered: balancePart1MouseArea.entered()
onExited: balancePart1MouseArea.exited()
onClicked: balancePart1MouseArea.clicked(mouse) onClicked: balancePart1MouseArea.clicked(mouse)
} }
} }

View File

@@ -28,6 +28,12 @@ clean:
scanner: scanner:
mkdir -p build && cd build && cmake -D ARCH="x86-64" -D DEV_MODE=$(or ${DEV_MODE},ON) -D WITH_SCANNER=ON -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release .. && $(MAKE) mkdir -p build && cd build && cmake -D ARCH="x86-64" -D DEV_MODE=$(or ${DEV_MODE},ON) -D WITH_SCANNER=ON -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release .. && $(MAKE)
release:
mkdir -p $(builddir)/release && cd $(builddir)/release && cmake -D DEV_MODE=$(or ${DEV_MODE},OFF) -D ARCH="x86-64" -D CMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE)
release-static:
mkdir -p $(builddir)/release && cd $(builddir)/release && cmake -D STATIC=ON -D DEV_MODE=$(or ${DEV_MODE},OFF) -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE)
debug-static-win64: debug-static-win64:
mkdir -p $(builddir)/debug && cd $(builddir)/debug && cmake -D STATIC=ON -G "MSYS Makefiles" -D DEV_MODE=$(or ${DEV_MODE},ON) -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Debug -D BUILD_TAG="win-x64" -D CMAKE_TOOLCHAIN_FILE=$(topdir)/cmake/64-bit-toolchain.cmake -D MSYS2_FOLDER=$(shell cd ${MINGW_PREFIX}/.. && pwd -W) -D MINGW=ON $(topdir) && $(MAKE) mkdir -p $(builddir)/debug && cd $(builddir)/debug && cmake -D STATIC=ON -G "MSYS Makefiles" -D DEV_MODE=$(or ${DEV_MODE},ON) -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Debug -D BUILD_TAG="win-x64" -D CMAKE_TOOLCHAIN_FILE=$(topdir)/cmake/64-bit-toolchain.cmake -D MSYS2_FOLDER=$(shell cd ${MINGW_PREFIX}/.. && pwd -W) -D MINGW=ON $(topdir) && $(MAKE)

View File

@@ -36,7 +36,7 @@ As with many development projects, the repository on Github is considered to be
Monero is a 100% community-sponsored endeavor. If you want to join our efforts, the easiest thing you can do is support the project financially. Both Monero and Bitcoin donations can be made to **donate.getmonero.org** if using a client that supports the [OpenAlias](https://openalias.org) standard. Monero is a 100% community-sponsored endeavor. If you want to join our efforts, the easiest thing you can do is support the project financially. Both Monero and Bitcoin donations can be made to **donate.getmonero.org** if using a client that supports the [OpenAlias](https://openalias.org) standard.
The Monero donation address is: `44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A` (viewkey: `f359631075708155cc3d92a32b75a7d02a5dcf27756707b47a2b31b21c389501`) The Monero donation address is: `888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H` (viewkey: `f359631075708155cc3d92a32b75a7d02a5dcf27756707b47a2b31b21c389501`)
The Bitcoin donation address is: `1KTexdemPdxSBcG55heUuTjDRYqbC5ZL8H` The Bitcoin donation address is: `1KTexdemPdxSBcG55heUuTjDRYqbC5ZL8H`

56
cmake/FindCcache.cmake Normal file
View File

@@ -0,0 +1,56 @@
# Copyright (c) 2014-2020, The Monero Project
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other
# materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be
# used to endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# - Try to find readline include dirs and libraries
#
# Automatically finds ccache build accelerator, if it's found in PATH.
#
# Usage of this module as follows:
#
# project(monero)
# include(FindCcache) # Include AFTER the project() macro to be able to reach the CMAKE_CXX_COMPILER variable
#
# Properties modified by this module:
#
# GLOBAL PROPERTY RULE_LAUNCH_COMPILE set to ccache, when ccache found
# GLOBAL PROPERTY RULE_LAUNCH_LINK set to ccache, when ccache found
find_program(CCACHE_FOUND ccache)
if (CCACHE_FOUND)
set(TEMP_CPP_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test-program.cpp")
file(WRITE "${TEMP_CPP_FILE}" "int main() { return 0; }")
execute_process(COMMAND "${CCACHE_FOUND}" "${CMAKE_CXX_COMPILER}" "${TEMP_CPP_FILE}" RESULT_VARIABLE RET)
if (${RET} EQUAL 0)
message("found usable ccache: ${CCACHE_FOUND}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_FOUND}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_FOUND}")
else()
message("found ccache ${CCACHE_FOUND}, but is UNUSABLE! Return code: ${RET}")
endif()
else()
message("ccache NOT found!")
endif()

View File

@@ -17,7 +17,7 @@ if [ ! -d $MONERO_DIR/src ]; then
fi fi
git submodule update --remote git submodule update --remote
git -C $MONERO_DIR fetch git -C $MONERO_DIR fetch
git -C $MONERO_DIR checkout v0.16.0.0 git -C $MONERO_DIR checkout v0.16.0.1
# get monero core tag # get monero core tag
pushd $MONERO_DIR pushd $MONERO_DIR

View File

@@ -2139,7 +2139,7 @@ ApplicationWindow {
if (mode < 2) { if (mode < 2) {
persistentSettings.useRemoteNode = false; persistentSettings.useRemoteNode = false;
if (middlePanel.settingsView.settingsStateViewState === "Node" || middlePanel.settingsView.settingsStateViewState === "Log") { if (middlePanel.settingsView.settingsStateViewState === "Node") {
middlePanel.settingsView.settingsStateViewState = "Wallet" middlePanel.settingsView.settingsStateViewState = "Wallet"
} }
} }

2
monero

Submodule monero updated: ab594cfee9...a498a1b4ce

View File

@@ -421,6 +421,13 @@ macx {
INCLUDEPATH += /usr/local/include INCLUDEPATH += /usr/local/include
} }
SODIUM_DIR = $$system(brew --prefix libsodium, lines, EXIT_CODE)
equals(EXIT_CODE, 0) {
INCLUDEPATH += $$SODIUM_DIR/include
} else {
INCLUDEPATH += /usr/local/include
}
QT += macextras QT += macextras
OBJECTIVE_SOURCES += src/qt/macoshelper.mm OBJECTIVE_SOURCES += src/qt/macoshelper.mm
LIBS+= -Wl,-dead_strip LIBS+= -Wl,-dead_strip

View File

@@ -273,7 +273,6 @@ Rectangle {
// LOG // LOG
id: navLog id: navLog
property bool isActive: settingsStateView.state === "Log" property bool isActive: settingsStateView.state === "Log"
visible: appWindow.walletMode >= 2
Layout.preferredWidth: navLogText.width + grid.textMargin Layout.preferredWidth: navLogText.width + grid.textMargin
Layout.preferredHeight: 32 Layout.preferredHeight: 32
Layout.minimumWidth: 72 Layout.minimumWidth: 72

View File

@@ -88,10 +88,24 @@ Rectangle {
} }
MoneroComponents.CheckBox { MoneroComponents.CheckBox {
id: askPasswordBeforeSendingCheckbox
checked: persistentSettings.askPasswordBeforeSending checked: persistentSettings.askPasswordBeforeSending
onClicked: persistentSettings.askPasswordBeforeSending = !persistentSettings.askPasswordBeforeSending
text: qsTr("Ask for password before sending a transaction") + translationManager.emptyString text: qsTr("Ask for password before sending a transaction") + translationManager.emptyString
toggleOnClick: false
onClicked: {
if (persistentSettings.askPasswordBeforeSending) {
passwordDialog.onAcceptedCallback = function() {
if (appWindow.walletPassword === passwordDialog.password){
persistentSettings.askPasswordBeforeSending = false;
} else {
passwordDialog.showError(qsTr("Wrong password"));
}
}
passwordDialog.onRejectedCallback = null;
passwordDialog.open()
} else {
persistentSettings.askPasswordBeforeSending = true;
}
}
} }
MoneroComponents.CheckBox { MoneroComponents.CheckBox {

View File

@@ -126,19 +126,17 @@ target_compile_definitions(monero-wallet-gui
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
if(X11_FOUND) if(INSTALL_VENDORED_LIBUNBOUND)
target_link_libraries(monero-wallet-gui ${X11_LIBRARIES} pthread dl Xt xcb X11) set(UNBOUND_LIBRARY ${CMAKE_BINARY_DIR}/monero/external/unbound/libunbound.a)
endif() else()
set(UNBOUND_LIBRARY unbound)
if(DEVICE_TREZOR_READY)
target_link_libraries(monero-wallet-gui ${TREZOR_DEP_LIBS})
endif() endif()
target_link_libraries(monero-wallet-gui target_link_libraries(monero-wallet-gui
${CMAKE_BINARY_DIR}/lib/libwallet_merged.a ${CMAKE_BINARY_DIR}/lib/libwallet_merged.a
${LMDB_LIBRARY} ${LMDB_LIBRARY}
${CMAKE_BINARY_DIR}/monero/contrib/epee/src/libepee.a ${CMAKE_BINARY_DIR}/monero/contrib/epee/src/libepee.a
${CMAKE_BINARY_DIR}/monero/external/unbound/libunbound.a ${UNBOUND_LIBRARY}
${SODIUM_LIBRARY} ${SODIUM_LIBRARY}
${CMAKE_BINARY_DIR}/monero/external/easylogging++/libeasylogging.a ${CMAKE_BINARY_DIR}/monero/external/easylogging++/libeasylogging.a
${CMAKE_BINARY_DIR}/monero/src/blockchain_db/libblockchain_db.a ${CMAKE_BINARY_DIR}/monero/src/blockchain_db/libblockchain_db.a
@@ -155,6 +153,14 @@ target_link_libraries(monero-wallet-gui
openpgp openpgp
) )
if(DEVICE_TREZOR_READY)
target_link_libraries(monero-wallet-gui ${TREZOR_DEP_LIBS})
endif()
if(X11_FOUND)
target_link_libraries(monero-wallet-gui ${X11_LIBRARIES})
endif()
if(WITH_SCANNER) if(WITH_SCANNER)
target_link_libraries(monero-wallet-gui target_link_libraries(monero-wallet-gui
${ZBAR_LIBRARIES} ${ZBAR_LIBRARIES}

View File

@@ -114,8 +114,8 @@ bool DaemonManager::start(const QString &flags, NetworkType::Type nettype, const
arguments << "--check-updates" << "disabled"; arguments << "--check-updates" << "disabled";
// --max-concurrency based on threads available. max: 6 // --max-concurrency based on threads available.
int32_t concurrency = qBound(1, QThread::idealThreadCount() / 2, 6); int32_t concurrency = qMax(1, QThread::idealThreadCount() / 2);
if(!flags.contains("--max-concurrency", Qt::CaseSensitive)){ if(!flags.contains("--max-concurrency", Qt::CaseSensitive)){
arguments << "--max-concurrency" << QString::number(concurrency); arguments << "--max-concurrency" << QString::number(concurrency);

View File

@@ -69,6 +69,7 @@
#include "qt/TailsOS.h" #include "qt/TailsOS.h"
#include "qt/KeysFiles.h" #include "qt/KeysFiles.h"
#include "qt/MoneroSettings.h" #include "qt/MoneroSettings.h"
#include "qt/NetworkAccessBlockingFactory.h"
// IOS exclusions // IOS exclusions
#ifndef Q_OS_IOS #ifndef Q_OS_IOS
@@ -94,11 +95,8 @@
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin); Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);
#endif #endif
Q_IMPORT_PLUGIN(QSvgIconPlugin) Q_IMPORT_PLUGIN(QSvgIconPlugin)
Q_IMPORT_PLUGIN(QGifPlugin)
Q_IMPORT_PLUGIN(QICNSPlugin) Q_IMPORT_PLUGIN(QICNSPlugin)
Q_IMPORT_PLUGIN(QICOPlugin)
Q_IMPORT_PLUGIN(QJpegPlugin) Q_IMPORT_PLUGIN(QJpegPlugin)
Q_IMPORT_PLUGIN(QMngPlugin)
Q_IMPORT_PLUGIN(QSvgPlugin) Q_IMPORT_PLUGIN(QSvgPlugin)
Q_IMPORT_PLUGIN(QTgaPlugin) Q_IMPORT_PLUGIN(QTgaPlugin)
Q_IMPORT_PLUGIN(QTiffPlugin) Q_IMPORT_PLUGIN(QTiffPlugin)
@@ -130,7 +128,9 @@ Q_IMPORT_PLUGIN(QtQuick2PrivateWidgetsPlugin)
Q_IMPORT_PLUGIN(QtQuickControls2Plugin) Q_IMPORT_PLUGIN(QtQuickControls2Plugin)
Q_IMPORT_PLUGIN(QtQuickTemplates2Plugin) Q_IMPORT_PLUGIN(QtQuickTemplates2Plugin)
Q_IMPORT_PLUGIN(QmlXmlListModelPlugin) Q_IMPORT_PLUGIN(QmlXmlListModelPlugin)
#ifdef WITH_SCANNER
Q_IMPORT_PLUGIN(QMultimediaDeclarativeModule) Q_IMPORT_PLUGIN(QMultimediaDeclarativeModule)
#endif
#endif #endif
@@ -418,6 +418,9 @@ Verify update binary using 'shasum'-compatible (SHA256 algo) output signed by tw
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
engine.setNetworkAccessManagerFactory(new NetworkAccessBlockingFactory);
#endif
OSCursor cursor; OSCursor cursor;
engine.rootContext()->setContextProperty("globalCursor", &cursor); engine.rootContext()->setContextProperty("globalCursor", &cursor);
OSHelper osHelper; OSHelper osHelper;

View File

@@ -48,10 +48,10 @@ public:
hash &operator=(const hash &) = delete; hash &operator=(const hash &) = delete;
hash(uint8_t algorithm) hash(uint8_t algorithm)
: algorithm(algorithm) : algo(algorithm)
, consumed(0) , consumed(0)
{ {
if (gcry_md_open(&md, algorithm, 0) != GPG_ERR_NO_ERROR) if (gcry_md_open(&md, algo, 0) != GPG_ERR_NO_ERROR)
{ {
throw std::runtime_error("failed to create message digest object"); throw std::runtime_error("failed to create message digest object");
} }
@@ -83,8 +83,8 @@ public:
std::vector<uint8_t> finish() const std::vector<uint8_t> finish() const
{ {
std::vector<uint8_t> result(gcry_md_get_algo_dlen(algorithm)); std::vector<uint8_t> result(gcry_md_get_algo_dlen(algo));
const void *digest = gcry_md_read(md, algorithm); const void *digest = gcry_md_read(md, algo);
if (digest == nullptr) if (digest == nullptr)
{ {
throw std::runtime_error("failed to read the digest"); throw std::runtime_error("failed to read the digest");
@@ -99,7 +99,7 @@ public:
} }
private: private:
const uint8_t algorithm; const uint8_t algo;
gcry_md_hd_t md; gcry_md_hd_t md;
size_t consumed; size_t consumed;
}; };

View File

@@ -93,15 +93,9 @@ std::string get_armored_block_contents(const std::string &text, const std::strin
} // namespace } // namespace
public_key_rsa::public_key_rsa(const std::string &armored) public_key_rsa::public_key_rsa(s_expression expression, size_t bits)
: public_key_rsa(decode(armored)) : m_expression(std::move(expression))
{ , m_bits(bits)
}
public_key_rsa::public_key_rsa(std::tuple<std::string, s_expression, size_t> params)
: m_expression(std::move(std::get<1>(params)))
, m_bits(std::get<2>(params))
, m_user_id(std::move(std::get<0>(params)))
{ {
} }
@@ -115,19 +109,14 @@ size_t public_key_rsa::bits() const
return m_bits; return m_bits;
} }
std::string public_key_rsa::user_id() const public_key_block::public_key_block(const std::string &armored)
: public_key_block(epee::to_byte_span(epee::to_span(epee::string_encoding::base64_decode(
strip_line_breaks(get_armored_block_contents(armored, "BEGIN PGP PUBLIC KEY BLOCK"))))))
{ {
return m_user_id;
} }
std::tuple<std::string, s_expression, size_t> public_key_rsa::decode(const std::string &armored) // TODO: Public-Key expiration, User ID and Public-Key certification, Subkey binding checks
{ public_key_block::public_key_block(const epee::span<const uint8_t> buffer)
const std::string buffer = epee::string_encoding::base64_decode(
strip_line_breaks(get_armored_block_contents(armored, "BEGIN PGP PUBLIC KEY BLOCK")));
return decode(epee::to_byte_span(epee::to_span(buffer)));
}
std::tuple<std::string, s_expression, size_t> public_key_rsa::decode(const epee::span<const uint8_t> buffer)
{ {
packet_stream packets(buffer); packet_stream packets(buffer);
@@ -136,38 +125,51 @@ std::tuple<std::string, s_expression, size_t> public_key_rsa::decode(const epee:
{ {
throw std::runtime_error("user id is missing"); throw std::runtime_error("user id is missing");
} }
std::string user_id(data->begin(), data->end()); m_user_id.assign(data->begin(), data->end());
const auto append_public_key = [this](const std::vector<uint8_t> &data) {
deserializer<std::vector<uint8_t>> serialized(data);
const auto version = serialized.read_big_endian<uint8_t>();
if (version != 4)
{
throw std::runtime_error("unsupported public key version");
}
/* const auto timestamp = */ serialized.read_big_endian<uint32_t>();
const auto algorithm = serialized.read_big_endian<uint8_t>();
if (algorithm != openpgp::algorithm::rsa)
{
throw std::runtime_error("unsupported public key algorithm");
}
{
const mpi public_key_n = serialized.read_mpi();
const mpi public_key_e = serialized.read_mpi();
emplace_back(
s_expression("(public-key (rsa (n %m) (e %m)))", public_key_n.get(), public_key_e.get()),
gcry_mpi_get_nbits(public_key_n.get()));
}
};
data = packets.find_first(packet_tag::type::public_key); data = packets.find_first(packet_tag::type::public_key);
if (data == nullptr) if (data == nullptr)
{ {
throw std::runtime_error("public key is missing"); throw std::runtime_error("public key is missing");
} }
append_public_key(*data);
deserializer<std::vector<uint8_t>> serialized(*data); packets.for_each(packet_tag::type::public_subkey, append_public_key);
const auto version = serialized.read_big_endian<uint8_t>();
if (version != 4)
{
throw std::runtime_error("unsupported public key version");
}
/* const auto timestamp = */ serialized.read_big_endian<uint32_t>();
const auto algorithm = serialized.read_big_endian<uint8_t>();
if (algorithm != algorithm::rsa)
{
throw std::runtime_error("unsupported public key algorithm");
}
const mpi public_key_n = serialized.read_mpi();
const mpi public_key_e = serialized.read_mpi();
s_expression expression("(public-key (rsa (n %m) (e %m)))", public_key_n.get(), public_key_e.get());
return {std::move(user_id), std::move(expression), gcry_mpi_get_nbits(public_key_n.get())};
} }
std::string public_key_block::user_id() const
{
return m_user_id;
}
// TODO: Signature expiration check
signature_rsa::signature_rsa( signature_rsa::signature_rsa(
uint8_t algorithm, uint8_t algorithm,
std::pair<uint8_t, uint8_t> hash_leftmost_bytes, std::pair<uint8_t, uint8_t> hash_leftmost_bytes,
@@ -217,7 +219,7 @@ signature_rsa signature_rsa::from_buffer(const epee::span<const uint8_t> input)
const auto signature_type = static_cast<type>(buffer.read_big_endian<uint8_t>()); const auto signature_type = static_cast<type>(buffer.read_big_endian<uint8_t>());
const auto algorithm = buffer.read_big_endian<uint8_t>(); const auto algorithm = buffer.read_big_endian<uint8_t>();
if (algorithm != algorithm::rsa) if (algorithm != openpgp::algorithm::rsa)
{ {
throw std::runtime_error("unsupported signature algorithm"); throw std::runtime_error("unsupported signature algorithm");
} }

View File

@@ -47,20 +47,25 @@ enum algorithm : uint8_t
class public_key_rsa class public_key_rsa
{ {
public: public:
public_key_rsa(const std::string &armored); public_key_rsa(s_expression expression, size_t bits);
public_key_rsa(std::tuple<std::string, s_expression, size_t> params);
size_t bits() const; size_t bits() const;
const gcry_sexp_t &get() const; const gcry_sexp_t &get() const;
std::string user_id() const;
private:
static std::tuple<std::string, s_expression, size_t> decode(const std::string &armored);
static std::tuple<std::string, s_expression, size_t> decode(const epee::span<const uint8_t> buffer);
private: private:
s_expression m_expression; s_expression m_expression;
size_t m_bits; size_t m_bits;
};
class public_key_block : public std::vector<public_key_rsa>
{
public:
public_key_block(const std::string &armored);
public_key_block(const epee::span<const uint8_t> buffer);
std::string user_id() const;
private:
std::string m_user_id; std::string m_user_id;
}; };

View File

@@ -69,6 +69,18 @@ public:
return nullptr; return nullptr;
} }
template <typename Callback>
void for_each(packet_tag::type type, Callback &callback) const
{
for (const auto &packet : packets)
{
if (packet.first.packet_type == type)
{
callback(packet.second);
}
}
}
private: private:
std::vector<std::pair<packet_tag, std::vector<uint8_t>>> packets; std::vector<std::pair<packet_tag, std::vector<uint8_t>>> packets;
}; };

View File

@@ -60,6 +60,7 @@ struct packet_tag
signature = 2, signature = 2,
public_key = 6, public_key = 6,
user_id = 13, user_id = 13,
public_subkey = 14,
}; };
const type packet_type; const type packet_type;

View File

@@ -0,0 +1,67 @@
/* Ricochet - https://ricochet.im/
* Copyright (C) 2014, John Brooks <john.brooks@dereferenced.net>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* * Neither the names of the copyright owners nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Through the QQmlNetworkAccessManagerFactory below, all network requests
* created via QML will be passed to this object; including, for example,
* <img> tags parsed in rich Text items.
*
* Ricochet's UI does not directly cause network requests for any reason. These
* are always a potentially deanonymizing bug. This object will block them,
* and assert if appropriate.
*/
#include <QDebug>
class BlockedNetworkAccessManager : public QNetworkAccessManager
{
public:
BlockedNetworkAccessManager(QObject *parent)
: QNetworkAccessManager(parent)
{
setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QLatin1String("0.0.0.0"), 0));
}
protected:
virtual QNetworkReply *createRequest(Operation op, const QNetworkRequest &req, QIODevice *outgoingData = 0)
{
qCritical() << "QML attempted to load a network resource from" << req.url() << " - this is potentially an input sanitization flaw.";
return QNetworkAccessManager::createRequest(op, QNetworkRequest(), outgoingData);
}
};
class NetworkAccessBlockingFactory : public QQmlNetworkAccessManagerFactory
{
public:
virtual QNetworkAccessManager *create(QObject *parent)
{
return new BlockedNetworkAccessManager(parent);
}
};

View File

@@ -28,6 +28,8 @@
#include "updater.h" #include "updater.h"
#include <common/util.h>
#include <openpgp/hash.h> #include <openpgp/hash.h>
#include "network.h" #include "network.h"
@@ -111,10 +113,9 @@ QPair<QString, QString> Updater::verifySignaturesAndHashSum(
QByteArray Updater::getHash(const void *data, size_t size) const QByteArray Updater::getHash(const void *data, size_t size) const
{ {
openpgp::hash hasher(openpgp::hash::algorithm::sha256); QByteArray hash(sizeof(crypto::hash), 0);
hasher << epee::span<const uint8_t>(reinterpret_cast<const uint8_t *>(data), size); tools::sha256sum(static_cast<const uint8_t *>(data), size, *reinterpret_cast<crypto::hash *>(hash.data()));
const std::vector<uint8_t> hash = hasher.finish(); return hash;
return QByteArray(reinterpret_cast<const char *>(&hash[0]), hash.size());
} }
QByteArray Updater::parseShasumOutput(const QString &message, const QString &filename) const QByteArray Updater::parseShasumOutput(const QString &message, const QString &filename) const
@@ -157,9 +158,12 @@ QString Updater::verifySignature(const epee::span<const uint8_t> data, const ope
{ {
for (const auto &maintainer : m_maintainers) for (const auto &maintainer : m_maintainers)
{ {
if (signature.verify(data, maintainer)) for (const auto &public_key : maintainer)
{ {
return QString::fromStdString(maintainer.user_id()); if (signature.verify(data, public_key))
{
return QString::fromStdString(maintainer.user_id());
}
} }
} }

View File

@@ -60,5 +60,5 @@ private:
QByteArray parseShasumOutput(const QString &message, const QString &filename) const; QByteArray parseShasumOutput(const QString &message, const QString &filename) const;
private: private:
std::vector<openpgp::public_key_rsa> m_maintainers; std::vector<openpgp::public_key_block> m_maintainers;
}; };

View File

@@ -17,13 +17,13 @@ fi
if [[ "$BUILD_TYPE" == "Release" ]]; then if [[ "$BUILD_TYPE" == "Release" ]]; then
echo "Release build" echo "Release build"
ICU_FILES=(libicudt65.dll libicuin65.dll libicuio65.dll libicutu65.dll libicuuc65.dll) ICU_FILES=(libicudt67.dll libicuin67.dll libicuio67.dll libicutu67.dll libicuuc67.dll)
else else
echo "Debug build" echo "Debug build"
ICU_FILES=(libicudtd65.dll libicuind65.dll libicuiod65.dll libicutud65.dll libicuucd65.dll) ICU_FILES=(libicudtd67.dll libicuind67.dll libicuiod67.dll libicutud67.dll libicuucd67.dll)
fi fi
FILES=(libprotobuf.dll libusb-1.0.dll zlib1.dll libzstd.dll libwinpthread-1.dll libtiff-5.dll libstdc++-6.dll libpng16-16.dll libpcre16-0.dll libpcre-1.dll libmng-2.dll liblzma-5.dll liblcms2-2.dll libjpeg-8.dll libintl-8.dll libiconv-2.dll libharfbuzz-0.dll libgraphite2.dll libglib-2.0-0.dll libfreetype-6.dll libbz2-1.dll libssp-0.dll libpcre2-16-0.dll libhidapi-0.dll libdouble-conversion.dll) FILES=(libprotobuf.dll libusb-1.0.dll zlib1.dll libzstd.dll libwinpthread-1.dll libtiff-5.dll libstdc++-6.dll libpng16-16.dll libpcre16-0.dll libpcre-1.dll libmng-2.dll liblzma-5.dll liblcms2-2.dll libjpeg-8.dll libintl-8.dll libiconv-2.dll libharfbuzz-0.dll libgraphite2.dll libglib-2.0-0.dll libfreetype-6.dll libbz2-1.dll libssp-0.dll libpcre2-16-0.dll libhidapi-0.dll libdouble-conversion.dll libgcrypt-20.dll)
OPENSSL_FILES=(libssl-1_1 libcrypto-1_1) OPENSSL_FILES=(libssl-1_1 libcrypto-1_1)