Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wenxing TLS test #8

Open
wants to merge 117 commits into
base: OpenSSL11_EOL
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
dd49d44
MdeModulePkg/Bus/Pci/EhciDxe: Fix FORWARD_NULL Coverity issues
Jul 3, 2023
3399f64
RedfishPkg/RedfishRestExDxe: reset session when TCP timeout happens
nicklela Jul 13, 2023
39ded59
OvmfPkg/PeilessStartupLib: Updated with PcdSecureBootSupported
sunceping Jul 10, 2023
4d10140
UefiCpuPkg: Uses gMmst in MmSaveStateLib
Jul 12, 2023
08aacbf
OvmfPkg/CloudHv: update Maintainers.txt entry
jongwu Jul 9, 2023
a52044a
OvmfPkg/IoMmuDxe: add locking to IoMmuAllocateBounceBuffer
kraxel Jul 19, 2023
6510dcf
NetworkPkg/HttpDxe: fix driver binding start issue.
Feb 10, 2023
b2de9ec
CryptoPkg/OpensslLib: Upgrade OpenSSL to 1.1.1u
swei22 Jul 18, 2023
c6b5129
UnitTestFrameworkPkg: UnitTestPersistenceLib: Save Unit Test Cache Op…
kuqin12 Mar 17, 2023
7427dd3
OvmfPkg/RiscVVirt: Check "no-map" and mark EfiReservedMemoryType
vlsunil Jul 17, 2023
925c445
OvmfPkg/RiscVVirt: Avoid printing hard coded timeout value
vlsunil Jul 17, 2023
5309ddc
EmulatorPkg/Win/Host: Fix RUNTIME_FUNCTION redefinition error
mdkinney Jul 21, 2023
dcf05f9
MdePkg/Include/IndustryStandard: Remove VS20xx workaround
mdkinney Jul 21, 2023
25a6745
RedfishPkg/RedfishDiscoverDxe: fix netmask check issue
nicklela Jul 24, 2023
c7a7f09
UefiCpuPkg: Decouple the SEV-ES functionality.
xieyuanh Jul 26, 2023
1c923b9
Revert "OvmfPkg/Bhyve: consume PciHostBridgeLibScan"
ckoehne Jul 11, 2023
f284981
Revert "OvmfPkg/Bhyve: remove IncompatiblePciDeviceSupport DXE driver"
ckoehne Jul 11, 2023
70f3e62
OvmfPkg/BhyvePkg: enable bus enumeration
ckoehne Jul 11, 2023
8543840
OvmfPkg/RiscVVirt: use 'auto' alignment and FIXED for XIP modules
vlsunil Jul 11, 2023
0f9fd06
OvmfPkg/RiscVVirt: SecEntry: Remove unnecessary assembly directives
vlsunil Jul 11, 2023
3f49462
BaseTools/tools_def: Add CLANGDWARF support for RISC-V
vlsunil Jul 11, 2023
677f2c6
OvmfPkg/RiscVVirt: Update README for CLANGDWARF support
vlsunil Jul 11, 2023
c7c1170
MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix SIGN_EXTENSION Coverity issue
Jul 17, 2023
d11968f
MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix UNUSED_VALUE Coverity issue
Jul 17, 2023
5cadb8c
BaseTools: BinToPcd: Resolve xdrlib deprecation
Javagedes Jun 27, 2023
fa789cc
BaseTools: scan Edk2ToolsBuild.py make output
Javagedes Jun 21, 2023
7672d1c
MdeModulePkg/SetupBrowser: Load storage via GetVariable for EfiVarStore
dandanbi Jul 25, 2023
ef05145
ArmPkg: DefaultExceptionHandlerLib: Do Not Allocate Memory
os-d Aug 2, 2023
01ad413
MdeModulePkg: Solve boot hang Xhci driver when use USB DVD with empty…
Aug 3, 2023
744c42b
OvmfPkg/PlatformCI: Use recent Qemu on Windows
osteffenrh Aug 3, 2023
bae848e
OvmfPkg/PlatformCI VS2019: Disable workaround for cpuhp bugfix
osteffenrh Aug 3, 2023
2d8c17a
OvmfPkg/PlatformCI: Boot OVMF in SMP mode.
kraxel Aug 3, 2023
107ddf1
MdePkg: Add missing status codes
nate-desimone Jul 28, 2023
3c274c0
MdePkg: Add new status codes to PrintLib
nate-desimone Jul 28, 2023
136931c
MedPkg/Include: Add PCI_EXPRESS_EXTENDED_CAPABILITY_DVSEC_ID
jiaxinno-dev Aug 3, 2023
9d6d237
CryptoPkg/openssl: update submodule to openssl-3.0.9
kraxel Aug 3, 2023
49a113a
CryptoPkg/openssl: cleanup all openssl1.1.1 generated files and code
liyi77 Aug 3, 2023
7cede6d
CryptoPkg/openssl: update Openssl*.inf files for openssl 3.0
kraxel Aug 3, 2023
81f5aa0
CryptoPkg/openssl: add openssl3 configure scripts
kraxel Aug 3, 2023
ac492c3
CryptoPkg/openssl: UefiAsm.conf update for openssl 3.0
kraxel Aug 3, 2023
84158d0
CryptoPkg/BaseCryptLib: no openssl deprecation warnings please
kraxel Aug 3, 2023
63c8d16
CryptoPkg/BaseCryptLib: adapt CryptSm3.c to openssl 3.0 changes.
kraxel Aug 3, 2023
2a6dc12
CryptoPkg/BaseCryptLib: drop BIO_* dummy functions
kraxel Aug 3, 2023
eac38f7
CryptoPkg/TlsLib: ERR_GET_FUNC is gone
kraxel Aug 3, 2023
c638d1f
CryptoPkg/openssl: adapt rand_pool.c to openssl 3.0 changes
kraxel Aug 3, 2023
3af00ae
CryptoPkg/openssl: move compiler_flags to buildinf.c
kraxel Aug 3, 2023
174a306
CryptoPkg/openssl: store dummy update for openssl 3.0
kraxel Aug 3, 2023
5e1900f
CryptoPkg/openssl: adapt EcSm2Null.c for openssl 3.0
kraxel Aug 3, 2023
9b9b331
CryptoPkg: Move all UEFI implement of openssl to OpensslStub
liyi77 Aug 3, 2023
ea7a37d
CryptoPkg: use UEFI provider as default
liyi77 Aug 3, 2023
cea8e3b
CryptoPkg: adapt 3.0 change in SslNull.c
liyi77 Aug 3, 2023
bf1ff73
CryptoPkg: Add instrinsics to support building openssl3 on IA32 windows
liyi77 Aug 3, 2023
20193b2
CryptoPkg: disable C4133 warning in openssl libraries
liyi77 Aug 3, 2023
bdf3142
CryptoPkg/TlsLib: use unsigned long for ErrorCode
kraxel Aug 3, 2023
f0d3e59
CryptoPkg: Align with 4096 when build with OpensslFullAccel
liyi77 Aug 3, 2023
43e0ede
CryptoPkg: Enable memcpy sys call in RISCV64 build
liyi77 Aug 3, 2023
4b5faa5
CryptoPkg: add missing gcc instructions
liyi77 Aug 3, 2023
b2ff8e4
CryptoPkg: add define of maximum unsigned size_t
liyi77 Aug 3, 2023
2bead79
CryptoPkg: add implemention of _ftol2_sse() to avoid build error
liyi77 Aug 3, 2023
dfa6147
CryptoPkg: add more dummy implement of openssl for size optimization
liyi77 Aug 3, 2023
c0aeb92
CryptoPkg: run configure.py to update all generated files
liyi77 Aug 3, 2023
46226fb
CryptoPkg: remove strcmp to syscall
liyi77 Aug 3, 2023
e91bfff
CryptoPkg/openssl: update CI config for openssl 3.0
kraxel Aug 3, 2023
991515a
CryptoPkg: remove BN and EC accel for size optimization
liyi77 Aug 3, 2023
055c7bd
UefiCpuPkg: Add SendStartupIpiAllExcludingSelf
xieyuanh Mar 27, 2023
98e9d29
UefiCpuPkg: Add PcdFirstTimeWakeUpAPsBySipi
xieyuanh Jul 18, 2023
1d76560
OvmfPkg: Disable PcdFirstTimeWakeUpAPsBySipi.
xieyuanh Jul 18, 2023
eaffa1d
UefiCpuPkg:Wake up APs after power-up or RESET through SIPI.
xieyuanh Jul 18, 2023
32531ef
CryptoPkg: Size optimization: trim objects structure
liyi77 Aug 15, 2023
adc1c9e
CryptoPkg: Size optimization: Enable openssl legacy code path
liyi77 May 30, 2023
ec9e95a
CryptoPkg: Size optimization: remove INTEL unused feature
liyi77 Jun 14, 2023
872df82
CryptoPkg: Size optimization: Disable AUTOALGINIT for non-tls build
liyi77 Aug 2, 2023
6cf31e9
CryptoPkg: Size optimization: add Accel library without TLS
liyi77 Aug 15, 2023
81f3578
CryptoPkg: Add readme for OpenSSL30 optimization
liyi77 Aug 17, 2023
71bb668
Add mbedtls submodule for EDKII
Wenxing-hou Aug 9, 2023
f3b36c5
Check mbedtls to version 3.3.0
Wenxing-hou Aug 9, 2023
d4fc61b
Add mbedtls_config and MbedTlsLib.inf to support MbedTlsLib
Wenxing-hou Aug 9, 2023
2d4dad7
Add Bignumber functions based on Mbedtls
Wenxing-hou Aug 16, 2023
423fb0f
Add Cipher functions based on Mbedtls
Wenxing-hou Aug 16, 2023
a968e78
Add MD5/SHA1/SHA2 functions based on Mbedtls
Wenxing-hou Aug 16, 2023
8ef929e
Add HMAC functions based on Mbedtls
Wenxing-hou Aug 16, 2023
92e0137
Add HKDF functions based on Mbedtls
Wenxing-hou Aug 16, 2023
0cba476
Add PEM functions based on Mbedtls
Wenxing-hou Aug 16, 2023
a52e111
Add DH functions based on Mbedtls
Wenxing-hou Aug 16, 2023
68a0afd
Add EC functions based on Mbedtls
Wenxing-hou Aug 16, 2023
f9d3fab
Add RSA functions based on Mbedtls
Wenxing-hou Aug 16, 2023
5358c0e
Add PKCS1 functions based on Mbedtls
Wenxing-hou Aug 16, 2023
ecb7970
Add PKCS5 functions based on Mbedtls
Wenxing-hou Aug 16, 2023
3024e8b
Add X509 functions based on Mbedtls
Wenxing-hou Aug 16, 2023
6bf9694
Add PKCS7 null functions based on Mbedtls to pass build
Wenxing-hou Aug 16, 2023
b825a9b
Add Rand functions based on Mbedtls
Wenxing-hou Aug 16, 2023
21f471e
Add SysCall for BaseCryptLibMbedTls
Wenxing-hou Aug 16, 2023
755c4d6
Add all the inf files for BaseCryptLibMbedTls
Wenxing-hou Aug 16, 2023
1e7e153
Add CryptoPkgMbedTls.dsc for CryptoPkgMbedTls
Wenxing-hou Aug 16, 2023
2ff52a7
Add CryptoPkgMbedHostUnitTest.dsc for UnitTest
Wenxing-hou Aug 16, 2023
e5d7a5b
Add PKCS7 all functions(WIP) based on Mbedtls
Wenxing-hou Aug 16, 2023
7f57b77
Add TlsLibMbedtls(WIP) based on Mbedtls
Wenxing-hou Aug 16, 2023
292af06
Add dummy API for Openssl raw API
Wenxing-hou Aug 16, 2023
4b3cd52
Add ReadmeMbedtls.md
Wenxing-hou Aug 17, 2023
9f843a2
Add SHA3/SM3 functions with openssl for Mbedtls
Wenxing-hou Aug 17, 2023
d88d0de
Update RSA based on Mbedtls
Wenxing-hou Aug 17, 2023
46ce37f
Fix type error for GCC build
Wenxing-hou Aug 17, 2023
c6fe53c
Fix Bignumber: Add more check for input parameters
Wenxing-hou Aug 22, 2023
8daf258
Readme: update status of auto init
liyi77 Aug 31, 2023
8447433
CryptoPkg: Fix EC fuzz
Wenxing-hou Sep 5, 2023
940dd51
CryptoPkg: Make the use of BnCtx in mbedtls clear
Wenxing-hou Sep 11, 2023
e3f4cc0
CryptoPkg: Enable MBEDTLS_AESNI_C
Wenxing-hou Nov 21, 2023
73d1bb6
CryptoPkg: Make SHA faster
Wenxing-hou Nov 29, 2023
3f1bf45
CryptoPkg: Fix MbedtlsPkcs7SignedDataVerifySigners
Wenxing-hou Nov 29, 2023
33ac7ec
CryptoPkg: Fix hardcode in CryptPkcs7VerifyCommon
Wenxing-hou Dec 25, 2023
c40618f
CryptoPkg: Update ReadmeMbedtls
Wenxing-hou Nov 29, 2023
5134115
CryptoPkg: Add miss RngLib
Wenxing-hou Jan 8, 2024
7b61160
CryptoPkg: Delete hardcode for buffer usage
Wenxing-hou Jan 18, 2024
578445f
CryptoPkg: Fix Pkcs7GetSigners
Wenxing-hou Jan 17, 2024
08b4438
CryptoPkg: Fix Cert copy
Wenxing-hou Jan 18, 2024
e0082e0
Wenxing TLS test(first unit_test pass)
Wenxing-hou Jan 31, 2024
2c3e2c0
Update for pass UnitTest
Wenxing-hou Mar 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@
[submodule "MdePkg/Library/MipiSysTLib/mipisyst"]
path = MdePkg/Library/MipiSysTLib/mipisyst
url = https://github.com/MIPI-Alliance/public-mipi-sys-t.git
[submodule "CryptoPkg/Library/MbedTlsLib/mbedtls"]
path = CryptoPkg/Library/MbedTlsLib/mbedtls
url = https://github.com/ARMmbed/mbedtls
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
#include <Protocol/DebugSupport.h>
#include <Protocol/LoadedImage.h>

