Commit Graph

461 Commits

Author SHA1 Message Date
Liwei Song
4602842eed sign_rpm_ext.bbclass: check the length of GPG_PATH
connect to gpg agent may failed due to the GPG_PATH is too long,
check and raise an error if the length is greater than 80.

Signed-off-by: Liwei Song <liwei.song@windriver.com>
2019-12-05 11:22:07 +08:00
Changqing Li
a100ee126a sign_rpm_ext.bbclass: remove prefuncs for do_package_write_rpm and
do_rootfs

in commit 393b80fa, prefuncs of do_package_write_rpm/do_rootfs
have been replace by (task)_prepend in this bbclass, so remove it.

Signed-off-by: Changqing Li <changqing.li@windriver.com>
2019-11-29 14:38:11 +08:00
Hongxu Jia
08c3f81a5f efitools: do not do_sign if GRUB_SIGN_VERIFY not enabled
If GRUB_SIGN_VERIFY is not enabled, do_sign will fail in which GPG_PATH
is not set (--homedir None)
...
|DEBUG: Executing python function do_sign
|NOTE: Running: echo "SecureCore" | tmp-glibc/hosttools/gpg  --pinentry-mode
loopback --batch --homedir None -u "SecureBootCore" --detach-sign
--passphrase-fd 0 "tmp-glibc/work/core2-32-wrs-linux/efitools/
1.9.2+gitAUTOINC+392836a46c-r0/image/boot/efi/EFI/BOOT/LockDown.efi"
|ERROR: Failed to sign: tmp-glibc/work/core2-32-wrs-linux/efitools/
1.9.2+gitAUTOINC+392836a46c-r0/image/boot/efi/EFI/BOOT/LockDown.efi
...

Since GPG_PATH is set in do_sign's prefunc check_boot_public_key if
GRUB_SIGN_VERIFY is enabled, add the same condition to do_sign

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2019-11-19 18:09:03 +08:00
Hongxu Jia
73602a5eea efitools-native: Fix compilation problem with latest /usr/include/efi
Since commit [382ffa1 efitools: Fix compilation problem with
latest /usr/include/efi], we should apply the fix to native also.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2019-11-19 16:05:17 +08:00
Joe Slater
b2bb64d9e6 sbsigntool-native: specify TMPDIR
Issue: LIN1018-450

Under extremely rare circumstances, access can be denied to /tmp,
so we specify a local TMPDIR.

This is a cherry-pick of 886c44b from WRL 10.17.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-14 08:42:33 +08:00
Robert Yang
9e63c16057 cryptsetup_%.bbappend: Fix for native
Issue: LIN1019-2347

Fixed:
$ bitbake cryptsetup-native
[snip]
Nothing RPROVIDES 'lvm2-udevrules-native'
[snip]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-14 08:42:33 +08:00
Jason Wessel
691252f79f kernel-initramfs-efi-secure-boot.inc: Copy .sig files and .p7b
While refactoring the code to eliminate the overlap in the copy of the
.sig and .p7b files the UEFI_SELOADER test was not removed.  This
results in the .sig files not getting copied to the deploy directory
when using the GRUB_SIGN_VERIFY = "1".

All that is needed is to remove the UEFI_SELOADER test statement.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-14 08:42:17 +08:00
Jason Wessel
ca003d11bb lvm2: Fix hanging dmcrypt volumes on boot
The initrd takes care of starting the luks volumes and activing the
dmcrypt udev rules.  The udev rule required a modification to deal
with volumes that had already been started, else the cold plug event
that runs at user space startup puts the dmcrypt device into a state
that systemd cannot manage it.

