From: Eric Biggers <ebiggers@kernel.org>
To: keyrings@vger.kernel.org, David Howells <dhowells@redhat.com>,
Jarkko Sakkinen <jarkko@kernel.org>
Cc: Denis Kenzior <denkenz@gmail.com>,
Marcel Holtmann <marcel@holtmann.org>,
James Morris <james.morris@microsoft.com>,
linux-crypto@vger.kernel.org
Subject: [PATCH 3/3] KEYS: asym_tpm: rename derive_pub_key()
Date: Thu, 13 Jan 2022 15:54:40 -0800 [thread overview]
Message-ID: <20220113235440.90439-4-ebiggers@kernel.org> (raw)
In-Reply-To: <20220113235440.90439-1-ebiggers@kernel.org>
From: Eric Biggers <ebiggers@google.com>
derive_pub_key() doesn't actually derive a key; it just formats one.
Rename it accordingly.
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
crypto/asymmetric_keys/asym_tpm.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/crypto/asymmetric_keys/asym_tpm.c b/crypto/asymmetric_keys/asym_tpm.c
index 2e365a221fbe..d2e0036d34a5 100644
--- a/crypto/asymmetric_keys/asym_tpm.c
+++ b/crypto/asymmetric_keys/asym_tpm.c
@@ -336,7 +336,7 @@ static inline uint8_t *encode_tag_length(uint8_t *buf, uint8_t tag,
return buf + 3;
}
-static uint32_t derive_pub_key(const void *pub_key, uint32_t len, uint8_t *buf)
+static uint32_t format_pub_key(const void *pub_key, uint32_t len, uint8_t *buf)
{
uint8_t *cur = buf;
uint32_t n_len = definite_length(len) + 1 + len + 1;
@@ -409,7 +409,7 @@ static int tpm_key_query(const struct kernel_pkey_params *params,
if (IS_ERR(tfm))
return PTR_ERR(tfm);
- der_pub_key_len = derive_pub_key(tk->pub_key, tk->pub_key_len,
+ der_pub_key_len = format_pub_key(tk->pub_key, tk->pub_key_len,
der_pub_key);
ret = crypto_akcipher_set_pub_key(tfm, der_pub_key, der_pub_key_len);
@@ -463,7 +463,7 @@ static int tpm_key_encrypt(struct tpm_key *tk,
if (IS_ERR(tfm))
return PTR_ERR(tfm);
- der_pub_key_len = derive_pub_key(tk->pub_key, tk->pub_key_len,
+ der_pub_key_len = format_pub_key(tk->pub_key, tk->pub_key_len,
der_pub_key);
ret = crypto_akcipher_set_pub_key(tfm, der_pub_key, der_pub_key_len);
@@ -758,7 +758,7 @@ static int tpm_key_verify_signature(const struct key *key,
if (IS_ERR(tfm))
return PTR_ERR(tfm);
- der_pub_key_len = derive_pub_key(tk->pub_key, tk->pub_key_len,
+ der_pub_key_len = format_pub_key(tk->pub_key, tk->pub_key_len,
der_pub_key);
ret = crypto_akcipher_set_pub_key(tfm, der_pub_key, der_pub_key_len);
--
2.34.1
next prev parent reply other threads:[~2022-01-13 23:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-13 23:54 [PATCH 0/3] KEYS: fixes for asym_tpm keys Eric Biggers
2022-01-13 23:54 ` [PATCH 1/3] KEYS: asym_tpm: fix buffer overreads in extract_key_parameters() Eric Biggers
2022-01-15 21:40 ` Jarkko Sakkinen
2022-01-19 0:59 ` Eric Biggers
2022-01-26 14:21 ` Jarkko Sakkinen
2022-01-26 14:22 ` Jarkko Sakkinen
2022-01-28 19:00 ` Eric Biggers
2022-02-08 9:30 ` Jarkko Sakkinen
2022-01-13 23:54 ` [PATCH 2/3] KEYS: asym_tpm: fix incorrect comment Eric Biggers
2022-01-15 19:12 ` Jarkko Sakkinen
2022-01-13 23:54 ` Eric Biggers [this message]
2022-01-15 19:09 ` [PATCH 3/3] KEYS: asym_tpm: rename derive_pub_key() Jarkko Sakkinen
2022-01-14 14:54 ` [PATCH 0/3] KEYS: fixes for asym_tpm keys Denis Kenzior
2022-01-15 21:42 ` Jarkko Sakkinen
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=20220113235440.90439-4-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=denkenz@gmail.com \
--cc=dhowells@redhat.com \
--cc=james.morris@microsoft.com \
--cc=jarkko@kernel.org \
--cc=keyrings@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=marcel@holtmann.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).