<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/CryptoPkg/Library/BaseCryptLib/Hash, branch master</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2026-10-27T09:04:14+00:00</updated>
<entry>
<title>CryptoPkg/BaseCryptLib: Use SHA512_Final() in Sha512Final()</title>
<updated>2026-10-27T09:04:14+00:00</updated>
<author>
<name>Shubham Aggarwal</name>
<email>shubagga@google.com</email>
</author>
<published>2026-10-26T10:52:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=13cb2f1d98573fd2c7bd2797f2007ce51ba1716a'/>
<id>urn:sha1:13cb2f1d98573fd2c7bd2797f2007ce51ba1716a</id>
<content type='text'>
Sha512Final() finalizes the SHA-512 context with SHA384_Final() instead
of SHA512_Final(). This has been the case since the file was added in
commit 2ac68e8b549b ("CryptoPkg Updates to support RFC3161 timestamp
signature verification."). All the other functions in the file call the
SHA384_*() or SHA512_*() functions of their own algorithm, including
Sha512HashAll(), which has used SHA512_Init(), SHA512_Update() and
SHA512_Final() since commit f335d91a3bfe ("CryptoPkg/BaseCryptLib:
avoid using SHA512()").

With OpenSSL, this happens to work: SHA384_Final() simply calls
SHA512_Final(), which writes as many bytes as the md_len field of the
context specifies, so a context set up by SHA512_Init() still yields
the full 64-byte SHA-512 digest.

However, SHA384_Final() is meant to be paired with SHA384_Init(), and
to produce the 48-byte SHA-384 digest. Crypto libraries that implement
the same API may enforce this, by asserting that md_len is the SHA-384
digest size and writing only 48 bytes. With an OpensslLib instance
based on such a library, every SHA-512 digest computed by
Sha512Final(), such as the one returned by Hash2DxeCrypto for
EFI_HASH2_PROTOCOL, either triggers the assertion or, if assertions are
disabled, is truncated to 48 bytes, leaving the last 16 bytes of the
HashValue buffer unwritten.

Use SHA512_Final(), which matches the SHA512_Init() and SHA512_Update()
calls in Sha512Init() and Sha512Update(). There is no functional change
with OpenSSL.

Signed-off-by: Shubham Aggarwal &lt;shubagga@google.com&gt;
</content>
</entry>
<entry>
<title>CryptoPkg/BaseCryptLib: Remove redundant uint64_t typedef</title>
<updated>2026-10-23T23:40:47+00:00</updated>
<author>
<name>Thamballi Sreelalitha</name>
<email>sreelali@qti.qualcomm.com</email>
</author>
<published>2026-10-21T06:01:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=280d35400e689afeb41e53fc1fb1f16b138d684a'/>
<id>urn:sha1:280d35400e689afeb41e53fc1fb1f16b138d684a</id>
<content type='text'>
The typedef 'uint64_t' in CryptParallelHash.h conflicts with the same
typedef defined in openssl/include/openssl/e_os2.h when both headers are
included in the same translation unit. This causes a redefinition error
with strict compiler flags (-Werror,-Wtypedef-redefinition).

The uint64_t type is already provided through the include chain:
InternalCryptLib.h -&gt; openssl/evp.h -&gt; openssl/e_os2.h

Removing the redundant typedef resolves the conflict while maintaining
compatibility, as the type is still available through the proper include
chain.

Signed-off-by: Thamballi Sreelalitha &lt;sreelali@qti.qualcomm.com&gt;
</content>
</entry>
<entry>
<title>CryptoPkg: Replace include guards with #pragma once</title>
<updated>2026-02-23T21:01:28+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2026-02-03T17:33:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=0f42cae11c06187ef72f34cfabdca200346ef660'/>
<id>urn:sha1:0f42cae11c06187ef72f34cfabdca200346ef660</id>
<content type='text'>
Replace traditional `#ifndef`/`#define`/`#endif` include guards with
`#pragma` once.

`#pragma once` is a widely supported preprocessor directive that
prevents header files from being included multiple times. It is
supported by all toolchains used to build edk2: GCC, Clang/LLVM, and
MSVC.

Does not include updates to OpenSSL generated header files checked
into the repo. Those in `CryptoPkg\Library\OpensslLib\OpensslGen\`.

Compared to macro-based include guards, `#pragma once`:

- Eliminates the risk of macro name collisions or copy/paste errors
  where two headers inadvertently use the same guard macro.
- Eliminate inconsistency in the way include guard macros are named
  (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.).
- Reduces boilerplate (three lines replaced by one).
- Avoids polluting the macro namespace with guard symbols.
- Can improve build times as the preprocessor can skip re-opening the
  file entirely, rather than re-reading it to find the matching
  `#endif` ("multiple-include optimization").
  - Note that some compilers may already optimize traditional include
    guards, by recognzining the idiomatic pattern.

This change is made acknowledging that overall portability of the
code will technically be reduced, as `#pragma once` is not part of the
C/C++ standards.

However, this is considered acceptable given:

1. edk2 already defines a subset of supported compilers in
   BaseTools/Conf/tools_def.template, all of which have supported
   `#pragma once` for over two decades.
2. There have been concerns raised to the project about inconsistent
   include guard naming and potential macro collisions.

Approximate compiler support dates:

- MSVC: Supported since Visual C++ 4.2 (1996)
- GCC: Supported since 3.4 (2004)
  (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html)
- Clang (LLVM based): Since initial release in 2007

Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
</content>
</entry>
<entry>
<title>CryptoPkg: Resolve CodeQL Errors</title>
<updated>2025-04-21T02:14:50+00:00</updated>
<author>
<name>Oliver Smith-Denny</name>
<email>osde@microsoft.com</email>
</author>
<published>2025-04-18T20:51:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=2e85d12685b950dc8ff54130f9d623a120f852d6'/>
<id>urn:sha1:2e85d12685b950dc8ff54130f9d623a120f852d6</id>
<content type='text'>
This patch updates several CodeQL errors for potential null pointer
access and unguarded header conclusion across production and test
code that have been flagged in the build/security tab in GitHub.

Signed-off-by: Oliver Smith-Denny &lt;osde@microsoft.com&gt;
</content>
</entry>
<entry>
<title>CryptoPkg/BaseCryptLib: add next parameter to SHA3_squeeze</title>
<updated>2024-12-06T08:01:25+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2024-09-09T21:26:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=9895fe25ac9579cfd85327c7b6d8ee271539c0e5'/>
<id>urn:sha1:9895fe25ac9579cfd85327c7b6d8ee271539c0e5</id>
<content type='text'>
Needed for openssl 3.3.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>CryptoPkg/BaseCryptLib: adapt CryptSm3.c to openssl 3.0 changes.</title>
<updated>2023-08-09T07:10:31+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2023-08-03T04:37:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=63c8d160ae32cbf51db9ea58061cc8976fae4980'/>
<id>urn:sha1:63c8d160ae32cbf51db9ea58061cc8976fae4980</id>
<content type='text'>
Functions have been renamed.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Cc: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
Cc: Xiaoyu Lu &lt;xiaoyu1.lu@intel.com&gt;
Cc: Guomin Jiang &lt;guomin.jiang@intel.com&gt;
Reviewed-by: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
Acked-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Tested-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Tested-by: Brian J. Johnson &lt;brian.johnson@hpe.com&gt;
Tested-by: Kenneth Lautner &lt;klautner@microsoft.com&gt;
</content>
</entry>
<entry>
<title>CryptoPkg/BaseCryptLib: avoid using SHA512()</title>
<updated>2023-03-07T09:59:50+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2023-02-13T19:19:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=f335d91a3bfe47de702af564eb3661ab8906d1be'/>
<id>urn:sha1:f335d91a3bfe47de702af564eb3661ab8906d1be</id>
<content type='text'>
In openssl 3.0 SHA512() goes through the provider logic,
requiring a huge amount of openssl code.  The individual
functions do not, so use them instead.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
</content>
</entry>
<entry>
<title>CryptoPkg/BaseCryptLib: avoid using SHA384()</title>
<updated>2023-03-07T09:59:50+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2023-02-13T19:19:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=5a6455e04cc2d1eab8124a7b7f5465c2f475c59c'/>
<id>urn:sha1:5a6455e04cc2d1eab8124a7b7f5465c2f475c59c</id>
<content type='text'>
In openssl 3.0 SHA384() goes through the provider logic,
requiring a huge amount of openssl code.  The individual
functions do not, so use them instead.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
</content>
</entry>
<entry>
<title>CryptoPkg/BaseCryptLib: avoid using SHA256()</title>
<updated>2023-03-07T09:59:50+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2023-02-13T19:19:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=7fc183df71b0aa2106139677258227662ce1f004'/>
<id>urn:sha1:7fc183df71b0aa2106139677258227662ce1f004</id>
<content type='text'>
In openssl 3.0 SHA256() goes through the provider logic,
requiring a huge amount of openssl code.  The individual
functions do not, so use them instead.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
</content>
</entry>
<entry>
<title>CryptoPkg/BaseCryptLib: avoid using SHA1()</title>
<updated>2023-03-07T09:59:50+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2023-02-13T19:19:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=437ed29f278687140c29e00f1a0e4204f25e2d33'/>
<id>urn:sha1:437ed29f278687140c29e00f1a0e4204f25e2d33</id>
<content type='text'>
In openssl 3.0 SHA1() goes through the provider logic,
requiring a huge amount of openssl code.  The individual
functions do not, so use them instead.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
</content>
</entry>
</feed>
