-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NetworkPkg: Dhcp6Dxe: SECURITY PATCH CVE-2023-45230 Unit Tests
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4535 Confirms that reported issue... "Buffer overflow in the DHCPv6 client via a long Server ID option" ..has been corrected by the provided patch. Tests the following functions to ensure they appropriately handle untrusted data (either too long or too small) to prevent a buffer overflow: Dhcp6AppendOption Dhcp6AppendETOption Dhcp6AppendIaOption Cc: Saloni Kasbekar <saloni.kasbekar@intel.com> Cc: Zachary Clark-williams <zachary.clark-williams@intel.com> Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com> Reviewed-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
- Loading branch information
1 parent
8014ac2
commit 5f36581
Showing
4 changed files
with
542 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** @file | ||
Acts as the main entry point for the tests for the Dhcp6Dxe module. | ||
Copyright (c) Microsoft Corporation | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
#include <gtest/gtest.h> | ||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
// Run the tests | ||
//////////////////////////////////////////////////////////////////////////////// | ||
int | ||
main ( | ||
int argc, | ||
char *argv[] | ||
) | ||
{ | ||
testing::InitGoogleTest (&argc, argv); | ||
return RUN_ALL_TESTS (); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
## @file | ||
# Unit test suite for the Dhcp6Dxe using Google Test | ||
# | ||
# Copyright (c) Microsoft Corporation.<BR> | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
## | ||
[Defines] | ||
INF_VERSION = 0x00010017 | ||
BASE_NAME = Dhcp6DxeGoogleTest | ||
FILE_GUID = 1D2A4C65-38C8-4C2F-BB60-B5FA49625AA9 | ||
VERSION_STRING = 1.0 | ||
MODULE_TYPE = HOST_APPLICATION | ||
# | ||
# The following information is for reference only and not required by the build tools. | ||
# | ||
# VALID_ARCHITECTURES = IA32 X64 AARCH64 | ||
# | ||
[Sources] | ||
Dhcp6DxeGoogleTest.cpp | ||
Dhcp6IoGoogleTest.cpp | ||
../Dhcp6Io.c | ||
../Dhcp6Utility.c | ||
|
||
[Packages] | ||
MdePkg/MdePkg.dec | ||
MdeModulePkg/MdeModulePkg.dec | ||
UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec | ||
NetworkPkg/NetworkPkg.dec | ||
|
||
[LibraryClasses] | ||
GoogleTestLib | ||
DebugLib | ||
NetLib | ||
PcdLib | ||
|
||
[Protocols] | ||
gEfiDhcp6ServiceBindingProtocolGuid | ||
|
||
[Pcd] | ||
gEfiNetworkPkgTokenSpaceGuid.PcdDhcp6UidType | ||
|
||
[Guids] | ||
gZeroGuid |
Oops, something went wrong.