From patchwork Mon May 30 14:52:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akuster808 X-Patchwork-Id: 8647 X-Patchwork-Delegate: akuster808@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 066D6C433F5 for ; Mon, 30 May 2022 14:55:01 +0000 (UTC) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mx.groups.io with SMTP id smtpd.web10.37556.1653922495951524477 for ; Mon, 30 May 2022 07:54:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Qd5w0r4r; spf=pass (domain: gmail.com, ip: 209.85.216.41, mailfrom: akuster808@gmail.com) Received: by mail-pj1-f41.google.com with SMTP id v5-20020a17090a7c0500b001df84fa82f8so10934345pjf.5 for ; Mon, 30 May 2022 07:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=YSOizuEiBI+3vPiP80AwQkzg2u07HZHx/hIJ6s8kdzQ=; b=Qd5w0r4r819ArOtlN+L2NqYN3y5PuB5MrBjNk3eSKSIaNsPBaFWKaexeifu9Y5zeTZ ThlrYoRWrH8kqO8BecGJrXPiThUelAONo5mtFGWCwdBGJZk3ElrRc9wkCzooltriuJWt 9SxE39ha4RecLYq5OSnKwcrVAGSOSdyFmxncxO5hc2KrakKxNsil004Rc9MsgP5icKpB hjGo1wTPGFGoUiNlMe3hkqMRi/tbenlQahXqbFjuAPfui2VwvM7NvyUtmK/ArrbSq0xy ouBw0dbCoLzdj17Jw2YeihWpI9HePL7NZeK3/feBoTvDIpCA3SMSvnjVtl8Da1esZPdG 2qqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=YSOizuEiBI+3vPiP80AwQkzg2u07HZHx/hIJ6s8kdzQ=; b=EykxqAsbCFZRQrzfo40oZDsaH6LnTIYrGWJKkjbNnkqk9YX5aT+Z7yOMsNN1CmFHwb dDSnl54HtlFf0kd767TVN7LnDQXcICzEcQJE1+EtcKZ9lSUMKmefpV68xwF7rglhd4Ri W/BxIPivfn3pSoIQE4w1YegwnmTb7XBdlAyotQZQTjeowHfqEacsUlghh7z/cqehUK3E KcgphsFNFglIOU6OPOH92+BTbg1C+bo7wcCjVsMr9kp/5plmVc9IkEqoxIv9RNaX34EQ eKcLlr+2aMjlSQVad1Nye3hQsZcwlnkTxduVKC2Y9j/krEnVUTbqvq9RL0yY07/PP+Cy MUqQ== X-Gm-Message-State: AOAM5322zCBZagtr5kzB/iFvlMAHMrHx5Pc5exjMjqforK1IUXjR1jiW 69nK9agF1ZtPfhgOB0SUX6JUTYPYcLg= X-Google-Smtp-Source: ABdhPJyRlH9Kp+5OXSTLQGP+PJpvJwcWG8d3VREl2iQbovsIbB0NaFbDOU/wASDU68lm9U9Z7yfQyw== X-Received: by 2002:a17:90a:ab8d:b0:1e0:a082:b2c7 with SMTP id n13-20020a17090aab8d00b001e0a082b2c7mr23237726pjq.17.1653922495046; Mon, 30 May 2022 07:54:55 -0700 (PDT) Received: from keaua.hsd1.ca.comcast.net (c-67-181-203-136.hsd1.ca.comcast.net. [67.181.203.136]) by smtp.gmail.com with ESMTPSA id q13-20020a170902b10d00b00163c9ad14efsm3480339plr.143.2022.05.30.07.54.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 07:54:54 -0700 (PDT) From: Armin Kuster To: yocto@lists.yoctoproject.org Subject: [meta-tpm][PATCH 1/5] swtpm: enable seccomp if DISTRO is enabled Date: Mon, 30 May 2022 07:52:48 -0700 Message-Id: <20220530145252.4059103-1-akuster808@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 30 May 2022 14:55:01 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/57219 Signed-off-by: Armin Kuster --- meta-tpm/recipes-tpm/swtpm/swtpm_0.7.1.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-tpm/recipes-tpm/swtpm/swtpm_0.7.1.bb b/meta-tpm/recipes-tpm/swtpm/swtpm_0.7.1.bb index 85e4c5d..db6ceee 100644 --- a/meta-tpm/recipes-tpm/swtpm/swtpm_0.7.1.bb +++ b/meta-tpm/recipes-tpm/swtpm/swtpm_0.7.1.bb @@ -22,6 +22,7 @@ TSS_GROUP="tss" PACKAGECONFIG ?= "openssl" PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}" +PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'seccomp', 'seccomp', '', d)}" PACKAGECONFIG += "${@bb.utils.contains('BBFILE_COLLECTIONS', 'filesystems-layer', 'cuse', '', d)}" PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl" # expect, bash, tpm2-pkcs11-tools (tpm2_ptool), tpmtool and certtool is From patchwork Mon May 30 14:52:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akuster808 X-Patchwork-Id: 8646 X-Patchwork-Delegate: akuster808@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E72CC4332F for ; Mon, 30 May 2022 14:55:01 +0000 (UTC) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mx.groups.io with SMTP id smtpd.web11.37676.1653922497461806482 for ; Mon, 30 May 2022 07:54:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iey1iZcB; spf=pass (domain: gmail.com, ip: 209.85.214.176, mailfrom: akuster808@gmail.com) Received: by mail-pl1-f176.google.com with SMTP id f18so10557390plg.0 for ; Mon, 30 May 2022 07:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=u/SeS5iZc/gJRvCc8uoyByA4LLdvHc9Yu0KcSDQnvUw=; b=iey1iZcB2dSsjdQznL/34pa75MlVEuBn0fxmS+RJAuhA1Kf2UfZBx1EbczWF0sB9lb N/ZUyZVeZqX6YDw3dMRs8ufTgQMPakJXKn26pwY/ajQO+Ys331OQWlARRMiRR25bTtSE w4fnEotXYbGAyl7OoxPf+x4S46WcXz7+GqTTluODc4MY2A1EjOxXg0ORFhZRRFFJaX8T aNngnVxPQznSgWvlK7KVG9roPulBWVeWoB+HZ/A96JP9EXQoioVTAT06whQyy989fHSQ iZIVUgkAe7rfPvUTYMwXuxW6ayxMLDpRHE+4nmpDUnh9BeNUqahP7BNs/DWGStqFmvQW KSfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u/SeS5iZc/gJRvCc8uoyByA4LLdvHc9Yu0KcSDQnvUw=; b=1m3nY3PapsCy9/24A8kOvhxPjtmvBdH5ssQXSouUdgyzh6qnAtCTfO3JYILUKhDUC9 0BneC11HyORj5FqHtKkPk1i00sp7VzEk+355SKvtL7GJd+kXGabXmFlY1ofnw/wUGVvW NOPdfK/TJYPWI5bTn7f1tk7jz81H5yOPfR5rPzhsKlkgYvqejYOyrV7FtBmOHqEkeREf sX8JW+CfnwZe37SLYFalquux9/aKD7p4v8nKoNXtDwGR9L/Mzgd4eWJHNPzwczyQwSaz Qhwt/yo5bK/yQQx3ByjDhfNzvyfgLUAbNg5wfxZoChqlfHDhq31wVT4lF7xb+ZcPK8pK R2gQ== X-Gm-Message-State: AOAM5339qwVQCj6MU+Vi41K/+dsq1/cwkx5nerEDZYr094+GrQ34KdeX GiRi6ZQXRSlyVLm5D06BXL0uvPrWLns= X-Google-Smtp-Source: ABdhPJxFp1wIqKTi9Y2K9W+LmskgNFkSWQqrlhup9xbVR9mlIIedGCv85HP6AG1Zv+XABe4lra8+Qw== X-Received: by 2002:a17:902:a70d:b0:15e:da68:b1b1 with SMTP id w13-20020a170902a70d00b0015eda68b1b1mr56938619plq.53.1653922496507; Mon, 30 May 2022 07:54:56 -0700 (PDT) Received: from keaua.hsd1.ca.comcast.net (c-67-181-203-136.hsd1.ca.comcast.net. [67.181.203.136]) by smtp.gmail.com with ESMTPSA id q13-20020a170902b10d00b00163c9ad14efsm3480339plr.143.2022.05.30.07.54.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 07:54:55 -0700 (PDT) From: Armin Kuster To: yocto@lists.yoctoproject.org Subject: [meta-tpm][PATCH 2/5] security-tpm2-image: add swtpm Date: Mon, 30 May 2022 07:52:49 -0700 Message-Id: <20220530145252.4059103-2-akuster808@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530145252.4059103-1-akuster808@gmail.com> References: <20220530145252.4059103-1-akuster808@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 30 May 2022 14:55:01 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/57220 Signed-off-by: Armin Kuster --- meta-tpm/recipes-core/images/security-tpm2-image.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-tpm/recipes-core/images/security-tpm2-image.bb b/meta-tpm/recipes-core/images/security-tpm2-image.bb index 7e047d1..941a661 100644 --- a/meta-tpm/recipes-core/images/security-tpm2-image.bb +++ b/meta-tpm/recipes-core/images/security-tpm2-image.bb @@ -7,6 +7,7 @@ IMAGE_INSTALL = "\ packagegroup-core-boot \ packagegroup-security-tpm2 \ os-release \ + swtpm \ " IMAGE_LINGUAS ?= " " From patchwork Mon May 30 14:52:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akuster808 X-Patchwork-Id: 8645 X-Patchwork-Delegate: akuster808@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 024E0C433EF for ; Mon, 30 May 2022 14:55:01 +0000 (UTC) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mx.groups.io with SMTP id smtpd.web12.37945.1653922498698973315 for ; Mon, 30 May 2022 07:54:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UGlgd53J; spf=pass (domain: gmail.com, ip: 209.85.216.54, mailfrom: akuster808@gmail.com) Received: by mail-pj1-f54.google.com with SMTP id m14-20020a17090a414e00b001df77d29587so14019269pjg.2 for ; Mon, 30 May 2022 07:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=znYY7ivYJNQzMo/3k1QYNQwkqy5JszbdQXPaisYmGdU=; b=UGlgd53JbPQNZcA3mEauHZuG1SV73I87jCv8bN0l+6Wj2YcEzWgv2WlbPJXjXkfDt3 0eeS6iPXseZ+PHpdsCmFpojLQE4iyqULoaZn+u3xV4cBsNZ75DD7cWHnKUTpXfE+mmPw h4madkZ5UsDEzQRNvYXEuyMczT0PUoZ6nrjwbwXQEGUrg1KDOqvIzEB7y1/ty9Ja3mcK tQiJ5qMprapEqmRi87cxg6AA6tX+6Okt2/cdX1TLCFBaGLZuL2fi3kFAbEYpYM5oD40n F5CTt/128vWrRRE0ZiISL2Rs3cBHqCnn+gazQ7PKb+yjzfc7td/gM2lFVe+XCkfLFyvp 34Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=znYY7ivYJNQzMo/3k1QYNQwkqy5JszbdQXPaisYmGdU=; b=6T27om9ktonlPmTOGgBPeCMbthckpXENJYPuZSxW8siNSyri5fKQYgM5JXOjZ7W7WW zlXglwFc/OLGtuXOQpO96npUVXh7w0GDtWXsXFs5RMRp1RKzjud/WK2+Hz433QhDldSE kJgHE2hfhbRsQcSQhxKCNy3WOFOTVUea/m0tme2JVba2HOigumK6DRw8FhYtoHPMqI4p u+GsSdn8gDlQzPhyI7GBdljtyx8I0TtCGEF++4x+M6wsVnBHMIb2ygXdvICWpvUto+Qy s1uphDM6LB3hhvnNvg3ZGjZd1e9Kk449+YPblPOFmuiNOwoBCuHmnT1qOQZafDotoJKM LsaQ== X-Gm-Message-State: AOAM532rvTNe+ElNgNAJWp334g9EvDUhpal/1blJ6VHujE0aZkzxUiE+ wSu5epeyQb5+HQoGyGeLkHvOP0Ygzio= X-Google-Smtp-Source: ABdhPJx4iXCA7GDfAGsrx5Vw8OUX2ERPIiqRlQcB899qx2Op23k/bQj+qnSbADrJrDHOwDL7nE9zAg== X-Received: by 2002:a17:903:3015:b0:163:c6a5:dcb with SMTP id o21-20020a170903301500b00163c6a50dcbmr9049273pla.38.1653922497883; Mon, 30 May 2022 07:54:57 -0700 (PDT) Received: from keaua.hsd1.ca.comcast.net (c-67-181-203-136.hsd1.ca.comcast.net. [67.181.203.136]) by smtp.gmail.com with ESMTPSA id q13-20020a170902b10d00b00163c9ad14efsm3480339plr.143.2022.05.30.07.54.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 07:54:57 -0700 (PDT) From: Armin Kuster To: yocto@lists.yoctoproject.org Subject: [meta-tpm][PATCH 3/5] swtpm: enable gnutls Date: Mon, 30 May 2022 07:52:50 -0700 Message-Id: <20220530145252.4059103-3-akuster808@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530145252.4059103-1-akuster808@gmail.com> References: <20220530145252.4059103-1-akuster808@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 30 May 2022 14:55:01 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/57221 needed for cert support Signed-off-by: Armin Kuster --- meta-tpm/recipes-tpm/swtpm/swtpm_0.7.1.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-tpm/recipes-tpm/swtpm/swtpm_0.7.1.bb b/meta-tpm/recipes-tpm/swtpm/swtpm_0.7.1.bb index db6ceee..03899d8 100644 --- a/meta-tpm/recipes-tpm/swtpm/swtpm_0.7.1.bb +++ b/meta-tpm/recipes-tpm/swtpm/swtpm_0.7.1.bb @@ -20,7 +20,7 @@ inherit autotools pkgconfig perlnative TSS_USER="tss" TSS_GROUP="tss" -PACKAGECONFIG ?= "openssl" +PACKAGECONFIG ?= "openssl gnutls" PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}" PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'seccomp', 'seccomp', '', d)}" PACKAGECONFIG += "${@bb.utils.contains('BBFILE_COLLECTIONS', 'filesystems-layer', 'cuse', '', d)}" @@ -28,7 +28,7 @@ PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl" # expect, bash, tpm2-pkcs11-tools (tpm2_ptool), tpmtool and certtool is # used by swtpm-create-tpmca (the last two is provided by gnutls) # gnutls is required by: swtpm-create-tpmca, swtpm-localca and swtpm_cert -PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls, gnutls, expect bash tpm2-pkcs11-tools" +PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls-native gnutls, gnutls-bin expect bash tpm2-pkcs11-tools" PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, libselinux" PACKAGECONFIG[cuse] = "--with-cuse, --without-cuse, fuse" PACKAGECONFIG[seccomp] = "--with-seccomp, --without-seccomp, libseccomp" From patchwork Mon May 30 14:52:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akuster808 X-Patchwork-Id: 8644 X-Patchwork-Delegate: akuster808@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04DFDC433FE for ; Mon, 30 May 2022 14:55:01 +0000 (UTC) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mx.groups.io with SMTP id smtpd.web10.37557.1653922499973965020 for ; Mon, 30 May 2022 07:55:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bATWLpRn; spf=pass (domain: gmail.com, ip: 209.85.214.174, mailfrom: akuster808@gmail.com) Received: by mail-pl1-f174.google.com with SMTP id o17so148941pla.6 for ; Mon, 30 May 2022 07:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=xoSvSXY08/+lVTmuOqA78fvDHZ3y+0m5RBT0A3FUBF4=; b=bATWLpRnd8usUy2cvSZd9wcK61VDZYHO8zkYLgKfpjkCuFp2PrSkAOB4knFBsbK860 omuIn0EpvWfMZk6v0IPTJXRQa6dYHZW+2B0rbkmlhGg3TuxYzBfP9R9NkLsunuexnIJb +hFl3A/r07yTPmoijvunHjqYV6wCgP2S9YbsShONzPivhVisiLZ0L3HXDAPSxbWcl+TD pxX/W4slmT0lbev4mI6vK0BllsrciwEW0BO1TKaIDIsyCEX2gHJWgCCIZDGbKq02ngqH dmJS0M51U0UsQtB0bsU7KyJzK5vrbYl09PItVhvkhgmNFWoo3PwzpFiHDHkdjyyRAPkQ T9ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xoSvSXY08/+lVTmuOqA78fvDHZ3y+0m5RBT0A3FUBF4=; b=PHWuUt7Bqa0Pf7jHNiMRie8K+GuFWCl4Rc2OoBFzWNaccjrLFO7Qd3dIxyXTSgkSFO sTzq6RqU2StgQ1QVsK7yuLPVFSr/+dXwNsjSlq64UUaPQzZvSkko4OhW9A577Uq5CHLh ia80F3WUWhGmCksAfZ5tcdnA/j3Rs1UUHQZ9Spz5JEjP3wPEMzqIXv1EL9zlT1L5YqAd ZOom1SLpdkGGoS/QD56Yh/rcbPBmVmFClqElvES0kE1hn2kZ/LOGsii+Q3k99EN3MXjA 97ExRchLt2ZEwJWXrSZ6NxqAuICXTAmLft12ja+vT/0kH+GUKg0Aafcz8R/w8gMV7zXb S8+w== X-Gm-Message-State: AOAM532z5VN+Fbev61vXB3/FbLzAExlCyRBfZuxbRMFoKH3uHO5AHo/S wTE5MYAjoTLDK2FlKR7m9X6aMzWrp94= X-Google-Smtp-Source: ABdhPJymKAo99abNCPsBhQr7jujOQWXJQQBummGlYROGcF/JOhmoDp0eY4fXEvVJ+cVN4UE7UiUwTQ== X-Received: by 2002:a17:902:d54c:b0:163:e1ca:6c7d with SMTP id z12-20020a170902d54c00b00163e1ca6c7dmr5234299plf.161.1653922499173; Mon, 30 May 2022 07:54:59 -0700 (PDT) Received: from keaua.hsd1.ca.comcast.net (c-67-181-203-136.hsd1.ca.comcast.net. [67.181.203.136]) by smtp.gmail.com with ESMTPSA id q13-20020a170902b10d00b00163c9ad14efsm3480339plr.143.2022.05.30.07.54.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 07:54:58 -0700 (PDT) From: Armin Kuster To: yocto@lists.yoctoproject.org Subject: [meta-tpm][PATCH 4/5] oeqa/swtpm: add swtpm runtime Date: Mon, 30 May 2022 07:52:51 -0700 Message-Id: <20220530145252.4059103-4-akuster808@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530145252.4059103-1-akuster808@gmail.com> References: <20220530145252.4059103-1-akuster808@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 30 May 2022 14:55:01 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/57222 Signed-off-by: Armin Kuster --- meta-tpm/lib/oeqa/runtime/cases/swtpm.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 meta-tpm/lib/oeqa/runtime/cases/swtpm.py diff --git a/meta-tpm/lib/oeqa/runtime/cases/swtpm.py b/meta-tpm/lib/oeqa/runtime/cases/swtpm.py new file mode 100644 index 0000000..df47b35 --- /dev/null +++ b/meta-tpm/lib/oeqa/runtime/cases/swtpm.py @@ -0,0 +1,24 @@ +# Copyright (C) 2022 Armin Kuster +# +from oeqa.runtime.case import OERuntimeTestCase +from oeqa.core.decorator.depends import OETestDepends +from oeqa.runtime.decorator.package import OEHasPackage +from oeqa.core.decorator.data import skipIfNotFeature + +class SwTpmTest(OERuntimeTestCase): + @classmethod + def setUpClass(cls): + cls.tc.target.run('mkdir /tmp/myvtpm2') + cls.tc.target.run('chown tss:root /tmp/myvtpm2') + + @classmethod + def tearDownClass(cls): + cls.tc.target.run('rm -fr /tmp/myvtpm2') + + @skipIfNotFeature('tpm2','Test tpm2_swtpm_socket requires tpm2 to be in DISTRO_FEATURES') + @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['swtpm']) + def test_swtpm2_ek_cert(self): + cmd = 'swtpm_setup --tpmstate /tmp/myvtpm2 --create-ek-cert --create-platform-cert --tpm2', + status, output = self.target.run(cmd) + self.assertEqual(status, 0, msg="swtpm create-ek-cert failed: %s" % output) From patchwork Mon May 30 14:52:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akuster808 X-Patchwork-Id: 8648 X-Patchwork-Delegate: akuster808@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00585C433F5 for ; Mon, 30 May 2022 14:55:11 +0000 (UTC) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mx.groups.io with SMTP id smtpd.web11.37679.1653922501194268746 for ; Mon, 30 May 2022 07:55:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pVI8RXFQ; spf=pass (domain: gmail.com, ip: 209.85.216.49, mailfrom: akuster808@gmail.com) Received: by mail-pj1-f49.google.com with SMTP id v11-20020a17090a4ecb00b001e2c5b837ccso4876779pjl.3 for ; Mon, 30 May 2022 07:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=SiHekeI5hZk6dbvdj1qmtcOWqCUYk0zqcI/P50WEkIg=; b=pVI8RXFQWOK1tDh4YEvEY1ULqpr5uhnd5VesSNAo/Tiqb29wn2dpQKKNSEFcQsugkW Qyu9TMHhjFE/lIuVavT+Exw8YLWuHL5Emon6fPcxqCsp4Kv0VDrHPRI/iTagqAPObaOo ovhM2rB/uGYlNW9KDaINsjbJiLgoKjLgzcE2VbGeJKzge2EvH/3TLDcMr3j0yAQtRGGS VI+DYcppz8UUAMftiakY8o1xYMzv6jVAZy9WjOkeW8o5pzhAn/fGcmo3O4DKNrjqavz1 GnSOPY1cFit7a9ZqqndlVnVkK0c79fidBNxgZEmlDEEPx+vHnLCiKM5ueeGuGCuXHquC beHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SiHekeI5hZk6dbvdj1qmtcOWqCUYk0zqcI/P50WEkIg=; b=aRqnxYWzLxaOyLjT09NCVf4NWlb3aMHumgYcLk4MHrN00e46iRRZcrUeT9uD2iBrUU 1ZWxnRCr6yffvy+wvcxbtMT645t8aWtxqm1wgWFwZuhef51w2TM+ZAyDzh4bUrfAvEyg XMOBPdatu/RhFsNVoFWyLI/iZdUXEL6H6Jh8WdPsHw001W6vjWu0b7vo5dXDAkAS5GMw ojKs71CLwrnitu3X2dVD19ii16b+49KMHe8fyROJZxW2HZA+19ZTTOsiJMSblCVZ5Stp G3BZU2a3Ik3joGiG7HlOmhB4TFEJ8b8FkXyZCCtYtuSNjsc+TqvTCLA1ffnRtwQpQyZA 975A== X-Gm-Message-State: AOAM5315FhrVW9hfS5LxZtwP4ecq6cBlhbGBLpUWttyl045yKmhN0+KE A10aqCG+y0AwjonrijjKm5+8J7aOCUE= X-Google-Smtp-Source: ABdhPJxmUyNiMbY3tIr/GaIzTYgxOaGMAXG5BYTLkm4x4/K/nyLNRGelxJWlIkda9OUloiupvBDvjA== X-Received: by 2002:a17:902:db07:b0:163:5374:6732 with SMTP id m7-20020a170902db0700b0016353746732mr19844709plx.15.1653922500401; Mon, 30 May 2022 07:55:00 -0700 (PDT) Received: from keaua.hsd1.ca.comcast.net (c-67-181-203-136.hsd1.ca.comcast.net. [67.181.203.136]) by smtp.gmail.com with ESMTPSA id q13-20020a170902b10d00b00163c9ad14efsm3480339plr.143.2022.05.30.07.54.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 07:54:59 -0700 (PDT) From: Armin Kuster To: yocto@lists.yoctoproject.org Subject: [meta-tpm][PATCH 5/5] oeqa/tpm2: fix and cleanup tests Date: Mon, 30 May 2022 07:52:52 -0700 Message-Id: <20220530145252.4059103-5-akuster808@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530145252.4059103-1-akuster808@gmail.com> References: <20220530145252.4059103-1-akuster808@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 30 May 2022 14:55:10 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/57223 Signed-off-by: Armin Kuster --- meta-tpm/lib/oeqa/runtime/cases/tpm2.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/meta-tpm/lib/oeqa/runtime/cases/tpm2.py b/meta-tpm/lib/oeqa/runtime/cases/tpm2.py index c2c95e7..e64d19d 100644 --- a/meta-tpm/lib/oeqa/runtime/cases/tpm2.py +++ b/meta-tpm/lib/oeqa/runtime/cases/tpm2.py @@ -1,11 +1,19 @@ -# Copyright (C) 2019 Armin Kuster +# Copyright (C) 2019 - 2022 Armin Kuster # from oeqa.runtime.case import OERuntimeTestCase from oeqa.core.decorator.depends import OETestDepends from oeqa.runtime.decorator.package import OEHasPackage - +from oeqa.core.decorator.data import skipIfNotFeature class Tpm2Test(OERuntimeTestCase): + @classmethod + def setUpClass(cls): + cls.tc.target.run('mkdir /tmp/myvtpm2') + + @classmethod + def tearDownClass(cls): + cls.tc.target.run('rm -fr /tmp/myvtpm2') + def check_endlines(self, results, expected_endlines): for line in results.splitlines(): for el in expected_endlines: @@ -19,20 +27,19 @@ class Tpm2Test(OERuntimeTestCase): @OEHasPackage(['tpm2-tools']) @OEHasPackage(['tpm2-abrmd']) @OEHasPackage(['swtpm']) + @skipIfNotFeature('tpm2','Test tpm2_startup requires tpm2 to be in DISTRO_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) - def test_tpm2_swtpm_socket(self): + def test_tpm2_startup(self): cmds = [ - 'mkdir /tmp/myvtpm', - 'swtpm socket --tpmstate dir=/tmp/myvtpm --tpm2 --ctrl type=tcp,port=2322 --server type=tcp,port=2321 --flags not-need-init &', - 'export TPM2TOOLS_TCTI="swtpm:port=2321"', - 'tpm2_startup -c' + 'swtpm socket -d --tpmstate dir=/tmp/myvtpm2 --tpm2 --ctrl type=tcp,port=2322 --server type=tcp,port=2321 --flags not-need-init', + 'tpm2_startup -c -T "swtpm:port=2321"', ] for cmd in cmds: status, output = self.target.run(cmd) self.assertEqual(status, 0, msg='\n'.join([cmd, output])) - @OETestDepends(['tpm2.Tpm2Test.test_tpm2_swtpm_socket']) + @OETestDepends(['tpm2.Tpm2Test.test_tpm2_startup']) def test_tpm2_pcrread(self): (status, output) = self.target.run('tpm2_pcrread') expected_endlines = [] @@ -49,7 +56,7 @@ class Tpm2Test(OERuntimeTestCase): @OEHasPackage(['p11-kit']) @OEHasPackage(['tpm2-pkcs11']) - @OETestDepends(['tpm2.Tpm2Test.test_tpm2_swtpm_socket']) + @OETestDepends(['tpm2.Tpm2Test.test_tpm2_pcrread']) def test_tpm2_pkcs11(self): (status, output) = self.target.run('p11-kit list-modules -v') self.assertEqual(status, 0, msg="Modules missing: %s" % output)