summaryrefslogtreecommitdiff
path: root/drivers/char/tpm/tpm2-sessions.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/tpm/tpm2-sessions.c')
-rw-r--r--drivers/char/tpm/tpm2-sessions.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/tpm/tpm2-sessions.c b/drivers/char/tpm/tpm2-sessions.c
index 4149379665c4..09df6353ef04 100644
--- a/drivers/char/tpm/tpm2-sessions.c
+++ b/drivers/char/tpm/tpm2-sessions.c
@@ -126,7 +126,7 @@ struct tpm2_auth {
u8 session_key[SHA256_DIGEST_SIZE];
u8 passphrase[SHA256_DIGEST_SIZE];
int passphrase_len;
- struct crypto_aes_ctx aes_ctx;
+ struct aes_enckey aes_key;
/* saved session attributes: */
u8 attrs;
__be32 ordinal;
@@ -677,8 +677,8 @@ int tpm_buf_fill_hmac_session(struct tpm_chip *chip, struct tpm_buf *buf)
auth->scratch);
len = tpm_buf_read_u16(buf, &offset_p);
- aes_expandkey(&auth->aes_ctx, auth->scratch, AES_KEY_BYTES);
- aescfb_encrypt(&auth->aes_ctx, &buf->data[offset_p],
+ aes_prepareenckey(&auth->aes_key, auth->scratch, AES_KEY_BYTES);
+ aescfb_encrypt(&auth->aes_key, &buf->data[offset_p],
&buf->data[offset_p], len,
auth->scratch + AES_KEY_BYTES);
/* reset p to beginning of parameters for HMAC */
@@ -858,8 +858,8 @@ int tpm_buf_check_hmac_response(struct tpm_chip *chip, struct tpm_buf *buf,
auth->scratch);
len = tpm_buf_read_u16(buf, &offset_p);
- aes_expandkey(&auth->aes_ctx, auth->scratch, AES_KEY_BYTES);
- aescfb_decrypt(&auth->aes_ctx, &buf->data[offset_p],
+ aes_prepareenckey(&auth->aes_key, auth->scratch, AES_KEY_BYTES);
+ aescfb_decrypt(&auth->aes_key, &buf->data[offset_p],
&buf->data[offset_p], len,
auth->scratch + AES_KEY_BYTES);
}