Revert "Add test for StunMessage::ValidateMessageIntegrity"
This reverts commit 1f4f672687861cae29259dd0c652d58de373dcac. Reason for revert: Breaks downstream test. Original change's description: > Add test for StunMessage::ValidateMessageIntegrity > > This also tests the UMA stats newly added to it. > > Bug: chromium:1177125 > Change-Id: I89bb17c1897565cd91ea5bbd92062018317738ca > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278600 > Reviewed-by: Johannes Kron <kron@webrtc.org> > Commit-Queue: Harald Alvestrand <hta@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#38345} Bug: chromium:1177125 Change-Id: I2490f2f740db8282ab293583013a50d03ead9141 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278801 Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38349}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
5584d4504e
commit
3d992bf47f
@ -146,7 +146,6 @@ if (rtc_include_tests) {
|
|||||||
"../../rtc_base:byte_order",
|
"../../rtc_base:byte_order",
|
||||||
"../../rtc_base:macromagic",
|
"../../rtc_base:macromagic",
|
||||||
"../../rtc_base:socket_address",
|
"../../rtc_base:socket_address",
|
||||||
"../../system_wrappers:metrics",
|
|
||||||
"../../test:test_support",
|
"../../test:test_support",
|
||||||
"//testing/gtest",
|
"//testing/gtest",
|
||||||
]
|
]
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include "rtc_base/byte_buffer.h"
|
#include "rtc_base/byte_buffer.h"
|
||||||
#include "rtc_base/byte_order.h"
|
#include "rtc_base/byte_order.h"
|
||||||
#include "rtc_base/socket_address.h"
|
#include "rtc_base/socket_address.h"
|
||||||
#include "system_wrappers/include/metrics.h"
|
|
||||||
#include "test/gtest.h"
|
#include "test/gtest.h"
|
||||||
|
|
||||||
namespace cricket {
|
namespace cricket {
|
||||||
@ -1856,26 +1855,4 @@ TEST_F(StunTest, SizeRestrictionOnAttributes) {
|
|||||||
ASSERT_FALSE(msg.Write(&out));
|
ASSERT_FALSE(msg.Write(&out));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(StunTest, ValidateMessageIntegrityWithParser) {
|
|
||||||
// Try the messages from RFC 5769.
|
|
||||||
StunMessage message;
|
|
||||||
rtc::ByteBufferReader reader(
|
|
||||||
reinterpret_cast<const char*>(kRfc5769SampleRequest),
|
|
||||||
sizeof(kRfc5769SampleRequest));
|
|
||||||
EXPECT_TRUE(message.Read(&reader));
|
|
||||||
EXPECT_EQ(message.ValidateMessageIntegrity(kRfc5769SampleMsgPassword),
|
|
||||||
StunMessage::IntegrityStatus::kIntegrityOk);
|
|
||||||
EXPECT_EQ(webrtc::metrics::NumEvents(
|
|
||||||
"WebRTC.Stun.Integrity.Request",
|
|
||||||
static_cast<int>(StunMessage::IntegrityStatus::kIntegrityOk)),
|
|
||||||
1);
|
|
||||||
EXPECT_EQ(message.ValidateMessageIntegrity("Invalid password"),
|
|
||||||
StunMessage::IntegrityStatus::kIntegrityBad);
|
|
||||||
EXPECT_EQ(webrtc::metrics::NumEvents(
|
|
||||||
"WebRTC.Stun.Integrity.Request",
|
|
||||||
static_cast<int>(StunMessage::IntegrityStatus::kIntegrityBad)),
|
|
||||||
1);
|
|
||||||
EXPECT_EQ(webrtc::metrics::NumSamples("WebRTC.Stun.Integrity.Request"), 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace cricket
|
} // namespace cricket
|
||||||
|
Reference in New Issue
Block a user