@@ -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,18 +256,16 @@ 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 /* Placeholder for field that will be added by Lending Protocol
271265 if (isFieldPresent(sfCounterpartySignature))
272266 {
273267 auto const counterSig = getFieldObject(sfCounterpartySignature);
274- if (auto const ret = checkSign(requireCanonicalSig, rules, counterSig);
268+ if (auto const ret = checkSign(rules, counterSig);
275269 !ret)
276270 return Unexpected("Counterparty: " + ret.error());
277271 }
@@ -280,9 +274,7 @@ STTx::checkSign(
280274}
281275
282276Expected<void , std::string>
283- STTx::checkBatchSign (
284- RequireFullyCanonicalSig requireCanonicalSig,
285- Rules const & rules) const
277+ STTx::checkBatchSign (Rules const & rules) const
286278{
287279 try
288280 {
@@ -299,8 +291,8 @@ STTx::checkBatchSign(
299291 {
300292 Blob const & signingPubKey = signer.getFieldVL (sfSigningPubKey);
301293 auto const result = signingPubKey.empty ()
302- ? checkBatchMultiSign (signer, requireCanonicalSig, rules)
303- : checkBatchSingleSign (signer, requireCanonicalSig );
294+ ? checkBatchMultiSign (signer, rules)
295+ : checkBatchSingleSign (signer);
304296
305297 if (!result)
306298 return result;
@@ -395,10 +387,7 @@ STTx::getMetaSQL(
395387}
396388
397389static Expected<void , std::string>
398- singleSignHelper (
399- STObject const & sigObject,
400- Slice const & data,
401- bool const fullyCanonical)
390+ singleSignHelper (STObject const & sigObject, Slice const & data)
402391{
403392 // We don't allow both a non-empty sfSigningPubKey and an sfSigners.
404393 // That would allow the transaction to be signed two ways. So if both
@@ -413,11 +402,8 @@ singleSignHelper(
413402 if (publicKeyType (makeSlice (spk)))
414403 {
415404 Blob const signature = sigObject.getFieldVL (sfTxnSignature);
416- validSig = verify (
417- PublicKey (makeSlice (spk)),
418- data,
419- makeSlice (signature),
420- fullyCanonical);
405+ validSig =
406+ verify (PublicKey (makeSlice (spk)), data, makeSlice (signature));
421407 }
422408 }
423409 catch (std::exception const &)
@@ -432,33 +418,24 @@ singleSignHelper(
432418}
433419
434420Expected<void , std::string>
435- STTx::checkSingleSign (
436- RequireFullyCanonicalSig requireCanonicalSig,
437- STObject const & sigObject) const
421+ STTx::checkSingleSign (STObject const & sigObject) const
438422{
439423 auto const data = getSigningData (*this );
440- bool const fullyCanonical = (getFlags () & tfFullyCanonicalSig) ||
441- (requireCanonicalSig == STTx::RequireFullyCanonicalSig::yes);
442- return singleSignHelper (sigObject, makeSlice (data), fullyCanonical);
424+ return singleSignHelper (sigObject, makeSlice (data));
443425}
444426
445427Expected<void , std::string>
446- STTx::checkBatchSingleSign (
447- STObject const & batchSigner,
448- RequireFullyCanonicalSig requireCanonicalSig) const
428+ STTx::checkBatchSingleSign (STObject const & batchSigner) const
449429{
450430 Serializer msg;
451431 serializeBatch (msg, getFlags (), getBatchTransactionIDs ());
452- bool const fullyCanonical = (getFlags () & tfFullyCanonicalSig) ||
453- (requireCanonicalSig == STTx::RequireFullyCanonicalSig::yes);
454- return singleSignHelper (batchSigner, msg.slice (), fullyCanonical);
432+ return singleSignHelper (batchSigner, msg.slice ());
455433}
456434
457435Expected<void , std::string>
458436multiSignHelper (
459437 STObject const & sigObject,
460438 std::optional<AccountID> txnAccountID,
461- bool const fullyCanonical,
462439 std::function<Serializer(AccountID const &)> makeMsg,
463440 Rules const & rules)
464441{
@@ -515,8 +492,7 @@ multiSignHelper(
515492 validSig = verify (
516493 PublicKey (makeSlice (spk)),
517494 makeMsg (accountID).slice (),
518- makeSlice (signature),
519- fullyCanonical);
495+ makeSlice (signature));
520496 }
521497 }
522498 catch (std::exception const & e)
@@ -535,14 +511,8 @@ multiSignHelper(
535511}
536512
537513Expected<void , std::string>
538- STTx::checkBatchMultiSign (
539- STObject const & batchSigner,
540- RequireFullyCanonicalSig requireCanonicalSig,
541- Rules const & rules) const
514+ STTx::checkBatchMultiSign (STObject const & batchSigner, Rules const & rules) const
542515{
543- bool const fullyCanonical = (getFlags () & tfFullyCanonicalSig) ||
544- (requireCanonicalSig == RequireFullyCanonicalSig::yes);
545-
546516 // We can ease the computational load inside the loop a bit by
547517 // pre-constructing part of the data that we hash. Fill a Serializer
548518 // with the stuff that stays constant from signature to signature.
@@ -551,7 +521,6 @@ STTx::checkBatchMultiSign(
551521 return multiSignHelper (
552522 batchSigner,
553523 std::nullopt ,
554- fullyCanonical,
555524 [&dataStart](AccountID const & accountID) -> Serializer {
556525 Serializer s = dataStart;
557526 finishMultiSigningData (accountID, s);
@@ -561,14 +530,8 @@ STTx::checkBatchMultiSign(
561530}
562531
563532Expected<void , std::string>
564- STTx::checkMultiSign (
565- RequireFullyCanonicalSig requireCanonicalSig,
566- Rules const & rules,
567- STObject const & sigObject) const
533+ STTx::checkMultiSign (Rules const & rules, STObject const & sigObject) const
568534{
569- bool const fullyCanonical = (getFlags () & tfFullyCanonicalSig) ||
570- (requireCanonicalSig == RequireFullyCanonicalSig::yes);
571-
572535 // Used inside the loop in multiSignHelper to enforce that
573536 // the account owner may not multisign for themselves.
574537 auto const txnAccountID = &sigObject != this
@@ -582,7 +545,6 @@ STTx::checkMultiSign(
582545 return multiSignHelper (
583546 sigObject,
584547 txnAccountID,
585- fullyCanonical,
586548 [&dataStart](AccountID const & accountID) -> Serializer {
587549 Serializer s = dataStart;
588550 finishMultiSigningData (accountID, s);
0 commit comments