Skip to content

Commit 004fad4

Browse files
committed
airgapped signing with UR
1 parent 33035a2 commit 004fad4

File tree

80 files changed

+3693
-567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+3693
-567
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ message(STATUS "libsodium: libraries at ${SODIUM_LIBRARY}")
8686
# QrEncode
8787
find_package(QREncode REQUIRED)
8888

89+
# bc-ur
90+
find_path(BCUR_INCLUDE_DIR "bcur/bc-ur.hpp")
91+
find_library(BCUR_LIBRARY bcur)
92+
message(STATUS "bcur: libraries at ${BCUR_INCLUDE_DIR}")
93+
8994
# Polyseed
9095
find_package(Polyseed REQUIRED)
9196
if(Polyseed_SUBMODULE)

monero

src/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ endif()
8282
if (WITH_SCANNER)
8383
file(GLOB QRCODE_UTILS_FILES
8484
"qrcode/utils/*.h"
85-
"qrcode/utils/*.cpp")
85+
"qrcode/utils/*.cpp"
86+
"wizard/offline_tx_signing/*.h"
87+
"wizard/offline_tx_signing/*.cpp")
8688
endif()
8789

8890
if (WITH_SCANNER)
@@ -152,6 +154,7 @@ target_include_directories(feather PUBLIC
152154
${LIBZIP_INCLUDE_DIRS}
153155
${ZLIB_INCLUDE_DIRS}
154156
${POLYSEED_INCLUDE_DIR}
157+
${BCUR_INCLUDE_DIR}
155158
)
156159

157160
if(WITH_SCANNER)
@@ -257,6 +260,7 @@ target_link_libraries(feather
257260
${ICU_LIBRARIES}
258261
${LIBZIP_LIBRARIES}
259262
${ZLIB_LIBRARIES}
263+
${BCUR_LIBRARY}
260264
)
261265

262266
if(CHECK_UPDATES)

src/CoinsWidget.cpp

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
#include "utils/Icons.h"
1212
#include "utils/Utils.h"
1313

14+
#ifdef WITH_SCANNER
15+
#include "wizard/offline_tx_signing/OfflineTxSigningWizard.h"
16+
#endif
17+
1418
CoinsWidget::CoinsWidget(Wallet *wallet, QWidget *parent)
1519
: QWidget(parent)
1620
, ui(new Ui::CoinsWidget)
@@ -186,7 +190,14 @@ void CoinsWidget::spendSelected() {
186190

187191
QStringList keyimages;
188192
for (QModelIndex index: list) {
189-
keyimages << m_model->entryFromIndex(m_proxyModel->mapToSource(index))->keyImage();
193+
QString keyImage = m_model->entryFromIndex(m_proxyModel->mapToSource(index))->keyImage();
194+
195+
if (keyImage == "0100000000000000000000000000000000000000000000000000000000000000") {
196+
Utils::showError(this, "Unable to select output to spend", "Selected output has unknown key image");
197+
return;
198+
}
199+
200+
keyimages << keyImage;
190201
}
191202

192203
m_wallet->setSelectedInputs(keyimages);
@@ -238,6 +249,20 @@ void CoinsWidget::onSweepOutputs() {
238249
int ret = dialog.exec();
239250
if (!ret) return;
240251

252+
if (m_wallet->keyImageSyncNeeded(totalAmount, false)) {
253+
#if defined(WITH_SCANNER)
254+
OfflineTxSigningWizard wizard(this, m_wallet);
255+
auto r = wizard.exec();
256+
257+
if (r == QDialog::Rejected) {
258+
return;
259+
}
260+
#else
261+
Utils::showError(this, "Can't open offline transaction signing wizard", "Feather was built without webcam QR scanner support");
262+
return;
263+
#endif
264+
}
265+
241266
m_wallet->sweepOutputs(keyImages, dialog.address(), dialog.churn(), dialog.outputs());
242267
}
243268

0 commit comments

Comments
 (0)