Files
Sergii Dmytruk 1d82490f1d CryptoPkg/Library/BaseCryptLibMbedTls: use calloc()/free() in CryptPkcs7VerifyCommon.c
AllocateZeroPool() can't be used after ExitBootServices() and that's
what happened without this change when OS was trying to update "dbx"
variable.  It requires use of authenticated variables therefore PKCS 7
and this particular file of BaseCryptLibMbedTls thus causing firmware to
crash.

There was no calloc() so added it as a form of an API to hide the fact
that memory is managed differently in different phases.

Using calloc()/free() outside of runtime (RT) phase causes trouble, so
non-RT modules will continue to rely on MemoryAllocationLib through
redirection in MbedTlsCrtLib while RT modules will use a heap invoked by
MbedTlsCrtRuntimeLib.

While at it, fixed memory leaks in WrapPkcs7Data() and
Pkcs7GetSigners().

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2025-03-10 20:16:26 +02:00
..
2021-12-07 17:24:28 +00:00
2022-04-12 14:39:01 +00:00