From 1e408b82e0d8d12a77662a2cea7ce5fd97efa90c Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Wed, 11 Nov 2026 13:41:02 +0100 Subject: [PATCH 1/5] fix(payments): show the address and an unverified label for unsigned payment requests An interactive BIP70 payment request that carries no signature now keeps the "Send to" address on the confirmation screen, and the name it supplies is shown as "Unverified recipient: " (or "Unverified recipient" when it supplies none). A signed request is unchanged: its verified name stands in for the address. Also for interactive requests: - an unsigned request always asks for PIN/biometric, whatever the spending confirmation setting is; - an unsigned request that pays more than one output is refused; - a signed request that pays more than one output says how many addresses it pays; - outside Debug builds the request URL must be https. The headless gift-card path is not changed; the rules live in the interactive coordinator and the confirm-screen rows. The five new strings are added to all 43 catalogs with English placeholders. Co-Authored-By: Claude Fable 5.2 --- .../BIP70InteractiveCoordinator.swift | 59 +++++++++++++ .../PaymentModels/DWPaymentOutput+DWView.m | 33 +++++++- .../Payments/PaymentModels/DWPaymentOutput.h | 5 +- .../PaymentModels/DWPaymentProcessor.m | 7 +- DashWallet/ar.lproj/Localizable.strings | 15 ++++ DashWallet/bg.lproj/Localizable.strings | 15 ++++ DashWallet/ca.lproj/Localizable.strings | 15 ++++ DashWallet/cs.lproj/Localizable.strings | 15 ++++ DashWallet/da.lproj/Localizable.strings | 15 ++++ DashWallet/de.lproj/Localizable.strings | 15 ++++ DashWallet/el.lproj/Localizable.strings | 15 ++++ DashWallet/en.lproj/Localizable.strings | 15 ++++ DashWallet/eo.lproj/Localizable.strings | 15 ++++ DashWallet/es.lproj/Localizable.strings | 15 ++++ DashWallet/et.lproj/Localizable.strings | 15 ++++ DashWallet/fa.lproj/Localizable.strings | 15 ++++ DashWallet/fi.lproj/Localizable.strings | 15 ++++ DashWallet/fil.lproj/Localizable.strings | 15 ++++ DashWallet/fr.lproj/Localizable.strings | 15 ++++ DashWallet/hr.lproj/Localizable.strings | 15 ++++ DashWallet/hu.lproj/Localizable.strings | 15 ++++ DashWallet/id.lproj/Localizable.strings | 15 ++++ DashWallet/it.lproj/Localizable.strings | 15 ++++ DashWallet/ja.lproj/Localizable.strings | 15 ++++ DashWallet/ko.lproj/Localizable.strings | 15 ++++ DashWallet/mk.lproj/Localizable.strings | 15 ++++ DashWallet/ms.lproj/Localizable.strings | 15 ++++ DashWallet/nb.lproj/Localizable.strings | 15 ++++ DashWallet/nl.lproj/Localizable.strings | 15 ++++ DashWallet/pl.lproj/Localizable.strings | 15 ++++ DashWallet/pt.lproj/Localizable.strings | 15 ++++ DashWallet/ro.lproj/Localizable.strings | 15 ++++ DashWallet/ru.lproj/Localizable.strings | 15 ++++ DashWallet/sk.lproj/Localizable.strings | 15 ++++ DashWallet/sl.lproj/Localizable.strings | 15 ++++ DashWallet/sl_SI.lproj/Localizable.strings | 15 ++++ DashWallet/sq.lproj/Localizable.strings | 15 ++++ DashWallet/sr.lproj/Localizable.strings | 15 ++++ DashWallet/sv.lproj/Localizable.strings | 15 ++++ DashWallet/th.lproj/Localizable.strings | 15 ++++ DashWallet/tr.lproj/Localizable.strings | 15 ++++ DashWallet/uk.lproj/Localizable.strings | 15 ++++ DashWallet/vi.lproj/Localizable.strings | 15 ++++ DashWallet/zh-Hans.lproj/Localizable.strings | 15 ++++ .../zh-Hant-TW.lproj/Localizable.strings | 15 ++++ DashWallet/zh.lproj/Localizable.strings | 15 ++++ DashWallet/zh_TW.lproj/Localizable.strings | 15 ++++ DashWalletTests/PaymentProtocolTests.swift | 84 +++++++++++++++++++ 48 files changed, 827 insertions(+), 6 deletions(-) diff --git a/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift b/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift index 9497716e17..ff6856b353 100644 --- a/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift +++ b/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift @@ -24,6 +24,56 @@ final class BIP70ConfirmationBox: NSObject { @objc var estimatedFee: UInt64 { confirmation.estimatedFee } @objc var primaryAddress: String? { confirmation.primaryAddress } @objc var memo: String? { confirmation.memo } + /// How many outputs the request pays. The confirm screen shows one address. + @objc var recipientCount: Int { confirmation.recipients.count } +} + +/// What the interactive (scan / link / paste / NFC) flow refuses on top of the protocol rules +/// in `BIP70PaymentService`. Kept out of the service on purpose: the headless gift-card +/// purchase shares that service and shows no confirm screen, so these rules do not apply to it. +enum BIP70InteractivePolicy { + enum Violation: LocalizedError, Equatable { + /// The request URL is not `https`. + case insecureTransport + /// An unsigned request paying more than one output. + case unsignedMultipleRecipients + + var errorDescription: String? { + switch self { + case .insecureTransport: + return NSLocalizedString("This payment request does not use a secure connection.", + comment: "Payment request refused") + case .unsignedMultipleRecipients: + return NSLocalizedString("This payment request is unsigned and pays more than one address.", + comment: "Payment request refused") + } + } + } + + /// Debug builds may fetch over plain http, which the local test server in + /// `BIP70_TESTING.md` uses. + static var allowsInsecureTransport: Bool { + #if DEBUG + return true + #else + return false + #endif + } + + /// Checked before the fetch. + static func check(requestURL: URL, allowsInsecureTransport: Bool) throws { + guard allowsInsecureTransport || requestURL.scheme?.lowercased() == "https" else { + throw Violation.insecureTransport + } + } + + /// Checked on the fetched and verified request. The confirm screen shows one address, and + /// an unsigned request has no signer answering for the others. + static func check(_ confirmation: Confirmation) throws { + if !confirmation.isSecure, confirmation.recipients.count > 1 { + throw Violation.unsignedMultipleRecipients + } + } } /// Opaque carrier for a completed `SendResult`. @@ -59,9 +109,13 @@ final class BIP70InteractiveCoordinator: NSObject { let normalizedScheme = Self.normalize(scheme) Task { do { + try BIP70InteractivePolicy.check( + requestURL: requestURL, + allowsInsecureTransport: BIP70InteractivePolicy.allowsInsecureTransport) let network = try PaymentNetworkResolver.current() let confirmation = try await service.prepareForConfirmation( from: requestURL, scheme: normalizedScheme, network: network, callbackScheme: callbackScheme) + try BIP70InteractivePolicy.check(confirmation) await MainActor.run { completion(BIP70ConfirmationBox(confirmation), nil) } } catch { await MainActor.run { completion(nil, Self.nsError(error)) } @@ -108,6 +162,11 @@ final class BIP70InteractiveCoordinator: NSObject { code: 1, userInfo: [NSLocalizedDescriptionKey: bip.errorDescription ?? "Payment failed"]) } + if let violation = error as? BIP70InteractivePolicy.Violation { + return NSError(domain: "org.dashfoundation.dash.bip70", + code: 3, + userInfo: [NSLocalizedDescriptionKey: violation.errorDescription ?? "Payment failed"]) + } return error as NSError } } diff --git a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput+DWView.m b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput+DWView.m index 2e38524475..c885725ffc 100644 --- a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput+DWView.m +++ b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput+DWView.m @@ -86,8 +86,9 @@ - (uint64_t)amountToDisplay { } - (nullable id)addressWithFont:(UIFont *)font tintColor:(UIColor *)tintColor { - if (self.isMerchantRequest) { - // don't show "send to" for BIP70 merchant requests + if (self.isMerchantRequest && self.isSecure) { + // A validly signed BIP70 request names its recipient by certificate, so the name row + // stands in for the address. An unsigned one names itself, so its address stays visible. return nil; } else { @@ -162,6 +163,16 @@ - (BOOL)copyAddressToPasteboard { #pragma mark - Private - (nullable NSString *)nameString { + if (self.isMerchantRequest && !self.isSecure) { + // Unsigned BIP70 request: the name is whatever the issuer typed into `pki_data`, so it + // is labelled as unverified — and the label shows even when no name was sent. + if (self.name.length > 0) { + return [NSString stringWithFormat:NSLocalizedString(@"Unverified recipient: %@", @"Payment confirmation: name supplied by an unsigned payment request"), + sanitizeString(self.name)]; + } + return NSLocalizedString(@"Unverified recipient", @"Payment confirmation: unsigned payment request without a name"); + } + if (self.name.length > 0) { NSString *sanitizedName = sanitizeString(self.name); if (self.isSecure) { @@ -175,6 +186,14 @@ - (nullable NSString *)nameString { return nil; } +/// Number of outputs a BIP70 request pays; 0 for a non-BIP70 output. +- (NSInteger)merchantRecipientCount { + if (![self.bip70Confirmation isKindOfClass:[DWBIP70ConfirmationBox class]]) { + return 0; + } + return ((DWBIP70ConfirmationBox *)self.bip70Confirmation).recipientCount; +} + - (nullable NSString *)generalInfoString { BOOL hasInfo = NO; NSString *info = @""; @@ -183,6 +202,16 @@ - (nullable NSString *)generalInfoString { hasInfo = YES; } + const NSInteger recipientCount = [self merchantRecipientCount]; + if (recipientCount > 1) { + // The confirm screen names one recipient, but the request pays every output it lists. + if (info.length > 0) { + info = [info stringByAppendingString:@"\n"]; + } + info = [info stringByAppendingFormat:NSLocalizedString(@"This payment goes to %ld addresses.", @"Payment confirmation: a payment request with several outputs"), (long)recipientCount]; + hasInfo = YES; + } + if (self.localCurrency && ![self.localCurrency isEqualToString:DWApp.localCurrencyCode]) { NSString *requestedAmount = [CurrencyExchangerObjcWrapper fiatCurrencyString:self.localCurrency forDashAmount:self.amount]; if (info.length > 0) { diff --git a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput.h b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput.h index 0ac9c14ccd..440e084276 100644 --- a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput.h +++ b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput.h @@ -35,8 +35,9 @@ typedef NS_ENUM(NSInteger, DWPaymentOutputBroadcastAuthorizationState) { @property (readonly, nullable, nonatomic, copy) NSString *localCurrency; @property (readonly, nonatomic, assign) DWPaymentOutputBroadcastAuthorizationState broadcastAuthorizationState; -/// YES for an app-side BIP70 merchant request (built from a verified `Confirmation`), so the -/// confirm screen renders the merchant name + lock instead of a plain "send to" address. +/// YES for an app-side BIP70 merchant request (built from a verified `Confirmation`). The +/// confirm screen renders the merchant name + lock instead of the "send to" address only when +/// `isSecure` is also YES; an unsigned request keeps its address and is labelled unverified. @property (readonly, nonatomic, assign) BOOL isMerchantRequest; /// Opaque `DWBIP70ConfirmationBox` (Swift) carried so the broadcast step can call diff --git a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m index c8343432a5..6c6688dd06 100644 --- a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m +++ b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m @@ -233,8 +233,11 @@ - (void)confirmBIP70Output:(id)bip70Confirmation { /// Authenticate (PIN / biometric), then build + broadcast + POST via the Swift orchestrator. - (void)broadcastBIP70PaymentOutput:(DWPaymentOutput *)paymentOutput { - BOOL skipAuth = [[DWGlobalOptions sharedInstance] spendingConfirmationDisabled] || - paymentOutput.broadcastAuthorizationState == DWPaymentOutputBroadcastAuthorizationStateAlreadyAuthorized; + // An unsigned request always asks for the PIN / biometric, even with spending confirmation + // turned off: nothing vouches for its recipient, so the prompt is the last deliberate step. + BOOL skipAuth = paymentOutput.isSecure && + ([[DWGlobalOptions sharedInstance] spendingConfirmationDisabled] || + paymentOutput.broadcastAuthorizationState == DWPaymentOutputBroadcastAuthorizationStateAlreadyAuthorized); if (skipAuth) { [self performBIP70Send:paymentOutput]; diff --git a/DashWallet/ar.lproj/Localizable.strings b/DashWallet/ar.lproj/Localizable.strings index 3051ca2b77..deb6c59919 100644 --- a/DashWallet/ar.lproj/Localizable.strings +++ b/DashWallet/ar.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "يزيل هذا نهائيًا كل المحافظ والمفاتيح الخاصة وعبارات الاسترداد التي يخزّنها هذا التطبيق على هذا الجهاز. ولا يمكن استعادتها إلا من نسخ احتياطية. ولا يمكن التراجع عن ذلك."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "غير محمي"; diff --git a/DashWallet/bg.lproj/Localizable.strings b/DashWallet/bg.lproj/Localizable.strings index cb478fdab9..28972757da 100644 --- a/DashWallet/bg.lproj/Localizable.strings +++ b/DashWallet/bg.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Това премахва завинаги всички портфейли, частни ключове и фрази за възстановяване, съхранявани от това приложение на това устройство. Те могат да бъдат възстановени само от резервни копия. Действието е необратимо."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Незащитен"; diff --git a/DashWallet/ca.lproj/Localizable.strings b/DashWallet/ca.lproj/Localizable.strings index 402c78bad0..5bea328ab8 100644 --- a/DashWallet/ca.lproj/Localizable.strings +++ b/DashWallet/ca.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Això elimina permanentment totes les carteres, claus privades i frases de recuperació que aquesta aplicació desa en aquest dispositiu. Només es poden restaurar des de còpies de seguretat. Això no es pot desfer."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Sense blindar"; diff --git a/DashWallet/cs.lproj/Localizable.strings b/DashWallet/cs.lproj/Localizable.strings index 14e928622e..021c22be76 100644 --- a/DashWallet/cs.lproj/Localizable.strings +++ b/DashWallet/cs.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Tímto se trvale odstraní všechny peněženky, soukromé klíče a fráze pro obnovení, které tato aplikace na tomto zařízení uchovává. Obnovit je půjde jen ze záloh. Tuto akci nelze vrátit zpět."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Nestíněné"; diff --git a/DashWallet/da.lproj/Localizable.strings b/DashWallet/da.lproj/Localizable.strings index 2ea99e839c..864283b61c 100644 --- a/DashWallet/da.lproj/Localizable.strings +++ b/DashWallet/da.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Dette fjerner permanent alle tegnebøger, private nøgler og gendannelsessætninger, som denne app gemmer på denne enhed. De kan kun gendannes fra sikkerhedskopier. Dette kan ikke fortrydes."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Uskærmet"; diff --git a/DashWallet/de.lproj/Localizable.strings b/DashWallet/de.lproj/Localizable.strings index 745ba1ce01..3bd12eef9a 100644 --- a/DashWallet/de.lproj/Localizable.strings +++ b/DashWallet/de.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Dies entfernt dauerhaft alle Wallets, privaten Schlüssel und Wiederherstellungs-Wortfolgen, die diese App auf diesem Gerät gespeichert hat. Sie können nur aus Backups wiederhergestellt werden. Das kann nicht rückgängig gemacht werden."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Nicht abgeschirmt"; diff --git a/DashWallet/el.lproj/Localizable.strings b/DashWallet/el.lproj/Localizable.strings index 64fb6002cd..f407fb5eda 100644 --- a/DashWallet/el.lproj/Localizable.strings +++ b/DashWallet/el.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Αυτό αφαιρεί οριστικά όλα τα πορτοφόλια, τα ιδιωτικά κλειδιά και τις φράσεις ανάκτησης που αποθηκεύει αυτή η εφαρμογή σε αυτή τη συσκευή. Μπορούν να επαναφερθούν μόνο από αντίγραφα ασφαλείας. Δεν αναιρείται."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Μη θωρακισμένο"; diff --git a/DashWallet/en.lproj/Localizable.strings b/DashWallet/en.lproj/Localizable.strings index 6220021227..0d7030c08a 100644 --- a/DashWallet/en.lproj/Localizable.strings +++ b/DashWallet/en.lproj/Localizable.strings @@ -5786,6 +5786,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Unshielded"; diff --git a/DashWallet/eo.lproj/Localizable.strings b/DashWallet/eo.lproj/Localizable.strings index 4071040e4a..b5df7254fb 100644 --- a/DashWallet/eo.lproj/Localizable.strings +++ b/DashWallet/eo.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Ĉi tio konstante forigas ĉiujn monujojn, privatajn ŝlosilojn kaj reakirajn frazojn, kiujn ĉi tiu aplikaĵo konservas sur ĉi tiu aparato. Ili estas restaŭreblaj nur el sekurkopioj. Ĉi tio ne estas malfarebla."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Neŝirmita"; diff --git a/DashWallet/es.lproj/Localizable.strings b/DashWallet/es.lproj/Localizable.strings index f928042120..c30092f552 100644 --- a/DashWallet/es.lproj/Localizable.strings +++ b/DashWallet/es.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Esto elimina permanentemente todas las carteras, claves privadas y frases de recuperación que esta app guarda en este dispositivo. Solo se podrán restaurar desde copias de seguridad. Esto no se puede deshacer."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Sin blindar"; diff --git a/DashWallet/et.lproj/Localizable.strings b/DashWallet/et.lproj/Localizable.strings index 688ec90393..35605d204e 100644 --- a/DashWallet/et.lproj/Localizable.strings +++ b/DashWallet/et.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "See eemaldab jäädavalt kõik rahakotid, privaatvõtmed ja taastefraasid, mida see rakendus selles seadmes hoiab. Neid saab taastada ainult varukoopiatest. Seda ei saa tagasi võtta."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Varjamata"; diff --git a/DashWallet/fa.lproj/Localizable.strings b/DashWallet/fa.lproj/Localizable.strings index baebead0c0..e430211f51 100644 --- a/DashWallet/fa.lproj/Localizable.strings +++ b/DashWallet/fa.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "این کار همه کیف پول‌ها، کلیدهای خصوصی و عبارت‌های بازیابی ذخیره‌شده توسط این برنامه روی این دستگاه را برای همیشه پاک می‌کند. آن‌ها فقط از نسخه‌های پشتیبان قابل بازیابی‌اند. این کار برگشت‌پذیر نیست."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "محافظت‌نشده"; diff --git a/DashWallet/fi.lproj/Localizable.strings b/DashWallet/fi.lproj/Localizable.strings index 5494fc5929..c2f0dc8283 100644 --- a/DashWallet/fi.lproj/Localizable.strings +++ b/DashWallet/fi.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Tämä poistaa pysyvästi kaikki lompakot, yksityiset avaimet ja palautuslauseet, jotka tämä sovellus säilyttää tällä laitteella. Ne voi palauttaa vain varmuuskopioista. Tätä ei voi perua."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Suojaamaton"; diff --git a/DashWallet/fil.lproj/Localizable.strings b/DashWallet/fil.lproj/Localizable.strings index 0f4746f262..3b523fff00 100644 --- a/DashWallet/fil.lproj/Localizable.strings +++ b/DashWallet/fil.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Permanenteng inaalis nito lahat ng wallet, private key, at recovery phrase na iniimbak ng app na ito sa device na ito. Maibabalik lang ang mga ito mula sa backup. Hindi ito maibabalik."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Hindi protektado"; diff --git a/DashWallet/fr.lproj/Localizable.strings b/DashWallet/fr.lproj/Localizable.strings index e1b07fbf08..72266b2fcf 100644 --- a/DashWallet/fr.lproj/Localizable.strings +++ b/DashWallet/fr.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Cette action supprime définitivement tous les portefeuilles, clés privées et phrases de récupération stockés par cette application sur cet appareil. Ils ne pourront être restaurés qu'à partir de sauvegardes. C'est irréversible."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Non blindé"; diff --git a/DashWallet/hr.lproj/Localizable.strings b/DashWallet/hr.lproj/Localizable.strings index 172b64da87..7075b24a3a 100644 --- a/DashWallet/hr.lproj/Localizable.strings +++ b/DashWallet/hr.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Ovo trajno uklanja sve novčanike, privatne ključeve i fraze za oporavak koje ova aplikacija čuva na ovom uređaju. Mogu se vratiti samo iz sigurnosnih kopija. Ovo se ne može poništiti."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Nezaštićeno"; diff --git a/DashWallet/hu.lproj/Localizable.strings b/DashWallet/hu.lproj/Localizable.strings index 94b0383db6..b6d2f96f2e 100644 --- a/DashWallet/hu.lproj/Localizable.strings +++ b/DashWallet/hu.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Ez véglegesen eltávolítja az összes tárcát, privát kulcsot és helyreállítási kifejezést, amelyet ez az alkalmazás ezen az eszközön tárol. Csak biztonsági mentésből állíthatók vissza. Ez nem vonható vissza."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Nem árnyékolt"; diff --git a/DashWallet/id.lproj/Localizable.strings b/DashWallet/id.lproj/Localizable.strings index ea977dd4a6..b22567543e 100644 --- a/DashWallet/id.lproj/Localizable.strings +++ b/DashWallet/id.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Ini menghapus secara permanen semua dompet, kunci privat, dan frasa pemulihan yang disimpan aplikasi ini di perangkat ini. Semuanya hanya dapat dipulihkan dari cadangan. Ini tidak dapat dibatalkan."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Tidak terlindungi"; diff --git a/DashWallet/it.lproj/Localizable.strings b/DashWallet/it.lproj/Localizable.strings index 44ebe789bf..5d4b7ffc8c 100644 --- a/DashWallet/it.lproj/Localizable.strings +++ b/DashWallet/it.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Questa operazione rimuove definitivamente tutti i portafogli, le chiavi private e le frasi di recupero memorizzati da questa app su questo dispositivo. Potranno essere ripristinati solo dai backup. L'operazione non può essere annullata."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Non schermato"; diff --git a/DashWallet/ja.lproj/Localizable.strings b/DashWallet/ja.lproj/Localizable.strings index 5f6f5f0cdf..431f4961f9 100644 --- a/DashWallet/ja.lproj/Localizable.strings +++ b/DashWallet/ja.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "この操作により、このアプリがこの端末に保存しているすべてのウォレット、秘密鍵、復元フレーズが完全に削除されます。バックアップからしか復元できません。この操作は取り消せません。"; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "シールドなし"; diff --git a/DashWallet/ko.lproj/Localizable.strings b/DashWallet/ko.lproj/Localizable.strings index 0adfb4d1fe..1892abf3e5 100644 --- a/DashWallet/ko.lproj/Localizable.strings +++ b/DashWallet/ko.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "이 작업은 이 앱이 이 기기에 저장한 모든 지갑, 개인 키, 복원 문구를 영구적으로 제거합니다. 백업에서만 복원할 수 있습니다. 되돌릴 수 없습니다."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "보호되지 않음"; diff --git a/DashWallet/mk.lproj/Localizable.strings b/DashWallet/mk.lproj/Localizable.strings index c147ddb3d5..ee4bdc6935 100644 --- a/DashWallet/mk.lproj/Localizable.strings +++ b/DashWallet/mk.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Ова трајно ги отстранува сите паричници, приватни клучеви и фрази за обновување што оваа апликација ги чува на овој уред. Тие може да се обноват само од резервни копии. Ова не може да се врати."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Незаштитено"; diff --git a/DashWallet/ms.lproj/Localizable.strings b/DashWallet/ms.lproj/Localizable.strings index 1da9f4a067..4600b2b215 100644 --- a/DashWallet/ms.lproj/Localizable.strings +++ b/DashWallet/ms.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Ini mengeluarkan secara kekal semua dompet, kunci peribadi dan frasa pemulihan yang disimpan oleh aplikasi ini pada peranti ini. Semuanya hanya boleh dipulihkan daripada sandaran. Ini tidak boleh dibatalkan."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Tidak terlindung"; diff --git a/DashWallet/nb.lproj/Localizable.strings b/DashWallet/nb.lproj/Localizable.strings index 4253bfbb41..7e90968dce 100644 --- a/DashWallet/nb.lproj/Localizable.strings +++ b/DashWallet/nb.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Dette fjerner permanent alle lommebøker, private nøkler og gjenopprettingsfraser som denne appen lagrer på denne enheten. De kan bare gjenopprettes fra sikkerhetskopier. Dette kan ikke angres."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Uskjermet"; diff --git a/DashWallet/nl.lproj/Localizable.strings b/DashWallet/nl.lproj/Localizable.strings index 5a02fa113a..871734095a 100644 --- a/DashWallet/nl.lproj/Localizable.strings +++ b/DashWallet/nl.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Hiermee worden alle wallets, privésleutels en herstelzinnen die deze app op dit apparaat bewaart permanent verwijderd. Ze kunnen alleen vanuit back-ups worden hersteld. Dit kan niet ongedaan worden gemaakt."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Niet afgeschermd"; diff --git a/DashWallet/pl.lproj/Localizable.strings b/DashWallet/pl.lproj/Localizable.strings index 1e7991d78c..3486b5b4d4 100644 --- a/DashWallet/pl.lproj/Localizable.strings +++ b/DashWallet/pl.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "To trwale usuwa wszystkie portfele, klucze prywatne i frazy odzyskiwania zapisane przez tę aplikację na tym urządzeniu. Będzie je można przywrócić tylko z kopii zapasowych. Tego nie da się cofnąć."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Nieosłonięte"; diff --git a/DashWallet/pt.lproj/Localizable.strings b/DashWallet/pt.lproj/Localizable.strings index 1f1043c022..3f24a01fc7 100644 --- a/DashWallet/pt.lproj/Localizable.strings +++ b/DashWallet/pt.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Isto remove permanentemente todas as carteiras, chaves privadas e frases de recuperação armazenadas por este app neste dispositivo. Elas só poderão ser restauradas a partir de backups. Isso não pode ser desfeito."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Não blindado"; diff --git a/DashWallet/ro.lproj/Localizable.strings b/DashWallet/ro.lproj/Localizable.strings index fd44d21364..ee7ec0f2e2 100644 --- a/DashWallet/ro.lproj/Localizable.strings +++ b/DashWallet/ro.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Această acțiune elimină definitiv toate portofelele, cheile private și frazele de recuperare stocate de această aplicație pe acest dispozitiv. Pot fi restaurate doar din copii de rezervă. Acțiunea nu poate fi anulată."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Neprotejat"; diff --git a/DashWallet/ru.lproj/Localizable.strings b/DashWallet/ru.lproj/Localizable.strings index 67ae65934b..c30a28797d 100644 --- a/DashWallet/ru.lproj/Localizable.strings +++ b/DashWallet/ru.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Это навсегда удалит все кошельки, приватные ключи и фразы восстановления, сохранённые этим приложением на этом устройстве. Их можно будет восстановить только из резервных копий. Отменить это нельзя."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Не экранировано"; diff --git a/DashWallet/sk.lproj/Localizable.strings b/DashWallet/sk.lproj/Localizable.strings index 128643737f..d16af8ad1d 100644 --- a/DashWallet/sk.lproj/Localizable.strings +++ b/DashWallet/sk.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Týmto sa natrvalo odstránia všetky peňaženky, súkromné kľúče a frázy pre obnovenie, ktoré táto aplikácia na tomto zariadení uchováva. Obnoviť ich pôjde len zo záloh. Túto akciu nemožno vrátiť späť."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Netienené"; diff --git a/DashWallet/sl.lproj/Localizable.strings b/DashWallet/sl.lproj/Localizable.strings index 19a5afca1e..58738396b4 100644 --- a/DashWallet/sl.lproj/Localizable.strings +++ b/DashWallet/sl.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "To trajno odstrani vse denarnice, zasebne ključe in fraze za obnovitev, ki jih ta aplikacija hrani na tej napravi. Obnoviti jih je mogoče samo iz varnostnih kopij. Tega ni mogoče razveljaviti."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Nezaščiteno"; diff --git a/DashWallet/sl_SI.lproj/Localizable.strings b/DashWallet/sl_SI.lproj/Localizable.strings index 442f9a2d5d..3c8e6e540f 100644 --- a/DashWallet/sl_SI.lproj/Localizable.strings +++ b/DashWallet/sl_SI.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "To trajno odstrani vse denarnice, zasebne ključe in fraze za obnovitev, ki jih ta aplikacija hrani na tej napravi. Obnoviti jih je mogoče samo iz varnostnih kopij. Tega ni mogoče razveljaviti."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Nezaščiteno"; diff --git a/DashWallet/sq.lproj/Localizable.strings b/DashWallet/sq.lproj/Localizable.strings index 3676ca2880..973ee9143d 100644 --- a/DashWallet/sq.lproj/Localizable.strings +++ b/DashWallet/sq.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Kjo heq përgjithmonë të gjithë portofolët, çelësat privatë dhe frazat e rikuperimit që ky aplikacion ruan në këtë pajisje. Ato mund të rikthehen vetëm nga kopjet rezervë. Kjo nuk mund të zhbëhet."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "I pambrojtur"; diff --git a/DashWallet/sr.lproj/Localizable.strings b/DashWallet/sr.lproj/Localizable.strings index 87959a1a92..5482bf3606 100644 --- a/DashWallet/sr.lproj/Localizable.strings +++ b/DashWallet/sr.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Ovo trajno uklanja sve novčanike, privatne ključeve i fraze za oporavak koje ova aplikacija čuva na ovom uređaju. Mogu se povratiti samo iz rezervnih kopija. Ovo se ne može poništiti."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Nezaštićeno"; diff --git a/DashWallet/sv.lproj/Localizable.strings b/DashWallet/sv.lproj/Localizable.strings index 8d4ad8c1fc..608a29eaa5 100644 --- a/DashWallet/sv.lproj/Localizable.strings +++ b/DashWallet/sv.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Detta tar permanent bort alla plånböcker, privata nycklar och återställningsfraser som den här appen lagrar på den här enheten. De kan bara återställas från säkerhetskopior. Detta går inte att ångra."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Oskyddad"; diff --git a/DashWallet/th.lproj/Localizable.strings b/DashWallet/th.lproj/Localizable.strings index 952d408bd5..a98dbfec4c 100644 --- a/DashWallet/th.lproj/Localizable.strings +++ b/DashWallet/th.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "การกระทำนี้จะลบกระเป๋าเงิน คีย์ส่วนตัว และวลีกู้คืนทั้งหมดที่แอปนี้เก็บไว้บนอุปกรณ์นี้อย่างถาวร กู้คืนได้จากข้อมูลสำรองเท่านั้น และย้อนกลับไม่ได้"; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "ไม่ปกปิด"; diff --git a/DashWallet/tr.lproj/Localizable.strings b/DashWallet/tr.lproj/Localizable.strings index 8670ca29f5..dae81fa9fe 100644 --- a/DashWallet/tr.lproj/Localizable.strings +++ b/DashWallet/tr.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Bu işlem, bu uygulamanın bu cihazda sakladığı tüm cüzdanları, özel anahtarları ve kurtarma sözcük gruplarını kalıcı olarak kaldırır. Bunlar yalnızca yedeklerden geri yüklenebilir. Bu geri alınamaz."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Korumasız"; diff --git a/DashWallet/uk.lproj/Localizable.strings b/DashWallet/uk.lproj/Localizable.strings index e8f4ed5995..ab8c85dfc3 100644 --- a/DashWallet/uk.lproj/Localizable.strings +++ b/DashWallet/uk.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Це назавжди видалить усі гаманці, приватні ключі та фрази відновлення, збережені цим застосунком на цьому пристрої. Їх можна буде відновити лише з резервних копій. Скасувати це неможливо."; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Не екрановано"; diff --git a/DashWallet/vi.lproj/Localizable.strings b/DashWallet/vi.lproj/Localizable.strings index bc5a7d8aaa..7ab3133af3 100644 --- a/DashWallet/vi.lproj/Localizable.strings +++ b/DashWallet/vi.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "Thao tác này xoá vĩnh viễn mọi ví, khoá riêng tư và cụm từ phục hồi mà ứng dụng này lưu trên thiết bị này. Chúng chỉ có thể khôi phục từ bản sao lưu. Không thể hoàn tác."; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "Không được che chắn"; diff --git a/DashWallet/zh-Hans.lproj/Localizable.strings b/DashWallet/zh-Hans.lproj/Localizable.strings index c61a38f797..e6c58190bb 100644 --- a/DashWallet/zh-Hans.lproj/Localizable.strings +++ b/DashWallet/zh-Hans.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "此操作会永久移除本应用在本设备上存储的所有钱包、私钥和助记词。它们只能从备份中恢复。此操作无法撤销。"; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "未屏蔽"; diff --git a/DashWallet/zh-Hant-TW.lproj/Localizable.strings b/DashWallet/zh-Hant-TW.lproj/Localizable.strings index f586df6fea..2c1ee7afab 100644 --- a/DashWallet/zh-Hant-TW.lproj/Localizable.strings +++ b/DashWallet/zh-Hant-TW.lproj/Localizable.strings @@ -5787,6 +5787,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "此操作會永久移除本 App 在本裝置上儲存的所有錢包、私鑰和助記詞。它們只能從備份中復原。此操作無法復原。"; @@ -6281,6 +6290,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "未遮蔽"; diff --git a/DashWallet/zh.lproj/Localizable.strings b/DashWallet/zh.lproj/Localizable.strings index 0674b1e3df..16394bce9f 100644 --- a/DashWallet/zh.lproj/Localizable.strings +++ b/DashWallet/zh.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "此操作会永久移除本应用在本设备上存储的所有钱包、私钥和助记词。它们只能从备份中恢复。此操作无法撤销。"; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "未屏蔽"; diff --git a/DashWallet/zh_TW.lproj/Localizable.strings b/DashWallet/zh_TW.lproj/Localizable.strings index 352478dbb3..efd28ca9f8 100644 --- a/DashWallet/zh_TW.lproj/Localizable.strings +++ b/DashWallet/zh_TW.lproj/Localizable.strings @@ -5785,6 +5785,15 @@ /* Voting */ "This node will no longer vote from this wallet. You can add its voting key again at any time." = "This node will no longer vote from this wallet. You can add its voting key again at any time."; +/* Payment confirmation: a payment request with several outputs */ +"This payment goes to %ld addresses." = "This payment goes to %ld addresses."; + +/* Payment request refused */ +"This payment request does not use a secure connection." = "This payment request does not use a secure connection."; + +/* Payment request refused */ +"This payment request is unsigned and pays more than one address." = "This payment request is unsigned and pays more than one address."; + /* No comment provided by engineer. */ "This permanently removes all wallets, private keys, and recovery phrases stored by this app on this device. They can only be restored from backups. This cannot be undone." = "此操作會永久移除本 App 在本裝置上儲存的所有錢包、私鑰和助記詞。它們只能從備份中復原。此操作無法復原。"; @@ -6279,6 +6288,12 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: unsigned payment request without a name */ +"Unverified recipient" = "Unverified recipient"; + +/* Payment confirmation: name supplied by an unsigned payment request */ +"Unverified recipient: %@" = "Unverified recipient: %@"; + /* No comment provided by engineer. */ "Unshielded" = "未遮蔽"; diff --git a/DashWalletTests/PaymentProtocolTests.swift b/DashWalletTests/PaymentProtocolTests.swift index 828c615527..8314053643 100644 --- a/DashWalletTests/PaymentProtocolTests.swift +++ b/DashWalletTests/PaymentProtocolTests.swift @@ -783,6 +783,90 @@ final class BIP70PaymentServiceTests: XCTestCase { .prepareForConfirmation(from: url, scheme: "dash", network: .testnet) } + // MARK: Interactive policy + confirm-screen rows (unsigned requests) + + private func unsignedNamed(_ name: String?, outputs: [PaymentOutput]? = nil) -> PaymentRequest { + let outs = outputs ?? [PaymentOutput(amount: 100_000, script: p2pkh)] + let details = PaymentDetails(network: "test", outputs: outs, expires: futureExpiry, + memo: nil, paymentURL: "http://h/pay", merchantData: nil) + let pkiData = name.map { X509Certificates(certificates: [Data($0.utf8)]).encoded() } + return PaymentRequest(pkiType: "none", pkiData: pkiData, serializedDetails: details.encoded()) + } + + private func paymentOutput(for request: PaymentRequest, isSecure: Bool? = nil) async throws -> DWPaymentOutput { + let confirmation = try await service(FakeTransport(request), FakeWallet()) + .prepareForConfirmation(from: url, scheme: "dash", network: .testnet) + let box = BIP70ConfirmationBox(confirmation) + guard let isSecure else { return BIP70PaymentOutputFactory.paymentOutput(from: box) } + // The lock is a property of the output, so a signed one is built directly here: a + // request that verifies as signed needs a certificate the simulator trusts. + return DWPaymentOutput(merchantName: box.merchantName, isSecure: isSecure, amount: box.amount, + fee: box.estimatedFee, address: box.primaryAddress ?? "", memo: box.memo, + bip70Confirmation: box) + } + + /// The confirm screen reads an output through this protocol; Swift only sees the + /// conformance at runtime (the Objective-C category forward-declares the protocol). + private func rows(of output: DWPaymentOutput) throws -> ConfirmPaymentDataSource { + try XCTUnwrap(output as AnyObject as? ConfirmPaymentDataSource) + } + + private func addressRow(of output: DWPaymentOutput) throws -> DWTitleDetailItem? { + try rows(of: output).address(with: UIFont.systemFont(ofSize: 12), tintColor: UIColor.black) + } + + func testUnsignedNameIsCarriedButNotSecure() { + let verdict = PaymentRequestVerifier().verify(unsignedNamed("Coffee Shop")) + XCTAssertEqual(verdict.commonName, "Coffee Shop") + XCTAssertFalse(verdict.isSecure) + } + + func testUnsignedNamedRequestShowsAddressAndUnverifiedLabel() async throws { + let output = try await paymentOutput(for: unsignedNamed("Coffee Shop")) + XCTAssertEqual(try addressRow(of: output)?.attributedDetail?.string, Self.testnetAddress) + XCTAssertEqual(try rows(of: output).nameInfo?.plainDetail, "Unverified recipient: Coffee Shop") + } + + func testUnsignedNamelessRequestShowsAddressAndUnverifiedLabel() async throws { + let output = try await paymentOutput(for: unsignedNamed(nil)) + XCTAssertEqual(try addressRow(of: output)?.attributedDetail?.string, Self.testnetAddress) + XCTAssertEqual(try rows(of: output).nameInfo?.plainDetail, "Unverified recipient") + } + + func testSignedRequestKeepsNameInPlaceOfAddress() async throws { + let output = try await paymentOutput(for: unsignedNamed("Coffee Shop"), isSecure: true) + XCTAssertNil(try addressRow(of: output)) + XCTAssertEqual(try rows(of: output).nameInfo?.plainDetail, "🔒 Coffee Shop") + } + + func testSignedMultiOutputRequestSaysHowManyAddressesItPays() async throws { + let outs = [PaymentOutput(amount: 100_000, script: p2pkh), PaymentOutput(amount: 200_000, script: p2sh)] + let output = try await paymentOutput(for: unsignedNamed("Coffee Shop", outputs: outs), isSecure: true) + XCTAssertEqual(try rows(of: output).generalInfo?.plainDetail, "This payment goes to 2 addresses.") + } + + func testInteractivePolicyRefusesUnsignedMultiOutput() async throws { + let outs = [PaymentOutput(amount: 100_000, script: p2pkh), PaymentOutput(amount: 200_000, script: p2sh)] + let svc = service(FakeTransport(unsignedNamed(nil, outputs: outs)), FakeWallet()) + let multi = try await svc.prepareForConfirmation(from: url, scheme: "dash", network: .testnet) + XCTAssertThrowsError(try BIP70InteractivePolicy.check(multi)) { + XCTAssertEqual($0 as? BIP70InteractivePolicy.Violation, .unsignedMultipleRecipients) + } + let single = try await service(FakeTransport(unsignedNamed(nil)), FakeWallet()) + .prepareForConfirmation(from: url, scheme: "dash", network: .testnet) + XCTAssertNoThrow(try BIP70InteractivePolicy.check(single)) + } + + func testInteractivePolicyRequiresHTTPSOutsideDebug() throws { + let http = URL(string: "http://h/pr")! + let https = URL(string: "HTTPS://h/pr")! + XCTAssertThrowsError(try BIP70InteractivePolicy.check(requestURL: http, allowsInsecureTransport: false)) { + XCTAssertEqual($0 as? BIP70InteractivePolicy.Violation, .insecureTransport) + } + XCTAssertNoThrow(try BIP70InteractivePolicy.check(requestURL: https, allowsInsecureTransport: false)) + XCTAssertNoThrow(try BIP70InteractivePolicy.check(requestURL: http, allowsInsecureTransport: true)) + } + func testCallbackURLFormat() async throws { let w = FakeWallet() let svc = service(FakeTransport(unsigned()), w) From 70954186b554d83ff14af90a39af1b417ba7704f Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Wed, 11 Nov 2026 15:33:47 +0100 Subject: [PATCH 2/5] fix(payments): require https on every hop of an interactive payment-request fetch The interactive flow's https rule checked the request URL only. The transport now takes a `requiresHTTPSFetch` flag, which the interactive coordinator sets outside Debug builds: the request URL, a BIP73 uri-list target and every HTTP redirect must be https, or the fetch fails with `BIP70Error.insecureRequestURL`. The headless gift-card path builds its transport without the flag and is unchanged. The PIN/biometric decision for a BIP70 send moves into `BIP70InteractivePolicy.requiresAuthentication`, which the payment processor calls, so it has unit tests. Co-Authored-By: Claude Fable 5.2 --- .../BIP70PaymentService+App.swift | 6 +- .../Models/PaymentProtocol/BIP70Error.swift | 6 ++ .../PaymentProtocolTransport.swift | 45 ++++++++++- .../BIP70InteractiveCoordinator.swift | 21 +++++- .../PaymentModels/DWPaymentProcessor.m | 7 +- DashWalletTests/PaymentProtocolTests.swift | 75 +++++++++++++++++++ 6 files changed, 152 insertions(+), 8 deletions(-) diff --git a/DashWallet/Sources/Infrastructure/SwiftDashSDK/BIP70PaymentService+App.swift b/DashWallet/Sources/Infrastructure/SwiftDashSDK/BIP70PaymentService+App.swift index e1524ab709..23d8af346b 100644 --- a/DashWallet/Sources/Infrastructure/SwiftDashSDK/BIP70PaymentService+App.swift +++ b/DashWallet/Sources/Infrastructure/SwiftDashSDK/BIP70PaymentService+App.swift @@ -11,9 +11,11 @@ import Foundation extension BIP70PaymentService { /// Builds a service backed by the funded SwiftDashSDK wallet, the app's receive-address - /// reader, and the PIN/biometric gate. - static func makeForCurrentWallet() -> BIP70PaymentService { + /// reader, and the PIN/biometric gate. `requiresHTTPSFetch` makes the transport fetch the + /// PaymentRequest over https only (see `PaymentProtocolTransport`). + static func makeForCurrentWallet(requiresHTTPSFetch: Bool = false) -> BIP70PaymentService { BIP70PaymentService( + transport: PaymentProtocolTransport(requiresHTTPSFetch: requiresHTTPSFetch), wallet: SwiftDashSDKWalletSending(), receiveAddress: SwiftDashSDKReceiveAddressProvider(), auth: BIP70SendAuthorizer()) diff --git a/DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift b/DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift index 865d8db8c5..4c9eed8bed 100644 --- a/DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift +++ b/DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift @@ -13,6 +13,9 @@ import Foundation enum BIP70Error: Error, Equatable { /// The payment-request / payment URL was missing or unparseable. case badURL + /// The transport was built to fetch over https only, and the request URL, a BIP73 + /// uri-list target or an HTTP redirect was not https. + case insecureRequestURL /// HTTP failure: non-2xx status, missing/non-HTTP response, or wrong content type. case unexpectedResponse(host: String?) /// Response body exceeded the 50 KB BIP70 cap. @@ -56,6 +59,9 @@ extension BIP70Error: LocalizedError { var errorDescription: String? { switch self { case .badURL: return "Invalid payment request URL." + case .insecureRequestURL: + return NSLocalizedString("This payment request does not use a secure connection.", + comment: "Payment request refused") case let .unexpectedResponse(host): return "Unexpected response from \(host ?? "the payment server")." case .payloadTooLarge: return "The payment request is too large." case .malformedRequest: return "The payment request could not be read." diff --git a/DashWallet/Sources/Models/PaymentProtocol/PaymentProtocolTransport.swift b/DashWallet/Sources/Models/PaymentProtocol/PaymentProtocolTransport.swift index feb7c83398..0ca64f3154 100644 --- a/DashWallet/Sources/Models/PaymentProtocol/PaymentProtocolTransport.swift +++ b/DashWallet/Sources/Models/PaymentProtocol/PaymentProtocolTransport.swift @@ -28,9 +28,13 @@ final class PaymentProtocolTransport: PaymentProtocolTransporting { private static let timeout: TimeInterval = 30 private let session: URLSession + /// When true, the PaymentRequest is fetched over https only: the request URL, a BIP73 + /// uri-list target and every HTTP redirect on the way must be https. + private let requiresHTTPSFetch: Bool - init(session: URLSession = PaymentProtocolTransport.makeDefaultSession()) { + init(session: URLSession = PaymentProtocolTransport.makeDefaultSession(), requiresHTTPSFetch: Bool = false) { self.session = session + self.requiresHTTPSFetch = requiresHTTPSFetch } static func makeDefaultSession() -> URLSession { @@ -49,10 +53,14 @@ final class PaymentProtocolTransport: PaymentProtocolTransporting { /// `followURIList` guards BIP73 to a single hop (the uri-list may point at the real /// request; we never recurse beyond that). private func fetchRequest(from url: URL, scheme: String, followURIList: Bool) async throws -> PaymentRequest { + if requiresHTTPSFetch, !Self.isHTTPS(url) { throw BIP70Error.insecureRequestURL } + var request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: Self.timeout) request.setValue("application/\(scheme)-paymentrequest", forHTTPHeaderField: "Accept") - let (data, response) = try await session.data(for: request) + let redirects = HTTPSRedirectGuard(isEnforced: requiresHTTPSFetch) + let (data, response) = try await session.data(for: request, delegate: redirects) + if redirects.refusedRedirect { throw BIP70Error.insecureRequestURL } let http = try validate(response, data: data, host: url.host) switch http.mimeType?.lowercased() { @@ -94,6 +102,10 @@ final class PaymentProtocolTransport: PaymentProtocolTransporting { return http } + static func isHTTPS(_ url: URL?) -> Bool { + url?.scheme?.lowercased() == "https" + } + private static func firstURL(inURIList data: Data) -> URL? { guard let text = String(data: data, encoding: .utf8) else { return nil } for line in text.split(whereSeparator: \.isNewline) { @@ -104,3 +116,32 @@ final class PaymentProtocolTransport: PaymentProtocolTransporting { return nil } } + +/// Per-task delegate for the PaymentRequest fetch: when enforced, a redirect to a URL that is +/// not https is not followed, and `refusedRedirect` records that it happened. +final class HTTPSRedirectGuard: NSObject, URLSessionTaskDelegate, @unchecked Sendable { + private let isEnforced: Bool + private let lock = NSLock() + private var refused = false + + init(isEnforced: Bool) { + self.isEnforced = isEnforced + } + + var refusedRedirect: Bool { + lock.lock(); defer { lock.unlock() } + return refused + } + + func urlSession(_ session: URLSession, task: URLSessionTask, + willPerformHTTPRedirection response: HTTPURLResponse, + newRequest request: URLRequest, + completionHandler: @escaping (URLRequest?) -> Void) { + guard isEnforced, !PaymentProtocolTransport.isHTTPS(request.url) else { + completionHandler(request) + return + } + lock.lock(); refused = true; lock.unlock() + completionHandler(nil) + } +} diff --git a/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift b/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift index ff6856b353..c2a7709370 100644 --- a/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift +++ b/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift @@ -67,6 +67,14 @@ enum BIP70InteractivePolicy { } } + /// Whether sending must ask for the PIN / biometric first. A signed request keeps the two + /// existing exemptions; an unsigned one has neither. + static func requiresAuthentication(isSecure: Bool, + spendingConfirmationDisabled: Bool, + alreadyAuthorized: Bool) -> Bool { + !(isSecure && (spendingConfirmationDisabled || alreadyAuthorized)) + } + /// Checked on the fetched and verified request. The confirm screen shows one address, and /// an unsigned request has no signer answering for the others. static func check(_ confirmation: Confirmation) throws { @@ -96,10 +104,21 @@ final class BIP70InteractiveCoordinator: NSObject { private let service: BIP70PaymentService @objc override init() { - service = BIP70PaymentService.makeForCurrentWallet() + service = BIP70PaymentService.makeForCurrentWallet( + requiresHTTPSFetch: !BIP70InteractivePolicy.allowsInsecureTransport) super.init() } + /// `BIP70InteractivePolicy.requiresAuthentication` for the ObjC payment processor. + @objc(requiresAuthenticationForSecureRequest:spendingConfirmationDisabled:alreadyAuthorized:) + static func requiresAuthentication(isSecure: Bool, + spendingConfirmationDisabled: Bool, + alreadyAuthorized: Bool) -> Bool { + BIP70InteractivePolicy.requiresAuthentication(isSecure: isSecure, + spendingConfirmationDisabled: spendingConfirmationDisabled, + alreadyAuthorized: alreadyAuthorized) + } + /// Fetch + verify a BIP70 request (no build, no spend). Completion fires on the main thread. @objc(fetchAndVerifyWithRequestURL:scheme:callbackScheme:completion:) func fetchAndVerify(requestURL: URL, diff --git a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m index 6c6688dd06..00234e30e4 100644 --- a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m +++ b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m @@ -235,9 +235,10 @@ - (void)confirmBIP70Output:(id)bip70Confirmation { - (void)broadcastBIP70PaymentOutput:(DWPaymentOutput *)paymentOutput { // An unsigned request always asks for the PIN / biometric, even with spending confirmation // turned off: nothing vouches for its recipient, so the prompt is the last deliberate step. - BOOL skipAuth = paymentOutput.isSecure && - ([[DWGlobalOptions sharedInstance] spendingConfirmationDisabled] || - paymentOutput.broadcastAuthorizationState == DWPaymentOutputBroadcastAuthorizationStateAlreadyAuthorized); + BOOL skipAuth = ![DWBIP70InteractiveCoordinator + requiresAuthenticationForSecureRequest:paymentOutput.isSecure + spendingConfirmationDisabled:[[DWGlobalOptions sharedInstance] spendingConfirmationDisabled] + alreadyAuthorized:paymentOutput.broadcastAuthorizationState == DWPaymentOutputBroadcastAuthorizationStateAlreadyAuthorized]; if (skipAuth) { [self performBIP70Send:paymentOutput]; diff --git a/DashWalletTests/PaymentProtocolTests.swift b/DashWalletTests/PaymentProtocolTests.swift index 8314053643..0057974d90 100644 --- a/DashWalletTests/PaymentProtocolTests.swift +++ b/DashWalletTests/PaymentProtocolTests.swift @@ -205,6 +205,61 @@ final class PaymentProtocolTests: XCTestCase { } } + private func makeHTTPSOnlyTransport() -> PaymentProtocolTransport { + let config = URLSessionConfiguration.ephemeral + config.protocolClasses = [MockURLProtocol.self] + return PaymentProtocolTransport(session: URLSession(configuration: config), requiresHTTPSFetch: true) + } + + func testHTTPSOnlyTransportRefusesAnHTTPRequestURLWithoutFetching() async { + var fetched = false + let body = fixture + MockURLProtocol.responseHandler = { _ in fetched = true; return (200, ["Content-Type": "application/dash-paymentrequest"], body) } + await assertThrowsBIP70(try await makeHTTPSOnlyTransport() + .fetchRequest(from: URL(string: "http://merchant.example/i/abc")!, scheme: "dash")) { $0 == .insecureRequestURL } + XCTAssertFalse(fetched) + } + + func testHTTPSOnlyTransportRefusesAnHTTPURIListTarget() async { + var fetchedHosts: [String] = [] + MockURLProtocol.responseHandler = { request in + fetchedHosts.append(request.url?.absoluteString ?? "") + return (200, ["Content-Type": "text/uri-list"], Data("http://merchant.example/real\n".utf8)) + } + await assertThrowsBIP70(try await makeHTTPSOnlyTransport().fetchRequest(from: requestURL, scheme: "dash")) { + $0 == .insecureRequestURL + } + XCTAssertEqual(fetchedHosts, [requestURL.absoluteString]) + } + + func testDefaultTransportStillFollowsAnHTTPURIListTarget() async throws { + let body = fixture + MockURLProtocol.responseHandler = { request in + request.url?.scheme == "https" + ? (200, ["Content-Type": "text/uri-list"], Data("http://merchant.example/real\n".utf8)) + : (200, ["Content-Type": "application/dash-paymentrequest"], body) + } + let req = try await makeTransport().fetchRequest(from: requestURL, scheme: "dash") + XCTAssertEqual(req.pkiType, "x509+sha256") + } + + private func redirectDecision(enforced: Bool, to target: String) -> (followed: Bool, refused: Bool) { + let redirects = HTTPSRedirectGuard(isEnforced: enforced) + let session = URLSession(configuration: .ephemeral) + let task = session.dataTask(with: requestURL) + let response = HTTPURLResponse(url: requestURL, statusCode: 302, httpVersion: nil, headerFields: nil)! + var followed = false + redirects.urlSession(session, task: task, willPerformHTTPRedirection: response, + newRequest: URLRequest(url: URL(string: target)!)) { followed = $0 != nil } + return (followed, redirects.refusedRedirect) + } + + func testRedirectGuardRefusesAnHTTPRedirectOnlyWhenEnforced() { + XCTAssertTrue(redirectDecision(enforced: true, to: "http://merchant.example/real") == (false, true)) + XCTAssertTrue(redirectDecision(enforced: true, to: "https://merchant.example/real") == (true, false)) + XCTAssertTrue(redirectDecision(enforced: false, to: "http://merchant.example/real") == (true, false)) + } + func testTransportRejectsOversizedPayload() async { let big = Data(count: 50_001) MockURLProtocol.responseHandler = { _ in (200, ["Content-Type": "application/dash-paymentrequest"], big) } @@ -845,6 +900,26 @@ final class BIP70PaymentServiceTests: XCTestCase { XCTAssertEqual(try rows(of: output).generalInfo?.plainDetail, "This payment goes to 2 addresses.") } + func testUnsignedRequestAlwaysRequiresAuthentication() { + for disabled in [false, true] { + for authorized in [false, true] { + XCTAssertTrue(BIP70InteractivePolicy.requiresAuthentication( + isSecure: false, spendingConfirmationDisabled: disabled, alreadyAuthorized: authorized)) + } + } + } + + func testSignedRequestKeepsItsAuthenticationExemptions() { + func required(_ disabled: Bool, _ authorized: Bool) -> Bool { + BIP70InteractiveCoordinator.requiresAuthentication( + isSecure: true, spendingConfirmationDisabled: disabled, alreadyAuthorized: authorized) + } + XCTAssertTrue(required(false, false)) + XCTAssertFalse(required(true, false)) + XCTAssertFalse(required(false, true)) + XCTAssertFalse(required(true, true)) + } + func testInteractivePolicyRefusesUnsignedMultiOutput() async throws { let outs = [PaymentOutput(amount: 100_000, script: p2pkh), PaymentOutput(amount: 200_000, script: p2sh)] let svc = service(FakeTransport(unsignedNamed(nil, outputs: outs)), FakeWallet()) From 8c9a32895bc90fc6d1abf1ad5cd56122aac83cbc Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Wed, 11 Nov 2026 18:24:13 +0100 Subject: [PATCH 3/5] fix(payments): cover the Payment POST with the https rule and label an unsigned request's note Follow-up to review of the interactive BIP70 rules: - https applies to the whole exchange outside Debug builds: the transport's flag (now `requiresHTTPS`, no default) also covers the Payment POST and its redirects, and an http `payment_url` is refused before the confirm screen. The first-hop check lives in the transport only; one error (`BIP70Error.insecureTransport`) carries the rule. - The note of an unsigned request is shown on one line, capped at 140 characters and labelled "Unverified note: ...". - The PIN/biometric prompt for a BIP70 send is given amount + fee, so the biometric spending limit applies to it. - The scanner shows the refusal text for a request refused by rule. - Addresses are counted, not outputs: two outputs to one address are one address for the refusal and for the "goes to N addresses" line. - Tests drive the coordinator's prepare step, the auth decision off a real output, and redirects through the transport. Co-Authored-By: Claude Fable 5.2 --- .../BIP70PaymentService+App.swift | 8 +- .../Models/PaymentProtocol/BIP70Error.swift | 8 +- .../PaymentProtocol/BIP70PaymentService.swift | 2 +- .../PaymentProtocolTransport.swift | 25 ++-- .../Transactions/SendCoinsService.swift | 2 +- .../Transactions/WalletSendService.swift | 13 ++ .../BIP70InteractiveCoordinator.swift | 109 ++++++++------- .../PaymentModels/DWPaymentOutput+DWView.m | 31 ++++- .../PaymentModels/DWPaymentProcessor.m | 11 +- .../UI/Payments/ScanQR/DWQRScanModel.m | 6 +- DashWallet/ar.lproj/Localizable.strings | 3 + DashWallet/bg.lproj/Localizable.strings | 3 + DashWallet/ca.lproj/Localizable.strings | 3 + DashWallet/cs.lproj/Localizable.strings | 3 + DashWallet/da.lproj/Localizable.strings | 3 + DashWallet/de.lproj/Localizable.strings | 3 + DashWallet/el.lproj/Localizable.strings | 3 + DashWallet/en.lproj/Localizable.strings | 3 + DashWallet/eo.lproj/Localizable.strings | 3 + DashWallet/es.lproj/Localizable.strings | 3 + DashWallet/et.lproj/Localizable.strings | 3 + DashWallet/fa.lproj/Localizable.strings | 3 + DashWallet/fi.lproj/Localizable.strings | 3 + DashWallet/fil.lproj/Localizable.strings | 3 + DashWallet/fr.lproj/Localizable.strings | 3 + DashWallet/hr.lproj/Localizable.strings | 3 + DashWallet/hu.lproj/Localizable.strings | 3 + DashWallet/id.lproj/Localizable.strings | 3 + DashWallet/it.lproj/Localizable.strings | 3 + DashWallet/ja.lproj/Localizable.strings | 3 + DashWallet/ko.lproj/Localizable.strings | 3 + DashWallet/mk.lproj/Localizable.strings | 3 + DashWallet/ms.lproj/Localizable.strings | 3 + DashWallet/nb.lproj/Localizable.strings | 3 + DashWallet/nl.lproj/Localizable.strings | 3 + DashWallet/pl.lproj/Localizable.strings | 3 + DashWallet/pt.lproj/Localizable.strings | 3 + DashWallet/ro.lproj/Localizable.strings | 3 + DashWallet/ru.lproj/Localizable.strings | 3 + DashWallet/sk.lproj/Localizable.strings | 3 + DashWallet/sl.lproj/Localizable.strings | 3 + DashWallet/sl_SI.lproj/Localizable.strings | 3 + DashWallet/sq.lproj/Localizable.strings | 3 + DashWallet/sr.lproj/Localizable.strings | 3 + DashWallet/sv.lproj/Localizable.strings | 3 + DashWallet/th.lproj/Localizable.strings | 3 + DashWallet/tr.lproj/Localizable.strings | 3 + DashWallet/uk.lproj/Localizable.strings | 3 + DashWallet/vi.lproj/Localizable.strings | 3 + DashWallet/zh-Hans.lproj/Localizable.strings | 3 + .../zh-Hant-TW.lproj/Localizable.strings | 3 + DashWallet/zh.lproj/Localizable.strings | 3 + DashWallet/zh_TW.lproj/Localizable.strings | 3 + DashWalletTests/PaymentProtocolTests.swift | 130 +++++++++++++----- DashWalletTests/PhraseRepairEngineTests.swift | 13 ++ 55 files changed, 376 insertions(+), 111 deletions(-) diff --git a/DashWallet/Sources/Infrastructure/SwiftDashSDK/BIP70PaymentService+App.swift b/DashWallet/Sources/Infrastructure/SwiftDashSDK/BIP70PaymentService+App.swift index 23d8af346b..e3de1d39df 100644 --- a/DashWallet/Sources/Infrastructure/SwiftDashSDK/BIP70PaymentService+App.swift +++ b/DashWallet/Sources/Infrastructure/SwiftDashSDK/BIP70PaymentService+App.swift @@ -11,11 +11,11 @@ import Foundation extension BIP70PaymentService { /// Builds a service backed by the funded SwiftDashSDK wallet, the app's receive-address - /// reader, and the PIN/biometric gate. `requiresHTTPSFetch` makes the transport fetch the - /// PaymentRequest over https only (see `PaymentProtocolTransport`). - static func makeForCurrentWallet(requiresHTTPSFetch: Bool = false) -> BIP70PaymentService { + /// reader, and the PIN/biometric gate. `requiresHTTPS` makes every request of the transport + /// https only (see `PaymentProtocolTransport`); it has no default, so each caller chooses. + static func makeForCurrentWallet(requiresHTTPS: Bool) -> BIP70PaymentService { BIP70PaymentService( - transport: PaymentProtocolTransport(requiresHTTPSFetch: requiresHTTPSFetch), + transport: PaymentProtocolTransport(requiresHTTPS: requiresHTTPS), wallet: SwiftDashSDKWalletSending(), receiveAddress: SwiftDashSDKReceiveAddressProvider(), auth: BIP70SendAuthorizer()) diff --git a/DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift b/DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift index 4c9eed8bed..53eb82c97b 100644 --- a/DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift +++ b/DashWallet/Sources/Models/PaymentProtocol/BIP70Error.swift @@ -13,9 +13,9 @@ import Foundation enum BIP70Error: Error, Equatable { /// The payment-request / payment URL was missing or unparseable. case badURL - /// The transport was built to fetch over https only, and the request URL, a BIP73 - /// uri-list target or an HTTP redirect was not https. - case insecureRequestURL + /// https was required and a URL on the way was not https: the request URL, a BIP73 + /// uri-list target, the `payment_url`, or an HTTP redirect from any of them. + case insecureTransport /// HTTP failure: non-2xx status, missing/non-HTTP response, or wrong content type. case unexpectedResponse(host: String?) /// Response body exceeded the 50 KB BIP70 cap. @@ -59,7 +59,7 @@ extension BIP70Error: LocalizedError { var errorDescription: String? { switch self { case .badURL: return "Invalid payment request URL." - case .insecureRequestURL: + case .insecureTransport: return NSLocalizedString("This payment request does not use a secure connection.", comment: "Payment request refused") case let .unexpectedResponse(host): return "Unexpected response from \(host ?? "the payment server")." diff --git a/DashWallet/Sources/Models/PaymentProtocol/BIP70PaymentService.swift b/DashWallet/Sources/Models/PaymentProtocol/BIP70PaymentService.swift index 715653354e..a14c68e545 100644 --- a/DashWallet/Sources/Models/PaymentProtocol/BIP70PaymentService.swift +++ b/DashWallet/Sources/Models/PaymentProtocol/BIP70PaymentService.swift @@ -167,7 +167,7 @@ final class BIP70PaymentService { /// always blocked regardless of this flag. private let allowUntrustedUnsigned: Bool - init(transport: PaymentProtocolTransporting = PaymentProtocolTransport(), + init(transport: PaymentProtocolTransporting = PaymentProtocolTransport(requiresHTTPS: false), verifier: PaymentRequestVerifier = PaymentRequestVerifier(), wallet: WalletSending, receiveAddress: ReceiveAddressProviding, diff --git a/DashWallet/Sources/Models/PaymentProtocol/PaymentProtocolTransport.swift b/DashWallet/Sources/Models/PaymentProtocol/PaymentProtocolTransport.swift index 0ca64f3154..4a78aa20ea 100644 --- a/DashWallet/Sources/Models/PaymentProtocol/PaymentProtocolTransport.swift +++ b/DashWallet/Sources/Models/PaymentProtocol/PaymentProtocolTransport.swift @@ -28,13 +28,14 @@ final class PaymentProtocolTransport: PaymentProtocolTransporting { private static let timeout: TimeInterval = 30 private let session: URLSession - /// When true, the PaymentRequest is fetched over https only: the request URL, a BIP73 - /// uri-list target and every HTTP redirect on the way must be https. - private let requiresHTTPSFetch: Bool + /// When true, every request this transport makes must be https: the request URL, a BIP73 + /// uri-list target, the Payment POST, and every HTTP redirect from any of them. + private let requiresHTTPS: Bool - init(session: URLSession = PaymentProtocolTransport.makeDefaultSession(), requiresHTTPSFetch: Bool = false) { + /// `requiresHTTPS` has no default on purpose: each caller states its choice. + init(session: URLSession = PaymentProtocolTransport.makeDefaultSession(), requiresHTTPS: Bool) { self.session = session - self.requiresHTTPSFetch = requiresHTTPSFetch + self.requiresHTTPS = requiresHTTPS } static func makeDefaultSession() -> URLSession { @@ -53,14 +54,14 @@ final class PaymentProtocolTransport: PaymentProtocolTransporting { /// `followURIList` guards BIP73 to a single hop (the uri-list may point at the real /// request; we never recurse beyond that). private func fetchRequest(from url: URL, scheme: String, followURIList: Bool) async throws -> PaymentRequest { - if requiresHTTPSFetch, !Self.isHTTPS(url) { throw BIP70Error.insecureRequestURL } + if requiresHTTPS, !Self.isHTTPS(url) { throw BIP70Error.insecureTransport } var request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: Self.timeout) request.setValue("application/\(scheme)-paymentrequest", forHTTPHeaderField: "Accept") - let redirects = HTTPSRedirectGuard(isEnforced: requiresHTTPSFetch) + let redirects = HTTPSRedirectGuard(isEnforced: requiresHTTPS) let (data, response) = try await session.data(for: request, delegate: redirects) - if redirects.refusedRedirect { throw BIP70Error.insecureRequestURL } + if redirects.refusedRedirect { throw BIP70Error.insecureTransport } let http = try validate(response, data: data, host: url.host) switch http.mimeType?.lowercased() { @@ -79,13 +80,17 @@ final class PaymentProtocolTransport: PaymentProtocolTransporting { // MARK: - Post func postPayment(_ payment: Payment, to url: URL, scheme: String) async throws -> PaymentACK { + if requiresHTTPS, !Self.isHTTPS(url) { throw BIP70Error.insecureTransport } + var request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: Self.timeout) request.httpMethod = "POST" request.setValue("application/\(scheme)-payment", forHTTPHeaderField: "Content-Type") request.setValue("application/\(scheme)-paymentack", forHTTPHeaderField: "Accept") request.httpBody = payment.encoded() - let (data, response) = try await session.data(for: request) + let redirects = HTTPSRedirectGuard(isEnforced: requiresHTTPS) + let (data, response) = try await session.data(for: request, delegate: redirects) + if redirects.refusedRedirect { throw BIP70Error.insecureTransport } let http = try validate(response, data: data, host: url.host) guard http.mimeType?.lowercased() == "application/\(scheme)-paymentack" else { throw BIP70Error.unexpectedResponse(host: url.host) @@ -117,7 +122,7 @@ final class PaymentProtocolTransport: PaymentProtocolTransporting { } } -/// Per-task delegate for the PaymentRequest fetch: when enforced, a redirect to a URL that is +/// Per-task delegate for the transport's requests: when enforced, a redirect to a URL that is /// not https is not followed, and `refusedRedirect` records that it happened. final class HTTPSRedirectGuard: NSObject, URLSessionTaskDelegate, @unchecked Sendable { private let isEnforced: Bool diff --git a/DashWallet/Sources/Models/Transactions/SendCoinsService.swift b/DashWallet/Sources/Models/Transactions/SendCoinsService.swift index 978c59a5fb..1e5dab7394 100644 --- a/DashWallet/Sources/Models/Transactions/SendCoinsService.swift +++ b/DashWallet/Sources/Models/Transactions/SendCoinsService.swift @@ -84,7 +84,7 @@ public final class SendCoinsService: NSObject { } let network = try PaymentNetworkResolver.current() - let service = BIP70PaymentService.makeForCurrentWallet() + let service = BIP70PaymentService.makeForCurrentWallet(requiresHTTPS: false) let result: SendResult do { result = try await service.confirmAndSendHeadless( diff --git a/DashWallet/Sources/Models/Transactions/WalletSendService.swift b/DashWallet/Sources/Models/Transactions/WalletSendService.swift index ad659820e7..bdd82c4c82 100644 --- a/DashWallet/Sources/Models/Transactions/WalletSendService.swift +++ b/DashWallet/Sources/Models/Transactions/WalletSendService.swift @@ -759,6 +759,19 @@ final class WalletSendService: NSObject { } } + /// `authenticateSpend(completion:)` with the amount being spent, so the biometric spending + /// limit applies: over the remaining allowance the PIN is asked for, and a biometric + /// approval counts against the allowance. + @objc(authenticateSpendOfAmount:completion:) + static func authenticateSpend(amount: UInt64, completion: @escaping (_ authenticated: Bool, _ cancelled: Bool) -> Void) { + Task { @MainActor in + let outcome = await AuthenticationGate.authenticate( + biometric: DWGlobalOptions.sharedInstance().biometricAuthEnabled, + spendAmount: amount) + completion(outcome == .ok, outcome == .cancelled) + } + } + /// Tag sweep txids (wire order) so the home screen groups them into the /// single "CoinJoin Withdrawals" cell — the unknown-outcome chunks too, /// which may still land. diff --git a/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift b/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift index c2a7709370..4046dd3d6d 100644 --- a/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift +++ b/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift @@ -24,8 +24,8 @@ final class BIP70ConfirmationBox: NSObject { @objc var estimatedFee: UInt64 { confirmation.estimatedFee } @objc var primaryAddress: String? { confirmation.primaryAddress } @objc var memo: String? { confirmation.memo } - /// How many outputs the request pays. The confirm screen shows one address. - @objc var recipientCount: Int { confirmation.recipients.count } + /// How many different addresses the request pays. The confirm screen shows one address. + @objc var recipientCount: Int { BIP70InteractivePolicy.addressCount(of: confirmation) } } /// What the interactive (scan / link / paste / NFC) flow refuses on top of the protocol rules @@ -33,16 +33,11 @@ final class BIP70ConfirmationBox: NSObject { /// purchase shares that service and shows no confirm screen, so these rules do not apply to it. enum BIP70InteractivePolicy { enum Violation: LocalizedError, Equatable { - /// The request URL is not `https`. - case insecureTransport - /// An unsigned request paying more than one output. + /// An unsigned request paying more than one address. case unsignedMultipleRecipients var errorDescription: String? { switch self { - case .insecureTransport: - return NSLocalizedString("This payment request does not use a secure connection.", - comment: "Payment request refused") case .unsignedMultipleRecipients: return NSLocalizedString("This payment request is unsigned and pays more than one address.", comment: "Payment request refused") @@ -60,27 +55,29 @@ enum BIP70InteractivePolicy { #endif } - /// Checked before the fetch. - static func check(requestURL: URL, allowsInsecureTransport: Bool) throws { - guard allowsInsecureTransport || requestURL.scheme?.lowercased() == "https" else { - throw Violation.insecureTransport - } + /// Whether sending must ask for the PIN / biometric first. A signed request follows the + /// "spending confirmation" setting; an unsigned one always asks. + static func requiresAuthentication(isSecure: Bool, spendingConfirmationDisabled: Bool) -> Bool { + !(isSecure && spendingConfirmationDisabled) } - /// Whether sending must ask for the PIN / biometric first. A signed request keeps the two - /// existing exemptions; an unsigned one has neither. - static func requiresAuthentication(isSecure: Bool, - spendingConfirmationDisabled: Bool, - alreadyAuthorized: Bool) -> Bool { - !(isSecure && (spendingConfirmationDisabled || alreadyAuthorized)) + /// Different addresses among the request's outputs. + static func addressCount(of confirmation: Confirmation) -> Int { + Set(confirmation.recipients.map(\.address)).count } - /// Checked on the fetched and verified request. The confirm screen shows one address, and - /// an unsigned request has no signer answering for the others. - static func check(_ confirmation: Confirmation) throws { - if !confirmation.isSecure, confirmation.recipients.count > 1 { + /// Checked on the fetched and verified request, before the confirm screen. The screen shows + /// one address, and an unsigned request has no signer answering for the others. The + /// `payment_url` is checked here so an http one is refused before anything is built; the + /// request URL and its hops are the transport's (`requiresHTTPS`). + static func check(_ confirmation: Confirmation, allowsInsecureTransport: Bool) throws { + if !confirmation.isSecure, addressCount(of: confirmation) > 1 { throw Violation.unsignedMultipleRecipients } + if !allowsInsecureTransport, let paymentURL = confirmation.paymentURL, + !PaymentProtocolTransport.isHTTPS(paymentURL) { + throw BIP70Error.insecureTransport + } } } @@ -101,22 +98,47 @@ final class BIP70SendResultBox: NSObject { @objc(DWBIP70InteractiveCoordinator) final class BIP70InteractiveCoordinator: NSObject { + /// NSError code of a request the app refused by rule (not https, or unsigned and paying + /// more than one address), as opposed to one that failed to load or verify. + static let refusalErrorCode = 3 + private static let errorDomain = "org.dashfoundation.dash.bip70" + private let service: BIP70PaymentService + private let allowsInsecureTransport: Bool + + @objc override convenience init() { + let allowsInsecureTransport = BIP70InteractivePolicy.allowsInsecureTransport + self.init(service: BIP70PaymentService.makeForCurrentWallet(requiresHTTPS: !allowsInsecureTransport), + allowsInsecureTransport: allowsInsecureTransport) + } - @objc override init() { - service = BIP70PaymentService.makeForCurrentWallet( - requiresHTTPSFetch: !BIP70InteractivePolicy.allowsInsecureTransport) + init(service: BIP70PaymentService, allowsInsecureTransport: Bool) { + self.service = service + self.allowsInsecureTransport = allowsInsecureTransport super.init() } - /// `BIP70InteractivePolicy.requiresAuthentication` for the ObjC payment processor. - @objc(requiresAuthenticationForSecureRequest:spendingConfirmationDisabled:alreadyAuthorized:) - static func requiresAuthentication(isSecure: Bool, - spendingConfirmationDisabled: Bool, - alreadyAuthorized: Bool) -> Bool { - BIP70InteractivePolicy.requiresAuthentication(isSecure: isSecure, - spendingConfirmationDisabled: spendingConfirmationDisabled, - alreadyAuthorized: alreadyAuthorized) + /// `BIP70InteractivePolicy.requiresAuthentication` for the ObjC payment processor, read + /// off the output it is about to send. + @objc(requiresAuthenticationForPaymentOutput:spendingConfirmationDisabled:) + static func requiresAuthentication(for output: DWPaymentOutput, spendingConfirmationDisabled: Bool) -> Bool { + BIP70InteractivePolicy.requiresAuthentication(isSecure: output.isSecure, + spendingConfirmationDisabled: spendingConfirmationDisabled) + } + + /// Whether `error` (as delivered by `fetchAndVerify`) is a refusal by rule. + @objc(isRefusalError:) + static func isRefusal(_ error: NSError) -> Bool { + error.domain == errorDomain && error.code == refusalErrorCode + } + + /// Fetch + verify, then apply the interactive rules. No build, no spend. + func prepare(requestURL: URL, scheme: String, callbackScheme: String?, + network: PaymentNetwork) async throws -> Confirmation { + let confirmation = try await service.prepareForConfirmation( + from: requestURL, scheme: Self.normalize(scheme), network: network, callbackScheme: callbackScheme) + try BIP70InteractivePolicy.check(confirmation, allowsInsecureTransport: allowsInsecureTransport) + return confirmation } /// Fetch + verify a BIP70 request (no build, no spend). Completion fires on the main thread. @@ -125,16 +147,11 @@ final class BIP70InteractiveCoordinator: NSObject { scheme: String, callbackScheme: String?, completion: @escaping (BIP70ConfirmationBox?, NSError?) -> Void) { - let normalizedScheme = Self.normalize(scheme) Task { do { - try BIP70InteractivePolicy.check( - requestURL: requestURL, - allowsInsecureTransport: BIP70InteractivePolicy.allowsInsecureTransport) let network = try PaymentNetworkResolver.current() - let confirmation = try await service.prepareForConfirmation( - from: requestURL, scheme: normalizedScheme, network: network, callbackScheme: callbackScheme) - try BIP70InteractivePolicy.check(confirmation) + let confirmation = try await prepare(requestURL: requestURL, scheme: scheme, + callbackScheme: callbackScheme, network: network) await MainActor.run { completion(BIP70ConfirmationBox(confirmation), nil) } } catch { await MainActor.run { completion(nil, Self.nsError(error)) } @@ -175,15 +192,15 @@ final class BIP70InteractiveCoordinator: NSObject { } } - private static func nsError(_ error: Error) -> NSError { + static func nsError(_ error: Error) -> NSError { if let bip = error as? BIP70Error { - return NSError(domain: "org.dashfoundation.dash.bip70", - code: 1, + return NSError(domain: errorDomain, + code: bip == .insecureTransport ? refusalErrorCode : 1, userInfo: [NSLocalizedDescriptionKey: bip.errorDescription ?? "Payment failed"]) } if let violation = error as? BIP70InteractivePolicy.Violation { - return NSError(domain: "org.dashfoundation.dash.bip70", - code: 3, + return NSError(domain: errorDomain, + code: refusalErrorCode, userInfo: [NSLocalizedDescriptionKey: violation.errorDescription ?? "Payment failed"]) } return error as NSError diff --git a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput+DWView.m b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput+DWView.m index c885725ffc..720f8eae79 100644 --- a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput+DWView.m +++ b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput+DWView.m @@ -32,6 +32,23 @@ } +/// Longest note shown from an unsigned payment request. +static const NSUInteger kUnverifiedNoteMaxLength = 140; + +/// One line, capped: line breaks and runs of whitespace become a single space before the +/// text is sanitized, then the result is cut to `maxLength`. +static NSString *singleLineString(NSString *s, NSUInteger maxLength) { + NSArray *parts = [s componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + NSArray *words = [parts filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"length > 0"]]; + NSString *line = sanitizeString([words componentsJoinedByString:@" "]); + if (line.length > maxLength) { + NSRange range = [line rangeOfComposedCharacterSequencesForRange:NSMakeRange(0, maxLength)]; + line = [[line substringWithRange:range] stringByAppendingString:@"…"]; + } + return line; +} + + @implementation DWPaymentOutput (DWView) //- (id _Nullable)addressWith:(UIFont * _Nonnull)font tintColor:(UIColor * _Nonnull)tintColor { @@ -186,7 +203,7 @@ - (nullable NSString *)nameString { return nil; } -/// Number of outputs a BIP70 request pays; 0 for a non-BIP70 output. +/// Number of different addresses a BIP70 request pays; 0 for a non-BIP70 output. - (NSInteger)merchantRecipientCount { if (![self.bip70Confirmation isKindOfClass:[DWBIP70ConfirmationBox class]]) { return 0; @@ -198,13 +215,21 @@ - (nullable NSString *)generalInfoString { BOOL hasInfo = NO; NSString *info = @""; if (self.memo.length > 0) { - info = sanitizeString(self.memo); + if (self.isMerchantRequest && !self.isSecure) { + // The note of an unsigned request is the issuer's own text: shown on one line, + // capped, and labelled, so it cannot pass for the app's wording. + NSString *note = singleLineString(self.memo, kUnverifiedNoteMaxLength); + info = [NSString stringWithFormat:NSLocalizedString(@"Unverified note: %@", @"Payment confirmation: note supplied by an unsigned payment request"), note]; + } + else { + info = sanitizeString(self.memo); + } hasInfo = YES; } const NSInteger recipientCount = [self merchantRecipientCount]; if (recipientCount > 1) { - // The confirm screen names one recipient, but the request pays every output it lists. + // The confirm screen names one recipient, but the request pays every address it lists. if (info.length > 0) { info = [info stringByAppendingString:@"\n"]; } diff --git a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m index 00234e30e4..572bee2105 100644 --- a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m +++ b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m @@ -234,18 +234,19 @@ - (void)confirmBIP70Output:(id)bip70Confirmation { /// Authenticate (PIN / biometric), then build + broadcast + POST via the Swift orchestrator. - (void)broadcastBIP70PaymentOutput:(DWPaymentOutput *)paymentOutput { // An unsigned request always asks for the PIN / biometric, even with spending confirmation - // turned off: nothing vouches for its recipient, so the prompt is the last deliberate step. + // turned off: nothing vouches for its recipient. The prompt is given the amount, so the + // biometric spending limit applies to it. BOOL skipAuth = ![DWBIP70InteractiveCoordinator - requiresAuthenticationForSecureRequest:paymentOutput.isSecure - spendingConfirmationDisabled:[[DWGlobalOptions sharedInstance] spendingConfirmationDisabled] - alreadyAuthorized:paymentOutput.broadcastAuthorizationState == DWPaymentOutputBroadcastAuthorizationStateAlreadyAuthorized]; + requiresAuthenticationForPaymentOutput:paymentOutput + spendingConfirmationDisabled:[[DWGlobalOptions sharedInstance] spendingConfirmationDisabled]]; if (skipAuth) { [self performBIP70Send:paymentOutput]; return; } - [DWWalletSendService authenticateSpendWithCompletion:^(BOOL authenticated, BOOL cancelled) { + [DWWalletSendService authenticateSpendOfAmount:paymentOutput.amount + paymentOutput.fee + completion:^(BOOL authenticated, BOOL cancelled) { if (cancelled) { [self.delegate paymentProcessorDidCancelTransactionSigning:self]; return; diff --git a/DashWallet/Sources/UI/Payments/ScanQR/DWQRScanModel.m b/DashWallet/Sources/UI/Payments/ScanQR/DWQRScanModel.m index 8f47b3b4d4..c2861df85d 100644 --- a/DashWallet/Sources/UI/Payments/ScanQR/DWQRScanModel.m +++ b/DashWallet/Sources/UI/Payments/ScanQR/DWQRScanModel.m @@ -281,7 +281,11 @@ - (void)didOutputMetadataObjects:(NSArray<__kindof AVMetadataObject *> *)metadat [strongSelf.delegate qrScanModel:strongSelf didScanPaymentInput:paymentInput]; } else { - [strongSelf.qrCodeObject setInvalidWithErrorMessage:[strongSelf invalidQRErrorMessageForURI:parsed]]; + // A request the app refused by rule says why; any other failure keeps the generic text. + NSString *message = (error && [DWBIP70InteractiveCoordinator isRefusalError:error]) + ? error.localizedDescription + : [strongSelf invalidQRErrorMessageForURI:parsed]; + [strongSelf.qrCodeObject setInvalidWithErrorMessage:message]; [strongSelf performSelector:@selector(resumeQRCodeSearch) withObject:nil afterDelay:kResumeSearchTimeInterval]; diff --git a/DashWallet/ar.lproj/Localizable.strings b/DashWallet/ar.lproj/Localizable.strings index 8321f4d746..de876e48c3 100644 --- a/DashWallet/ar.lproj/Localizable.strings +++ b/DashWallet/ar.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/bg.lproj/Localizable.strings b/DashWallet/bg.lproj/Localizable.strings index 470e6e3ac7..15d0767fc4 100644 --- a/DashWallet/bg.lproj/Localizable.strings +++ b/DashWallet/bg.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/ca.lproj/Localizable.strings b/DashWallet/ca.lproj/Localizable.strings index 35873d97eb..08eada9e96 100644 --- a/DashWallet/ca.lproj/Localizable.strings +++ b/DashWallet/ca.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/cs.lproj/Localizable.strings b/DashWallet/cs.lproj/Localizable.strings index e7072bde8f..5d9eb48ce8 100644 --- a/DashWallet/cs.lproj/Localizable.strings +++ b/DashWallet/cs.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/da.lproj/Localizable.strings b/DashWallet/da.lproj/Localizable.strings index eec2f419f9..53f5ee892d 100644 --- a/DashWallet/da.lproj/Localizable.strings +++ b/DashWallet/da.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/de.lproj/Localizable.strings b/DashWallet/de.lproj/Localizable.strings index a2e2eddda7..3f7aa62155 100644 --- a/DashWallet/de.lproj/Localizable.strings +++ b/DashWallet/de.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/el.lproj/Localizable.strings b/DashWallet/el.lproj/Localizable.strings index 2c72a9d3c0..5bdda3a323 100644 --- a/DashWallet/el.lproj/Localizable.strings +++ b/DashWallet/el.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/en.lproj/Localizable.strings b/DashWallet/en.lproj/Localizable.strings index 1b7fb53ff1..e691e79f38 100644 --- a/DashWallet/en.lproj/Localizable.strings +++ b/DashWallet/en.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/eo.lproj/Localizable.strings b/DashWallet/eo.lproj/Localizable.strings index 248aa6e1c8..84c0b5d4b1 100644 --- a/DashWallet/eo.lproj/Localizable.strings +++ b/DashWallet/eo.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/es.lproj/Localizable.strings b/DashWallet/es.lproj/Localizable.strings index 19e399f9e4..320935c4c7 100644 --- a/DashWallet/es.lproj/Localizable.strings +++ b/DashWallet/es.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/et.lproj/Localizable.strings b/DashWallet/et.lproj/Localizable.strings index 781dc99ffa..91026af257 100644 --- a/DashWallet/et.lproj/Localizable.strings +++ b/DashWallet/et.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/fa.lproj/Localizable.strings b/DashWallet/fa.lproj/Localizable.strings index 060a31c340..3fe9bcf68c 100644 --- a/DashWallet/fa.lproj/Localizable.strings +++ b/DashWallet/fa.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/fi.lproj/Localizable.strings b/DashWallet/fi.lproj/Localizable.strings index fb89f9f4e8..b1fcf817b3 100644 --- a/DashWallet/fi.lproj/Localizable.strings +++ b/DashWallet/fi.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/fil.lproj/Localizable.strings b/DashWallet/fil.lproj/Localizable.strings index 47589b9299..bc1d622496 100644 --- a/DashWallet/fil.lproj/Localizable.strings +++ b/DashWallet/fil.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/fr.lproj/Localizable.strings b/DashWallet/fr.lproj/Localizable.strings index 22b59cec79..4aa52e3ff1 100644 --- a/DashWallet/fr.lproj/Localizable.strings +++ b/DashWallet/fr.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/hr.lproj/Localizable.strings b/DashWallet/hr.lproj/Localizable.strings index fdf5f3808a..e2c0e305ce 100644 --- a/DashWallet/hr.lproj/Localizable.strings +++ b/DashWallet/hr.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/hu.lproj/Localizable.strings b/DashWallet/hu.lproj/Localizable.strings index a5bd5e53ea..2b83dac5b6 100644 --- a/DashWallet/hu.lproj/Localizable.strings +++ b/DashWallet/hu.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/id.lproj/Localizable.strings b/DashWallet/id.lproj/Localizable.strings index c596893e3c..f25332e477 100644 --- a/DashWallet/id.lproj/Localizable.strings +++ b/DashWallet/id.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/it.lproj/Localizable.strings b/DashWallet/it.lproj/Localizable.strings index db318f81bc..cfb66a8d06 100644 --- a/DashWallet/it.lproj/Localizable.strings +++ b/DashWallet/it.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/ja.lproj/Localizable.strings b/DashWallet/ja.lproj/Localizable.strings index a49ef3baf6..3442f31888 100644 --- a/DashWallet/ja.lproj/Localizable.strings +++ b/DashWallet/ja.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/ko.lproj/Localizable.strings b/DashWallet/ko.lproj/Localizable.strings index 448c2bc237..e28f44d106 100644 --- a/DashWallet/ko.lproj/Localizable.strings +++ b/DashWallet/ko.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/mk.lproj/Localizable.strings b/DashWallet/mk.lproj/Localizable.strings index 0894a1790a..c9244c808f 100644 --- a/DashWallet/mk.lproj/Localizable.strings +++ b/DashWallet/mk.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/ms.lproj/Localizable.strings b/DashWallet/ms.lproj/Localizable.strings index 7a61f52a49..a2726663ac 100644 --- a/DashWallet/ms.lproj/Localizable.strings +++ b/DashWallet/ms.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/nb.lproj/Localizable.strings b/DashWallet/nb.lproj/Localizable.strings index 7a74ca9634..0e18b785af 100644 --- a/DashWallet/nb.lproj/Localizable.strings +++ b/DashWallet/nb.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/nl.lproj/Localizable.strings b/DashWallet/nl.lproj/Localizable.strings index edda222543..1f412019a6 100644 --- a/DashWallet/nl.lproj/Localizable.strings +++ b/DashWallet/nl.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/pl.lproj/Localizable.strings b/DashWallet/pl.lproj/Localizable.strings index 8ef5bfe87f..45ca924c6e 100644 --- a/DashWallet/pl.lproj/Localizable.strings +++ b/DashWallet/pl.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/pt.lproj/Localizable.strings b/DashWallet/pt.lproj/Localizable.strings index 7f9bd869c8..1253d6716a 100644 --- a/DashWallet/pt.lproj/Localizable.strings +++ b/DashWallet/pt.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/ro.lproj/Localizable.strings b/DashWallet/ro.lproj/Localizable.strings index cd76994902..b89c91deba 100644 --- a/DashWallet/ro.lproj/Localizable.strings +++ b/DashWallet/ro.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/ru.lproj/Localizable.strings b/DashWallet/ru.lproj/Localizable.strings index 703f7c681e..939d88ee4e 100644 --- a/DashWallet/ru.lproj/Localizable.strings +++ b/DashWallet/ru.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/sk.lproj/Localizable.strings b/DashWallet/sk.lproj/Localizable.strings index bee9e2774e..8f9ce7e774 100644 --- a/DashWallet/sk.lproj/Localizable.strings +++ b/DashWallet/sk.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/sl.lproj/Localizable.strings b/DashWallet/sl.lproj/Localizable.strings index 1a3c6e78a4..3856f91ef4 100644 --- a/DashWallet/sl.lproj/Localizable.strings +++ b/DashWallet/sl.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/sl_SI.lproj/Localizable.strings b/DashWallet/sl_SI.lproj/Localizable.strings index 4ec355129d..fa84ba85f6 100644 --- a/DashWallet/sl_SI.lproj/Localizable.strings +++ b/DashWallet/sl_SI.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/sq.lproj/Localizable.strings b/DashWallet/sq.lproj/Localizable.strings index 8ad5776502..2ef97adc69 100644 --- a/DashWallet/sq.lproj/Localizable.strings +++ b/DashWallet/sq.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/sr.lproj/Localizable.strings b/DashWallet/sr.lproj/Localizable.strings index 5b1ac44352..8d21561666 100644 --- a/DashWallet/sr.lproj/Localizable.strings +++ b/DashWallet/sr.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/sv.lproj/Localizable.strings b/DashWallet/sv.lproj/Localizable.strings index 9ec925bcf4..8ce526b76b 100644 --- a/DashWallet/sv.lproj/Localizable.strings +++ b/DashWallet/sv.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/th.lproj/Localizable.strings b/DashWallet/th.lproj/Localizable.strings index 90bd96ab00..1c9a47975f 100644 --- a/DashWallet/th.lproj/Localizable.strings +++ b/DashWallet/th.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/tr.lproj/Localizable.strings b/DashWallet/tr.lproj/Localizable.strings index a49f1b9dc5..d5e390b21c 100644 --- a/DashWallet/tr.lproj/Localizable.strings +++ b/DashWallet/tr.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/uk.lproj/Localizable.strings b/DashWallet/uk.lproj/Localizable.strings index ebdda4101d..4ab6fa1224 100644 --- a/DashWallet/uk.lproj/Localizable.strings +++ b/DashWallet/uk.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/vi.lproj/Localizable.strings b/DashWallet/vi.lproj/Localizable.strings index 3e515b1378..75edb8924e 100644 --- a/DashWallet/vi.lproj/Localizable.strings +++ b/DashWallet/vi.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/zh-Hans.lproj/Localizable.strings b/DashWallet/zh-Hans.lproj/Localizable.strings index 925ae07ceb..b8f7eaad50 100644 --- a/DashWallet/zh-Hans.lproj/Localizable.strings +++ b/DashWallet/zh-Hans.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/zh-Hant-TW.lproj/Localizable.strings b/DashWallet/zh-Hant-TW.lproj/Localizable.strings index 828d47c81f..73d9a8005e 100644 --- a/DashWallet/zh-Hant-TW.lproj/Localizable.strings +++ b/DashWallet/zh-Hant-TW.lproj/Localizable.strings @@ -6313,6 +6313,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/zh.lproj/Localizable.strings b/DashWallet/zh.lproj/Localizable.strings index 17e68e2137..e0ed35128d 100644 --- a/DashWallet/zh.lproj/Localizable.strings +++ b/DashWallet/zh.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWallet/zh_TW.lproj/Localizable.strings b/DashWallet/zh_TW.lproj/Localizable.strings index add6a40a91..e50828eed1 100644 --- a/DashWallet/zh_TW.lproj/Localizable.strings +++ b/DashWallet/zh_TW.lproj/Localizable.strings @@ -6311,6 +6311,9 @@ /* Log export */ "Unlock with your wallet PIN to export logs." = "Unlock with your wallet PIN to export logs."; +/* Payment confirmation: note supplied by an unsigned payment request */ +"Unverified note: %@" = "Unverified note: %@"; + /* Payment confirmation: unsigned payment request without a name */ "Unverified recipient" = "Unverified recipient"; diff --git a/DashWalletTests/PaymentProtocolTests.swift b/DashWalletTests/PaymentProtocolTests.swift index 0057974d90..c51515e0c9 100644 --- a/DashWalletTests/PaymentProtocolTests.swift +++ b/DashWalletTests/PaymentProtocolTests.swift @@ -162,6 +162,7 @@ final class PaymentProtocolTests: XCTestCase { override func tearDown() { MockURLProtocol.responseHandler = nil + MockURLProtocol.redirectHandler = nil MockURLProtocol.handler = nil super.tearDown() } @@ -169,7 +170,7 @@ final class PaymentProtocolTests: XCTestCase { private func makeTransport() -> PaymentProtocolTransport { let config = URLSessionConfiguration.ephemeral config.protocolClasses = [MockURLProtocol.self] - return PaymentProtocolTransport(session: URLSession(configuration: config)) + return PaymentProtocolTransport(session: URLSession(configuration: config), requiresHTTPS: false) } private var requestURL: URL { URL(string: "https://merchant.example/i/abc")! } @@ -208,7 +209,7 @@ final class PaymentProtocolTests: XCTestCase { private func makeHTTPSOnlyTransport() -> PaymentProtocolTransport { let config = URLSessionConfiguration.ephemeral config.protocolClasses = [MockURLProtocol.self] - return PaymentProtocolTransport(session: URLSession(configuration: config), requiresHTTPSFetch: true) + return PaymentProtocolTransport(session: URLSession(configuration: config), requiresHTTPS: true) } func testHTTPSOnlyTransportRefusesAnHTTPRequestURLWithoutFetching() async { @@ -216,7 +217,7 @@ final class PaymentProtocolTests: XCTestCase { let body = fixture MockURLProtocol.responseHandler = { _ in fetched = true; return (200, ["Content-Type": "application/dash-paymentrequest"], body) } await assertThrowsBIP70(try await makeHTTPSOnlyTransport() - .fetchRequest(from: URL(string: "http://merchant.example/i/abc")!, scheme: "dash")) { $0 == .insecureRequestURL } + .fetchRequest(from: URL(string: "http://merchant.example/i/abc")!, scheme: "dash")) { $0 == .insecureTransport } XCTAssertFalse(fetched) } @@ -227,7 +228,7 @@ final class PaymentProtocolTests: XCTestCase { return (200, ["Content-Type": "text/uri-list"], Data("http://merchant.example/real\n".utf8)) } await assertThrowsBIP70(try await makeHTTPSOnlyTransport().fetchRequest(from: requestURL, scheme: "dash")) { - $0 == .insecureRequestURL + $0 == .insecureTransport } XCTAssertEqual(fetchedHosts, [requestURL.absoluteString]) } @@ -243,6 +244,29 @@ final class PaymentProtocolTests: XCTestCase { XCTAssertEqual(req.pkiType, "x509+sha256") } + func testHTTPSOnlyTransportRefusesAnHTTPRedirectOfTheFetch() async { + MockURLProtocol.redirectHandler = { $0.url?.scheme == "https" ? URL(string: "http://merchant.example/real") : nil } + let body = fixture + MockURLProtocol.responseHandler = { _ in (200, ["Content-Type": "application/dash-paymentrequest"], body) } + await assertThrowsBIP70(try await makeHTTPSOnlyTransport().fetchRequest(from: requestURL, scheme: "dash")) { + $0 == .insecureTransport + } + } + + func testHTTPSOnlyTransportRefusesAnHTTPPaymentURLAndRedirect() async { + var posted = false + MockURLProtocol.responseHandler = { _ in posted = true; return (200, ["Content-Type": "application/dash-paymentack"], Data()) } + let payment = Payment(merchantData: nil, transactions: [Data([1])], refundTo: [], memo: nil) + await assertThrowsBIP70(try await makeHTTPSOnlyTransport() + .postPayment(payment, to: URL(string: "http://merchant.example/pay")!, scheme: "dash")) { $0 == .insecureTransport } + XCTAssertFalse(posted) + + MockURLProtocol.redirectHandler = { $0.url?.scheme == "https" ? URL(string: "http://merchant.example/pay") : nil } + await assertThrowsBIP70(try await makeHTTPSOnlyTransport() + .postPayment(payment, to: URL(string: "https://merchant.example/pay")!, scheme: "dash")) { $0 == .insecureTransport } + XCTAssertFalse(posted) + } + private func redirectDecision(enforced: Bool, to target: String) -> (followed: Bool, refused: Bool) { let redirects = HTTPSRedirectGuard(isEnforced: enforced) let session = URLSession(configuration: .ephemeral) @@ -900,46 +924,80 @@ final class BIP70PaymentServiceTests: XCTestCase { XCTAssertEqual(try rows(of: output).generalInfo?.plainDetail, "This payment goes to 2 addresses.") } - func testUnsignedRequestAlwaysRequiresAuthentication() { - for disabled in [false, true] { - for authorized in [false, true] { - XCTAssertTrue(BIP70InteractivePolicy.requiresAuthentication( - isSecure: false, spendingConfirmationDisabled: disabled, alreadyAuthorized: authorized)) - } - } + func testUnsignedOutputAlwaysRequiresAuthentication() async throws { + let output = try await paymentOutput(for: unsignedNamed("Coffee Shop")) + XCTAssertFalse(output.isSecure) + XCTAssertTrue(BIP70InteractiveCoordinator.requiresAuthentication(for: output, spendingConfirmationDisabled: false)) + XCTAssertTrue(BIP70InteractiveCoordinator.requiresAuthentication(for: output, spendingConfirmationDisabled: true)) } - func testSignedRequestKeepsItsAuthenticationExemptions() { - func required(_ disabled: Bool, _ authorized: Bool) -> Bool { - BIP70InteractiveCoordinator.requiresAuthentication( - isSecure: true, spendingConfirmationDisabled: disabled, alreadyAuthorized: authorized) - } - XCTAssertTrue(required(false, false)) - XCTAssertFalse(required(true, false)) - XCTAssertFalse(required(false, true)) - XCTAssertFalse(required(true, true)) + func testSignedOutputFollowsTheSpendingConfirmationSetting() async throws { + let output = try await paymentOutput(for: unsignedNamed("Coffee Shop"), isSecure: true) + XCTAssertTrue(BIP70InteractiveCoordinator.requiresAuthentication(for: output, spendingConfirmationDisabled: false)) + XCTAssertFalse(BIP70InteractiveCoordinator.requiresAuthentication(for: output, spendingConfirmationDisabled: true)) } - func testInteractivePolicyRefusesUnsignedMultiOutput() async throws { - let outs = [PaymentOutput(amount: 100_000, script: p2pkh), PaymentOutput(amount: 200_000, script: p2sh)] - let svc = service(FakeTransport(unsignedNamed(nil, outputs: outs)), FakeWallet()) - let multi = try await svc.prepareForConfirmation(from: url, scheme: "dash", network: .testnet) - XCTAssertThrowsError(try BIP70InteractivePolicy.check(multi)) { - XCTAssertEqual($0 as? BIP70InteractivePolicy.Violation, .unsignedMultipleRecipients) + private var twoAddresses: [PaymentOutput] { + [PaymentOutput(amount: 100_000, script: p2pkh), PaymentOutput(amount: 200_000, script: p2sh)] + } + + private func coordinator(_ request: PaymentRequest, allowsInsecureTransport: Bool) -> BIP70InteractiveCoordinator { + BIP70InteractiveCoordinator(service: service(FakeTransport(request), FakeWallet()), + allowsInsecureTransport: allowsInsecureTransport) + } + + private func prepare(_ request: PaymentRequest, allowsInsecureTransport: Bool = true) async throws -> Confirmation { + try await coordinator(request, allowsInsecureTransport: allowsInsecureTransport) + .prepare(requestURL: url, scheme: "pay", callbackScheme: nil, network: .testnet) + } + + func testCoordinatorRefusesUnsignedRequestPayingTwoAddresses() async throws { + do { + _ = try await prepare(unsignedNamed(nil, outputs: twoAddresses)) + XCTFail("expected a refusal") + } catch { + XCTAssertEqual(error as? BIP70InteractivePolicy.Violation, .unsignedMultipleRecipients) + XCTAssertTrue(BIP70InteractiveCoordinator.isRefusal(BIP70InteractiveCoordinator.nsError(error))) } - let single = try await service(FakeTransport(unsignedNamed(nil)), FakeWallet()) - .prepareForConfirmation(from: url, scheme: "dash", network: .testnet) - XCTAssertNoThrow(try BIP70InteractivePolicy.check(single)) + let single = try await prepare(unsignedNamed(nil)) + XCTAssertEqual(single.recipients.count, 1) + } + + func testTwoOutputsToOneAddressCountAsOneAddress() async throws { + let sameAddress = [PaymentOutput(amount: 100_000, script: p2pkh), PaymentOutput(amount: 200_000, script: p2pkh)] + let confirmation = try await prepare(unsignedNamed(nil, outputs: sameAddress)) + XCTAssertEqual(confirmation.amount, 300_000) + XCTAssertEqual(BIP70ConfirmationBox(confirmation).recipientCount, 1) } - func testInteractivePolicyRequiresHTTPSOutsideDebug() throws { - let http = URL(string: "http://h/pr")! - let https = URL(string: "HTTPS://h/pr")! - XCTAssertThrowsError(try BIP70InteractivePolicy.check(requestURL: http, allowsInsecureTransport: false)) { - XCTAssertEqual($0 as? BIP70InteractivePolicy.Violation, .insecureTransport) + func testCoordinatorRefusesAnHTTPPaymentURLWhenHTTPSIsRequired() async throws { + // `unsignedNamed` carries payment_url "http://h/pay". + do { + _ = try await prepare(unsignedNamed("Coffee Shop"), allowsInsecureTransport: false) + XCTFail("expected a refusal") + } catch { + XCTAssertEqual(error as? BIP70Error, .insecureTransport) + XCTAssertTrue(BIP70InteractiveCoordinator.isRefusal(BIP70InteractiveCoordinator.nsError(error))) } - XCTAssertNoThrow(try BIP70InteractivePolicy.check(requestURL: https, allowsInsecureTransport: false)) - XCTAssertNoThrow(try BIP70InteractivePolicy.check(requestURL: http, allowsInsecureTransport: true)) + _ = try await prepare(unsignedNamed("Coffee Shop"), allowsInsecureTransport: true) + XCTAssertFalse(BIP70InteractiveCoordinator.isRefusal(BIP70InteractiveCoordinator.nsError(BIP70Error.expired))) + } + + func testUnsignedNoteIsLabelledFlattenedAndCapped() async throws { + let details = PaymentDetails(network: "test", outputs: [PaymentOutput(amount: 100_000, script: p2pkh)], + expires: futureExpiry, memo: "Verified merchant:\n Coffee Shop\n" + String(repeating: "x", count: 300), + paymentURL: "http://h/pay", merchantData: nil) + let request = PaymentRequest(pkiType: "none", pkiData: nil, serializedDetails: details.encoded()) + let unsignedOutput = try await paymentOutput(for: request) + let unsignedNote = try XCTUnwrap(try rows(of: unsignedOutput).generalInfo?.plainDetail) + XCTAssertEqual(String(unsignedNote.prefix(49)), "Unverified note: Verified merchant: Coffee Shop x") + XCTAssertFalse(unsignedNote.contains("\n")) + XCTAssertEqual(unsignedNote.count, "Unverified note: ".count + 140 + 1) + + let signedOutput = try await paymentOutput(for: request, isSecure: true) + let signedNote = try XCTUnwrap(try rows(of: signedOutput).generalInfo?.plainDetail) + XCTAssertTrue(signedNote.hasPrefix("Verified merchant:")) + XCTAssertGreaterThan(signedNote.count, 300) } func testCallbackURLFormat() async throws { diff --git a/DashWalletTests/PhraseRepairEngineTests.swift b/DashWalletTests/PhraseRepairEngineTests.swift index 8a0e243366..8fff026fac 100644 --- a/DashWalletTests/PhraseRepairEngineTests.swift +++ b/DashWalletTests/PhraseRepairEngineTests.swift @@ -351,6 +351,10 @@ final class MockURLProtocol: URLProtocol { /// validation can be exercised. Consulted before `handler` when set. static var responseHandler: ((URLRequest) -> (Int, [String: String], Data))? + /// When set and it returns a URL for a request, that request answers with a 302 to the URL. + /// Consulted first. + static var redirectHandler: ((URLRequest) -> URL?)? + static func bodyString(of request: URLRequest) -> String? { if let body = request.httpBody { return String(data: body, encoding: .utf8) @@ -396,6 +400,15 @@ final class MockURLProtocol: URLProtocol { let statusCode: Int let headerFields: [String: String]? let data: Data + if let target = MockURLProtocol.redirectHandler?(request), let from = request.url { + let redirect = HTTPURLResponse(url: from, statusCode: 302, httpVersion: "HTTP/1.1", + headerFields: ["Location": target.absoluteString])! + client?.urlProtocol(self, wasRedirectedTo: URLRequest(url: target), redirectResponse: redirect) + // A redirect the session's delegate refuses ends the task with the 302 itself. + client?.urlProtocol(self, didReceive: redirect, cacheStoragePolicy: .notAllowed) + client?.urlProtocolDidFinishLoading(self) + return + } if let responseHandler = MockURLProtocol.responseHandler { (statusCode, headerFields, data) = responseHandler(request) } else if let handler = MockURLProtocol.handler { From c9e1e132a46d01c922e431679e2ada18db59657c Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Wed, 11 Nov 2026 19:32:38 +0100 Subject: [PATCH 4/5] style(payments): apply clang-format to the BIP70 spend authentication block The build's clang-format phase re-indented this block, so the CI check that the build leaves the checkout unmodified failed. Whitespace only. Co-Authored-By: Claude Fable 5.2 --- .../PaymentModels/DWPaymentProcessor.m | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m index 572bee2105..f86c14200b 100644 --- a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m +++ b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentProcessor.m @@ -247,18 +247,18 @@ - (void)broadcastBIP70PaymentOutput:(DWPaymentOutput *)paymentOutput { [DWWalletSendService authenticateSpendOfAmount:paymentOutput.amount + paymentOutput.fee completion:^(BOOL authenticated, BOOL cancelled) { - if (cancelled) { - [self.delegate paymentProcessorDidCancelTransactionSigning:self]; - return; - } - if (!authenticated) { - [self failedWithError:nil - title:NSLocalizedString(@"Couldn't make payment", nil) - message:NSLocalizedString(@"Authentication failed", nil)]; - return; - } - [self performBIP70Send:paymentOutput]; - }]; + if (cancelled) { + [self.delegate paymentProcessorDidCancelTransactionSigning:self]; + return; + } + if (!authenticated) { + [self failedWithError:nil + title:NSLocalizedString(@"Couldn't make payment", nil) + message:NSLocalizedString(@"Authentication failed", nil)]; + return; + } + [self performBIP70Send:paymentOutput]; + }]; } - (void)performBIP70Send:(DWPaymentOutput *)paymentOutput { From 1baf1745c0c553228cf83f9c57ce801e2aaeee38 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Wed, 11 Nov 2026 19:49:04 +0100 Subject: [PATCH 5/5] fix(payments): refuse an unparseable payment_url, keep the unverified note within its cap - An interactive payment request whose payment_url is present but does not parse is refused before the confirm screen. - The 140-character cap on an unsigned request's note now includes the ellipsis and never splits a composed character. - Both spend-authentication selectors share one gate call. Co-Authored-By: Claude Fable 5.2 --- .../Models/Transactions/WalletSendService.swift | 14 ++++++++------ .../BIP70InteractiveCoordinator.swift | 7 ++++++- .../PaymentModels/DWPaymentOutput+DWView.m | 7 ++++--- DashWalletTests/PaymentProtocolTests.swift | 16 +++++++++++++++- 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/DashWallet/Sources/Models/Transactions/WalletSendService.swift b/DashWallet/Sources/Models/Transactions/WalletSendService.swift index bdd82c4c82..7987782584 100644 --- a/DashWallet/Sources/Models/Transactions/WalletSendService.swift +++ b/DashWallet/Sources/Models/Transactions/WalletSendService.swift @@ -752,11 +752,7 @@ final class WalletSendService: NSObject { /// never calling back. @objc(authenticateSpendWithCompletion:) static func authenticateSpend(completion: @escaping (_ authenticated: Bool, _ cancelled: Bool) -> Void) { - Task { @MainActor in - let outcome = await AuthenticationGate.authenticate( - biometric: DWGlobalOptions.sharedInstance().biometricAuthEnabled) - completion(outcome == .ok, outcome == .cancelled) - } + authenticateSpend(spendAmount: nil, completion: completion) } /// `authenticateSpend(completion:)` with the amount being spent, so the biometric spending @@ -764,10 +760,16 @@ final class WalletSendService: NSObject { /// approval counts against the allowance. @objc(authenticateSpendOfAmount:completion:) static func authenticateSpend(amount: UInt64, completion: @escaping (_ authenticated: Bool, _ cancelled: Bool) -> Void) { + authenticateSpend(spendAmount: amount, completion: completion) + } + + /// The one gate call behind both Objective-C selectors. + private static func authenticateSpend(spendAmount: UInt64?, + completion: @escaping (_ authenticated: Bool, _ cancelled: Bool) -> Void) { Task { @MainActor in let outcome = await AuthenticationGate.authenticate( biometric: DWGlobalOptions.sharedInstance().biometricAuthEnabled, - spendAmount: amount) + spendAmount: spendAmount) completion(outcome == .ok, outcome == .cancelled) } } diff --git a/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift b/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift index 4046dd3d6d..98c7d5afe1 100644 --- a/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift +++ b/DashWallet/Sources/UI/Payments/PaymentModels/BIP70InteractiveCoordinator.swift @@ -69,11 +69,16 @@ enum BIP70InteractivePolicy { /// Checked on the fetched and verified request, before the confirm screen. The screen shows /// one address, and an unsigned request has no signer answering for the others. The /// `payment_url` is checked here so an http one is refused before anything is built; the - /// request URL and its hops are the transport's (`requiresHTTPS`). + /// request URL and its hops are the transport's (`requiresHTTPS`). A `payment_url` that is + /// present but does not parse is refused, so the request is never paid without the Payment + /// message it asks for. static func check(_ confirmation: Confirmation, allowsInsecureTransport: Bool) throws { if !confirmation.isSecure, addressCount(of: confirmation) > 1 { throw Violation.unsignedMultipleRecipients } + if confirmation.paymentURL == nil, let raw = confirmation.request.details.paymentURL, !raw.isEmpty { + throw BIP70Error.malformedRequest + } if !allowsInsecureTransport, let paymentURL = confirmation.paymentURL, !PaymentProtocolTransport.isHTTPS(paymentURL) { throw BIP70Error.insecureTransport diff --git a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput+DWView.m b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput+DWView.m index 720f8eae79..3baa2a2f41 100644 --- a/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput+DWView.m +++ b/DashWallet/Sources/UI/Payments/PaymentModels/DWPaymentOutput+DWView.m @@ -36,14 +36,15 @@ static const NSUInteger kUnverifiedNoteMaxLength = 140; /// One line, capped: line breaks and runs of whitespace become a single space before the -/// text is sanitized, then the result is cut to `maxLength`. +/// text is sanitized, then the result is cut to `maxLength` UTF-16 units, the ellipsis included, +/// without splitting a composed character. static NSString *singleLineString(NSString *s, NSUInteger maxLength) { NSArray *parts = [s componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSArray *words = [parts filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"length > 0"]]; NSString *line = sanitizeString([words componentsJoinedByString:@" "]); if (line.length > maxLength) { - NSRange range = [line rangeOfComposedCharacterSequencesForRange:NSMakeRange(0, maxLength)]; - line = [[line substringWithRange:range] stringByAppendingString:@"…"]; + NSUInteger cut = [line rangeOfComposedCharacterSequenceAtIndex:maxLength - 1].location; + line = [[line substringToIndex:cut] stringByAppendingString:@"…"]; } return line; } diff --git a/DashWalletTests/PaymentProtocolTests.swift b/DashWalletTests/PaymentProtocolTests.swift index c51515e0c9..eafe80101e 100644 --- a/DashWalletTests/PaymentProtocolTests.swift +++ b/DashWalletTests/PaymentProtocolTests.swift @@ -983,6 +983,19 @@ final class BIP70PaymentServiceTests: XCTestCase { XCTAssertFalse(BIP70InteractiveCoordinator.isRefusal(BIP70InteractiveCoordinator.nsError(BIP70Error.expired))) } + func testCoordinatorRefusesAPaymentURLThatDoesNotParse() async throws { + let details = PaymentDetails(network: "test", outputs: [PaymentOutput(amount: 100_000, script: p2pkh)], + expires: futureExpiry, memo: nil, paymentURL: "https://[h/pay", merchantData: nil) + XCTAssertNil(URL(string: "https://[h/pay")) + let request = PaymentRequest(pkiType: "none", pkiData: nil, serializedDetails: details.encoded()) + do { + _ = try await prepare(request, allowsInsecureTransport: true) + XCTFail("expected a refusal") + } catch { + XCTAssertEqual(error as? BIP70Error, .malformedRequest) + } + } + func testUnsignedNoteIsLabelledFlattenedAndCapped() async throws { let details = PaymentDetails(network: "test", outputs: [PaymentOutput(amount: 100_000, script: p2pkh)], expires: futureExpiry, memo: "Verified merchant:\n Coffee Shop\n" + String(repeating: "x", count: 300), @@ -992,7 +1005,8 @@ final class BIP70PaymentServiceTests: XCTestCase { let unsignedNote = try XCTUnwrap(try rows(of: unsignedOutput).generalInfo?.plainDetail) XCTAssertEqual(String(unsignedNote.prefix(49)), "Unverified note: Verified merchant: Coffee Shop x") XCTAssertFalse(unsignedNote.contains("\n")) - XCTAssertEqual(unsignedNote.count, "Unverified note: ".count + 140 + 1) + XCTAssertEqual(unsignedNote.count, "Unverified note: ".count + 140) + XCTAssertTrue(unsignedNote.hasSuffix("…")) let signedOutput = try await paymentOutput(for: request, isSecure: true) let signedNote = try XCTUnwrap(try rows(of: signedOutput).generalInfo?.plainDetail)