Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79960943 authored by David Gstir's avatar David Gstir Committed by Herbert Xu
Browse files

crypto: talitos - Fix timing leak in ESP ICV verification



Using non-constant time memcmp() makes the verification of the authentication
tag in the decrypt path vulnerable to timing attacks. Fix this by using
crypto_memneq() instead.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarDavid Gstir <david@sigma-star.at>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent cb8affb5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -977,7 +977,7 @@ static void ipsec_esp_decrypt_swauth_done(struct device *dev,
		} else
			oicv = (char *)&edesc->link_tbl[0];

		err = memcmp(oicv, icv, authsize) ? -EBADMSG : 0;
		err = crypto_memneq(oicv, icv, authsize) ? -EBADMSG : 0;
	}

	kfree(edesc);