diff mbox series

[3/3] KEYS: asym_tpm: rename derive_pub_key()

Message ID 20220113235440.90439-4-ebiggers@kernel.org
State New
Headers show
Series KEYS: fixes for asym_tpm keys | expand

Commit Message

Eric Biggers Jan. 13, 2022, 11:54 p.m. UTC
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 mbox series

Patch

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);