<feed xmlns='http://www.w3.org/2005/Atom'>
<title>efi-boot-shim.git/Cryptlib, branch 15.7</title>
<subtitle> (mirror of https://github.com/vyos/efi-boot-shim.git)
</subtitle>
<id>https://git.amelek.net/vyos/efi-boot-shim.git/atom?h=15.7</id>
<link rel='self' href='https://git.amelek.net/vyos/efi-boot-shim.git/atom?h=15.7'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/'/>
<updated>2022-11-15T18:07:29+00:00</updated>
<entry>
<title>CryptoPkg/BaseCryptLib: fix NULL dereference</title>
<updated>2022-11-15T18:07:29+00:00</updated>
<author>
<name>Jian J Wang</name>
<email>jian.j.wang@intel.com</email>
</author>
<published>2019-04-25T15:42:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=53509eaf2253e23bfb552e9386fd0877abe592b4'/>
<id>urn:sha1:53509eaf2253e23bfb552e9386fd0877abe592b4</id>
<content type='text'>
AuthenticodeVerify() calls OpenSSLs d2i_PKCS7() API to parse asn encoded
signed authenticode pkcs#7 data. when this successfully returns, a type
check is done by calling PKCS7_type_is_signed() and then
Pkcs7-&gt;d.sign-&gt;contents-&gt;type is used. It is possible to construct an asn1
blob that successfully decodes and have d2i_PKCS7() return a valid pointer
and have PKCS7_type_is_signed() also return success  but have Pkcs7-&gt;d.sign
be a NULL pointer.

Looking at how PKCS7_verify() [inside of OpenSSL] implements checking for
pkcs7 structs it does the following:
- call PKCS7_type_is_signed()
- call PKCS7_get_detached()
Looking into how PKCS7_get_detatched() is implemented, it checks to see if
p7-&gt;d.sign is NULL or if p7-&gt;d.sign-&gt;contents-&gt;d.ptr is NULL.

As such, the fix is to do the same as OpenSSL after calling d2i_PKCS7().
- Add call to PKS7_get_detached() to existing error handling

Cc: Chao Zhang &lt;chao.b.zhang@intel.com&gt;
Cc: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
Signed-off-by: Jian J Wang &lt;jian.j.wang@intel.com&gt;
Cherry-picked-from: https://github.com/tianocore/edk2/commit/26442d11e620a9e81c019a24a4ff38441c64ba10
</content>
</entry>
<entry>
<title>Make CopyMem() work with EFI's declaration</title>
<updated>2021-09-07T21:05:04+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-08-04T17:24:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=e13ac7386ea425c9222e05a2f9879d5af5cb91f6'/>
<id>urn:sha1:e13ac7386ea425c9222e05a2f9879d5af5cb91f6</id>
<content type='text'>
EFI_BOOT_SERVICES includes CopyMem() and SetMem() functions which are
marked EFIAPI, and in the case of CopyMem() does not mark the source
argument as CONST.

This patch makes all our invocations work with that, so (once gnu-efi's
implementation is fixed to match) we can use the existing implementation
as the implementation in a mock EFI_BOOT_SERVICES.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>More va_* work</title>
<updated>2021-03-12T09:15:01+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-03-11T21:48:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=4457d79ce0ea638e7732f5529bf13849e290940d'/>
<id>urn:sha1:4457d79ce0ea638e7732f5529bf13849e290940d</id>
<content type='text'>
Be much more explicit about exactly which va_* stuff comes from which
ABI in both shim and gnu-efi.  This fixes the problem where we see:

| (null):0:(null)() v-&gt;name:"(null)" v-&gt;rtname:"(null)"
| (null):0:(null)() v-&gt;data_size:0 v-&gt;data:0x0

and similar messages where everything is NULL.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>openssl: nerf some -W flags for clang.</title>
<updated>2021-03-12T09:15:01+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-03-11T16:40:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=df74fff124a84428c9717a89ff00ca0931d09c52'/>
<id>urn:sha1:df74fff124a84428c9717a89ff00ca0931d09c52</id>
<content type='text'>
Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>make: use -Wextra (minus some obnoxious bits)</title>
<updated>2021-03-10T20:54:20+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-03-09T22:15:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=1bc4bf063adf57a17e5d6d8dc6399f03080a0566'/>
<id>urn:sha1:1bc4bf063adf57a17e5d6d8dc6399f03080a0566</id>
<content type='text'>
gcc -Wextra, has a lot of good, useful checks, a few obnoxious checks,
and a few absolutely insane checks.

This enables -Wextra, but disables -Wmissing-field-initializers, because
it is irrational nonsense that just leads to worse code.  It also
disables some specific things in the Cryptlib and Cryptlib/OpenSSL
trees:

Both:
-Wno-unused-parameter
 - there are a fair number of functions that have to conform to some API
   or another but have arguments that are unused, but haven't been
   marked with UNUSED; we don't need to see warnings about them.

Cryptlib/OpenSSL:
-Wno-empty-body
 - functions that exist merely to populate some API
-Wno-implicit-fallthrough
 - these probably should get fixed someday, but I bet upstream will do
   it and rebasing will solve it
-Wno-old-style-declaration
 - this gripes if you write "const static" instead of "static const".
   Again I expect rebasing will fix it at some point.
-Wno-unused-but-set-variable
 - self explanatory, and again, I expect a rebase to solve it someday.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>openssl: fix various build errors and warnings</title>
<updated>2021-03-10T20:54:20+00:00</updated>
<author>
<name>Paul Moore</name>
<email>pmoore2@cisco.com</email>
</author>
<published>2021-03-09T17:15:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=f5493df9c626a7436803d1e68b0118f4d041e0fa'/>
<id>urn:sha1:f5493df9c626a7436803d1e68b0118f4d041e0fa</id>
<content type='text'>
There were a couple cases of "uninitialized variable" warnings in the
imported OpenSSL code; I used the current OpenSSL code as a guide for
picking the default values used here.

On my dev system there is one remaining build warning in OpenSSL's
crypto/asn1/x_pkey.c:X509_PKEY_new() function.  Unfortunately it
involves some preprocessor crimes and the fix would be a bit ugly.
Fortunately it appears the warning here is harmless and can be
ignored.

As a point of reference, my build system is a current Arch install
with GCC v10.2.0 and GNU-EFI v 3.0.12.

Signed-off-by: Paul Moore &lt;pmoore2@cisco.com&gt;
</content>
</entry>
<entry>
<title>Fix stdarg to work the same everywhere.</title>
<updated>2021-03-10T20:54:20+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-03-09T19:40:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=9beca885c29c77bb901547321a5ce6fd3c9c8ee3'/>
<id>urn:sha1:9beca885c29c77bb901547321a5ce6fd3c9c8ee3</id>
<content type='text'>
This gets us the same working definition for VA_* va_* etc everywhere,
and it's the same definition edk2 is using.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>Consolidate most of our standard lib functions to lib</title>
<updated>2021-03-10T20:54:20+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-03-09T16:54:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=766aac4d5cfbe76026be5ce718b0883ee211f323'/>
<id>urn:sha1:766aac4d5cfbe76026be5ce718b0883ee211f323</id>
<content type='text'>
Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>Fix Cryptlib's va_* definitions.</title>
<updated>2021-03-10T20:54:20+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-03-09T17:16:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=78809820b5a3f79a0bfbec00e630e40011acf4ec'/>
<id>urn:sha1:78809820b5a3f79a0bfbec00e630e40011acf4ec</id>
<content type='text'>
Some time ago, commit e571428e212 ("Update to openssl to 1.0.2e")
changed the way we define the va_* (and VA_*) functions and macros.
Unfortunately, it only changed for some parts of the tree, and the
different parts of the tree need to both call each other and use the
same types in all cases.  Additionally, they need to all be able to call
gnu-efi functions such as VPrint, which means they need the same va_list
type definitions everywhere.

This partially reverts that patch, adding EFIAPI back and unsetting
NO_BUILTIN_VA_FUNCS everywhere.
</content>
</entry>
<entry>
<title>Restructure our includes.</title>
<updated>2021-03-10T20:54:20+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-03-09T16:42:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=f033a1da9f4c3acf7e3dfef906d01e348b6fcf42'/>
<id>urn:sha1:f033a1da9f4c3acf7e3dfef906d01e348b6fcf42</id>
<content type='text'>
This re-structures our includes so we can be sure everything is always
including all the system headers in a uniform, predictable way.

Temporarily it also adds a bunch of junk at all the places we use
variadic functions to specifically pick either the MS (cdecl) or ELF
ABIs.

I'm not 100% sure that's all correct (see later patch) but it's enough
to allow this to build.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
</feed>