[ Issue: LINUXEXEC-2450 ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Jason Wessel
d63b6d273b layer.conf gpg boot key sample: Add the gpg boot key sample files
Sample keys are required in order for the signing to succeed when
using grub boot verification.  The keys are only used when
GRUB_SIGN_VERIFY = "1", and it is intended that and user would
generate new keys with the create-user-key-store.sh.

[ Issue: LINUXEXEC-2450 ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Jason Wessel
31d2105b7a secure boot: Make SELoader optional and copy sig files when GRUB_SIGN_VERIFY=1
This commit makes the SELoader entire optional and allows it to be
removed, with the intended replacement being to use grub's built in
gpg key verification.

It will be possible in a template or local.conf:

UEFI_SELOADER = "0"
GRUB_SIGN_VERIFY = "1"

[ Issue: LINUXEXEC-2450 ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Jason Wessel
59a1f79ad8 packagegroup-luks.inc: Addlvm2-udevrules
The lvm2-udevrules is required else udev will never perform the device
notification when an encrypted volume is initially created.

[ Issue: LINUXEXEC-2450 ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Jason Wessel
c0b514f1ac create-user-key-store.sh: Update for OSTree and ease of use
The create-user-key-store.sh was changed in a number ways to improve
the usability with other layers that will consume the key services
provided by meta-secure-core.

New features:

* A safety check was added that keys can only be written to a fresh
   empty directory.

* The script can be run non-iteractively or interactively for the ease of use.

* gpg 1.x support and gpg 2.x support work with the passphrases

* A keys.conf is generated to allow a single line to be written into the
  local.conf with all the keys.

An interactive session looks like:
==================================

./create-user-key-store.sh -d /tmp/test
KEYS_DIR: /tmp/test
Enter RPM/OSTree GPG keyname (use dashes instead of spaces) [default: PKG-SecureCore]: PKG-Sample-Man
Enter RPM/OSTree GPG e-mail address [default: SecureCore@foo.com]: sample.man@sample.com
Enter RPM/OSTREE GPG comment [default: Signing Key]: Sample Signing Key
  Using boot loader gpg name: BOOT-Sample-Man
  Using boot loader gpg email: sample.man@sample.com
  Using boot loader gpg comment: Sample Signing Key
    Press control-c now if and use -bn -bm -bc arguments if you want
    different values other than listed above
Enter RPM/OSTREE passphrase: abc1234
Enter IMA passphrase: 1234pass
Enter boot loader GPG passphrase: bootup
Enter boot loader locked configuration password(e.g. grub pw): root

MASTER_KEYS_DIR = "/tmp/test"

IMA_KEYS_DIR = "${MASTER_KEYS_DIR}/ima_keys"
IMA_EVM_KEY_DIR = "${MASTER_KEYS_DIR}/ima_keys"
RPM_KEYS_DIR = "${MASTER_KEYS_DIR}/rpm_keys"
BOOT_KEYS_DIR = "${MASTER_KEYS_DIR}/boot_keys"
MOK_SB_KEYS_DIR = "${MASTER_KEYS_DIR}/mok_sb_keys"
SYSTEM_TRUSTED_KEYS_DIR = "${MASTER_KEYS_DIR}/system_trusted_keys"
UEFI_SB_KEYS_DIR = "${MASTER_KEYS_DIR}/uefi_sb_keys"
GRUB_PUB_KEY = "${MASTER_KEYS_DIR}/boot_keys/boot_pub_key"
GRUB_PW_FILE = "${MASTER_KEYS_DIR}/boot_keys/boot_cfg_pw"
OSTREE_GPGDIR = "${MASTER_KEYS_DIR}/rpm_keys"

RPM_GPG_NAME = "PKG-Sample-Man"
RPM_GPG_PASSPHRASE = "abc1234"
RPM_FSK_PASSWORD = "1234pass"
BOOT_GPG_NAME = "BOOT-Sample-Man"
BOOT_GPG_PASSPHRASE = "bootup"
OSTREE_GPGID = "PKG-Sample-Man"
OSTREE_GPG_PASSPHRASE = "abc1234"
OSTREE_GRUB_PW_FILE = "${GRUB_PW_FILE}"

[ Issue: LINUXEXEC-2450 ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Jason Wessel
01f67e4c7e grub: Make SELoader optional and add gpg verify support
Allow SELoader to be an optional component for secure boot
verification.  The GPG_SIGN_VERIFY variable was added to control the
ability to have grub perform all of the verification of the loaded
files using a public key which gets built into grub at the time that
mkimage is run.

It is not intended that GPG_SIGN_VERIFY and UEFI_SELOADER would both
be set to "1".  While this configuration could work, it makes very
little sense to use the system that way.

Also enabled is the tftp feature for grub as a builtin.  This allows
grub to start from the network when the UEFI is configured to boot off
the network with tftp.

[ Issue: LINUXEXEC-2450 ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Jason Wessel
e19748f11e cryptfs-tpm2: Add support for QEMU swtpm tpm2
The device nodes are in a different place when using the swtpm + ovfm
+ qemu.  The luks-setup.sh needs to look in an additional location to
properly support qemu.

[ Issue: LINUXEXEC-2450 ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Jason Wessel
4a7afb4477 sign_rpm_ext.bbclass, user-key-store.bbclass: Add boot loader signing
This changes the rpm signing setup to use a generic routine
check_gpg_key(), in order that the boot loader gpg signing can use the
same infrastructure.

For now the boot loader gpg signing will only support grub and
introduces the variable:

   GRUB_SIGN_VERIFY = "1"

This variable is a control point to activate the code in grub-efi to
perform file verification of any file it loads against a gpg key which
is linked into the boot loader with grub-mkimage.  It will also cause
all the other files such as the kernel, initramfs and LockDown.efi to
be signed such that grub will verify the files.

[ Issue: LINUXEXEC-2450 ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Jason Wessel
363c7a606a secure-core-image: Remove packagegroup-core-lsb
oe-core commit fb064356af615d67d85b65942103bf943d84d290 removed the
packagegroup-core-lsb, so it must be removed from any other image
recipes which refernce the packagegroup-core-lsb.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Jason Wessel
382ffa19cf efitools: Fix compilation problem with latest /usr/include/efi
| gcc  -I/opt/tmp/work/x86_64-linux/efitools-native/1.9.2+gitAUTOINC+392836a46c-r0/git/include/ -I/opt/tmp/work/x86_64-linux/efitools-native/1.9.2+gitAUTOINC+392836a46c-r0/recipe-sysroot-native/usr/include -I/opt/tmp/work/x86_64-linux/efitools-native/1.9.2+gitAUTOINC+392836a46c-r0/recipe-sysroot-native/usr/include/efi -I/opt/tmp/work/x86_64-linux/efitools-native/1.9.2+gitAUTOINC+392836a46c-r0/recipe-sysroot-native/usr/include/efi/x86_64 -I/opt/tmp/work/x86_64-linux/efitools-native/1.9.2+gitAUTOINC+392836a46c-r0/recipe-sysroot-native/usr/include/efi/protocol -O2 -g  -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -fno-toplevel-reorder -DBUILD_EFI -c console.c -o console.efi.o
| console.c:360:5: error: ‘EFI_WARN_UNKOWN_GLYPH’ undeclared here (not in a function); did you mean ‘EFI_WARN_UNKNOWN_GLYPH’?
|   {  EFI_WARN_UNKOWN_GLYPH,      L"Warning Unknown Glyph"},
|      ^~~~~~~~~~~~~~~~~~~~~
|      EFI_WARN_UNKNOWN_GLYPH
| ../Make.rules:113: recipe for target 'console.efi.o' failed

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Jason Wessel
fab7b8d93d shim: Fix compilation problem with latest /usr/include/efi
| x86_64-poky-linux-gcc -ggdb -O0 -fno-stack-protector -fno-strict-aliasing -fpic -fshort-wchar -Wall -Wsign-compare -Werror -fno-builtin -Werror=sign-compare -ffreestanding -std=gnu89 -I/opt/tmp/work/core2-64-poky-linux/shim/12+gitAUTOINC+5202f80c32-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux/../../lib/x86_64-poky-linux/gcc/x86_64-poky-linux/9.2.0/include -DDEFAULT_LOADER=L"\SELoaderx64.efi" -DDEFAULT_LOADER_CHAR="\SELoaderx64.efi" -nostdinc -I/opt/tmp/work/core2-64-poky-linux/shim/12+gitAUTOINC+5202f80c32-r0/git/Cryptlib -I/opt/tmp/work/core2-64-poky-linux/shim/12+gitAUTOINC+5202f80c32-r0/git/Cryptlib/Include -I/opt/tmp/work/core2-64-poky-linux/shim/12+gitAUTOINC+5202f80c32-r0/recipe-sysroot/usr/include/efi -I/opt/tmp/work/core2-64-poky-linux/shim/12+gitAUTOINC+5202f80c32-r0/recipe-sysroot/usr/include/efi/x86_64 -I/opt/tmp/work/core2-64-poky-linux/shim/12+gitAUTOINC+5202f80c32-r0/recipe-sysroot/usr/include/efi/protocol -I/opt/tmp/work/core2-64-poky-linux/shim/12+gitAUTOINC+5202f80c32-r0/git/include -iquote /opt/tmp/work/core2-64-poky-linux/shim/12+gitAUTOINC+5202f80c32-r0/git -iquote /opt/tmp/work/core2-64-poky-linux/shim/12+gitAUTOINC+5202f80c32-r0/git -DOVERRIDE_SECURITY_POLICY -DENABLE_HTTPBOOT -mno-mmx -mno-sse -mno-red-zone -nostdinc -maccumulate-outgoing-args -DEFI_FUNCTION_WRAPPER -DGNU_EFI_USE_MS_ABI -DNO_BUILTIN_VA_FUNCS -DMDE_CPU_X64 -DPAGE_SIZE=4096 -DEFI_ARCH=L"x64" -DDEBUGDIR=L"/usr/lib/debug/usr/share/shim/x64-12-_poky_3.0/" -DVENDOR_CERT_FILE="/opt/tmp/work/core2-64-poky-linux/shim/12+gitAUTOINC+5202f80c32-r0/vendor_cert.cer"   -c -o console.o console.c
| console.c:363:5: error: 'EFI_WARN_UNKOWN_GLYPH' undeclared here (not in a function); did you mean 'EFI_WARN_UNKNOWN_GLYPH'?
|   363 |  {  EFI_WARN_UNKOWN_GLYPH,      L"Warning Unknown Glyph"},
|       |     ^~~~~~~~~~~~~~~~~~~~~
|       |     EFI_WARN_UNKNOWN_GLYPH
| <builtin>: recipe for target 'console.o' failed
| make[1]: *** [console.o] Error 1
| make[1]: Leaving directory '/opt/tmp/work/core2-64-poky-linux/shim/12+gitAUTOINC+5202f80c32-r0/git/lib'
| Makefile:223: recipe for target 'lib/lib.a' failed
| make: *** [lib/lib.a] Error 2
| WARNING: exit code 1 from a shell command.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Jason Wessel
1473c05286 efitools: Uprev to fix LockDown.efi for UEFI built after 2018
Versions of the UEFI core from 2018 on will not work properly with
LockDown.efi's key install.  It will report that the PK key cannot be
installed due to the handling of the signature header with the PKCS7
data.  There are several other minor bug fixes, with the short log
shown below.

====

James Bottomley (13):
      cert-to-efi-hash-list: fix for openssl 1.1
      Version: 1.8.0
      Fix Fedora build
      Version: 1.8.1
      factor out variable signing code
      support engine based keys
      use SignedData instead of PKCS7 for variable updates
      Version: 1.9.0
      Makefile: Reverse the order of lib.a and -lcrypto
      Version: 1.9.1
      sign-efi-sig-list: add man page entry for engine option
      sha256: do not align raw section sizes
      Version: 1.9.2

pai-yi.huang (1):
      efi-updatevar: remove all authenticated attributes from signature

 Make.rules              |   6 ++---
 Makefile                |  12 +++++-----
 cert-to-efi-hash-list.c |   6 ++++-
 efi-updatevar.c         |  28 +++++++++++------------
 include/openssl_sign.h  |  10 ++++++++
 include/version.h       |   2 +-
 lib/Makefile            |   2 +-
 lib/openssl_sign.c      | 156 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/sha256.c            |   8 ++++---
 sign-efi-sig-list.c     |  59 +++++++++++------------------------------------
 10 files changed, 213 insertions(+), 76 deletions(-)
 create mode 100644 include/openssl_sign.h
 create mode 100644 lib/openssl_sign.c

[ Issue: LINUXEXEC-2450 ]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
2019-11-08 13:27:23 +08:00
Sandy
393b80fa35 sign_rpm_ext.bbclass: fix check_rpm_public_key failed while host not install gpg (#124)
Due to the following reasons, need to add the dependency to
task who needs to run check_rpm_public_key:
* packagegroup recipe don't have task prepare_recipe_sysroot
* varflags depends don't work for prefuncs

Signed-off-by: Changqing Li <changqing.li@windriver.com>
2019-11-07 17:31:03 +08:00
Sandy
99760f4771 sign_rpm_ext.bbclass: fix compile fail since missing gpg (#123)
there is a scenario that this bbclass is enabled globally,
all targets will inherit sign_rpm_ext. but this bbclass
need gpg to work, on some new distro like
ubuntun 19.04, gpg is not installed, so compile will failed.

fail cmd:
cmd = '%s --batch --homedir %s --passphrase %s --import %s' % \
            (gpg_bin, gpg_path, d.getVar('RPM_GPG_PASSPHRASE', True), gpg_key)
error:
base-files-3.0.14-r89 do_package_write_rpm: Failed to import gpg key (): /bin/sh: 1: --batch: not found

Signed-off-by: Changqing Li <changqing.li@windriver.com>
2019-11-06 15:35:51 +08:00
Zhao Yi
5698bb8529 grub-efi/boot-menu.inc: remove invalid menuentry (#122)
Currently the recovery menuentry is not available because we don't
provide bzImage_backup and initrd_backup. Remove this entry.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2019-11-01 18:21:09 +08:00
muvarov
e3678e964c conf/layer.conf: Add zeus to LAYERSERIES_COMPAT (#121)
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2019-11-01 08:39:17 +08:00
Yunguo Wei
701cbaf3c3 lib-evm-utils: using the correct algo for v2 signature (#120)
When using rpmsign (with --signfiles --fskpath) to sign RPM package,
the IMA signature is not correct, see:

$ getfattr -d -m - rootfs/usr/sbin/grpconv

file: rootfs/usr/sbin/grpconv
security.ima=0sAwIEDy1SEQP3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==

And the expected signature is like this:
$ getfattr -d -m - rootfs/usr/sbin/grpconv

file: rootfs/usr/sbin/grpconv
security.ima=0sAwIEDy1SEQEAA6s8DwmRCVutcrE8NvHWWYXlg8L1AwH5teu44prkKRwmhZQ52Oa4UQoZZlxER/SJ9tijbve8ZAv++KW8EqgP4iZjEGh8ke76rpiRU5glnG/U+HUjnilJBpzpMJHxyNbAiFoHMESeCOtrhY0zZIUXK3DnIuIJSwpfl2HaNFxRrE38EaqgV9IQ8QiWFCvgDYXoJDwc3KdhjKjs214tCfZpKO1w4QJl2n4llZHw2RTHIuUOsMhRDEXs6onLHmdmhvqgxIHt7IvsT9v7H8GnoaiX0xgzxk2o/mE5EtPrnMtUoGSQwdY8CAfUbCwAp0c5QlsrHk5RBmewjJ/jxd/K1uKp7w==

The root cause is libimaevm doesn't retrieve correct signing algo, so this patch
is making things right.

Signed-off-by: Yunguo Wei <yunguo.wei@windriver.com>
2019-10-10 18:10:52 +08:00
Hongxu Jia
69117bef3a linux-yocto-integrity.inc: fix 'uks_modsign_keys_dir' is not defined (#119)
Since commit [b41010c linux-yocto-integrity: fix modsign key path] applied,
if MODSIGN_ENABLED is "0", bbclass user-key-store will not be inherited
which causing 'uks_modsign_keys_dir' is not defined

Unconditionally inherit user-key-store, but conditionally invoke
uks_modsign_keys_dir

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2019-10-07 11:51:32 +08:00
Jia Zhang
2d8b45a3d8 Merge pull request #118 from lumag/drop-privkeys
Security: do not install private keys into rootfs
2019-10-01 09:29:24 +08:00
Dmitry Eremin-Solenikov
f2db9e0de6 meta-integrity: fix documentation
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
2019-09-30 17:10:15 +03:00
Dmitry Eremin-Solenikov
b41010c80c linux-yocto-integrity: fix modsign key path
Use modsign key directly from uks_modsign_keys_path(d), rather than from
installed package.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
2019-09-16 16:00:09 +03:00
Dmitry Eremin-Solenikov
24d27e9f97 packagegroup-ima: RRECOMMEND certificates rather than private keys
Do not even try pulling private keys into rootfs.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
2019-09-16 14:07:11 +03:00
Dmitry Eremin-Solenikov
51b2da4a41 key-store: drop private keys packages
Having a private key package might allow one to pull it into rootfs
which is really, really bad. So drop all private key packages.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
2019-09-16 14:06:06 +03:00
Jia Zhang
809a4774a0 Merge pull request #117 from 2005songliwei/master
secure-core:allow other layer overwrite INITRAMFS_IMAGE
2019-09-12 17:56:30 +08:00
Jiang Lu
56dbf2a67a secure-core:allow other layer overwrite INITRAMFS_IMAGE
Allow other layer overwrite $INITRAMFS_IMAGE.

Signed-off-by: Jiang Lu <lu.jiang@windriver.com>
Signed-off-by: Liwei Song <liwei.song@windriver.com>
2019-09-12 05:17:43 -04:00
Jia Zhang
0cea6e869f Merge pull request #116 from lumag/master
Use PKCS7 drivers compiled from OVMF source
2019-09-04 22:20:29 +08:00
Dmitry Eremin-Solenikov
883be5aff5 seloader: use pkcs7 drivers from OVMF
Rather than using pre-compiled EFI drivers, use freshly compiled drivers
from OVMF source tree.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
2019-09-04 16:39:59 +03:00
Dmitry Eremin-Solenikov
b0dfb596da ovmf: package PKCS7 verification drivers
Package Pkcs7VerifyDxe.efi and Hash2DxeCrypto.efi to be used by SELoader
bootloader.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
2019-09-04 16:32:05 +03:00
Jia Zhang
df51a87b5a Merge pull request #115 from lumag/master
Several updates and additional patch for grub-efi MOK2 support
2019-09-04 20:01:13 +08:00
Dmitry Eremin-Solenikov
6d1bd0da1f ima-inspect: add patch to fix compilation with newer ima-evm-utils
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
2019-09-04 12:01:45 +03:00
Dmitry Eremin-Solenikov
d139491c9a ima-evm-utils: update to release 1.2.1
Bump ima-evm-utils to latest release (1.2.1).

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
2019-09-04 12:01:45 +03:00
Dmitry Eremin-Solenikov
26ced755f5 grub-efi: support mok2 verify in multiboot2 protocol
Add support for verifying PKCS#7 signatures via MOK2 protocol to
multiboot2 command enabling one to load multiboot-capable kernels.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
2019-09-04 12:01:45 +03:00
Dmitry Eremin-Solenikov
99ec1bedbb meta-tpm2: tpm2-tools: update to version 3.2.0
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
2019-09-04 12:01:45 +03:00
Dmitry Eremin-Solenikov
fe4f5b1122 meta-tpm2: tpm2-tss: update to version 2.2.3
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
2019-09-04 12:01:45 +03:00
Jia Zhang
127542429b Merge pull request #113 from 2005songliwei/master
grub-efi: fix uid contamination by host QA warning
2019-08-27 11:36:23 +08:00
Liwei Song
c624ea2843 grub-efi: fix uid contamination by host QA warning
Fix the following QA issue:
WARNING: grub-efi-2.04-r0 do_package_qa: QA Issue: grub-efi: /boot/efi/EFI/BOOT/grub.cfg.p7b is owned by uid 19183

chown to root for p7b file to fix uid contamination by host.

Signed-off-by: Liwei Song <liwei.song@windriver.com>
2019-08-26 22:47:38 -04:00
Jia Zhang
51b5089a60 Merge pull request #112 from yizhao1/fix2
meta-signing-key/conf/layer.conf: use weak assignment for RPM_GPG_NAM…
2019-08-19 17:20:59 +08:00
Yi Zhao
729916e322 fixup! meta-secure-core: use bb.fatal instead of bb.build.FuncFailed 2019-08-19 17:20:45 +08:00
Yi Zhao
0ae8bf25f1 meta-signing-key/conf/layer.conf: use weak assignment for RPM_GPG_NAME and RPM_GPG_PASSPHRASE
Use weak assignment for RPM_GPG_NAME and RPM_GPG_PASSPHRASE so these
values could be overridden in other conf files.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2019-08-19 16:44:20 +08:00
Yi Zhao
1be79730bf meta-secure-core: use bb.fatal instead of bb.build.FuncFailed
The bb.build.FuncFailed had been removed in bitbake with commit
cfeffb602dd5319f071cd6bcf84139ec77f2d170. Use bb.fatal instead of it.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2019-08-19 13:47:55 +08:00
Yi Zhao
8d1b7c2a29 meta-secure-core: add linux-yocto-dev bbappend
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2019-08-13 20:53:14 +08:00
Yi Zhao
b0a4ae0fe3 linux-yocto: upgrade bbappend from 4.% to 5.%
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2019-08-13 20:53:14 +08:00
Mark Hatle
ed0de6b295 meta-efi-secure-boot: only apply if efi-secure-boot distro flag set
Only apply grub-efi and linux-yocto bbappend if feature efi-secure-boot
set

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2019-08-13 20:53:14 +08:00