From patchwork Sat Dec 12 22:03:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 1415479 X-Patchwork-Delegate: daniel@makrotopia.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=TQGj4HmU; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CthYv4xW6z9sTv for ; Sun, 13 Dec 2020 09:06:09 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-ID:Subject:To:From:Date:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=+V9nQnr3nvPxB3FZnfRVa9X3dvAJvJUxyEXwwC6Ko2U=; b=TQGj4HmUY0CxR/SCc/++3g4TvY v3sBUzB791NwcMcD1DZQONtwJaYTSpuOeddGdblHgPlM1MVNsK6T5bE2rUscxqhnwGptTyWCzYgLj VLIU4j0hG/KFd/CofpyDvygWJJ9NkoTcChHo7t6vF89+ppbLmhcqgxcYTKoNQKCzLaA5i3SG64TGX O1EgSApGlwlA5FlWudF232aTsX2cp/wLwUGnPKkk11uc9jCw3nQP7gs/1Dc1Zt8bPFNHL2ZKRx3wM hDTsQNSPnqFXEJynLugHCX9Dh90FyxHV6an7HZQDd4lVoVpVAoeU60TMx3ZjUgYBv26uAVVAYq3vP wtcaMOLw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1koCzX-0007Nl-37; Sat, 12 Dec 2020 22:03:51 +0000 Received: from fudo.makrotopia.org ([2a07:2ec0:3002::71]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1koCzU-0007NT-MC for openwrt-devel@lists.openwrt.org; Sat, 12 Dec 2020 22:03:49 +0000 Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.93.0.4) (envelope-from ) id 1koCzT-0004Ot-CM for openwrt-devel@lists.openwrt.org; Sat, 12 Dec 2020 23:03:47 +0100 Date: Sat, 12 Dec 2020 22:03:37 +0000 From: Daniel Golle To: openwrt-devel@lists.openwrt.org Subject: [PATCH 2/3] kernel: package kmod-keys-encrypted and kmod-keys-trusted Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201212_170348_870237_81FAF3FB X-CRM114-Status: UNSURE ( 9.99 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add kernel module packages for handling encrypted and TPM trusted keys on the kernel chain. Signed-off-by: Daniel Golle --- package/kernel/linux/modules/other.mk | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 41de6ac2ba..421b1b536c 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -1103,6 +1103,47 @@ endef $(eval $(call KernelPackage,echo)) +define KernelPackage/keys-encrypted + SUBMENU:=$(OTHER_MENU) + TITLE:=encrypted keys on kernel keyring + DEPENDS:=@KERNEL_KEYS +kmod-crypto-cbc +kmod-crypto-hmac +kmod-crypto-rng \ + +kmod-crypto-sha256 +kmod-keys-trusted + KCONFIG:=CONFIG_ENCRYPTED_KEYS + FILES:=$(LINUX_DIR)/security/keys/encrypted-keys/encrypted-keys.ko + AUTOLOAD:=$(call AutoLoad,01,encrypted-keys,1) +endef + +define KernelPackage/keys-encrypted/description + This module provides support for create/encrypting/decrypting keys + in the kernel. Encrypted keys are kernel generated random numbers, + which are encrypted/decrypted with a 'master' symmetric key. The + 'master' key can be either a trusted-key or user-key type. + Userspace only ever sees/stores encrypted blobs. +endef + +$(eval $(call KernelPackage,keys-encrypted)) + + +define KernelPackage/keys-trusted + SUBMENU:=$(OTHER_MENU) + TITLE:=TPM trusted keys on kernel keyring + DEPENDS:=@KERNEL_KEYS +kmod-crypto-hash +kmod-crypto-hmac +kmod-crypto-sha1 +kmod-tpm + KCONFIG:=CONFIG_TRUSTED_KEYS + FILES:=$(LINUX_DIR)/security/keys/trusted.ko + AUTOLOAD:=$(call AutoLoad,01,trusted-keys,1) +endef + +define KernelPackage/keys-trusted/description + This module provides support for creating, sealing, and unsealing + keys in the kernel. Trusted keys are random number symmetric keys, + generated and RSA-sealed by the TPM. The TPM only unseals the keys, + if the boot PCRs and other criteria match. Userspace will only ever + see encrypted blobs. +endef + +$(eval $(call KernelPackage,keys-trusted)) + + define KernelPackage/tpm SUBMENU:=$(OTHER_MENU) TITLE:=TPM Hardware Support