From patchwork Wed Aug 21 12:59:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 171953 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp934295ily; Wed, 21 Aug 2019 06:00:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/9rXmRSo1bZCnuMYHe9z0N03k2hgfK5p653iNmQSvNq1jcVRlyZU25H5XD+jJ7lfLNJkk X-Received: by 2002:a63:f941:: with SMTP id q1mr29173466pgk.350.1566392407634; Wed, 21 Aug 2019 06:00:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566392407; cv=none; d=google.com; s=arc-20160816; b=M6Xx7psph3ZKVM/NG+FWNEp16CTRYxgLx81Ep1+fIJwbqqcINufmZC0LaMTelb+kQn fDnRynwcoayLmbh9KsAPGmon22Jk51Zs8vYzrAei8X58MaMVqyJVn8EABUT5OUjp16tp jcdMAcMoSD9df5zsWFq+xhIjns35k12u7QXrRMe/IT/fQhdpAPBDVu22qFN1uRYRSxQP OL3PPxQAiKLukvPwoQDbmPV1gNP16AVmAnlM2mJpHs+31NEUb7Z3NI+rs3m0uGmjn3xJ 7dFbLdwycaggMrUAbAi436Atiga2ZeGJp72YguAVQQyLExt1Py69cRqEng6wZ5mySeaA kxOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=dCpbsUikcAiIIXp7jgc0W0pYfHlRBYPDddlP94xglMY=; b=S59BXKwkSxNp7B221LiyfdSyWgmhP8mZpMHzWASh74XZfwsRXrsuLP6Ua6j8Cd3eW+ IOXwyVe160Ez211kxpqvHHHaKBQNjjddlfWUDh53QEClDwEp68sDNJiAJ/VKm7GYxZrZ O7++aEjfbnfJC9fQsrenfjGCe6ek+6uSBe6ercs8/6KhAM5GeD45hvGIbCUoChQ2OrqH WiYKhtsRfMXnHbxwaDAp7m9LfWvL8KusywiFCjC/ESOx2g0et532vqluhx7EPlp5VAte 9UlKSkrBxbmuh/lP0iF/0N5/2nOZB/n6DmKzCF8tR4p+131jfoov+1a5YwUClvE6gutc jWMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A+anOlKt; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i18si15532977pfa.23.2019.08.21.06.00.07; Wed, 21 Aug 2019 06:00:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A+anOlKt; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728828AbfHUNAG (ORCPT + 3 others); Wed, 21 Aug 2019 09:00:06 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41118 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728794AbfHUNAG (ORCPT ); Wed, 21 Aug 2019 09:00:06 -0400 Received: by mail-pg1-f194.google.com with SMTP id x15so1279227pgg.8 for ; Wed, 21 Aug 2019 06:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dCpbsUikcAiIIXp7jgc0W0pYfHlRBYPDddlP94xglMY=; b=A+anOlKtIb/37ODmD/JLSvKsH5N4SyH5JTe4f04NJHj1jZGo/RG9ZRUxLTZioJ36SB KsVbHytTm1wk77s/h5xyTCdVddEcXQRdaA47ipGw4gaNuBEIPlPlDPBDFgcLMO//UZsi DmFzXx1oYJnjnRjZ0t/6f2L1Epkb2m0l6fn37M/L76sihLCqsYMKGQeTPX7Gz+1CJGvm ihq9M4sFum3jRcb3UXs0k9/jfYRHU+bhqGxi7ndwqefUuKQJsyM1wJlxiW6D4n2/s9gl st+ejQ1mDYkoe1g6MVY9vZArjXf+BfGrytbbbr2lJbjblojXB99krE1pgr4a0tR9aBNk 8JSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dCpbsUikcAiIIXp7jgc0W0pYfHlRBYPDddlP94xglMY=; b=lfiJWuqWHbl3+P7dbcprI0jat0nwXy2Hz6cSHLujlFvTXfTobjBsN9m90kT7c/YXd6 zd6cMfXU4TmuyL4EICOtDCJhWiYYaeEmNmuKgBEH+6DoMfwGULFq3aP0OQwGRdNEXfLv 4TdQ3sttwbOVwel9DLpejknwTva/9xsWTvMgNRdY/n4I3tjsXVy14puOEsfssh0bTzIt VvHNYhDb+tdapTHR0h7QqxnFAMj4XA/7dMsPwM3Q6coSOUWMIV5NcPxEL9pJ77Ro4oKv BWxXz8fWv/R0T0mVrEAs9k13wCsFRuI1PprgjDjhiyGUvm51/JfAXV0CTxE58GMmkssr RiVQ== X-Gm-Message-State: APjAAAVnSEtu8+VGmWqxxf++9o8dEseG38wHgoSgNoSmVq5IrZgf13Mk OlRQHiXFV2q6ngXWwvRT7vWegw== X-Received: by 2002:aa7:96b3:: with SMTP id g19mr34281542pfk.26.1566392405646; Wed, 21 Aug 2019 06:00:05 -0700 (PDT) Received: from localhost.localdomain ([117.252.68.28]) by smtp.gmail.com with ESMTPSA id o24sm47377476pfp.135.2019.08.21.05.59.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Aug 2019 06:00:04 -0700 (PDT) From: Sumit Garg To: keyrings@vger.kernel.org, linux-integrity@vger.kernel.org, linux-crypto@vger.kernel.org, linux-security-module@vger.kernel.org Cc: dhowells@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, peterhuewe@gmx.de, jgg@ziepe.ca, jejb@linux.ibm.com, jarkko.sakkinen@linux.intel.com, arnd@arndb.de, gregkh@linuxfoundation.org, zohar@linux.ibm.com, jmorris@namei.org, serge@hallyn.com, casey@schaufler-ca.com, ard.biesheuvel@linaro.org, daniel.thompson@linaro.org, linux-kernel@vger.kernel.org, tee-dev@lists.linaro.org, Sumit Garg Subject: [PATCH v5 3/4] KEYS: trusted: create trusted keys subsystem Date: Wed, 21 Aug 2019 18:29:04 +0530 Message-Id: <1566392345-15419-4-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1566392345-15419-1-git-send-email-sumit.garg@linaro.org> References: <1566392345-15419-1-git-send-email-sumit.garg@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Move existing code to trusted keys subsystem. Also, rename files with "tpm" as suffix which provides the underlying implementation. Suggested-by: Jarkko Sakkinen Signed-off-by: Sumit Garg --- crypto/asymmetric_keys/asym_tpm.c | 2 +- include/Kbuild | 1 - include/keys/{trusted.h => trusted_tpm.h} | 7 +++++-- security/keys/Makefile | 2 +- security/keys/trusted-keys/Makefile | 7 +++++++ security/keys/{trusted.c => trusted-keys/trusted_tpm1.c} | 2 +- 6 files changed, 15 insertions(+), 6 deletions(-) rename include/keys/{trusted.h => trusted_tpm.h} (96%) create mode 100644 security/keys/trusted-keys/Makefile rename security/keys/{trusted.c => trusted-keys/trusted_tpm1.c} (99%) -- 2.7.4 Reviewed-by: Jarkko Sakkinen diff --git a/crypto/asymmetric_keys/asym_tpm.c b/crypto/asymmetric_keys/asym_tpm.c index 76d2ce3..ec3f309 100644 --- a/crypto/asymmetric_keys/asym_tpm.c +++ b/crypto/asymmetric_keys/asym_tpm.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/include/Kbuild b/include/Kbuild index 7e9f1ac..e9546a8 100644 --- a/include/Kbuild +++ b/include/Kbuild @@ -65,7 +65,6 @@ header-test- += keys/asymmetric-subtype.h header-test- += keys/asymmetric-type.h header-test- += keys/big_key-type.h header-test- += keys/request_key_auth-type.h -header-test- += keys/trusted.h header-test- += kvm/arm_arch_timer.h header-test- += kvm/arm_pmu.h header-test-$(CONFIG_ARM) += kvm/arm_psci.h diff --git a/include/keys/trusted.h b/include/keys/trusted_tpm.h similarity index 96% rename from include/keys/trusted.h rename to include/keys/trusted_tpm.h index 29e3e9b..7b9d7b4 100644 --- a/include/keys/trusted.h +++ b/include/keys/trusted_tpm.h @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __TRUSTED_KEY_H -#define __TRUSTED_KEY_H +#ifndef __TRUSTED_TPM_H +#define __TRUSTED_TPM_H + +#include +#include /* implementation specific TPM constants */ #define MAX_BUF_SIZE 1024 diff --git a/security/keys/Makefile b/security/keys/Makefile index 9cef540..074f275 100644 --- a/security/keys/Makefile +++ b/security/keys/Makefile @@ -28,5 +28,5 @@ obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += keyctl_pkey.o # Key types # obj-$(CONFIG_BIG_KEYS) += big_key.o -obj-$(CONFIG_TRUSTED_KEYS) += trusted.o +obj-$(CONFIG_TRUSTED_KEYS) += trusted-keys/ obj-$(CONFIG_ENCRYPTED_KEYS) += encrypted-keys/ diff --git a/security/keys/trusted-keys/Makefile b/security/keys/trusted-keys/Makefile new file mode 100644 index 0000000..1a24680 --- /dev/null +++ b/security/keys/trusted-keys/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for trusted keys +# + +obj-$(CONFIG_TRUSTED_KEYS) += trusted.o +trusted-y += trusted_tpm1.o diff --git a/security/keys/trusted.c b/security/keys/trusted-keys/trusted_tpm1.c similarity index 99% rename from security/keys/trusted.c rename to security/keys/trusted-keys/trusted_tpm1.c index f7134d6..66687e7 100644 --- a/security/keys/trusted.c +++ b/security/keys/trusted-keys/trusted_tpm1.c @@ -27,7 +27,7 @@ #include #include -#include +#include static const char hmac_alg[] = "hmac(sha1)"; static const char hash_alg[] = "sha1";