From patchwork Tue Aug 13 07:53:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 171169 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp566294ily; Tue, 13 Aug 2019 00:54:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDOj9IBeCLqnmlzWGqH+i6kCgOQcx1gLcnc0ZtF1zax1+Cice3fTvDLLJGs3RMr3OudNU1 X-Received: by 2002:aa7:9191:: with SMTP id x17mr39621711pfa.23.1565682868367; Tue, 13 Aug 2019 00:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565682868; cv=none; d=google.com; s=arc-20160816; b=zGBJ8ZsJzTPSYouzzAOoH6GgzdjgObQ4BM6f8Podm6l2v4f4R2IQLpx2URU4LhUadH RaC7wUTpRyANel154iW4y2tN7gB7j7QfZ3vAfffpBecKDnnPh2TTsK+lwx213W+/zSha c0VR0KXBwjLxC26Nnjq1b40w/JPuHqBzn2EdppuLobWhBfPGIg5ycsF6Xn49gC9wc1XL quwCUjoSeAhH2Dhh77o3sZXl37tk+tNEY2FRldd2pz5J7+h0Qna6I2FPyQPDZ5dS39tF TK7AGjhrk1daj6T3To4fcMAjronW2FSQdhGuya2BrHze6liWIh/npBiC/yohQKDedH+p BA9w== 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=GCl85JKs1gSecc0KTbirVsTaub6OgsM5xbDj1pFTySM=; b=XXVF3js1I4/TWssLJVXshQcdAvrvjWrgPCNBDKGFJRjW8HyGJS6PtYKRjjjidaiUDK 4tecma5mPAe19IJRWoXMmrkeDRwkAXBc63yHymN0Td4VpAvpNI/iDorIjtjud1hB/VtL T+GqvJ4uMozPrQy/x6jjgOb4Nm/9SUc55iOhVatn7CywMUMsTA+68U5BwBaOCs7UQBGg cSJ0Dd2nNXjrjKwuShf5NetGlxqdFNwfwVFYriJQl5nWbh4SiTawhK97dgBxmQTOh19D d/7NteZUJTCxnucCFNy2r3bY5xMQbqdhYpwfyCft9v2eMKJYUUZUYB7Aag5wAGCJ609u thvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=chQd+HUw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 a123si68749024pfd.114.2019.08.13.00.54.28; Tue, 13 Aug 2019 00:54:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=chQd+HUw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1727956AbfHMHy1 (ORCPT + 28 others); Tue, 13 Aug 2019 03:54:27 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:45565 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727326AbfHMHy0 (ORCPT ); Tue, 13 Aug 2019 03:54:26 -0400 Received: by mail-pf1-f193.google.com with SMTP id w26so5859062pfq.12 for ; Tue, 13 Aug 2019 00:54:26 -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=GCl85JKs1gSecc0KTbirVsTaub6OgsM5xbDj1pFTySM=; b=chQd+HUw8fMvGc9VG8day9h5nefxZnRxFm4hphhm2CYpr49nSh/+ev5t9abDXDXZ9l kJMGGDfwB1sg+AQ905NLN2KRacZenYdeEUdA3G13T54twXmQylRjNMFCwoQuNCgHxbWB vxkF15V/LSZ2c8z6AWrp7vPaGMIBbl/kEoCO4rpH7QA+2wiF/ivd1t8fjoEPKxBFW9jF 85a5ISI/Ppj9c0uuHyu8kFWE9qq5p726ukjRCEXFC0VnO+ST6bNi6vf1+E13I6UCv+VR 9PeZozby9tnGwRViTqdAwnRa9HkdY4BQMdtL+L5IFindm9IIXEn+/AQOpv9cCMWJxhrX /L8w== 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=GCl85JKs1gSecc0KTbirVsTaub6OgsM5xbDj1pFTySM=; b=fS0JVqOv5ctMw9hxAIyWmaC0DiumFOhGdxMuIUbEQpcJXkcrdA/qrFw560CQfhr5aa 4y8T7xzdbpy7g1O+1SDBjcJp6mTaRv3UPil/au/DYcr0A2cjIAz2BsgJFZxl6gj+9IO/ 9GcsrRZ7cW1UldOmnvwKjeFzc8/ITQUKj4aeH5hCv+LfKiMQNrQc5gslVMCeePZdUKFt tzSoqEgvB5EekGQnXJ6B/n3DsekgrNi/HSra2e/kJtNfOezVSMV+EC7uJMnLX5A6YO91 Oa6RhfCj1rFp2/nzytE0TecmxGDeSUXBzHH+pZAXdJce0jcNYEbjZqquz0Kli3vxY3Zs 0D/w== X-Gm-Message-State: APjAAAXpyNCivaC+DNwkpA/pSjvJ2GDp4DLl9wW5lSYcglKf+d/gfHW7 dwhv/BGgMsZ2jILoWDB4V+AZQQ== X-Received: by 2002:a63:de43:: with SMTP id y3mr33723727pgi.211.1565682865908; Tue, 13 Aug 2019 00:54:25 -0700 (PDT) Received: from localhost.localdomain ([45.114.72.100]) by smtp.gmail.com with ESMTPSA id l25sm131462563pff.143.2019.08.13.00.54.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Aug 2019 00:54:25 -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: [RFC/RFT v4 3/5] KEYS: trusted: create trusted keys subsystem Date: Tue, 13 Aug 2019 13:23:02 +0530 Message-Id: <1565682784-10234-4-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1565682784-10234-1-git-send-email-sumit.garg@linaro.org> References: <1565682784-10234-1-git-send-email-sumit.garg@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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/keys/{trusted.h => trusted_tpm.h} | 4 ++-- security/keys/Makefile | 2 +- security/keys/trusted-keys/Makefile | 7 +++++++ security/keys/{trusted.c => trusted-keys/trusted-tpm.c} | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) rename include/keys/{trusted.h => trusted_tpm.h} (98%) create mode 100644 security/keys/trusted-keys/Makefile rename security/keys/{trusted.c => trusted-keys/trusted-tpm.c} (99%) -- 2.7.4 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/keys/trusted.h b/include/keys/trusted_tpm.h similarity index 98% rename from include/keys/trusted.h rename to include/keys/trusted_tpm.h index 29e3e9b..9bdf5f4 100644 --- a/include/keys/trusted.h +++ b/include/keys/trusted_tpm.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __TRUSTED_KEY_H -#define __TRUSTED_KEY_H +#ifndef __TRUSTED_TPM_H +#define __TRUSTED_TPM_H /* 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..4e8963a --- /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-tpm.o diff --git a/security/keys/trusted.c b/security/keys/trusted-keys/trusted-tpm.c similarity index 99% rename from security/keys/trusted.c rename to security/keys/trusted-keys/trusted-tpm.c index f7134d6..66687e7 100644 --- a/security/keys/trusted.c +++ b/security/keys/trusted-keys/trusted-tpm.c @@ -27,7 +27,7 @@ #include #include -#include +#include static const char hmac_alg[] = "hmac(sha1)"; static const char hash_alg[] = "sha1";