layer.conf: add honister to LAYERSERIES_COMPAT
PATCH 1/3 layer.conf: add honister to LAYERSERIES_COMPAT
Signed-off-by Yi Zhao <[email protected]>
--- conf/layer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
conf/layer.conf +1 -1
@@ -10,7 +10,7 @@ BBFILE_PRIORITY_meta-openssl-one-zero-two-fips = "5" LAYERVERSION_meta-openssl-one-zero-two-fips = "1" -LAYERSERIES_COMPAT_meta-openssl-one-zero-two-fips = "hardknott" +LAYERSERIES_COMPAT_meta-openssl-one-zero-two-fips = "honister" LAYERPATH_meta-openssl-one-zero-two-fips = "${LAYERDIR}"
Signature · 1 line
2.25.1
PATCH 2/3 openssh: refresh patches for 8.6p1
Refresh patches:
0001-openssh-8.6p1-fips.patch
0001-conditional-enable-fips-mode.patch
Signed-off-by Yi Zhao <[email protected]>
---
.../0001-conditional-enable-fips-mode.patch | 38 +++++++------
...ps.patch => 0001-openssh-8.6p1-fips.patch} | 55 ++++++++++---------
recipes-connectivity/openssh/openssh_fips.inc | 2 +-
3 files changed, 50 insertions(+), 45 deletions(-)
rename recipes-connectivity/openssh/openssh/{0001-openssh-8.4p1-fips.patch => 0001-openssh-8.6p1-fips.patch} (92%)recipes-connectivity/openssh/openssh/0001-conditional-enable-fips-mode.patch +20 -18
@@ -1,4 +1,4 @@ -From 48888de317391522186c6ae24a8d6d7d7add2673 Mon Sep 17 00:00:00 2001 +From 1696484c2a06e2ec095d748d2155eb8206dd850b Mon Sep 17 00:00:00 2001 From: Hongxu Jia <[email protected]> Date: Sat, 21 Dec 2019 13:03:23 +0800 Subject: [PATCH] conditional enable fips mode
@@ -14,11 +14,12 @@ The ssh_malloc_init function is removed in openssh 8.1p1, we need to insert ssh_enable_fips_mode function to main function for all applications. +Rebase to 8.6p1 Signed-off-by: Yi Zhao <[email protected]> --- sftp-server-main.c | 1 + sftp-server.c | 1 + - sftp.c | 1 + + sftp.c | 2 ++ ssh-add.c | 1 + ssh-agent.c | 1 + ssh-keygen.c | 1 +
@@ -29,7 +30,7 @@ Signed-off-by: Yi Zhao <[email protected]> sshd.c | 1 + xmalloc.c | 20 ++++++++++++++++++++ xmalloc.h | 1 + - 13 files changed, 32 insertions(+) + 13 files changed, 33 insertions(+) diff --git a/sftp-server-main.c b/sftp-server-main.c index 06566d3..a10566d 100644
@@ -44,10 +45,10 @@ index 06566d3..a10566d 100644 sanitise_stdfd(); diff --git a/sftp-server.c b/sftp-server.c -index 7300900..42da9d7 100644 +index 838f048..8a8d87b 100644 --- a/sftp-server.c +++ b/sftp-server.c -@@ -1616,6 +1616,7 @@ sftp_server_main(int argc, char **argv, struct passwd *user_pw) +@@ -1656,6 +1656,7 @@ sftp_server_main(int argc, char **argv, struct passwd *user_pw) extern char *optarg; extern char *__progname;
@@ -56,19 +57,20 @@ index 7300900..42da9d7 100644 log_init(__progname, log_level, log_facility, log_stderr); diff --git a/sftp.c b/sftp.c -index fb3c08d..85b9b67 100644 +index 3f46c55..e9c8f1d 100644 --- a/sftp.c +++ b/sftp.c -@@ -2345,6 +2345,7 @@ main(int argc, char **argv) - size_t num_requests = DEFAULT_NUM_REQUESTS; +@@ -2342,6 +2342,8 @@ main(int argc, char **argv) + size_t num_requests = 0; long long limit_kbps = 0; + ssh_enable_fips_mode(); ++ /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ sanitise_stdfd(); msetlocale(); diff --git a/ssh-add.c b/ssh-add.c -index 7edb9f9..c75f85b 100644 +index 92192fc..4ed14cd 100644 --- a/ssh-add.c +++ b/ssh-add.c @@ -667,6 +667,7 @@ main(int argc, char **argv)
@@ -80,7 +82,7 @@ index 7edb9f9..c75f85b 100644 sanitise_stdfd(); diff --git a/ssh-agent.c b/ssh-agent.c -index 58fe6dd..9018a7c 100644 +index 48a47d4..8a0d7a2 100644 --- a/ssh-agent.c +++ b/ssh-agent.c @@ -1388,6 +1388,7 @@ main(int ac, char **av)
@@ -92,7 +94,7 @@ index 58fe6dd..9018a7c 100644 sanitise_stdfd(); diff --git a/ssh-keygen.c b/ssh-keygen.c -index 6451584..246caa1 100644 +index fc73943..cdb45a9 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -3153,6 +3153,7 @@ main(int argc, char **argv)
@@ -140,7 +142,7 @@ index a9a6fe3..3c76f70 100644 seed_rng(); TAILQ_INIT(&pkcs11_keylist); diff --git a/ssh.c b/ssh.c -index 729d87a..ab78b53 100644 +index a6e7642..8f91534 100644 --- a/ssh.c +++ b/ssh.c @@ -650,6 +650,7 @@ main(int ac, char **av)
@@ -152,10 +154,10 @@ index 729d87a..ab78b53 100644 sanitise_stdfd(); diff --git a/sshd.c b/sshd.c -index fee4703..07faf7b 100644 +index b2ab001..8112d2c 100644 --- a/sshd.c +++ b/sshd.c -@@ -1534,6 +1534,7 @@ main(int ac, char **av) +@@ -1535,6 +1535,7 @@ main(int ac, char **av) Authctxt *authctxt; struct connection_info *connection_info = NULL;
@@ -199,13 +201,13 @@ index b48d33b..456a063 100644 + } +} diff --git a/xmalloc.h b/xmalloc.h -index abaf7ad..b3b1c8c 100644 +index a6b8d23..18fe756 100644 --- a/xmalloc.h +++ b/xmalloc.h -@@ -26,3 +26,4 @@ int xasprintf(char **, const char *, ...) - __attribute__((__nonnull__ (2))); +@@ -25,3 +25,4 @@ int xasprintf(char **, const char *, ...) + __attribute__((__format__ (printf, 2, 3))) __attribute__((__nonnull__ (2))); int xvasprintf(char **, const char *, va_list) - __attribute__((__nonnull__ (2))); + __attribute__((__nonnull__ (2))); +void ssh_enable_fips_mode(void); -- 2.17.1
recipes-connectivity/openssh/openssh/0001-openssh-8.6p1-fips.patch renamed from recipes-connectivity/openssh/openssh/0001-openssh-8.4p1-fips.patch +29 -26
165 lines not on this page · raw message
recipes-connectivity/openssh/openssh_fips.inc +1 -1
@@ -6,7 +6,7 @@ DEPENDS += " \ RRECOMMENDS_${PN}-sshd_remove = "rng-tools" SRC_URI += " \ - file://0001-openssh-8.4p1-fips.patch \ + file://0001-openssh-8.6p1-fips.patch \ file://0001-conditional-enable-fips-mode.patch \ file://openssh-6.6p1-ctr-cavstest.patch \ file://openssh-6.7p1-kdf-cavs.patch \
Signature · 1 line
2.25.1
PATCH 3/3 meta-openssl102-fips: convert to new override syntax
In reply to Yi ZhaoThis is the result of automated script conversion:poky/scripts/contrib/convert-overrides.py meta-openssl102-fips
Converting the metadata to use ":" as the override character instead of "_".
Signed-off-by Yi Zhao <[email protected]>
--- README.build | 8 ++++---- README.openssh_cavstest | 2 +- classes/fips_kernel.bbclass | 4 ++-- classes/image-enable-fips.bbclass | 2 +- conf/layer.conf | 4 ++-- .../openssh/openssh_8.%.bbappend | 2 +- recipes-connectivity/openssh/openssh_fips.inc | 16 ++++++++-------- .../openssl/openssl-fips-example_2.0.16.bb | 6 +++--- .../openssl/openssl-fips_2.0.16.bb | 6 +++--- .../openssl/openssl_1.0.2%.bbappend | 2 +- recipes-connectivity/openssl/openssl_fips.inc | 8 ++++---- recipes-support/fipscheck/fipscheck_1.5.0.bb | 6 +++--- recipes-support/rng-tools/rng-tools_6.%.bbappend | 2 +- recipes-support/rng-tools/rng-tools_fips.inc | 2 +- 14 files changed, 35 insertions(+), 35 deletions(-)
README.build +4 -4
@@ -44,7 +44,7 @@ to image [3] [2] git://git.yoctoproject.org/meta-openssl102 Manually set 1.0.2% to openssl preferred version echo "PREFERRED_VERSION_openssl = '1.0.2%'" >> conf/local.conf -[3] echo "IMAGE_INSTALL_append = ' packagegroup-core-buildessential'" >> conf/local.conf +[3] echo "IMAGE_INSTALL:append = ' packagegroup-core-buildessential'" >> conf/local.conf The easiest way to do this with Wind River Linux is include:
@@ -56,7 +56,7 @@ Additionally you will need a way to get the openssl-fips module source to the target for the build. Adding ssh/scp is recommended, to add these add the following to your local.conf file: - IMAGE_INSTALL_append = " openssh-ssh openssh-scp" + IMAGE_INSTALL:append = " openssh-ssh openssh-scp" If you are building with configurations that have security software enabled, such as SE Linux, you may be required to boot in a non-enforcing mode to
@@ -132,7 +132,7 @@ Building Steps (based on section 4 of the UsersGuide-2.0.pdf): prebuilt tar archive. For Yocto, in your build directory, edit conf/local.conf, add: - IMAGE_INSTALL_append = " openssl-fips-dev" + IMAGE_INSTALL:append = " openssl-fips-dev" OPENSSL_FIPS_ENABLED = "1" OPENSSL_FIPS_PREBUILT = "<path>"
@@ -230,7 +230,7 @@ program, and embed the fingerprint. On host: edit local.conf to add openssl-fips-example to image -$ echo 'IMAGE_INSTALL_append = " openssl-fips-example"' >> conf/local.conf +$ echo 'IMAGE_INSTALL:append = " openssl-fips-example"' >> conf/local.conf $ bitbake <image> On target:
README.openssh_cavstest +1 -1
@@ -1,5 +1,5 @@ 1. Install openssh-cavs to images -$ echo "IMAGE_INSTALL_append = ' openssh-cavs'" >> conf/local.conf +$ echo "IMAGE_INSTALL:append = ' openssh-cavs'" >> conf/local.conf $ bitbake <image> 2. Run tests on target
classes/fips_kernel.bbclass +2 -2
@@ -1,4 +1,4 @@ -FILESEXTRAPATHS_prepend := "${LAYER_PATH_meta-openssl-one-zero-two-fips}/recipes-kernel/linux/files/:" -SRC_URI_append = " \ +FILESEXTRAPATHS:prepend := "${LAYER_PATH_meta-openssl-one-zero-two-fips}/recipes-kernel/linux/files/:" +SRC_URI:append = " \ file://crypto_fips.scc \ "
classes/image-enable-fips.bbclass +1 -1
@@ -1,4 +1,4 @@ -ROOTFS_POSTPROCESS_COMMAND_append = " enable_system_fips;" +ROOTFS_POSTPROCESS_COMMAND:append = " enable_system_fips;" enable_system_fips() { install -d ${IMAGE_ROOTFS}${sysconfdir}
conf/layer.conf +2 -2
@@ -18,8 +18,8 @@ LAYERDEPENDS_meta-openssl-one-zero-two-fips = " \ meta-openssl-one-zero-two \ " -IMAGE_CLASSES_append = "${@'' if d.getVar('OPENSSL_FIPS_ENABLED', True) != '1' else ' image-enable-fips'}" +IMAGE_CLASSES:append = "${@'' if d.getVar('OPENSSL_FIPS_ENABLED', True) != '1' else ' image-enable-fips'}" LAYER_PATH_meta-openssl-one-zero-two-fips = "${LAYERDIR}" -KERNEL_CLASSES_append = " ${@bb.utils.contains('OPENSSL_FIPS_ENABLED', '1', ' fips_kernel', '',d)}" +KERNEL_CLASSES:append = " ${@bb.utils.contains('OPENSSL_FIPS_ENABLED', '1', ' fips_kernel', '',d)}"
recipes-connectivity/openssh/openssh_8.%.bbappend +1 -1
@@ -1,4 +1,4 @@ FIPSINC = "" -FIPSINC_class-target = "${@'' if d.getVar('OPENSSL_FIPS_ENABLED', True) != '1' else 'openssh_fips.inc'}" +FIPSINC:class-target = "${@'' if d.getVar('OPENSSL_FIPS_ENABLED', True) != '1' else 'openssh_fips.inc'}" require ${FIPSINC}
recipes-connectivity/openssh/openssh_fips.inc +8 -8
@@ -1,9 +1,9 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/openssh:" +FILESEXTRAPATHS:prepend := "${THISDIR}/openssh:" DEPENDS += " \ openssl-fips \ fipscheck \ " -RRECOMMENDS_${PN}-sshd_remove = "rng-tools" +RRECOMMENDS:${PN}-sshd:remove = "rng-tools" SRC_URI += " \ file://0001-openssh-8.6p1-fips.patch \
@@ -14,13 +14,13 @@ SRC_URI += " \ file://0001-ssh-cavs-set-kex-sessin_id-via-sshbuf_put.patch \ " -do_install_append() { +do_install:append() { install -d ${D}${libdir}/fipscheck } inherit qemu -pkg_postinst_append_${PN}-ssh () { +pkg_postinst:append:${PN}-ssh () { if [ -n "$D" ]; then if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true','false', d)}; then ${@qemu_run_binary(d, '$D', '${bindir}/fipshmac')} \
@@ -33,7 +33,7 @@ pkg_postinst_append_${PN}-ssh () { fi } -pkg_postinst_append_${PN}-sshd () { +pkg_postinst:append:${PN}-sshd () { if [ -n "$D" ]; then if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true','false', d)}; then ${@qemu_run_binary(d, '$D', '${bindir}/fipshmac')} \
@@ -47,10 +47,10 @@ pkg_postinst_append_${PN}-sshd () { } PACKAGES =+ "${PN}-cavs" -SUMMARY_${PN}-cavs = "CAVS tests for FIPS validation" -FILES_${PN}-cavs = " \ +SUMMARY:${PN}-cavs = "CAVS tests for FIPS validation" +FILES:${PN}-cavs = " \ ${libexecdir}/ctr-cavstest \ ${libexecdir}/ssh-cavs \ ${libexecdir}/ssh-cavs_driver.pl" -FILES_${PN} += "${libdir}/fipscheck" +FILES:${PN} += "${libdir}/fipscheck"
recipes-connectivity/openssl/openssl-fips-example_2.0.16.bb +3 -3
@@ -19,14 +19,14 @@ DEPENDS = " \ openssl \ " -RDEPENDS_${PN} = " \ +RDEPENDS:${PN} = " \ openssl-fips-dev \ openssl-dev \ openssl-staticdev \ packagegroup-core-buildessential \ " -FILES_${PN} += "${libdir}/ssl/fips-2.0/test" +FILES:${PN} += "${libdir}/ssl/fips-2.0/test" do_configure[noexec] = "1"
@@ -47,7 +47,7 @@ do_install() { sed -i "s:@LIBDIR@:${libdir}:g" ${D}/${libdir}/ssl/fips-2.0/test/Makefile } -INSANE_SKIP_${PN} += "dev-deps" +INSANE_SKIP:${PN} += "dev-deps" python __anonymous() { if d.getVar("OPENSSL_FIPS_ENABLED", True) != "1":
recipes-connectivity/openssl/openssl-fips_2.0.16.bb +3 -3
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=f9a8f968107345e0b75aa8c2ecaa7ec8" # Set "OPENSSL_FIPS_PREBUILT" to the location of the prebuilt # openssl-fips-TARGET_ARCH-install.tar.bz2 files. # -FILESEXTRAPATHS_prepend := "${OPENSSL_FIPS_PREBUILT}:" +FILESEXTRAPATHS:prepend := "${OPENSSL_FIPS_PREBUILT}:" PREBUILT_OPENSSL_FIPS = "openssl-fips-${PV}-${TARGET_ARCH}-install.tar.bz2"
@@ -20,8 +20,8 @@ SRC_URI = "file://${PREBUILT_OPENSSL_FIPS} \ " S = "${WORKDIR}" -RDEPENDS_${PN}-dev = "" -FILES_${PN}-dev += "${bindir}/fipsld ${libdir}/ssl/fips-2.0" +RDEPENDS:${PN}-dev = "" +FILES:${PN}-dev += "${bindir}/fipsld ${libdir}/ssl/fips-2.0" INHIBIT_PACKAGE_DEBUG_SPLIT = '1' INHIBIT_PACKAGE_STRIP = '1'
recipes-connectivity/openssl/openssl_1.0.2%.bbappend +1 -1
@@ -1,4 +1,4 @@ FIPSINC = "" -FIPSINC_class-target = "${@'' if d.getVar('OPENSSL_FIPS_ENABLED', True) != '1' else 'openssl_fips.inc'}" +FIPSINC:class-target = "${@'' if d.getVar('OPENSSL_FIPS_ENABLED', True) != '1' else 'openssl_fips.inc'}" require ${FIPSINC}
recipes-connectivity/openssl/openssl_fips.inc +4 -4
@@ -1,11 +1,11 @@ -PACKAGECONFIG_append = " fips" +PACKAGECONFIG:append = " fips" PACKAGECONFIG[fips] = "fips --with-fipsdir=${STAGING_DIR_TARGET}${libdir}/ssl/fips-2.0,,openssl-fips,," -FILESEXTRAPATHS_prepend := "${THISDIR}/openssl:" +FILESEXTRAPATHS:prepend := "${THISDIR}/openssl:" # This adds the necessary symbols if fips is enabled. -SRC_URI_append = " file://openssl-fips-version.patch \ +SRC_URI:append = " file://openssl-fips-version.patch \ file://0001-make-fips_premain_dso-support-cross-compiling.patch \ "
@@ -14,7 +14,7 @@ DEPENDS += "qemu-native" inherit qemu # We need to run the special fips_premain_dso under QEMU -do_compile_prepend() { +do_compile:prepend() { qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_HOST}', ['${STAGING_LIBDIR}','${STAGING_BASELIBDIR}'])}" cat << EOF > fips_premain_dso #! /bin/sh
recipes-support/fipscheck/fipscheck_1.5.0.bb +3 -3
@@ -27,13 +27,13 @@ EXTRA_OECONF += " \ EXTRA_OEMAKE += " \ -I${STAGING_LIBDIR_NATIVE}/ssl/fips-2.0/include \ " -do_install_append() { +do_install:append() { install -d ${D}${libdir}/fipscheck } inherit qemu -pkg_postinst_${PN} () { +pkg_postinst:${PN} () { if [ -n "$D" ]; then if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true','false', d)}; then ${@qemu_run_binary(d, '$D', '${bindir}/fipshmac')} \
@@ -54,4 +54,4 @@ python __anonymous() { raise bb.parse.SkipPackage("To enable the fipscheck recipe set OPENSSL_FIPS_ENABLED = '1'.") } -FILES_${PN} += "${libdir}/fipscheck" +FILES:${PN} += "${libdir}/fipscheck"
recipes-support/rng-tools/rng-tools_6.%.bbappend +1 -1
@@ -1,4 +1,4 @@ FIPSINC = "" -FIPSINC_class-target = "${@'' if d.getVar('OPENSSL_FIPS_ENABLED', True) != '1' else 'rng-tools_fips.inc'}" +FIPSINC:class-target = "${@'' if d.getVar('OPENSSL_FIPS_ENABLED', True) != '1' else 'rng-tools_fips.inc'}" require ${FIPSINC}
recipes-support/rng-tools/rng-tools_fips.inc +1 -1
@@ -1,2 +1,2 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/rng-tools:" +FILESEXTRAPATHS:prepend := "${THISDIR}/rng-tools:"
Signature · 1 line
2.25.1
All three patches have been merged and a hardknott branch was split off prior to the merges of change set.
Cheers,
Jason.
Quoted 18 lines · Yi Zhao
Signed-off-by Yi Zhao <[email protected]>--- conf/layer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)conf/layer.conf +1
-1@@ -10,7 +10,7 @@ BBFILE_PRIORITY_meta-openssl-one-zero-two-fips = "5" LAYERVERSION_meta-openssl-one-zero-two-fips = "1" -LAYERSERIES_COMPAT_meta-openssl-one-zero-two-fips = "hardknott" +LAYERSERIES_COMPAT_meta-openssl-one-zero-two-fips = "honister" LAYERPATH_meta-openssl-one-zero-two-fips = "${LAYERDIR}"