All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nayna Jain <nayna@linux.ibm.com>
To: linux-integrity@vger.kernel.org, keyrings@vger.kernel.org
Cc: dhowells@redhat.com, zohar@linux.ibm.com, jarkko@kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, dimitri.ledkov@canonical.com,
	seth@forshee.me, rnsastry@linux.ibm.com,
	Masahiro Yamada <masahiroy@kernel.org>,
	Nayna Jain <nayna@linux.ibm.com>
Subject: [PATCH v11 2/4] integrity: make integrity_keyring_from_id() non-static
Date: Thu, 10 Mar 2022 16:44:48 -0500	[thread overview]
Message-ID: <20220310214450.676505-3-nayna@linux.ibm.com> (raw)
In-Reply-To: <20220310214450.676505-1-nayna@linux.ibm.com>

Make integrity_keyring_from_id() non-static so that it is accessible
by other files in security/integrity.

Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
---
 security/integrity/digsig.c    | 2 +-
 security/integrity/integrity.h | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c
index c8c8a4a4e7a0..9c3165c07935 100644
--- a/security/integrity/digsig.c
+++ b/security/integrity/digsig.c
@@ -39,7 +39,7 @@ static const char * const keyring_name[INTEGRITY_KEYRING_MAX] = {
 #define restrict_link_to_ima restrict_link_by_builtin_trusted
 #endif
 
-static struct key *integrity_keyring_from_id(const unsigned int id)
+struct key *integrity_keyring_from_id(const unsigned int id)
 {
 	if (id >= INTEGRITY_KEYRING_MAX)
 		return ERR_PTR(-EINVAL);
diff --git a/security/integrity/integrity.h b/security/integrity/integrity.h
index 2e214c761158..76e9a9515f99 100644
--- a/security/integrity/integrity.h
+++ b/security/integrity/integrity.h
@@ -168,6 +168,7 @@ int __init integrity_init_keyring(const unsigned int id);
 int __init integrity_load_x509(const unsigned int id, const char *path);
 int __init integrity_load_cert(const unsigned int id, const char *source,
 			       const void *data, size_t len, key_perm_t perm);
+struct key *integrity_keyring_from_id(const unsigned int id);
 #else
 
 static inline int integrity_digsig_verify(const unsigned int id,
@@ -195,6 +196,11 @@ static inline int __init integrity_load_cert(const unsigned int id,
 {
 	return 0;
 }
+
+static inline struct key *integrity_keyring_from_id(const unsigned int id)
+{
+	return ERR_PTR(-EOPNOTSUPP);
+}
 #endif /* CONFIG_INTEGRITY_SIGNATURE */
 
 #ifdef CONFIG_INTEGRITY_ASYMMETRIC_KEYS
-- 
2.27.0


  parent reply	other threads:[~2022-03-10 21:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 21:44 [PATCH v11 0/4] integrity: support including firmware ".platform" keys at build time Nayna Jain
2022-03-10 21:44 ` [PATCH v11 1/4] certs: export load_certificate_list() to be used outside certs/ Nayna Jain
2022-03-10 21:44 ` Nayna Jain [this message]
2022-03-10 21:44 ` [PATCH v11 3/4] certs: conditionally build extract-cert if platform keyring is enabled Nayna Jain
2022-03-11  4:34   ` Masahiro Yamada
2022-03-10 21:44 ` [PATCH v11 4/4] integrity: support including firmware ".platform" keys at build time Nayna Jain
2022-03-11  4:41 ` [PATCH v11 0/4] " Nageswara Sastry
2022-03-11 16:42   ` Jarkko Sakkinen
2022-03-11 21:03     ` Nayna
2022-03-17  7:38       ` Jarkko Sakkinen
2022-03-18 21:25         ` Nayna
2022-03-20 21:31           ` Jarkko Sakkinen
2022-03-11 16:39 ` Jarkko Sakkinen
2022-03-14 12:53   ` Mimi Zohar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220310214450.676505-3-nayna@linux.ibm.com \
    --to=nayna@linux.ibm.com \
    --cc=dhowells@redhat.com \
    --cc=dimitri.ledkov@canonical.com \
    --cc=jarkko@kernel.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=rnsastry@linux.ibm.com \
    --cc=seth@forshee.me \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.