mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-22 23:00:55 +00:00
fix: Compute validation suppression key over canonical serialisation
This commit is contained in:
@@ -153,7 +153,10 @@ public:
|
||||
SerialIter sit{kPayload8};
|
||||
|
||||
auto val = std::make_shared<STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, true);
|
||||
sit,
|
||||
[](PublicKey const& pk) { return calcNodeID(pk); },
|
||||
STValidation::DeserializeOptions{
|
||||
.checkSignature = true, .requireCanonicalOrder = false});
|
||||
|
||||
BEAST_EXPECT(val);
|
||||
BEAST_EXPECT(val->isFieldPresent(sfLedgerSequence));
|
||||
@@ -174,7 +177,10 @@ public:
|
||||
{
|
||||
SerialIter sit{kPayload1};
|
||||
auto val = std::make_shared<xrpl::STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
sit,
|
||||
[](PublicKey const& pk) { return calcNodeID(pk); },
|
||||
STValidation::DeserializeOptions{
|
||||
.checkSignature = false, .requireCanonicalOrder = false});
|
||||
fail("An exception should have been thrown");
|
||||
}
|
||||
catch (std::exception const& ex)
|
||||
@@ -186,7 +192,10 @@ public:
|
||||
{
|
||||
SerialIter sit{kPayload2};
|
||||
auto val = std::make_shared<xrpl::STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
sit,
|
||||
[](PublicKey const& pk) { return calcNodeID(pk); },
|
||||
STValidation::DeserializeOptions{
|
||||
.checkSignature = false, .requireCanonicalOrder = false});
|
||||
fail("An exception should have been thrown");
|
||||
}
|
||||
catch (std::exception const& ex)
|
||||
@@ -198,7 +207,10 @@ public:
|
||||
{
|
||||
SerialIter sit{kPayload3};
|
||||
auto val = std::make_shared<xrpl::STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
sit,
|
||||
[](PublicKey const& pk) { return calcNodeID(pk); },
|
||||
STValidation::DeserializeOptions{
|
||||
.checkSignature = false, .requireCanonicalOrder = false});
|
||||
fail("An exception should have been thrown");
|
||||
}
|
||||
catch (std::exception const& ex)
|
||||
@@ -210,7 +222,10 @@ public:
|
||||
{
|
||||
SerialIter sit{kPayload4};
|
||||
auto val = std::make_shared<xrpl::STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
sit,
|
||||
[](PublicKey const& pk) { return calcNodeID(pk); },
|
||||
STValidation::DeserializeOptions{
|
||||
.checkSignature = false, .requireCanonicalOrder = false});
|
||||
fail("An exception should have been thrown");
|
||||
}
|
||||
catch (std::exception const& ex)
|
||||
@@ -224,7 +239,10 @@ public:
|
||||
{
|
||||
SerialIter sit{kPayload5};
|
||||
auto val = std::make_shared<STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
sit,
|
||||
[](PublicKey const& pk) { return calcNodeID(pk); },
|
||||
STValidation::DeserializeOptions{
|
||||
.checkSignature = false, .requireCanonicalOrder = false});
|
||||
fail("Expected exception not thrown from validation");
|
||||
}
|
||||
catch (std::exception const& ex)
|
||||
@@ -236,7 +254,10 @@ public:
|
||||
{
|
||||
SerialIter sit{kPayload6};
|
||||
auto val = std::make_shared<STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
sit,
|
||||
[](PublicKey const& pk) { return calcNodeID(pk); },
|
||||
STValidation::DeserializeOptions{
|
||||
.checkSignature = false, .requireCanonicalOrder = false});
|
||||
fail("Expected exception not thrown from validation");
|
||||
}
|
||||
catch (std::exception const& ex)
|
||||
@@ -249,7 +270,10 @@ public:
|
||||
SerialIter sit{kPayload7};
|
||||
|
||||
auto val = std::make_shared<STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
sit,
|
||||
[](PublicKey const& pk) { return calcNodeID(pk); },
|
||||
STValidation::DeserializeOptions{
|
||||
.checkSignature = false, .requireCanonicalOrder = false});
|
||||
|
||||
fail("Expected exception not thrown from validation");
|
||||
}
|
||||
@@ -279,7 +303,10 @@ public:
|
||||
SerialIter sit{makeSlice(v2)};
|
||||
|
||||
auto val = std::make_shared<STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, true);
|
||||
sit,
|
||||
[](PublicKey const& pk) { return calcNodeID(pk); },
|
||||
STValidation::DeserializeOptions{
|
||||
.checkSignature = true, .requireCanonicalOrder = false});
|
||||
|
||||
fail("Mutated validation signature checked out: offset=" + std::to_string(i));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user