Commit 66edb901 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull crypto fix from Herbert Xu:

 - Reject algorithms with authsizes that are too short in authencesn

* tag 'v7.1-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: authencesn - reject short ahash digests during instance creation
parents 4c2ed2a3 5db6ef98
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -390,6 +390,11 @@ static int crypto_authenc_esn_create(struct crypto_template *tmpl,
	auth = crypto_spawn_ahash_alg(&ctx->auth);
	auth_base = &auth->base;

	if (auth->digestsize > 0 && auth->digestsize < 4) {
		err = -EINVAL;
		goto err_free_inst;
	}

	err = crypto_grab_skcipher(&ctx->enc, aead_crypto_instance(inst),
				   crypto_attr_alg_name(tb[2]), 0, mask);
	if (err)