Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: cmac - Use modern init_tfm/exit_tfm

Use the modern init_tfm/exit_tfm interface instead of the obsolete
cra_init/cra_exit interface.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

+9 -9
+9 -9
crypto/cmac.c
··· 198 198 return 0; 199 199 } 200 200 201 - static int cmac_init_tfm(struct crypto_tfm *tfm) 201 + static int cmac_init_tfm(struct crypto_shash *tfm) 202 202 { 203 + struct shash_instance *inst = shash_alg_instance(tfm); 204 + struct cmac_tfm_ctx *ctx = crypto_shash_ctx(tfm); 205 + struct crypto_cipher_spawn *spawn; 203 206 struct crypto_cipher *cipher; 204 - struct crypto_instance *inst = (void *)tfm->__crt_alg; 205 - struct crypto_cipher_spawn *spawn = crypto_instance_ctx(inst); 206 - struct cmac_tfm_ctx *ctx = crypto_tfm_ctx(tfm); 207 207 208 + spawn = shash_instance_ctx(inst); 208 209 cipher = crypto_spawn_cipher(spawn); 209 210 if (IS_ERR(cipher)) 210 211 return PTR_ERR(cipher); ··· 215 214 return 0; 216 215 }; 217 216 218 - static void cmac_exit_tfm(struct crypto_tfm *tfm) 217 + static void cmac_exit_tfm(struct crypto_shash *tfm) 219 218 { 220 - struct cmac_tfm_ctx *ctx = crypto_tfm_ctx(tfm); 219 + struct cmac_tfm_ctx *ctx = crypto_shash_ctx(tfm); 221 220 crypto_free_cipher(ctx->child); 222 221 } 223 222 ··· 275 274 ~(crypto_tfm_ctx_alignment() - 1)) 276 275 + alg->cra_blocksize * 2; 277 276 278 - inst->alg.base.cra_init = cmac_init_tfm; 279 - inst->alg.base.cra_exit = cmac_exit_tfm; 280 - 281 277 inst->alg.init = crypto_cmac_digest_init; 282 278 inst->alg.update = crypto_cmac_digest_update; 283 279 inst->alg.final = crypto_cmac_digest_final; 284 280 inst->alg.setkey = crypto_cmac_digest_setkey; 281 + inst->alg.init_tfm = cmac_init_tfm; 282 + inst->alg.exit_tfm = cmac_exit_tfm; 285 283 286 284 inst->free = shash_free_singlespawn_instance; 287 285