fscrypt: use crypto_skcipher_driver_name()
diff mbox series

Message ID 20191209203810.225302-1-ebiggers@kernel.org
State Accepted
Headers show
Series
  • fscrypt: use crypto_skcipher_driver_name()
Related show

Commit Message

Eric Biggers Dec. 9, 2019, 8:38 p.m. UTC
From: Eric Biggers <ebiggers@google.com>

Crypto API users shouldn't really be accessing struct skcipher_alg
directly.  <crypto/skcipher.h> already has a function
crypto_skcipher_driver_name(), so use that instead.

No change in behavior.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 fs/crypto/keysetup.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Eric Biggers Jan. 3, 2020, 4:57 p.m. UTC | #1
On Mon, Dec 09, 2019 at 12:38:10PM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> Crypto API users shouldn't really be accessing struct skcipher_alg
> directly.  <crypto/skcipher.h> already has a function
> crypto_skcipher_driver_name(), so use that instead.
> 
> No change in behavior.
> 
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
>  fs/crypto/keysetup.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/crypto/keysetup.c b/fs/crypto/keysetup.c
> index f577bb6613f93..c9f4fe955971f 100644
> --- a/fs/crypto/keysetup.c
> +++ b/fs/crypto/keysetup.c
> @@ -89,8 +89,7 @@ struct crypto_skcipher *fscrypt_allocate_skcipher(struct fscrypt_mode *mode,
>  		 * first time a mode is used.
>  		 */
>  		pr_info("fscrypt: %s using implementation \"%s\"\n",
> -			mode->friendly_name,
> -			crypto_skcipher_alg(tfm)->base.cra_driver_name);
> +			mode->friendly_name, crypto_skcipher_driver_name(tfm));
>  	}
>  	crypto_skcipher_set_flags(tfm, CRYPTO_TFM_REQ_FORBID_WEAK_KEYS);
>  	err = crypto_skcipher_setkey(tfm, raw_key, mode->keysize);
> -- 
> 2.24.0.393.g34dc348eaf-goog
> 

Applied to fscrypt.git#master for 5.6.

- Eric

Patch
diff mbox series

diff --git a/fs/crypto/keysetup.c b/fs/crypto/keysetup.c
index f577bb6613f93..c9f4fe955971f 100644
--- a/fs/crypto/keysetup.c
+++ b/fs/crypto/keysetup.c
@@ -89,8 +89,7 @@  struct crypto_skcipher *fscrypt_allocate_skcipher(struct fscrypt_mode *mode,
 		 * first time a mode is used.
 		 */
 		pr_info("fscrypt: %s using implementation \"%s\"\n",
-			mode->friendly_name,
-			crypto_skcipher_alg(tfm)->base.cra_driver_name);
+			mode->friendly_name, crypto_skcipher_driver_name(tfm));
 	}
 	crypto_skcipher_set_flags(tfm, CRYPTO_TFM_REQ_FORBID_WEAK_KEYS);
 	err = crypto_skcipher_setkey(tfm, raw_key, mode->keysize);