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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Eric Biggers <ebiggers@xxxxxxxxxx>

derive_pub_key() doesn't actually derive a key; it just formats one.
Rename it accordingly.

Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
---
 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




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux