@@ -237,10 +237,7 @@ STTx::sign(
237237}
238238
239239Expected<void , std::string>
240- STTx::checkSign (
241- RequireFullyCanonicalSig requireCanonicalSig,
242- Rules const & rules,
243- STObject const & sigObject) const
240+ STTx::checkSign (Rules const & rules, STObject const & sigObject) const
244241{
245242 try
246243 {
@@ -249,9 +246,8 @@ STTx::checkSign(
249246 // multi-signing. Otherwise we're single-signing.
250247
251248 Blob const & signingPubKey = sigObject.getFieldVL (sfSigningPubKey);
252- return signingPubKey.empty ()
253- ? checkMultiSign (requireCanonicalSig, rules, sigObject)
254- : checkSingleSign (requireCanonicalSig, sigObject);
249+ return signingPubKey.empty () ? checkMultiSign (rules, sigObject)
250+ : checkSingleSign (sigObject);
255251 }
256252 catch (std::exception const &)
257253 {
@@ -260,27 +256,23 @@ STTx::checkSign(
260256}
261257
262258Expected<void , std::string>
263- STTx::checkSign (
264- RequireFullyCanonicalSig requireCanonicalSig,
265- Rules const & rules) const
259+ STTx::checkSign (Rules const & rules) const
266260{
267- if (auto const ret = checkSign (requireCanonicalSig, rules, *this ); !ret)
261+ if (auto const ret = checkSign (rules, *this ); !ret)
268262 return ret;
269263
270264 if (isFieldPresent (sfCounterpartySignature))
271265 {
272266 auto const counterSig = getFieldObject (sfCounterpartySignature);
273- if (auto const ret = checkSign (requireCanonicalSig, rules, counterSig);
267+ if (auto const ret = checkSign (rules, counterSig);
274268 !ret)
275269 return Unexpected (" Counterparty: " + ret.error ());
276270 }
277271 return {};
278272}
279273
280274Expected<void , std::string>
281- STTx::checkBatchSign (
282- RequireFullyCanonicalSig requireCanonicalSig,
283- Rules const & rules) const
275+ STTx::checkBatchSign (Rules const & rules) const
284276{
285277 try
286278 {
@@ -297,8 +289,8 @@ STTx::checkBatchSign(
297289 {
298290 Blob const & signingPubKey = signer.getFieldVL (sfSigningPubKey);
299291 auto const result = signingPubKey.empty ()
300- ? checkBatchMultiSign (signer, requireCanonicalSig, rules)
301- : checkBatchSingleSign (signer, requireCanonicalSig );
292+ ? checkBatchMultiSign (signer, rules)
293+ : checkBatchSingleSign (signer);
302294
303295 if (!result)
304296 return result;
@@ -393,10 +385,7 @@ STTx::getMetaSQL(
393385}
394386
395387static Expected<void , std::string>
396- singleSignHelper (
397- STObject const & sigObject,
398- Slice const & data,
399- bool const fullyCanonical)
388+ singleSignHelper (STObject const & sigObject, Slice const & data)
400389{
401390 // We don't allow both a non-empty sfSigningPubKey and an sfSigners.
402391 // That would allow the transaction to be signed two ways. So if both
@@ -411,11 +400,8 @@ singleSignHelper(
411400 if (publicKeyType (makeSlice (spk)))
412401 {
413402 Blob const signature = sigObject.getFieldVL (sfTxnSignature);
414- validSig = verify (
415- PublicKey (makeSlice (spk)),
416- data,
417- makeSlice (signature),
418- fullyCanonical);
403+ validSig =
404+ verify (PublicKey (makeSlice (spk)), data, makeSlice (signature));
419405 }
420406 }
421407 catch (std::exception const &)
@@ -430,33 +416,24 @@ singleSignHelper(
430416}
431417
432418Expected<void , std::string>
433- STTx::checkSingleSign (
434- RequireFullyCanonicalSig requireCanonicalSig,
435- STObject const & sigObject) const
419+ STTx::checkSingleSign (STObject const & sigObject) const
436420{
437421 auto const data = getSigningData (*this );
438- bool const fullyCanonical = (getFlags () & tfFullyCanonicalSig) ||
439- (requireCanonicalSig == STTx::RequireFullyCanonicalSig::yes);
440- return singleSignHelper (sigObject, makeSlice (data), fullyCanonical);
422+ return singleSignHelper (sigObject, makeSlice (data));
441423}
442424
443425Expected<void , std::string>
444- STTx::checkBatchSingleSign (
445- STObject const & batchSigner,
446- RequireFullyCanonicalSig requireCanonicalSig) const
426+ STTx::checkBatchSingleSign (STObject const & batchSigner) const
447427{
448428 Serializer msg;
449429 serializeBatch (msg, getFlags (), getBatchTransactionIDs ());
450- bool const fullyCanonical = (getFlags () & tfFullyCanonicalSig) ||
451- (requireCanonicalSig == STTx::RequireFullyCanonicalSig::yes);
452- return singleSignHelper (batchSigner, msg.slice (), fullyCanonical);
430+ return singleSignHelper (batchSigner, msg.slice ());
453431}
454432
455433Expected<void , std::string>
456434multiSignHelper (
457435 STObject const & sigObject,
458436 std::optional<AccountID> txnAccountID,
459- bool const fullyCanonical,
460437 std::function<Serializer(AccountID const &)> makeMsg,
461438 Rules const & rules)
462439{
@@ -513,8 +490,7 @@ multiSignHelper(
513490 validSig = verify (
514491 PublicKey (makeSlice (spk)),
515492 makeMsg (accountID).slice (),
516- makeSlice (signature),
517- fullyCanonical);
493+ makeSlice (signature));
518494 }
519495 }
520496 catch (std::exception const & e)
@@ -533,14 +509,8 @@ multiSignHelper(
533509}
534510
535511Expected<void , std::string>
536- STTx::checkBatchMultiSign (
537- STObject const & batchSigner,
538- RequireFullyCanonicalSig requireCanonicalSig,
539- Rules const & rules) const
512+ STTx::checkBatchMultiSign (STObject const & batchSigner, Rules const & rules) const
540513{
541- bool const fullyCanonical = (getFlags () & tfFullyCanonicalSig) ||
542- (requireCanonicalSig == RequireFullyCanonicalSig::yes);
543-
544514 // We can ease the computational load inside the loop a bit by
545515 // pre-constructing part of the data that we hash. Fill a Serializer
546516 // with the stuff that stays constant from signature to signature.
@@ -549,7 +519,6 @@ STTx::checkBatchMultiSign(
549519 return multiSignHelper (
550520 batchSigner,
551521 std::nullopt ,
552- fullyCanonical,
553522 [&dataStart](AccountID const & accountID) -> Serializer {
554523 Serializer s = dataStart;
555524 finishMultiSigningData (accountID, s);
@@ -559,14 +528,8 @@ STTx::checkBatchMultiSign(
559528}
560529
561530Expected<void , std::string>
562- STTx::checkMultiSign (
563- RequireFullyCanonicalSig requireCanonicalSig,
564- Rules const & rules,
565- STObject const & sigObject) const
531+ STTx::checkMultiSign (Rules const & rules, STObject const & sigObject) const
566532{
567- bool const fullyCanonical = (getFlags () & tfFullyCanonicalSig) ||
568- (requireCanonicalSig == RequireFullyCanonicalSig::yes);
569-
570533 // Used inside the loop in multiSignHelper to enforce that
571534 // the account owner may not multisign for themselves.
572535 auto const txnAccountID = &sigObject != this
@@ -580,7 +543,6 @@ STTx::checkMultiSign(
580543 return multiSignHelper (
581544 sigObject,
582545 txnAccountID,
583- fullyCanonical,
584546 [&dataStart](AccountID const & accountID) -> Serializer {
585547 Serializer s = dataStart;
586548 finishMultiSigningData (accountID, s);
0 commit comments