//
// Maximum number of characters to print to serial (UINT8s) and to console if
// available (as UINT16s)
//
#define MAX_PRINT_CHARS 100

STATIC CHAR8 *gExceptionTypeString[] = {
"Synchronous",
"IRQ",
Expand Down Expand Up @@ -188,28 +194,25 @@ DefaultExceptionHandler (
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
{
CHAR8 Buffer[100];
UINTN CharCount;
INT32 Offset;
CHAR8 Buffer[MAX_PRINT_CHARS];
CHAR16 UnicodeBuffer[MAX_PRINT_CHARS];
UINTN CharCount;
INT32 Offset;

if (mRecursiveException) {
STATIC CHAR8 CONST Message[] = "\nRecursive exception occurred while dumping the CPU state\n";

SerialPortWrite ((UINT8 *)Message, sizeof Message - 1);
if (gST->ConOut != NULL) {
AsciiPrint (Message);
}

CpuDeadLoop ();
}

mRecursiveException = TRUE;

CharCount = AsciiSPrint (Buffer, sizeof (Buffer), "\n\n%a Exception at 0x%016lx\n", gExceptionTypeString[ExceptionType], SystemContext.SystemContextAArch64->ELR);
SerialPortWrite ((UINT8 *)Buffer, CharCount);
if (gST->ConOut != NULL) {
AsciiPrint (Buffer);
}

// Prepare a unicode buffer for ConOut, if applicable, in case the buffer
// gets reused.
UnicodeSPrintAsciiFormat (UnicodeBuffer, MAX_PRINT_CHARS, Buffer);

DEBUG_CODE_BEGIN ();
CHAR8 *Pdb, *PrevPdb;
Expand Down Expand Up @@ -330,6 +333,13 @@ DefaultExceptionHandler (
));
}

// Attempt to print that we had a synchronous exception to ConOut. We do
// this after the serial logging as ConOut's logging is more complex and we
// aren't guaranteed to succeed.
if (gST->ConOut != NULL) {
gST->ConOut->OutputString (gST->ConOut, UnicodeBuffer);
}

ASSERT (FALSE);
CpuDeadLoop ();
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
#include <Protocol/DebugSupport.h>
#include <Library/DefaultExceptionHandlerLib.h>

//
// Maximum number of characters to print to serial (UINT8s) and to console if
// available (as UINT16s)
//
#define MAX_PRINT_CHARS 100

//
// The number of elements in a CHAR8 array, including the terminating NUL, that
// is meant to hold the string rendering of the CPSR.
Expand Down Expand Up @@ -198,7 +204,8 @@ DefaultExceptionHandler (
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
{
CHAR8 Buffer[100];
CHAR8 Buffer[MAX_PRINT_CHARS];
CHAR16 UnicodeBuffer[MAX_PRINT_CHARS];
UINTN CharCount;
UINT32 DfsrStatus;
UINT32 IfsrStatus;
Expand All @@ -216,9 +223,10 @@ DefaultExceptionHandler (
SystemContext.SystemContextArm->CPSR
);
SerialPortWrite ((UINT8 *)Buffer, CharCount);
if (gST->ConOut != NULL) {
AsciiPrint (Buffer);
}

// Prepare a unicode buffer for ConOut, if applicable, as Buffer is used
// below.
UnicodeSPrintAsciiFormat (UnicodeBuffer, MAX_PRINT_CHARS, Buffer);

DEBUG_CODE_BEGIN ();
CHAR8 *Pdb;
Expand Down Expand Up @@ -289,6 +297,14 @@ DefaultExceptionHandler (
}

DEBUG ((DEBUG_ERROR, "\n"));

// Attempt to print that we had a synchronous exception to ConOut. We do
// this after the serial logging as ConOut's logging is more complex and we
// aren't guaranteed to succeed.
if (gST->ConOut != NULL) {
gST->ConOut->OutputString (gST->ConOut, UnicodeBuffer);
}

ASSERT (FALSE);

CpuDeadLoop (); // may return if executing under a debugger
Expand Down
53 changes: 53 additions & 0 deletions BaseTools/Conf/tools_def.template
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ DEFINE GCC_LOONGARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mabi=lp64d -fno-asyn
DEFINE GCC_ARM_CC_XIPFLAGS = -mno-unaligned-access
DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18
DEFINE GCC_AARCH64_CC_XIPFLAGS = -mstrict-align -mgeneral-regs-only
DEFINE GCC_RISCV64_CC_XIPFLAGS = -mstrict-align -mgeneral-regs-only
DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie
DEFINE GCC_DLINK2_FLAGS_COMMON = -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections
Expand Down Expand Up @@ -2023,6 +2024,58 @@ DEFINE CLANGDWARF_AARCH64_DLINK_FLAGS = DEF(CLANGDWARF_AARCH64_TARGET) DEF(GCC_
RELEASE_CLANGDWARF_AARCH64_CC_FLAGS = DEF(CLANGDWARF_AARCH64_CC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
RELEASE_CLANGDWARF_AARCH64_DLINK_FLAGS = DEF(CLANGDWARF_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -fuse-ld=lld -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wl,--no-pie,--no-relax

##################
# CLANGDWARF RISCV64 definitions
##################
DEFINE CLANGDWARF_RISCV64_TARGET = -target riscv64-linux-gnu
DEFINE CLANGDWARF_RISCV64_CC_COMMON = DEF(GCC5_RISCV_ALL_CC_FLAGS) DEF(GCC5_RISCV_ALL_CC_FLAGS_WARNING_DISABLE) DEF(GCC5_RISCV_OPENSBI_TYPES) -march=DEF(GCC5_RISCV64_ARCH) -fno-builtin -fno-builtin-memcpy -fno-stack-protector -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -Wno-unused-but-set-variable -fpack-struct=8 -mcmodel=medany -mabi=lp64 -mno-relax
DEFINE CLANGDWARF_RISCV64_CC_FLAGS = DEF(CLANGDWARF_RISCV64_CC_COMMON) DEF(CLANGDWARF_RISCV64_TARGET) DEF(CLANGDWARF_WARNING_OVERRIDES)

# This is similar to GCC flags but without -n
DEFINE CLANGDWARF_RISCV64_ALL_DLINK_COMMON = -nostdlib -Wl,-q,--gc-sections -z common-page-size=0x40
DEFINE CLANGDWARF_RISCV64_ALL_DLINK_FLAGS = DEF(CLANGDWARF_RISCV64_ALL_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
DEFINE CLANGDWARF_RISCV64_DLINK_FLAGS = DEF(CLANGDWARF_RISCV64_TARGET) DEF(CLANGDWARF_RISCV64_ALL_DLINK_FLAGS) -Wl,-melf64lriscv,--oformat=elf64-littleriscv,--no-relax

*_CLANGDWARF_RISCV64_PP_FLAGS = DEF(GCC_PP_FLAGS)
*_CLANGDWARF_RISCV64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
*_CLANGDWARF_RISCV64_APP_FLAGS =
*_CLANGDWARF_RISCV64_ASL_FLAGS = DEF(IASL_FLAGS)
*_CLANGDWARF_RISCV64_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
*_CLANGDWARF_RISCV64_DTCPP_FLAGS = DEF(GCC_DTCPP_FLAGS)
*_CLANGDWARF_RISCV64_DEPS_FLAGS = DEF(GCC_DEPS_FLAGS)

*_CLANGDWARF_RISCV64_CC_PATH = ENV(CLANGDWARF_BIN)clang
*_CLANGDWARF_RISCV64_ASM_PATH = ENV(CLANGDWARF_BIN)clang
*_CLANGDWARF_RISCV64_PP_PATH = ENV(CLANGDWARF_BIN)clang
*_CLANGDWARF_RISCV64_VFRPP_PATH = ENV(CLANGDWARF_BIN)clang
*_CLANGDWARF_RISCV64_ASLCC_PATH = ENV(CLANGDWARF_BIN)clang
*_CLANGDWARF_RISCV64_ASLPP_PATH = ENV(CLANGDWARF_BIN)clang
*_CLANGDWARF_RISCV64_DLINK_PATH = ENV(CLANGDWARF_BIN)clang
*_CLANGDWARF_RISCV64_ASLDLINK_PATH = ENV(CLANGDWARF_BIN)clang

*_CLANGDWARF_RISCV64_SLINK_PATH = ENV(CLANGDWARF_BIN)llvm-ar
*_CLANGDWARF_RISCV64_RC_PATH = ENV(CLANGDWARF_BIN)llvm-objcopy

*_CLANGDWARF_RISCV64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -fno-lto
*_CLANGDWARF_RISCV64_ASLDLINK_FLAGS = DEF(CLANGDWARF_RISCV64_TARGET) DEF(GCC5_RISCV32_RISCV64_ASLDLINK_FLAGS)
*_CLANGDWARF_RISCV64_ASM_FLAGS = DEF(GCC_ASM_FLAGS) DEF(CLANGDWARF_RISCV64_TARGET) $(PLATFORM_FLAGS) -Qunused-arguments -mabi=lp64 -mno-relax
*_CLANGDWARF_RISCV64_DLINK_FLAGS = DEF(CLANGDWARF_RISCV64_TARGET) DEF(GCC5_RISCV64_DLINK_FLAGS)
*_CLANGDWARF_RISCV64_DLINK_XIPFLAGS = -z common-page-size=0x20
*_CLANGDWARF_RISCV64_DLINK2_FLAGS = DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0x240
*_CLANGDWARF_RISCV64_PLATFORM_FLAGS =
*_CLANGDWARF_RISCV64_PP_FLAGS = DEF(GCC_PP_FLAGS) DEF(CLANGDWARF_RISCV64_TARGET) $(PLATFORM_FLAGS)
*_CLANGDWARF_RISCV64_RC_FLAGS = DEF(GCC_RISCV64_RC_FLAGS)
*_CLANGDWARF_RISCV64_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS) DEF(CLANGDWARF_RISCV64_TARGET) $(PLATFORM_FLAGS)
*_CLANGDWARF_RISCV64_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) DEF(CLANGDWARF_RISCV64_TARGET)
*_CLANGDWARF_RISCV64_CC_XIPFLAGS = DEF(GCC_RISCV64_CC_XIPFLAGS)

DEBUG_CLANGDWARF_RISCV64_CC_FLAGS = DEF(CLANGDWARF_RISCV64_CC_FLAGS) $(PLATFORM_FLAGS) -flto -O1
DEBUG_CLANGDWARF_RISCV64_DLINK_FLAGS = DEF(CLANGDWARF_RISCV64_DLINK_FLAGS) -flto -Wl,-O1 -fuse-ld=lld -Wl,--no-pie,--no-relax
NOOPT_CLANGDWARF_RISCV64_CC_FLAGS = DEF(CLANGDWARF_RISCV64_CC_FLAGS) $(PLATFORM_FLAGS) -O0
NOOPT_CLANGDWARF_RISCV64_DLINK_FLAGS = DEF(CLANGDWARF_RISCV64_DLINK_FLAGS) -fuse-ld=lld -Wl,--no-pie,--no-relax
RELEASE_CLANGDWARF_RISCV64_CC_FLAGS = DEF(CLANGDWARF_RISCV64_CC_FLAGS) $(PLATFORM_FLAGS) -flto -O3
RELEASE_CLANGDWARF_RISCV64_DLINK_FLAGS = DEF(CLANGDWARF_RISCV64_DLINK_FLAGS) -flto -Wl,-O3 -fuse-ld=lld -Wl,--no-pie,--no-relax

#
#
# XCODE5 support
Expand Down
11 changes: 11 additions & 0 deletions BaseTools/Edk2ToolsBuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,13 @@ def Go(self):
shell_env.insert_path(self.OutputDir)

# Actually build the tools.
output_stream = edk2_logging.create_output_stream()
ret = RunCmd('nmake.exe', None,
workingdir=shell_env.get_shell_var("EDK_TOOLS_PATH"))
edk2_logging.remove_output_stream(output_stream)
problems = edk2_logging.scan_compiler_output(output_stream)
for level, problem in problems:
logging.log(level, problem)
if ret != 0:
raise Exception("Failed to build.")

Expand All @@ -143,7 +148,13 @@ def Go(self):

elif self.tool_chain_tag.lower().startswith("gcc"):
cpu_count = self.GetCpuThreads()

output_stream = edk2_logging.create_output_stream()
ret = RunCmd("make", f"-C . -j {cpu_count}", workingdir=shell_env.get_shell_var("EDK_TOOLS_PATH"))
edk2_logging.remove_output_stream(output_stream)
problems = edk2_logging.scan_compiler_output(output_stream)
for level, problem in problems:
logging.log(level, problem)
if ret != 0:
raise Exception("Failed to build.")

Expand Down
19 changes: 15 additions & 4 deletions BaseTools/Scripts/BinToPcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
import argparse
import re
import xdrlib
import io
import struct
import math

#
# Globals for help information
Expand Down Expand Up @@ -46,16 +49,24 @@ def ValidateGuidName (Argument):
raise argparse.ArgumentTypeError (Message)
return Argument

def XdrPackBuffer (buffer):
packed_bytes = io.BytesIO()
for unpacked_bytes in buffer:
n = len(unpacked_bytes)
packed_bytes.write(struct.pack('>L',n))
data = unpacked_bytes[:n]
n = math.ceil(n/4)*4
data = data + (n - len(data)) * b'\0'
packed_bytes.write(data)
return packed_bytes.getvalue()

def ByteArray (Buffer, Xdr = False):
if Xdr:
#
# If Xdr flag is set then encode data using the Variable-Length Opaque
# Data format of RFC 4506 External Data Representation Standard (XDR).
#
XdrEncoder = xdrlib.Packer ()
for Item in Buffer:
XdrEncoder.pack_bytes (Item)
Buffer = bytearray (XdrEncoder.get_buffer ())
Buffer = bytearray (XdrPackBuffer (Buffer))
else:
#
# If Xdr flag is not set, then concatenate all the data
Expand Down
62 changes: 51 additions & 11 deletions CryptoPkg/CryptoPkg.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
"LicenseCheck": {
"IgnoreFiles": [
# These directories contain auto-generated OpenSSL content
"Library/OpensslLib/IA32",
"Library/OpensslLib/IA32Gcc",
"Library/OpensslLib/X64",
"Library/OpensslLib/X64Gcc",
"Library/Include/openssl"
"Library/OpensslLib/OpensslGen",
"Library/OpensslLib/OpensslStub/crypto/objects",
"Library/OpensslLib/OpensslStub/openssl"
]
},
"EccCheck": {
Expand All @@ -30,14 +28,13 @@
## Both file path and directory path are accepted.
"IgnoreFiles": [
"Library/OpensslLib/openssl",
"Library/Include/openssl",
"Library/Include/crypto",
"Library/OpensslLib/OpensslGen",
# The unit testing folder is not to be checked
"Test/UnitTest",
# This has OpenSSL interfaces that aren't UEFI spec compliant
"Library/BaseCryptLib/SysCall",
# This has OpenSSL interfaces that aren't UEFI spec compliant
"Library/OpensslLib/rand_pool.c",
"Library/OpensslLib/OpensslStub",
# This has OpenSSL interfaces that aren't UEFI spec compliant
"Library/Include/CrtLibSupport.h",
# This has OpenSSL interfaces that aren't UEFI spec compliant
Expand Down Expand Up @@ -96,9 +93,52 @@
# options defined in .pytool/Plugin/UncrustifyCheck
"UncrustifyCheck": {
"IgnoreFiles": [
"opensslconf.h",
"dso_conf.h",
"opensslconf_generated.h"
"Library/OpensslLib/OpensslGen/include/crypto/bn_conf.h",
"Library/OpensslLib/OpensslGen/include/crypto/dso_conf.h",
"Library/OpensslLib/OpensslGen/include/openssl/asn1.h",
"Library/OpensslLib/OpensslGen/include/openssl/asn1t.h",
"Library/OpensslLib/OpensslGen/include/openssl/bio.h",
"Library/OpensslLib/OpensslGen/include/openssl/cmp.h",
"Library/OpensslLib/OpensslGen/include/openssl/cms.h",
"Library/OpensslLib/OpensslGen/include/openssl/conf.h",
"Library/OpensslLib/OpensslGen/include/openssl/configuration-ec.h",
"Library/OpensslLib/OpensslGen/include/openssl/configuration-noec.h",
"Library/OpensslLib/OpensslGen/include/openssl/configuration.h",
"Library/OpensslLib/OpensslGen/include/openssl/crmf.h",
"Library/OpensslLib/OpensslGen/include/openssl/crypto.h",
"Library/OpensslLib/OpensslGen/include/openssl/ct.h",
"Library/OpensslLib/OpensslGen/include/openssl/err.h",
"Library/OpensslLib/OpensslGen/include/openssl/ess.h",
"Library/OpensslLib/OpensslGen/include/openssl/fipskey.h",
"Library/OpensslLib/OpensslGen/include/openssl/lhash.h",
"Library/OpensslLib/OpensslGen/include/openssl/ocsp.h",
"Library/OpensslLib/OpensslGen/include/openssl/opensslv.h",
"Library/OpensslLib/OpensslGen/include/openssl/pkcs12.h",
"Library/OpensslLib/OpensslGen/include/openssl/pkcs7.h",
"Library/OpensslLib/OpensslGen/include/openssl/safestack.h",
"Library/OpensslLib/OpensslGen/include/openssl/srp.h",
"Library/OpensslLib/OpensslGen/include/openssl/ssl.h",
"Library/OpensslLib/OpensslGen/include/openssl/ui.h",
"Library/OpensslLib/OpensslGen/include/openssl/x509.h",
"Library/OpensslLib/OpensslGen/include/openssl/x509v3.h",
"Library/OpensslLib/OpensslGen/include/openssl/x509_vfy.h",
"Library/OpensslLib/OpensslGen/providers/common/der/der_digests_gen.c",
"Library/OpensslLib/OpensslGen/providers/common/der/der_ecx_gen.c",
"Library/OpensslLib/OpensslGen/providers/common/der/der_ec_gen.c",
"Library/OpensslLib/OpensslGen/providers/common/der/der_rsa_gen.c",
"Library/OpensslLib/OpensslGen/providers/common/der/der_wrap_gen.c",
"Library/OpensslLib/OpensslGen/providers/common/include/prov/der_digests.h",
"Library/OpensslLib/OpensslGen/providers/common/include/prov/der_ec.h",
"Library/OpensslLib/OpensslGen/providers/common/include/prov/der_ecx.h",
"Library/OpensslLib/OpensslGen/providers/common/include/prov/der_rsa.h",
"Library/OpensslLib/OpensslGen/providers/common/include/prov/der_wrap.h",
"Library/OpensslLib/OpensslStub/uefiprov.c",
"Library/OpensslLib/OpensslStub/crypto/objects/obj_dat.h",
"Library/OpensslLib/OpensslStub/crypto/objects/obj_dat.c",
"Library/OpensslLib/OpensslStub/openssl/obj_mac.h",
"Library/OpensslLib/OpensslStub/crypto/evp/pmeth_lib.c",
"Library/OpensslLib/OpensslStub/crypto/x509/x_pubkey.c",
"Library/OpensslLib/OpensslStub/crypto/evp/digest.c"
]
}
}
9 changes: 9 additions & 0 deletions CryptoPkg/CryptoPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@
[Includes.Common.Private]
Private
Library/Include
Library/OpensslLib/OpensslStub
Library/OpensslLib/openssl/include
Library/OpensslLib/openssl/providers/common/include
Library/OpensslLib/openssl/providers/implementations/include
Library/OpensslLib/OpensslGen/include
Library/OpensslLib/OpensslGen/providers/common/include
Library/MbedTlsLib/Include
Library/MbedTlsLib/mbedtls
Library/MbedTlsLib/mbedtls/include
Library/MbedTlsLib/mbedtls/include/mbedtls

[LibraryClasses]
## @libraryclass Provides basic library functions for cryptographic primitives.
Expand Down
12 changes: 6 additions & 6 deletions CryptoPkg/CryptoPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@
<LibraryClasses>
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
<BuildOptions>
MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:64
MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:256
MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:4096
MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:4096
}
!endif

Expand Down Expand Up @@ -522,8 +522,8 @@
<LibraryClasses>
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
<BuildOptions>
MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:64
MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:256
MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:4096
MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:4096
}
#
# CryptoSmm with OpensslLib instance with no SSL or EC services
Expand Down Expand Up @@ -575,8 +575,8 @@
<LibraryClasses>
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
<BuildOptions>
MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:64
MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:256
MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:4096
MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:4096
}
!endif

Expand Down
Loading