mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	crypto: authencesn - Only access common skcipher fields on spawn
As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
		
							parent
							
								
									cae3304330
								
							
						
					
					
						commit
						24a285cea8
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
					@ -390,9 +390,9 @@ static int crypto_authenc_esn_create(struct crypto_template *tmpl,
 | 
				
			||||||
	u32 mask;
 | 
						u32 mask;
 | 
				
			||||||
	struct aead_instance *inst;
 | 
						struct aead_instance *inst;
 | 
				
			||||||
	struct authenc_esn_instance_ctx *ctx;
 | 
						struct authenc_esn_instance_ctx *ctx;
 | 
				
			||||||
 | 
						struct skcipher_alg_common *enc;
 | 
				
			||||||
	struct hash_alg_common *auth;
 | 
						struct hash_alg_common *auth;
 | 
				
			||||||
	struct crypto_alg *auth_base;
 | 
						struct crypto_alg *auth_base;
 | 
				
			||||||
	struct skcipher_alg *enc;
 | 
					 | 
				
			||||||
	int err;
 | 
						int err;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_AEAD, &mask);
 | 
						err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_AEAD, &mask);
 | 
				
			||||||
| 
						 | 
					@ -415,7 +415,7 @@ static int crypto_authenc_esn_create(struct crypto_template *tmpl,
 | 
				
			||||||
				   crypto_attr_alg_name(tb[2]), 0, mask);
 | 
									   crypto_attr_alg_name(tb[2]), 0, mask);
 | 
				
			||||||
	if (err)
 | 
						if (err)
 | 
				
			||||||
		goto err_free_inst;
 | 
							goto err_free_inst;
 | 
				
			||||||
	enc = crypto_spawn_skcipher_alg(&ctx->enc);
 | 
						enc = crypto_spawn_skcipher_alg_common(&ctx->enc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = -ENAMETOOLONG;
 | 
						err = -ENAMETOOLONG;
 | 
				
			||||||
	if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME,
 | 
						if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME,
 | 
				
			||||||
| 
						 | 
					@ -435,8 +435,8 @@ static int crypto_authenc_esn_create(struct crypto_template *tmpl,
 | 
				
			||||||
				       enc->base.cra_alignmask;
 | 
									       enc->base.cra_alignmask;
 | 
				
			||||||
	inst->alg.base.cra_ctxsize = sizeof(struct crypto_authenc_esn_ctx);
 | 
						inst->alg.base.cra_ctxsize = sizeof(struct crypto_authenc_esn_ctx);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	inst->alg.ivsize = crypto_skcipher_alg_ivsize(enc);
 | 
						inst->alg.ivsize = enc->ivsize;
 | 
				
			||||||
	inst->alg.chunksize = crypto_skcipher_alg_chunksize(enc);
 | 
						inst->alg.chunksize = enc->chunksize;
 | 
				
			||||||
	inst->alg.maxauthsize = auth->digestsize;
 | 
						inst->alg.maxauthsize = auth->digestsize;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	inst->alg.init = crypto_authenc_esn_init_tfm;
 | 
						inst->alg.init = crypto_authenc_esn_init_tfm;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue